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.ui.genericeditor
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.ui.genericeditor')
-rw-r--r--org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/folding/IndentFoldingStrategy.java6
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 {

Back to the top