Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-06-14 09:20:16 +0000
committerLars Vogel2019-06-14 09:28:57 +0000
commite88d686c1fc682507b0246d04249afa81bdb6146 (patch)
treee277717f5e273ac4d8175534cdf68c80527bba73 /org.eclipse.jface.text.examples
parent45c0a30d7027df909b78fa167cf3da83488581d9 (diff)
downloadeclipse.platform.text-e88d686c1fc682507b0246d04249afa81bdb6146.tar.gz
eclipse.platform.text-e88d686c1fc682507b0246d04249afa81bdb6146.tar.xz
eclipse.platform.text-e88d686c1fc682507b0246d04249afa81bdb6146.zip
Use isEmpty() instead of length() to check if collection is emptyI20190615-1800I20190614-1800
Change-Id: I0106dd0c2ddfa318375877d4562068d82aa9ac5f Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.jface.text.examples')
-rw-r--r--org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassImplementationsCodeMiningProvider.java2
-rw-r--r--org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassReferenceCodeMiningProvider.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassImplementationsCodeMiningProvider.java b/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassImplementationsCodeMiningProvider.java
index 065dc22be..1b450797c 100644
--- a/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassImplementationsCodeMiningProvider.java
+++ b/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassImplementationsCodeMiningProvider.java
@@ -56,7 +56,7 @@ public class ClassImplementationsCodeMiningProvider extends AbstractCodeMiningPr
if (index != -1) {
className = className.substring(0, index);
}
- if (className.length() > 0) {
+ if (!className.isEmpty()) {
try {
lenses.add(new ClassImplementationCodeMining(className, lineIndex, document, this));
} catch (BadLocationException e) {
diff --git a/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassReferenceCodeMiningProvider.java b/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassReferenceCodeMiningProvider.java
index 203c0a547..2a168e95c 100644
--- a/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassReferenceCodeMiningProvider.java
+++ b/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/codemining/ClassReferenceCodeMiningProvider.java
@@ -44,7 +44,7 @@ public class ClassReferenceCodeMiningProvider extends AbstractCodeMiningProvider
int index = line.indexOf("class ");
if (index == 0) {
String className = line.substring(index + "class ".length(), line.length()).trim();
- if (className.length() > 0) {
+ if (!className.isEmpty()) {
try {
lenses.add(new ClassReferenceCodeMining(className, i, document, this));
} catch (BadLocationException e) {

Back to the top