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.jface.text/projection/org/eclipse | |
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.jface.text/projection/org/eclipse')
2 files changed, 3 insertions, 3 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 15bdd8ac944..b930c66cc5e 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 @@ -186,7 +186,7 @@ class ProjectionSummary { return; } - if (bags != null && bags.size() > 0) { + if (bags != null && !bags.isEmpty()) { Annotation[] deletions= new Annotation[bags.size()]; bags.toArray(deletions); if (!isCanceled(monitor)) @@ -220,7 +220,7 @@ class ProjectionSummary { return; } - if (additions.size() > 0) { + if (!additions.isEmpty()) { if (visualAnnotationModel instanceof IAnnotationModelExtension) { IAnnotationModelExtension extension= (IAnnotationModelExtension)visualAnnotationModel; if (!isCanceled(monitor)) 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 403af6398b0..316a78702c6 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 @@ -1028,7 +1028,7 @@ public class ProjectionViewer extends SourceViewer implements ITextViewerExtensi } } - if (annotations.size() > 0) { + if (!annotations.isEmpty()) { ProjectionAnnotation[] result= new ProjectionAnnotation[annotations.size()]; annotations.toArray(result); return result; |