diff options
author | Lars Vogel | 2019-06-14 09:20:16 +0000 |
---|---|---|
committer | Lars Vogel | 2019-06-14 09:28:57 +0000 |
commit | e88d686c1fc682507b0246d04249afa81bdb6146 (patch) | |
tree | e277717f5e273ac4d8175534cdf68c80527bba73 /org.eclipse.ui.genericeditor | |
parent | 45c0a30d7027df909b78fa167cf3da83488581d9 (diff) | |
download | eclipse.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.ui.genericeditor')
-rw-r--r-- | org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/folding/IndentFoldingStrategy.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/folding/IndentFoldingStrategy.java b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/folding/IndentFoldingStrategy.java index 19a56b9e6c7..730070d9694 100644 --- a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/folding/IndentFoldingStrategy.java +++ b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/folding/IndentFoldingStrategy.java @@ -266,7 +266,7 @@ public class IndentFoldingStrategy implements IReconcilingStrategy, IReconciling // be sure projection has not been disabled if (projectionAnnotationModel != null) { - if (existing.size() > 0) { + if (!existing.isEmpty()) { deletions.addAll(existing); } // send the calculated updates to the annotations to the @@ -305,7 +305,7 @@ public class IndentFoldingStrategy implements IReconcilingStrategy, IReconciling // The line starts with the given keyword (ex: starts with "import") return LineState.StartWithKeyWord; } - if (lastLineForKeyword != null && (lineContent == null || lineContent.trim().length() == 0)) { + if (lastLineForKeyword != null && (lineContent == null || lineContent.trim().isEmpty())) { // a last line for keyword was defined, line is empty return LineState.EmptyLine; } @@ -377,7 +377,7 @@ public class IndentFoldingStrategy implements IReconcilingStrategy, IReconciling int startOffset = document.getLineOffset(line); int endOffset = document.getLineOffset(endLineNumber) + document.getLineLength(endLineNumber); Position newPos = new Position(startOffset, endOffset - startOffset); - if (existing.size() > 0) { + if (!existing.isEmpty()) { FoldingAnnotation existingAnnotation = existing.remove(existing.size() - 1); updateAnnotations(existingAnnotation, newPos, modifications, deletions); } else { |