Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ <h3>getMessage</h3>
<dt>Specified by:</dt>
<dd><code><a href="../pkg/ValidationConstraint.html#getMessage()">getMessage</a></code>&nbsp;in interface&nbsp;<code><a href="../pkg/ValidationConstraint.html" title="interface in org.odftoolkit.odfdom.pkg">ValidationConstraint</a></code></dd>
<dt>Returns:</dt>
<dd>the detail message string of this <tt>Constraint</tt> instance (which may be
<tt>null</tt>).</dd>
<dd>the detail message string of this <code>Constraint</code> instance (which may be
<code>null</code>).</dd>
</dl>
</section>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ <h3>getMessage</h3>
<dt>Specified by:</dt>
<dd><code><a href="ValidationConstraint.html#getMessage()">getMessage</a></code>&nbsp;in interface&nbsp;<code><a href="ValidationConstraint.html" title="interface in org.odftoolkit.odfdom.pkg">ValidationConstraint</a></code></dd>
<dt>Returns:</dt>
<dd>the detail message string of this <tt>Constraint</tt> instance (which may be
<tt>null</tt>).</dd>
<dd>the detail message string of this <code>Constraint</code> instance (which may be
<code>null</code>).</dd>
</dl>
</section>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ <h3>getMessage</h3>
<div class="block">Returns the detail message string of this Constraint.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the detail message string of this <tt>Constraint</tt> instance (which may be
<tt>null</tt>).</dd>
<dd>the detail message string of this <code>Constraint</code> instance (which may be
<code>null</code>).</dd>
</dl>
</section>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ public class MSVExpressionInformation {
private Map<Expression, List<List<Expression>>> mContainedInPaths;
private boolean mCanHaveText = false;
// map child to its isSingleton property
private Set<Expression> mSingletonChildren = new HashSet<Expression>();
private Set<Expression> mMultipleChildren = new HashSet<Expression>();
private Set<Expression> mSingletonChildren = new HashSet<>();
private Set<Expression> mMultipleChildren = new HashSet<>();

public MSVExpressionInformation(Expression exp, String schemaFileName) {
mContainedInPaths = new HashMap<Expression, List<List<Expression>>>();
mContainedInPaths = new HashMap<>();

// Builds paths to child elements and child attributes
List<List<Expression>> paths = new ArrayList<List<Expression>>();
List<Expression> start = new ArrayList<Expression>(1);
List<List<Expression>> paths = new ArrayList<>();
List<Expression> start = new ArrayList<>(1);
start.add(exp);
paths.add(start);
buildPaths(paths);
Expand Down Expand Up @@ -111,7 +111,7 @@ public MSVExpressionInformation(Expression exp, String schemaFileName) {
for (Expression step : path) {
List<List<Expression>> pathsToStep = mContainedInPaths.get(step);
if (pathsToStep == null) {
pathsToStep = new ArrayList<List<Expression>>(1);
pathsToStep = new ArrayList<>(1);
pathsToStep.add(path);
mContainedInPaths.put(step, pathsToStep);
} else {
Expand All @@ -132,9 +132,8 @@ public MSVExpressionInformation(Expression exp, String schemaFileName) {
*/
private void registerChildrenMaxCardinalities(List<List<Expression>> waysToChildren) {
Map<Expression, Boolean> multiples =
new HashMap<
Expression, Boolean>(); // Cardinality (the opposite of isSingleton): true=N, false=1
Map<Expression, List<Expression>> paths = new HashMap<Expression, List<Expression>>();
new HashMap<>(); // Cardinality (the opposite of isSingleton): true=N, false=1
Map<Expression, List<Expression>> paths = new HashMap<>();

for (List<Expression> way : waysToChildren) {
Expression childexp = way.get(way.size() - 1);
Expand Down Expand Up @@ -169,7 +168,7 @@ private void registerChildrenMaxCardinalities(List<List<Expression>> waysToChild
// MSV detects that this is two times the same choice and creates just one ChoiceExpression.
// But this is not what we understand as a common CHOICE -> It's a common element definition
// <OPTIONAL>X</OPTIONAL> == <CHOICE>empty, X</CHOICE>
Set<ChoiceExp> choices = new HashSet<ChoiceExp>();
Set<ChoiceExp> choices = new HashSet<>();
for (Expression oldStep : paths.get(childexp)) {
if (oldStep instanceof ChoiceExp) {
choices.add((ChoiceExp) oldStep);
Expand Down Expand Up @@ -290,7 +289,7 @@ private static void buildPaths(List<List<Expression>> paths) {
} else if (children.size() > 1) {
paths.remove(paths.size() - 1);
for (Expression child : children) {
List<Expression> newway = new ArrayList<Expression>();
List<Expression> newway = new ArrayList<>();
newway.addAll(waytoresearch);
newway.add(child);
paths.add(newway);
Expand All @@ -301,8 +300,8 @@ private static void buildPaths(List<List<Expression>> paths) {
}
}

private static List<List<Expression>> getPathsToClass(List<List<Expression>> paths, Class clazz) {
List<List<Expression>> remainingPaths = new ArrayList<List<Expression>>();
private static List<List<Expression>> getPathsToClass(List<List<Expression>> paths, Class<?> clazz) {
List<List<Expression>> remainingPaths = new ArrayList<>();
for (List<Expression> path : paths) {
if (clazz.isInstance(path.get(path.size() - 1))) {
remainingPaths.add(path);
Expand Down Expand Up @@ -350,7 +349,7 @@ public boolean isMandatory(Collection<Expression> equallyNamedChildren) {
"ExpressionInformation: Cannot determine isMandatory for a null or empty children list.");
}

Set<List<Expression>> twins = new HashSet<List<Expression>>();
Set<List<Expression>> twins = new HashSet<>();

for (Expression exp : equallyNamedChildren) {
if (!(exp instanceof NameClassAndExpression)) {
Expand Down Expand Up @@ -378,7 +377,7 @@ public boolean isMandatory(Collection<Expression> equallyNamedChildren) {
* So both twins do not really share such a CHOICE. You have to look for another path which _really_ shares this choice or - if you find none -
* set CHILD to optional.
*/
HashSet<Expression> visitedChoices = new HashSet<Expression>();
HashSet<Expression> visitedChoices = new HashSet<>();

for (List<Expression> path : twins) {
for (int s = 0; s < path.size(); s++) {
Expand All @@ -388,7 +387,7 @@ public boolean isMandatory(Collection<Expression> equallyNamedChildren) {

// If other twin paths share the same choice...
List<List<Expression>> choiceInPaths =
new ArrayList<List<Expression>>(mContainedInPaths.get(step));
new ArrayList<>(mContainedInPaths.get(step));
choiceInPaths.retainAll(twins);

// small Performance gain: A CHOICE contained only in one path makes CHILD always optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public UniqueAncestor(Expression exp, int siblingIndex) {
private int mSiblingIndex;
}
// limit browsing to subclasses of Expression
private Class mDesiredExpression;
private Class<?> mDesiredExpression;
// if false, only return direct children of root. Don't return root as first element or grand
// children
private boolean mOnlyChildren;
Expand All @@ -102,7 +102,7 @@ public MSVExpressionIterator(Expression root) {
* @param root Expression root
* @param desiredExpression Limit returned expressions to subclasses of desiredExpression
*/
public MSVExpressionIterator(Expression root, Class desiredExpression) {
public MSVExpressionIterator(Expression root, Class<?> desiredExpression) {
this(root, desiredExpression, false);
}

Expand All @@ -118,18 +118,18 @@ public MSVExpressionIterator(Expression root, Class desiredExpression) {
* @param desiredExpression Limit returned expressions to subclasses of desiredExpression
* @param onlyChildren if only children should be returned
*/
public MSVExpressionIterator(Expression root, Class desiredExpression, boolean onlyChildren) {
public MSVExpressionIterator(Expression root, Class<?> desiredExpression, boolean onlyChildren) {
// initialize members
mCurrentExpression = root;
mDesiredExpression = desiredExpression;
mOnlyChildren = onlyChildren;

// create helpers
mVisitor = new MSVExpressionVisitorChildren();
mKnownElementExpressions = new HashSet<Expression>();
mKnownElementExpressions = new HashSet<>();

// Initialize status
mAncestorsAndCurrent = new Stack<UniqueAncestor>();
mAncestorsAndCurrent = new Stack<>();
mAncestorsAndCurrent.push(new UniqueAncestor(root, 0));

// make sure that there is at least one desired expression - for hasNext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public List<Expression> onValue(ValueExp exp) {
}

private List<Expression> children(Iterator<Expression> i) {
ArrayList<Expression> list = new ArrayList<Expression>();
ArrayList<Expression> list = new ArrayList<>();
while (i.hasNext()) {
list.add(i.next());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public List<String> onAnyName(AnyNameClass arg0) {
}

public List<String> onChoice(ChoiceNameClass arg0) {
List<String> retval = new ArrayList<String>();
List<String> retval = new ArrayList<>();
retval.addAll((List<String>) arg0.nc1.visit(this));
retval.addAll((List<String>) arg0.nc2.visit(this));
return retval;
Expand All @@ -71,7 +71,7 @@ public List<String> onChoice(ChoiceNameClass arg0) {
// W3C Schema restriction on name have to be given out as more adequate for us!
public List<String> onDifference(DifferenceNameClass arg0) {
if (arg0 != null) {
List<String> l = new ArrayList<String>(2);
List<String> l = new ArrayList<>(2);
l.add(arg0.nc1.toString());
l.add(arg0.nc2.toString());
return l;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class NamespaceDictionary {

/** Construct a new empty dictionary */
public NamespaceDictionary() {
uri2local = new HashMap<String, String>();
local2uri = new HashMap<String, String>();
uri2local = new HashMap<>();
local2uri = new HashMap<>();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void initialize() {
// Whenever visiting elements and RefExps, they are memorized
// to identify head of islands.
int depth = 1;
List resultList = null;
List<String> resultList = null;

@Override
public void onElement(ElementExp exp) {
Expand All @@ -116,7 +116,7 @@ public void onAttribute(AttributeExp exp) {
// System.out.println("NEW FAMILY" + asString(propertiesByFamily));
collectingState = Boolean.TRUE;
depthCollecting = depth;
resultList = new ArrayList();
resultList = new ArrayList<>();
if (exp.exp instanceof ValueExp) {
// System.out.println("style:family-1" + ((ValueExp) exp.exp).value.toString());
propertiesByFamily.put(((ValueExp) exp.exp).value.toString(), resultList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public boolean isStylable(SourceCodeBaseClass base) {
* @return list of style family names
*/
public List<String> getStyleFamilies(PuzzleComponent element) {
List<String> retval = new ArrayList<String>();
List<String> retval = new ArrayList<>();
if (mNameToFamiliesMap.containsKey(element.getQName())) {
retval.addAll(mNameToFamiliesMap.get(element.getQName()));
}
Expand All @@ -135,11 +135,11 @@ public List<String> getStyleFamilies(PuzzleComponent element) {
*/
public SortedSet<String> getStyleFamilies() {
Iterator<List<String>> iter = mNameToFamiliesMap.values().iterator();
List<String> families = new ArrayList<String>();
List<String> families = new ArrayList<>();
while (iter.hasNext()) {
families.addAll(iter.next());
}
return new TreeSet<String>(families);
return new TreeSet<>(families);
}

/**
Expand Down
Loading