diff options
author | aclement <aclement> | 2008-08-22 17:10:10 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-08-22 17:10:10 +0000 |
commit | 18f59c4ecf7b4fa124d46eae69bebd2581267ecd (patch) | |
tree | e72423a7c07ecd21c90ba1e8aa11c7b27004e8a8 /ajde | |
parent | 1de0ef98b813eb8a4f539d9eb94909fda84598ce (diff) | |
download | aspectj-18f59c4ecf7b4fa124d46eae69bebd2581267ecd.tar.gz aspectj-18f59c4ecf7b4fa124d46eae69bebd2581267ecd.zip |
removed unnecessary code
Diffstat (limited to 'ajde')
-rw-r--r-- | ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java b/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java index 5b312fd25..c187fe3c2 100644 --- a/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java +++ b/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java @@ -386,41 +386,26 @@ public class TreeStructureViewBuilder { public int compare(Object o1, Object o2) { IProgramElement sv1 = ((IStructureViewNode)o1).getStructureNode(); IProgramElement sv2 = ((IStructureViewNode)o2).getStructureNode(); - - if (sv1 instanceof IProgramElement && sv2 instanceof IProgramElement) { - - IProgramElement p1 = (IProgramElement)sv1; - IProgramElement p2 = (IProgramElement)sv2; - - if (p2.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return 1; - if (p1.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return -1; - - return p1.getName().compareTo(p2.getName()); - } else { - return 0; - } + if (sv1.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return 1; + if (sv2.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return -1; + return sv1.getName().compareTo(sv2.getName()); } }; private static final Comparator DECLARATIONAL_COMPARATOR = new Comparator() { public int compare(Object o1, Object o2) { - IProgramElement sv1 = ((IStructureViewNode)o1).getStructureNode(); - IProgramElement sv2 = ((IStructureViewNode)o2).getStructureNode(); - if (sv1 instanceof IProgramElement && sv2 instanceof IProgramElement) { - IProgramElement p1 = (IProgramElement)sv1; - IProgramElement p2 = (IProgramElement)sv2; - if (p2.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return 1; - if (p1.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return -1; - if (p1.getSourceLocation() == null || p2.getSourceLocation() == null) { - return 0; - } else if (p1.getSourceLocation().getLine() < p2.getSourceLocation().getLine()) { - return -1; - } else { - return 1; - } - } else { - return 0; - } + IProgramElement p1 = ((IStructureViewNode)o1).getStructureNode(); + IProgramElement p2 = ((IStructureViewNode)o2).getStructureNode(); + + if (p2.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return 1; + if (p1.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return -1; + if (p1.getSourceLocation() == null || p2.getSourceLocation() == null) { + return 0; + } else if (p1.getSourceLocation().getLine() < p2.getSourceLocation().getLine()) { + return -1; + } else { + return 1; + } } }; } |