diff options
author | Tor Norbye <tnorbye@google.com> | 2011-12-13 11:41:47 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-12-13 15:07:56 -0800 |
commit | d92449489ab49fffdf96321d74cc03abcee2f185 (patch) | |
tree | 78119996344d66e8058b1a88843839194cba2761 /eclipse | |
parent | daa5a5c9200708b09983bf3852b94bb8ebab1e27 (diff) | |
download | sdk-d92449489ab49fffdf96321d74cc03abcee2f185.zip sdk-d92449489ab49fffdf96321d74cc03abcee2f185.tar.gz sdk-d92449489ab49fffdf96321d74cc03abcee2f185.tar.bz2 |
Fix lint view comparator
This changeset fixes
22501: invalid Comparator passed to Collections.sort by ADT's LintList
Change-Id: I265a2f9d5901caf9c3f6fb45009ba25a72b05d29
Diffstat (limited to 'eclipse')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintList.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintList.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintList.java index dc3a2f1..1be6803 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintList.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintList.java @@ -197,7 +197,7 @@ class LintList extends Composite implements IResourceChangeListener, ControlList marker2.getResource().getName()); } Issue issue1 = registry.getIssue(id1); - Issue issue2 = registry.getIssue(id1); + Issue issue2 = registry.getIssue(id2); if (issue1 == null || issue2 == null) { // Unknown issue? Can happen if you have used a third party detector // which is no longer available but which left a persistent marker behind @@ -220,14 +220,15 @@ class LintList extends Composite implements IResourceChangeListener, ControlList return categoryDelta; } int idDelta = id1.compareTo(id2); - if (idDelta != -1) { + if (idDelta != 0) { return idDelta; } int fileDelta = marker1.getResource().getName().compareTo( marker2.getResource().getName()); - if (fileDelta != -1) { + if (fileDelta != 0) { return fileDelta; } + return marker1.getAttribute(IMarker.LINE_NUMBER, 0) - marker2.getAttribute(IMarker.LINE_NUMBER, 0); } |