Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-05-24 11:36:51 -0400
committerLars Vogel2019-06-12 10:44:10 -0400
commit8816cdaddd2f38ac3be6e6a70a0e8a683c772d83 (patch)
tree1153216ca56f53f33e8f176ded7954b3e4c6c8ed /org.eclipse.text
parent4f61ae008412225c6e73ac917ce6a839a58e5eda (diff)
downloadeclipse.platform.text-8816cdaddd2f38ac3be6e6a70a0e8a683c772d83.tar.gz
eclipse.platform.text-8816cdaddd2f38ac3be6e6a70a0e8a683c772d83.tar.xz
eclipse.platform.text-8816cdaddd2f38ac3be6e6a70a0e8a683c772d83.zip
Use isEmpty() instead of size()==0 where possibleI20190613-0210I20190612-1800
Change-Id: Ib6c59f4c9cea396c98196d23ff9ea917e2ef4114 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Diffstat (limited to 'org.eclipse.text')
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java2
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java4
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java2
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java2
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java4
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java2
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java2
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java4
8 files changed, 11 insertions, 11 deletions
diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java
index dc5d899c2..deefdf512 100644
--- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java
+++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java
@@ -77,7 +77,7 @@ public class ProjectionDocumentManager implements IDocumentListener, ISlaveDocum
List<ProjectionDocument> list= fProjectionRegistry.get(master);
if (list != null) {
list.remove(projection);
- if (list.size() == 0)
+ if (list.isEmpty())
fProjectionRegistry.remove(master);
}
}
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
index 458f0e515..5fad7d961 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
@@ -452,7 +452,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension,
* @since 3.4
*/
protected int computeIndexInPositionList(List<? extends Position> positions, int offset, boolean orderedByOffset) {
- if (positions.size() == 0)
+ if (positions.isEmpty())
return 0;
int left= 0;
@@ -1406,7 +1406,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension,
if (partitioner == null) {
if (fDocumentPartitioners != null) {
fDocumentPartitioners.remove(partitioning);
- if (fDocumentPartitioners.size() == 0)
+ if (fDocumentPartitioners.isEmpty())
fDocumentPartitioners= null;
}
} else {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java
index 56c7edee9..eb93bbcb5 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java
@@ -55,7 +55,7 @@ abstract class ListLineTracker implements ILineTracker {
*/
private int findLine(int offset) {
- if (fLines.size() == 0)
+ if (fLines.isEmpty())
return -1;
int left= 0;
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java b/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java
index 696efa05f..1e33bd7b3 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java
@@ -79,7 +79,7 @@ public class SequentialRewriteTextStore implements ITextStore {
if (text == null)
text= ""; //$NON-NLS-1$
- if (fReplaceList.size() == 0) {
+ if (fReplaceList.isEmpty()) {
fReplaceList.add(new Replace(offset, offset, length, text));
} else {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java b/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
index 296cd01b0..c9afe8dd1 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
@@ -188,7 +188,7 @@ public class TextUtilities {
*/
public static DocumentEvent mergeUnprocessedDocumentEvents(IDocument unprocessedDocument, List<? extends DocumentEvent> documentEvents) throws BadLocationException {
- if (documentEvents.size() == 0)
+ if (documentEvents.isEmpty())
return null;
final Iterator<? extends DocumentEvent> iterator= documentEvents.iterator();
@@ -253,7 +253,7 @@ public class TextUtilities {
*/
public static DocumentEvent mergeProcessedDocumentEvents(List<? extends DocumentEvent> documentEvents) throws BadLocationException {
- if (documentEvents.size() == 0)
+ if (documentEvents.isEmpty())
return null;
final ListIterator<? extends DocumentEvent> iterator= documentEvents.listIterator(documentEvents.size());
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java
index 0a6b2f5e7..495616f8a 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java
@@ -113,7 +113,7 @@ class LinkedModeManager {
return null;
}
- if (mgrs.size() == 0)
+ if (mgrs.isEmpty())
mgr= new LinkedModeManager();
for (IDocument document : documents)
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java
index d16a3576e..204430a7c 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java
@@ -393,7 +393,7 @@ public class LinkedPositionGroup {
* @since 3.1
*/
public boolean isEmpty() {
- return fPositions.size() == 0;
+ return fPositions.isEmpty();
}
/**
diff --git a/org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java
index 67ea88517..9d202feda 100644
--- a/org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java
+++ b/org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java
@@ -102,7 +102,7 @@ public class MultiTextEdit extends TextEdit {
return super.getOffset();
List<TextEdit> children= internalGetChildren();
- if (children == null || children.size() == 0)
+ if (children == null || children.isEmpty())
return 0;
// the children are already sorted
return children.get(0).getOffset();
@@ -114,7 +114,7 @@ public class MultiTextEdit extends TextEdit {
return super.getLength();
List<TextEdit> children= internalGetChildren();
- if (children == null || children.size() == 0)
+ if (children == null || children.isEmpty())
return 0;
// the children are already sorted
TextEdit first= children.get(0);

Back to the top