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
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>
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.java2
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSupport.java2
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java4
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/DocumentCommand.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/PaintManager.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextPresentation.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java8
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/DirtyRegionQueue.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationSupport.java2
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/PositionTracker.java2
-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
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java2
-rw-r--r--org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java2
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/DocumentLineDiffer.java4
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java2
25 files changed, 33 insertions, 33 deletions
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.java
index efe2e8875..2d11988e9 100644
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.java
+++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.java
@@ -127,7 +127,7 @@ class ProjectionSummary {
synchronized (fLock) {
if (fConfiguredAnnotationTypes != null) {
fConfiguredAnnotationTypes.remove(annotationType);
- if (fConfiguredAnnotationTypes.size() == 0)
+ if (fConfiguredAnnotationTypes.isEmpty())
fConfiguredAnnotationTypes= null;
}
}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSupport.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSupport.java
index 16f94e5a4..600b49f54 100644
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSupport.java
+++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSupport.java
@@ -208,7 +208,7 @@ public class ProjectionSupport {
public void removeSummarizableAnnotationType(String annotationType) {
if (fSummarizableTypes != null) {
fSummarizableTypes.remove(annotationType);
- if (fSummarizableTypes.size() == 0)
+ if (fSummarizableTypes.isEmpty())
fSummarizableTypes= null;
}
}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java
index 63d7b0ae0..8babac849 100644
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java
+++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java
@@ -458,7 +458,7 @@ public class ProjectionViewer extends SourceViewer implements ITextViewerExtensi
if (fProjectionListeners != null) {
fProjectionListeners.remove(listener);
- if (fProjectionListeners.size() == 0)
+ if (fProjectionListeners.isEmpty())
fProjectionListeners= null;
}
}
@@ -882,7 +882,7 @@ public class ProjectionViewer extends SourceViewer implements ITextViewerExtensi
while (true) {
AnnotationModelEvent ame= null;
synchronized (fLock) {
- if (fPendingRequests.size() == 0)
+ if (fPendingRequests.isEmpty())
return;
ame= fPendingRequests.remove(0);
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java
index 697a3a387..4d7c78ba5 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java
@@ -119,7 +119,7 @@ public class CodeMiningManager implements Runnable {
@Override
public void run() {
if (fViewer == null || fInlinedAnnotationSupport == null || fCodeMiningProviders == null
- || fCodeMiningProviders.size() == 0 || fViewer.getAnnotationModel() == null) {
+ || fCodeMiningProviders.isEmpty() || fViewer.getAnnotationModel() == null) {
return;
}
// Cancel the last progress monitor to cancel last resolve and render of code
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
index eb783f428..f96276a98 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
@@ -173,7 +173,7 @@ public final class RevisionPainter {
float scale;
if (fRenderingMode == IRevisionRulerColumnExtension.AGE) {
int index= computeAgeIndex(revision);
- if (index == -1 || fRevisions.size() == 0) {
+ if (index == -1 || fRevisions.isEmpty()) {
rgb= getBackground().getRGB();
} else {
// gradient from intense red for most recent to faint yellow for oldest
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/DocumentCommand.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/DocumentCommand.java
index 37d869c30..cf6898d4d 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/DocumentCommand.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/DocumentCommand.java
@@ -391,7 +391,7 @@ public class DocumentCommand {
*/
void execute(IDocument document) throws BadLocationException {
- if (length == 0 && text == null && fCommands.size() == 0)
+ if (length == 0 && text == null && fCommands.isEmpty())
return;
DefaultPositionUpdater updater= new DefaultPositionUpdater(getCategory());
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/PaintManager.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/PaintManager.java
index 08ac23004..e9c38bbd2 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/PaintManager.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/PaintManager.java
@@ -220,7 +220,7 @@ public final class PaintManager implements KeyListener, MouseListener, ISelectio
painter.deactivate(true);
painter.setPositionManager(null);
}
- if (fPainters.size() == 0)
+ if (fPainters.isEmpty())
dispose();
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextPresentation.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextPresentation.java
index a23b5932e..ff79eff03 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextPresentation.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextPresentation.java
@@ -270,7 +270,7 @@ public class TextPresentation {
int length= range.length;
int end= start + length;
- if (fRanges.size() == 0) {
+ if (fRanges.isEmpty()) {
StyleRange defaultRange= getDefaultStyleRange();
if (defaultRange == null)
defaultRange= range;
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
index c98fa3ec5..2c266dcea 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
@@ -2491,7 +2491,7 @@ public class TextViewer extends Viewer implements
if (fPostSelectionChangedListeners != null) {
fPostSelectionChangedListeners.remove(listener);
- if (fPostSelectionChangedListeners.size() == 0)
+ if (fPostSelectionChangedListeners.isEmpty())
fPostSelectionChangedListeners= null;
}
}
@@ -2661,7 +2661,7 @@ public class TextViewer extends Viewer implements
if (fTextListeners != null) {
fTextListeners.remove(listener);
- if (fTextListeners.size() == 0)
+ if (fTextListeners.isEmpty())
fTextListeners= null;
}
}
@@ -2709,7 +2709,7 @@ public class TextViewer extends Viewer implements
if (fTextInputListeners != null) {
fTextInputListeners.remove(listener);
- if (fTextInputListeners.size() == 0)
+ if (fTextInputListeners.isEmpty())
fTextInputListeners= null;
}
}
@@ -5446,7 +5446,7 @@ public class TextViewer extends Viewer implements
if (fTextPresentationListeners != null) {
fTextPresentationListeners.remove(listener);
- if (fTextPresentationListeners.size() == 0)
+ if (fTextPresentationListeners.isEmpty())
fTextPresentationListeners= null;
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/DirtyRegionQueue.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/DirtyRegionQueue.java
index fc4c7f11b..c342fc776 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/DirtyRegionQueue.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/DirtyRegionQueue.java
@@ -98,7 +98,7 @@ class DirtyRegionQueue {
* @return the next dirty region on the queue
*/
public DirtyRegion removeNextDirtyRegion() {
- if (fDirtyRegions.size() == 0)
+ if (fDirtyRegions.isEmpty())
return null;
DirtyRegion dr= fDirtyRegions.get(0);
fDirtyRegions.remove(0);
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationSupport.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationSupport.java
index 69aa435ca..cc897c554 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationSupport.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationSupport.java
@@ -441,7 +441,7 @@ public class InlinedAnnotationSupport {
for (AbstractInlinedAnnotation ann : annotations) {
ann.setSupport(this);
}
- if (annotationsToAdd.size() == 0 && annotationsToRemove.size() == 0) {
+ if (annotationsToAdd.isEmpty() && annotationsToRemove.isEmpty()) {
// None change, do nothing. Here the user could change position of codemining
// range
// (ex: user key press
diff --git a/org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/PositionTracker.java b/org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/PositionTracker.java
index 51ef2ee29..b8853901c 100644
--- a/org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/PositionTracker.java
+++ b/org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/PositionTracker.java
@@ -181,7 +181,7 @@ public class PositionTracker implements IQueryListener, ISearchResultListener, I
Set<Match> matches= fFileBuffersToMatches.get(fb);
if (matches != null) {
matches.remove(match);
- if (matches.size() == 0)
+ if (matches.isEmpty())
fFileBuffersToMatches.remove(fb);
}
}
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);
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java
index b00bcfd17..18b73351d 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java
@@ -981,7 +981,7 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro
public void removeElementStateListener(IElementStateListener listener) {
Assert.isNotNull(listener);
fElementStateListeners.remove(listener);
- if (fElementStateListeners.size() == 0) {
+ if (fElementStateListeners.isEmpty()) {
IFileBufferManager manager= FileBuffers.getTextFileBufferManager();
manager.removeFileBufferListener(fFileBufferListener);
}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java
index a2261760b..2afcf8f03 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java
@@ -617,7 +617,7 @@ public abstract class AbstractMarkerAnnotationModel extends AnnotationModel impl
IAnnotationMap annotationMap= getAnnotationMap();
- if (annotationMap.size() == 0 && fDeletedAnnotations.size() == 0)
+ if (annotationMap.size() == 0 && fDeletedAnnotations.isEmpty())
return;
if (fMarkerUpdaterSpecifications == null)
diff --git a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java
index b271c5338..3a7ae7227 100644
--- a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java
+++ b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java
@@ -95,7 +95,7 @@ public class CompositeInformationControl extends AbstractInformationControl impl
if (informationControl instanceof AbstractInformationControl) {
List<Control> children = Arrays.asList(((AbstractInformationControl)informationControl).getShell().getChildren());
children.remove(parent);
- if (children.size() == 0 ) {
+ if (children.isEmpty() ) {
continue;
}
for (Control control : children) {
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/DocumentLineDiffer.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/DocumentLineDiffer.java
index 32ec5314c..454e663eb 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/DocumentLineDiffer.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/DocumentLineDiffer.java
@@ -631,7 +631,7 @@ public class DocumentLineDiffer implements ILineDiffer, IDocumentListener, IAnno
synchronized (DocumentLineDiffer.this) {
if (isCanceled(monitor))
return Status.CANCEL_STATUS;
- if (fStoredEvents.size() == 0 && actual != null)
+ if (fStoredEvents.isEmpty() && actual != null)
break;
}
} while (true);
@@ -1026,7 +1026,7 @@ public class DocumentLineDiffer implements ILineDiffer, IDocumentListener, IAnno
// compare
List<QuickDiffRangeDifference> diffs= asQuickDiffRangeDifference(RangeDifferencer.findRanges(fRangeDiffFactory, null, reference, change));
- if (diffs.size() == 0) {
+ if (diffs.isEmpty()) {
diffs.add(new QuickDiffRangeDifference(RangeDifference.CHANGE, 0, 0, 0, 0));
}
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java
index 9293185a5..f15626598 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java
@@ -432,7 +432,7 @@ public abstract class AbstractDocumentProvider implements IDocumentProvider, IDo
removeUnchangedElementListeners(element, info);
disposeElementInfo(element, info);
- if (fElementInfoMap.size() == 0)
+ if (fElementInfoMap.isEmpty())
disconnected();
} else

Back to the top