Skip to content
Snippets Groups Projects
Commit 9ac18bcc authored by Simon Barner's avatar Simon Barner
Browse files

YELLOW

Use static Integer.compare() instead of constructing a temporary Integer object (build server now uses Java 7+).
refs 2490
parent 3a16ba1d
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 52CDC61CFABB702141979961A910CAB3
* @ConQAT.Rating YELLOW Hash: B8044C95361D3A05AE4615B1088BCDFE
*/
public abstract class AnnotationViewPartBase extends ViewPart implements ISelectionListener,
IAnnotationViewPart {
......@@ -225,12 +225,9 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect
public int compare(AnnotationEntry a1, AnnotationEntry a2) {
// Equality of model element implies equal hashCode(), order is arbitrary
// but not relevant for ensuring uniqueness of annotation entries.
//
// int Integer.compare(int x, int y) requires JDK 1.7 which is not available
// on the build server
// TODO (FH): JDK argument no longer valid
return new Integer(a1.getModelElement().hashCode()).compareTo(a2
.getModelElement().hashCode());
return Integer.compare(a1.getModelElement().hashCode(), a2.getModelElement()
.hashCode());
}
});
......
......@@ -35,7 +35,7 @@ import org.fortiss.tooling.kernel.model.INamedElement;
* @author eder, diewald, barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: EC8D59CB52D8864FE01DB8F36673F483
* @ConQAT.Rating YELLOW Hash: 55E292C1C09D2636EBB3F2CF54C5671A
*/
public class HierarchicalNameComparator extends ViewerComparator {
......@@ -65,13 +65,11 @@ public class HierarchicalNameComparator extends ViewerComparator {
}
}
// int Integer.compare(int x, int y) requires JDK 1.7 which is not available
// on the build server
if(o1 instanceof IIdLabeled && o2 instanceof IIdLabeled) {
return new Integer(((IIdLabeled)o1).getId()).compareTo(((IIdLabeled)o2).getId());
return Integer.compare(((IIdLabeled)o1).getId(), ((IIdLabeled)o2).getId());
}
return new Integer(o1.hashCode()).compareTo(o2.hashCode());
return Integer.compare(o1.hashCode(), o2.hashCode());
}
/** {@inheritDoc} */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment