diff options
author | 2021-10-02 20:51:58 +0200 | |
---|---|---|
committer | 2021-10-02 20:51:58 +0200 | |
commit | 9b8236dd7499510577c32f0d87dfd52d34f6b023 (patch) | |
tree | d9e35fa5692e3b08d0bcf1fbbd538c65ed4b58e1 /language-ide | |
parent | build: simplify Eclipse project generation (diff) | |
download | refinery-9b8236dd7499510577c32f0d87dfd52d34f6b023.tar.gz refinery-9b8236dd7499510577c32f0d87dfd52d34f6b023.tar.zst refinery-9b8236dd7499510577c32f0d87dfd52d34f6b023.zip |
chore: fix Java 17 Sonar warnings
Had to disable code coverage measurement in the Quality Gate, we should
switch it on again once we have a complete test suite.
Diffstat (limited to 'language-ide')
-rw-r--r-- | language-ide/src/main/java/org/eclipse/viatra/solver/language/ide/syntaxcoloring/ProblemSemanticHighlightingCalculator.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/language-ide/src/main/java/org/eclipse/viatra/solver/language/ide/syntaxcoloring/ProblemSemanticHighlightingCalculator.java b/language-ide/src/main/java/org/eclipse/viatra/solver/language/ide/syntaxcoloring/ProblemSemanticHighlightingCalculator.java index f9a1fb7b..1de73912 100644 --- a/language-ide/src/main/java/org/eclipse/viatra/solver/language/ide/syntaxcoloring/ProblemSemanticHighlightingCalculator.java +++ b/language-ide/src/main/java/org/eclipse/viatra/solver/language/ide/syntaxcoloring/ProblemSemanticHighlightingCalculator.java | |||
@@ -105,9 +105,8 @@ public class ProblemSemanticHighlightingCalculator extends DefaultSemanticHighli | |||
105 | return new String[] { BUILTIN_CLASS }; | 105 | return new String[] { BUILTIN_CLASS }; |
106 | } | 106 | } |
107 | ImmutableList.Builder<String> classesBuilder = ImmutableList.builder(); | 107 | ImmutableList.Builder<String> classesBuilder = ImmutableList.builder(); |
108 | if (eObject instanceof ClassDeclaration) { | 108 | if (eObject instanceof ClassDeclaration classDeclaration) { |
109 | classesBuilder.add(CLASS_CLASS); | 109 | classesBuilder.add(CLASS_CLASS); |
110 | var classDeclaration = (ClassDeclaration) eObject; | ||
111 | if (classDeclaration.isAbstract()) { | 110 | if (classDeclaration.isAbstract()) { |
112 | classesBuilder.add(ABSTRACT_CLASS); | 111 | classesBuilder.add(ABSTRACT_CLASS); |
113 | } | 112 | } |
@@ -115,23 +114,20 @@ public class ProblemSemanticHighlightingCalculator extends DefaultSemanticHighli | |||
115 | if (eObject instanceof EnumDeclaration) { | 114 | if (eObject instanceof EnumDeclaration) { |
116 | classesBuilder.add(ENUM_CLASS); | 115 | classesBuilder.add(ENUM_CLASS); |
117 | } | 116 | } |
118 | if (eObject instanceof ReferenceDeclaration) { | 117 | if (eObject instanceof ReferenceDeclaration referenceDeclaration) { |
119 | classesBuilder.add(REFERENCE_CLASS); | 118 | classesBuilder.add(REFERENCE_CLASS); |
120 | var referenceDeclaration = (ReferenceDeclaration) eObject; | ||
121 | if (referenceDeclaration.isContainment()) { | 119 | if (referenceDeclaration.isContainment()) { |
122 | classesBuilder.add(CONTAINMENT_CLASS); | 120 | classesBuilder.add(CONTAINMENT_CLASS); |
123 | } | 121 | } |
124 | } | 122 | } |
125 | if (eObject instanceof PredicateDefinition) { | 123 | if (eObject instanceof PredicateDefinition predicateDefinition) { |
126 | classesBuilder.add(PREDICATE_CLASS); | 124 | classesBuilder.add(PREDICATE_CLASS); |
127 | var predicateDefinition = (PredicateDefinition) eObject; | ||
128 | if (predicateDefinition.isError()) { | 125 | if (predicateDefinition.isError()) { |
129 | classesBuilder.add(ERROR_CLASS); | 126 | classesBuilder.add(ERROR_CLASS); |
130 | } | 127 | } |
131 | } | 128 | } |
132 | if (eObject instanceof Node) { | 129 | if (eObject instanceof Node node) { |
133 | classesBuilder.add(NODE_CLASS); | 130 | classesBuilder.add(NODE_CLASS); |
134 | var node = (Node) eObject; | ||
135 | if (ProblemUtil.isUniqueNode(node)) { | 131 | if (ProblemUtil.isUniqueNode(node)) { |
136 | classesBuilder.add(UNIQUE_NODE_CLASS); | 132 | classesBuilder.add(UNIQUE_NODE_CLASS); |
137 | } | 133 | } |
@@ -142,9 +138,8 @@ public class ProblemSemanticHighlightingCalculator extends DefaultSemanticHighli | |||
142 | if (eObject instanceof Parameter) { | 138 | if (eObject instanceof Parameter) { |
143 | classesBuilder.add(PARAMETER_CLASS); | 139 | classesBuilder.add(PARAMETER_CLASS); |
144 | } | 140 | } |
145 | if (eObject instanceof Variable) { | 141 | if (eObject instanceof Variable variable) { |
146 | classesBuilder.add(VARIABLE_CLASS); | 142 | classesBuilder.add(VARIABLE_CLASS); |
147 | var variable = (Variable) eObject; | ||
148 | if (ProblemUtil.isSingletonVariable(variable)) { | 143 | if (ProblemUtil.isSingletonVariable(variable)) { |
149 | classesBuilder.add(SINGLETON_VARIABLE_CLASS); | 144 | classesBuilder.add(SINGLETON_VARIABLE_CLASS); |
150 | } | 145 | } |