Skip to content

Commit

Permalink
Replace 'var' typing with explicit type naming
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-ronge committed Apr 11, 2023
1 parent e66b31e commit f20b293
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ public StructuralElementViewInterface getStructuralElementView(String divisionId
List<LanguageRange> priorityList) {

Optional<Division> division = ruleset.getDivision(divisionId);
DivisionDeclaration divisionDeclaration = division.isPresent() ? new DivisionDeclaration(ruleset, division.get())
DivisionDeclaration divisionDeclaration = division.isPresent()
? new DivisionDeclaration(ruleset, division.get())
: new DivisionDeclaration(ruleset, divisionId);
return new DivisionView(ruleset, divisionDeclaration, acquisitionStage, priorityList);
}
Expand All @@ -176,17 +177,19 @@ public StructuralElementViewInterface getStructuralElementView(String divisionId
* Opens a views on a metadata of the ruleset.
*
* @param keyId
* the id of the metadata
* the id of the metadata
* @param acquisitionStage
* the current acquisition level
* the current acquisition level
* @param priorityList
* the list of display languages preferred by the user
* the list of display languages preferred by the user
* @return a view on a metadata
*/
@Override
public NestedKeyView<KeyDeclaration> getMetadataView(String keyId, String acquisitionStage, List<LanguageRange> priorityList) {
public NestedKeyView<KeyDeclaration> getMetadataView(String keyId, String acquisitionStage,
List<LanguageRange> priorityList) {
Optional<Key> key = ruleset.getKey(keyId);
KeyDeclaration keyDeclaration = key.isPresent() ? new KeyDeclaration(ruleset, key.get()) : new KeyDeclaration(ruleset, keyId);
KeyDeclaration keyDeclaration = key.isPresent() ? new KeyDeclaration(ruleset, key.get())
: new KeyDeclaration(ruleset, keyId);
Rule rule = ruleset.getRuleForKey(keyId);
return new NestedKeyView<>(ruleset, keyDeclaration, rule, ruleset.getSettings(acquisitionStage), priorityList);
}
Expand Down Expand Up @@ -331,7 +334,8 @@ public int updateMetadata(Collection<Metadata> currentMetadata, String acquisiti
Collection<Metadata> updateMetadata) {

final Function<String, MutableTriple<Collection<Metadata>, Reimport, Collection<Metadata>>> entryProducer = key -> {
var entry = new MutableTriple<Collection<Metadata>, Reimport, Collection<Metadata>>();
MutableTriple<Collection<Metadata>, Reimport, Collection<Metadata>> entry =
new MutableTriple<Collection<Metadata>, Reimport, Collection<Metadata>>();
entry.setLeft(new ArrayList<>());
entry.setRight(new ArrayList<>());
return entry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -350,7 +351,7 @@ private List<Element> createMetadataElements(Namespace xmlns, DocketData docketD
HashMap<String, String> names = getNamespacesFromConfig();
Namespace[] namespaces = new Namespace[names.size()];
int index = 0;
for (var entries = names.entrySet().iterator(); entries.hasNext(); index++) {
for (Iterator<Entry<String, String>> entries = names.entrySet().iterator(); entries.hasNext(); index++) {
Entry<String, String> entry = entries.next();
namespaces[index] = Namespace.getNamespace(entry.getKey(), entry.getValue());
}
Expand Down

0 comments on commit f20b293

Please sign in to comment.