diff options
author | René Purrio | 2018-01-05 12:03:34 +0000 |
---|---|---|
committer | René Purrio | 2018-01-05 12:37:20 +0000 |
commit | a0bbfb0b2a5a40b73eaeabdf3221f079e7ef38f7 (patch) | |
tree | bb6076ab60831479cdb1efd04b7d44838dd85b61 | |
parent | 85d1ab104cfb519b8a43180897a3303df369ac8b (diff) | |
download | eclipse.platform.ua-a0bbfb0b2a5a40b73eaeabdf3221f079e7ef38f7.tar.gz eclipse.platform.ua-a0bbfb0b2a5a40b73eaeabdf3221f079e7ef38f7.tar.xz eclipse.platform.ua-a0bbfb0b2a5a40b73eaeabdf3221f079e7ef38f7.zip |
Bug 529425 - [sonar] Resolve "instanceof will always return true"I20180117-2000I20180116-2000I20180115-2000I20180114-2000I20180113-1500I20180112-2000I20180111-2000I20180111-0530I20180110-2000I20180110-0100I20180109-2000I20180108-2000I20180107-2000I20180106-1500I20180105-2000
Change-Id: I8ae0af3452dd8e6d6e14b5b79d6c31687906b5fe
Signed-off-by: René Purrio <rpurrio@itemis.de>
-rw-r--r-- | org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java b/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java index 6ac8a72e2..e073e96dc 100644 --- a/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java +++ b/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java @@ -233,15 +233,15 @@ public class ProductPreferences { @Override public int compare(String o1, String o2) { - Object name1 = tocNames.get(o1); - Object name2 = tocNames.get(o2); - if (!(name1 instanceof String)) { - return (name2 instanceof String) ? -1 : 0; + String name1 = tocNames.get(o1); + String name2 = tocNames.get(o2); + if (name1 == null) { + return (name2 != null) ? -1 : 0; } - if (!(name2 instanceof String)) { + if (name2 == null) { return 1; } - return Collator.getInstance().compare((String)name1, (String)name2); + return Collator.getInstance().compare(name1, name2); } } |