Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-04-19 09:45:59 +0000
committerGerrit Code Review @ Eclipse.org2019-04-19 09:45:59 +0000
commitfa63f34bd61f35f257403d23e9834da5df663ccd (patch)
treeaf6d81d78b510753524ba2b317a35d9862b16106
parent62cedd70d946e75a66ee79434a025648cb300ae8 (diff)
parentc7e47efde3ce645b9dfa06dbfcda28248d1479fa (diff)
downloadegit-fa63f34bd61f35f257403d23e9834da5df663ccd.tar.gz
egit-fa63f34bd61f35f257403d23e9834da5df663ccd.tar.xz
egit-fa63f34bd61f35f257403d23e9834da5df663ccd.zip
Merge "Use isEmpty() instead of size()==0 where possible"
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageBuilder.java2
5 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java
index ca2046029e..3b5dda2f83 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java
@@ -117,7 +117,7 @@ public class RuleUtil {
rules.add(rule);
}
}
- if (rules.size() == 0)
+ if (rules.isEmpty())
return null;
else
return new MultiRule(rules.toArray(new ISchedulingRule[0]));
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java
index 56acd884ce..61483a8b84 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java
@@ -218,7 +218,7 @@ public class CommitOperation implements IEGitOperation {
}
private void addUntracked() throws CoreException {
- if (notTracked == null || notTracked.size() == 0) {
+ if (notTracked == null || notTracked.isEmpty()) {
return;
}
try (Git git = new Git(repo)) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java
index 801b36faec..6596ed69bd 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java
@@ -77,7 +77,7 @@ class GitRemoteFolder extends GitRemoteResource {
GitRemoteResource[] members(IProgressMonitor monitor) {
Collection<GitSyncObjectCache> members = cachedData.members();
- if (members == null || members.size() == 0)
+ if (members == null || members.isEmpty())
return new GitRemoteResource[0];
List<IResourceVariant> result = new ArrayList<IResourceVariant>();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java
index 02d13e3f9c..0a367f91d5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java
@@ -91,7 +91,7 @@ public class CompareWithPreviousActionHandler extends RepositoryActionHandler {
final AtomicReference<RevCommit> previous = new AtomicReference<>();
- if (previousList.size() == 0) {
+ if (previousList.isEmpty()) {
return null;
} else if (previousList.size() == 1)
previous.set(previousList.get(0));
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageBuilder.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageBuilder.java
index c8dedee22e..64089264be 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageBuilder.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageBuilder.java
@@ -215,7 +215,7 @@ class CommitMessageBuilder {
resources.add(file.getProject());
}
}
- if (resources.size() == 0) {
+ if (resources.isEmpty()) {
resources
.addAll(Arrays
.asList(ProjectUtil.getProjects(repository)));

Back to the top