Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-04-14 06:22:49 -0400
committerMichael Keppler2019-04-26 08:08:09 -0400
commit1ec405f058b677b8d83234d8fffa132f800cefd7 (patch)
treeb51caf24bf2501a6a5754deac75e8391b40a1eee
parent95bf547c006e288a7cd42b99f03ceaa42a9279b9 (diff)
downloadegit-1ec405f058b677b8d83234d8fffa132f800cefd7.tar.gz
egit-1ec405f058b677b8d83234d8fffa132f800cefd7.tar.xz
egit-1ec405f058b677b8d83234d8fffa132f800cefd7.zip
Remove unnecessary type specifications
Since Java 7 the diamond operator can be used instead of explicit typeparameters. Change-Id: I602e7b1bf45ca1c6612305e655fc4618742d0d4f Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--org.eclipse.egit.core.junit/src/org/eclipse/egit/core/test/TestUtils.java4
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java2
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffDataTest.java8
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitProjectSetCapabilityTest.java2
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java2
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/rebase/RebaseInteractivePlanTest.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseProxySelector.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/FileChecker.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java6
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffData.java48
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/CreatePatchOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java6
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java6
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncObjectCache.java6
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java8
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/prefpages/configuration/GlobalConfigurationPageTest.java6
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java6
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java2
25 files changed, 71 insertions, 71 deletions
diff --git a/org.eclipse.egit.core.junit/src/org/eclipse/egit/core/test/TestUtils.java b/org.eclipse.egit.core.junit/src/org/eclipse/egit/core/test/TestUtils.java
index 7cb71fa79..569bf4e5e 100644
--- a/org.eclipse.egit.core.junit/src/org/eclipse/egit/core/test/TestUtils.java
+++ b/org.eclipse.egit.core.junit/src/org/eclipse/egit/core/test/TestUtils.java
@@ -241,7 +241,7 @@ public class TestUtils {
*/
public void assertRepositoryContainsFiles(Repository repository,
String[] paths) throws Exception {
- Set<String> expectedfiles = new HashSet<String>();
+ Set<String> expectedfiles = new HashSet<>();
for (String path : paths)
expectedfiles.add(path);
try (TreeWalk treeWalk = new TreeWalk(repository)) {
@@ -376,7 +376,7 @@ public class TestUtils {
private static HashMap<String, String> mkmap(String... args) {
if ((args.length % 2) > 0)
throw new IllegalArgumentException("needs to be pairs");
- HashMap<String, String> map = new HashMap<String, String>();
+ HashMap<String, String> map = new HashMap<>();
for (int i = 0; i < args.length; i += 2) {
map.put(args[i], args[i+1]);
}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java
index 2100cd9f1..d63569468 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java
@@ -74,7 +74,7 @@ public class GitMoveDeleteHookTest {
Repository repository;
- Set<File> testDirs = new HashSet<File>();
+ Set<File> testDirs = new HashSet<>();
File workspaceSupplement;
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffDataTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffDataTest.java
index 62a64ab29..5c6708982 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffDataTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffDataTest.java
@@ -50,10 +50,10 @@ public class IndexDiffDataTest extends GitTestCase {
@Test
public void testMergeIgnored() {
Set<String> result;
- Set<String> expected = new HashSet<String>();
- Set<String> oldIgnoredPaths = new HashSet<String>();
- Collection<String> changedPaths = new HashSet<String>();
- Set<String> newIgnoredPaths = new HashSet<String>();
+ Set<String> expected = new HashSet<>();
+ Set<String> oldIgnoredPaths = new HashSet<>();
+ Collection<String> changedPaths = new HashSet<>();
+ Set<String> newIgnoredPaths = new HashSet<>();
result = mergeIgnored(oldIgnoredPaths, changedPaths, newIgnoredPaths);
assertEquals(expected, result);
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitProjectSetCapabilityTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitProjectSetCapabilityTest.java
index 61bb8d1af..1c03438be 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitProjectSetCapabilityTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitProjectSetCapabilityTest.java
@@ -56,7 +56,7 @@ public class GitProjectSetCapabilityTest {
private GitProjectSetCapability capability;
private List<IProject> createdProjects = new ArrayList<IProject>();
- private List<File> pathsToClean = new ArrayList<File>();
+ private List<File> pathsToClean = new ArrayList<>();
protected final static TestUtils testUtils = new TestUtils();
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java
index e3a396821..0a1b629f1 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java
@@ -239,7 +239,7 @@ public class CommitOperationTest extends GitTestCase {
}
private String[] getRepoRelativePaths(IFile[] files) {
- ArrayList<String> result = new ArrayList<String>();
+ ArrayList<String> result = new ArrayList<>();
for (IFile file:files)
result.add(file.getProjectRelativePath().toString());
return result.toArray(new String[0]);
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/rebase/RebaseInteractivePlanTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/rebase/RebaseInteractivePlanTest.java
index 3c80b6c53..5560ab679 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/rebase/RebaseInteractivePlanTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/rebase/RebaseInteractivePlanTest.java
@@ -172,11 +172,11 @@ public class RebaseInteractivePlanTest extends GitTestCase {
@Before
public void beforeTest() {
- testData1 = new LinkedList<Integer>();
+ testData1 = new LinkedList<>();
for (int i = 1; i <= 4; i++) {
testData1.add(Integer.valueOf(i));
}
- testData2 = new LinkedList<Integer>();
+ testData2 = new LinkedList<>();
for (int i = 5; i <= 10; i++) {
testData2.add(Integer.valueOf(i));
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseProxySelector.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseProxySelector.java
index e606ba4a4..8ec130a1e 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseProxySelector.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseProxySelector.java
@@ -34,7 +34,7 @@ class EclipseProxySelector extends ProxySelector {
@Override
public List<Proxy> select(final URI uri) {
- final ArrayList<Proxy> r = new ArrayList<Proxy>();
+ final ArrayList<Proxy> r = new ArrayList<>();
final String host = uri.getHost();
if (host != null) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/FileChecker.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/FileChecker.java
index e67ca613c..bd10a0411 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/FileChecker.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/FileChecker.java
@@ -41,7 +41,7 @@ public class FileChecker {
private boolean containsNotSharedResources = false;
- private Map<String, CheckResultEntry> problems = new HashMap<String, FileChecker.CheckResultEntry>();
+ private Map<String, CheckResultEntry> problems = new HashMap<>();
/**
* @return true if there are no problems
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java
index 148268097..513589fb0 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/ProjectReferenceImporter.java
@@ -130,7 +130,7 @@ public class ProjectReferenceImporter {
if (repositoryAlreadyExistsForUrl(repositoryPath, gitUrl))
return repositoryPath;
else {
- final Collection<String> projectNames = new LinkedList<String>();
+ final Collection<String> projectNames = new LinkedList<>();
for (final ProjectReference projectReference : projects)
projectNames.add(projectReference.getProjectDir());
throw new TeamException(
@@ -168,14 +168,14 @@ public class ProjectReferenceImporter {
Map<String, Set<ProjectReference>> repositoryBranches = repositories
.get(projectReference.getRepository());
if (repositoryBranches == null) {
- repositoryBranches = new HashMap<String, Set<ProjectReference>>();
+ repositoryBranches = new HashMap<>();
repositories.put(projectReference.getRepository(),
repositoryBranches);
}
Set<ProjectReference> projectReferences = repositoryBranches
.get(projectReference.getBranch());
if (projectReferences == null) {
- projectReferences = new LinkedHashSet<ProjectReference>();
+ projectReferences = new LinkedHashSet<>();
repositoryBranches.put(projectReference.getBranch(),
projectReferences);
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java
index d0c88e757..332af4926 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java
@@ -88,7 +88,7 @@ public class GitResourceDeltaVisitor implements IResourceDeltaVisitor {
Map<IProject, IPath> deletedProjects) {
this.repository = repository;
- filesToUpdate = new HashSet<String>();
+ filesToUpdate = new HashSet<>();
resourcesToUpdate = new HashSet<IResource>();
this.deletedProjects = deletedProjects;
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffData.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffData.java
index 1f8a88bb7..a3f9f8a88 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffData.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffData.java
@@ -78,34 +78,34 @@ public class IndexDiffData {
* @param indexDiff
*/
public IndexDiffData(IndexDiff indexDiff) {
- added = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ added = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getAdded()));
assumeUnchanged = Collections.unmodifiableSet(
- new HashSet<String>(indexDiff.getAssumeUnchanged()));
- changed = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ new HashSet<>(indexDiff.getAssumeUnchanged()));
+ changed = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getChanged()));
- removed = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ removed = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getRemoved()));
- missing = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ missing = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getMissing()));
- modified = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ modified = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getModified()));
- untracked = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ untracked = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getUntracked()));
untrackedFolders = Collections.unmodifiableSet(getUntrackedFolders(indexDiff));
- conflicts = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ conflicts = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getConflicting()));
- ignored = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ ignored = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getIgnoredNotInIndex()));
- symlinks = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ symlinks = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getPathsWithIndexMode(FileMode.SYMLINK)));
- submodules = Collections.unmodifiableSet(new HashSet<String>(indexDiff
+ submodules = Collections.unmodifiableSet(new HashSet<>(indexDiff
.getPathsWithIndexMode(FileMode.GITLINK)));
changedResources = Collections.emptySet();
}
private Set<String> getUntrackedFolders(IndexDiff indexDiff) {
- HashSet<String> result = new HashSet<String>();
+ HashSet<String> result = new HashSet<>();
for (String folder:indexDiff.getUntrackedFolders())
result.add(folder + "/"); //$NON-NLS-1$
return result;
@@ -128,17 +128,17 @@ public class IndexDiffData {
IndexDiff diffForChangedFiles) {
this.changedResources = Collections
.unmodifiableCollection(new HashSet<IResource>(changedResources));
- Set<String> added2 = new HashSet<String>(baseDiff.getAdded());
- Set<String> assumeUnchanged2 = new HashSet<String>(
+ Set<String> added2 = new HashSet<>(baseDiff.getAdded());
+ Set<String> assumeUnchanged2 = new HashSet<>(
baseDiff.getAssumeUnchanged());
- Set<String> changed2 = new HashSet<String>(baseDiff.getChanged());
- Set<String> removed2 = new HashSet<String>(baseDiff.getRemoved());
- Set<String> missing2 = new HashSet<String>(baseDiff.getMissing());
- Set<String> modified2 = new HashSet<String>(baseDiff.getModified());
- Set<String> untracked2 = new HashSet<String>(baseDiff.getUntracked());
- Set<String> conflicts2 = new HashSet<String>(baseDiff.getConflicting());
- Set<String> symlinks2 = new HashSet<String>(baseDiff.getSymlinks());
- Set<String> submodules2 = new HashSet<String>(baseDiff.getSubmodules());
+ Set<String> changed2 = new HashSet<>(baseDiff.getChanged());
+ Set<String> removed2 = new HashSet<>(baseDiff.getRemoved());
+ Set<String> missing2 = new HashSet<>(baseDiff.getMissing());
+ Set<String> modified2 = new HashSet<>(baseDiff.getModified());
+ Set<String> untracked2 = new HashSet<>(baseDiff.getUntracked());
+ Set<String> conflicts2 = new HashSet<>(baseDiff.getConflicting());
+ Set<String> symlinks2 = new HashSet<>(baseDiff.getSymlinks());
+ Set<String> submodules2 = new HashSet<>(baseDiff.getSubmodules());
mergeList(added2, changedFiles, diffForChangedFiles.getAdded());
mergeList(assumeUnchanged2, changedFiles,
@@ -189,7 +189,7 @@ public class IndexDiffData {
private static Set<String> mergeUntrackedFolders(Set<String> oldUntrackedFolders,
Collection<String> changedFiles, Set<String> newUntrackedFolders) {
- Set<String> merged = new HashSet<String>();
+ Set<String> merged = new HashSet<>();
for (String oldUntrackedFolder : oldUntrackedFolders) {
boolean changeInUntrackedFolder = isAnyFileContainedInFolder(
oldUntrackedFolder, changedFiles);
@@ -218,7 +218,7 @@ public class IndexDiffData {
*/
protected static Set<String> mergeIgnored(Set<String> oldIgnoredPaths,
Collection<String> changedPaths, Set<String> newIgnoredPaths) {
- Set<String> merged = new HashSet<String>();
+ Set<String> merged = new HashSet<>();
for (String oldIgnoredPath : oldIgnoredPaths) {
boolean changed = isAnyPrefixOf(oldIgnoredPath, changedPaths);
if (!changed) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java
index f65f7ff00..0f8339aff 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java
@@ -111,7 +111,7 @@ abstract class IndexDiffUpdateJob extends Job {
private void cleanup() {
synchronized (lock) {
- files = new HashSet<String>();
+ files = new HashSet<>();
resources = new HashSet<IResource>();
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
index 085e3002d..317269326 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
@@ -609,7 +609,7 @@ public class ResourceUtil {
if (path != null) {
Collection<String> resourcesList = result.get(repository);
if (resourcesList == null) {
- resourcesList = new ArrayList<String>();
+ resourcesList = new ArrayList<>();
result.put(repository, resourcesList);
}
resourcesList.add(path);
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java
index 30528aecc..b9d6b73e3 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CloneOperation.java
@@ -171,7 +171,7 @@ public class CloneOperation {
cloneRepository.setCallback(callback);
}
if (selectedBranches != null) {
- List<String> branches = new ArrayList<String>();
+ List<String> branches = new ArrayList<>();
for (Ref branch : selectedBranches) {
branches.add(branch.getName());
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CreatePatchOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CreatePatchOperation.java
index 0adff06ee..38b71bc85 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CreatePatchOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CreatePatchOperation.java
@@ -292,7 +292,7 @@ public class CreatePatchOperation implements IEGitOperation {
private void writeGitPatchHeader(StringBuilder sb) {
String template = headerFormat.getTemplate();
String[] segments = template.split("\\$\\{"); //$NON-NLS-1$
- Stack<String> evaluated = new Stack<String>();
+ Stack<String> evaluated = new Stack<>();
evaluated.add(segments[0]);
for (int i = 1; i < segments.length; i++) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
index f0ea1b97f..99ef8e984 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java
@@ -57,10 +57,10 @@ import org.eclipse.jgit.util.SystemReader;
public class RepositoryFinder {
private final IProject proj;
- private final List<RepositoryMapping> results = new ArrayList<RepositoryMapping>();
- private final Set<File> gitdirs = new HashSet<File>();
+ private final List<RepositoryMapping> results = new ArrayList<>();
+ private final Set<File> gitdirs = new HashSet<>();
- private final Set<File> ceilingDirectories = new HashSet<File>();
+ private final Set<File> ceilingDirectories = new HashSet<>();
private boolean findInChildren = true;
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java
index f9c7db901..c93e7579b 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java
@@ -331,7 +331,7 @@ public class GitCommitsModelCache {
public static List<Commit> build(Repository repo, ObjectId srcId,
ObjectId dstId, TreeFilter pathFilter) throws IOException {
if (dstId.equals(srcId))
- return new ArrayList<Commit>(0);
+ return new ArrayList<>(0);
try (RevWalk rw = new RevWalk(repo)) {
@@ -355,7 +355,7 @@ public class GitCommitsModelCache {
if (pathFilter != null)
rw.setTreeFilter(pathFilter);
- List<Commit> result = new ArrayList<Commit>();
+ List<Commit> result = new ArrayList<>();
for (RevCommit revCommit : rw) {
if (revCommit.hasAll(allFlags))
break;
@@ -398,7 +398,7 @@ public class GitCommitsModelCache {
private static Map<String, Change> getChangedObjects(Repository repo,
RevCommit commit, RevCommit parentCommit,
TreeFilter pathFilter, final int direction) throws IOException {
- final Map<String, Change> result = new HashMap<String, GitCommitsModelCache.Change>();
+ final Map<String, Change> result = new HashMap<>();
try (final TreeWalk tw = new TreeWalk(repo)) {
int commitIndex = addTree(tw, commit);
int parentCommitIndex = addTree(tw, parentCommit);
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncObjectCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncObjectCache.java
index 28a67f298..24fe9e6f7 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncObjectCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncObjectCache.java
@@ -74,7 +74,7 @@ class GitSyncObjectCache {
String memberPath = entry.getPath();
if (members == null)
- members = new HashMap<String, GitSyncObjectCache>();
+ members = new HashMap<>();
int start = -1;
Map<String, GitSyncObjectCache> parent = members;
@@ -89,7 +89,7 @@ class GitSyncObjectCache {
start = separatorIdx;
separatorIdx = memberPath.indexOf("/", separatorIdx + 1); //$NON-NLS-1$
if (cacheObject.members == null)
- cacheObject.members = new HashMap<String, GitSyncObjectCache>();
+ cacheObject.members = new HashMap<>();
parent = cacheObject.members;
}
@@ -171,7 +171,7 @@ class GitSyncObjectCache {
void merge(GitSyncObjectCache other, Set<String> filterPaths) {
if (other.members != null) {
if (members == null)
- members = new HashMap<String, GitSyncObjectCache>();
+ members = new HashMap<>();
for (Entry<String, GitSyncObjectCache> entry : members.entrySet()) {
String key = entry.getKey();
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java
index a11ea7eae..f027bd3e4 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java
@@ -67,7 +67,7 @@ public class StagedChangeCache {
headCommit = null;
MutableObjectId idBuf = new MutableObjectId();
- Map<String, Change> result = new HashMap<String, Change>();
+ Map<String, Change> result = new HashMap<>();
while(tw.next()) {
if (!shouldIncludeEntry(tw))
continue;
@@ -89,7 +89,7 @@ public class StagedChangeCache {
return result;
} catch (IOException e) {
Activator.logError(e.getMessage(), e);
- return new HashMap<String, Change>(0);
+ return new HashMap<>(0);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java
index a46d68850..b178cea1a 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java
@@ -44,7 +44,7 @@ public class WorkingTreeChangeCache {
tw.setFilter(new IndexDiffFilter(cacheNth, fileNth));
tw.setRecursive(true);
- Map<String, Change> result = new HashMap<String, Change>();
+ Map<String, Change> result = new HashMap<>();
MutableObjectId idBuf = new MutableObjectId();
while (tw.next()) {
Change change = new Change();
@@ -61,7 +61,7 @@ public class WorkingTreeChangeCache {
return result;
} catch (IOException e) {
Activator.logError(e.getMessage(), e);
- return new HashMap<String, GitCommitsModelCache.Change>(0);
+ return new HashMap<>(0);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java
index b40de828e..3455dff8a 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java
@@ -48,8 +48,8 @@ public class GitSynchronizeDataSet implements Iterable<GitSynchronizeData> {
*/
public GitSynchronizeDataSet(boolean forceFetch) {
this.forceFetch = forceFetch;
- gsdSet = new HashSet<GitSynchronizeData>();
- projectMapping = new HashMap<String, GitSynchronizeData>();
+ gsdSet = new HashSet<>();
+ projectMapping = new HashMap<>();
}
/**
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java
index 1ad15e5cd..f5ddc247e 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java
@@ -102,14 +102,14 @@ public class CommonUtilsTest {
*/
private void assertSortedLike(String... inputs) {
List<String> expected = Arrays.asList(inputs);
- List<String> tmp = new ArrayList<String>(expected);
+ List<String> tmp = new ArrayList<>(expected);
Collections.shuffle(tmp, new Random(1));
Collections.sort(tmp, CommonUtils.STRING_ASCENDING_COMPARATOR);
assertEquals(expected, tmp);
- List<String> expectedWithoutDuplicates = new ArrayList<String>(
- new LinkedHashSet<String>(expected));
- List<String> shuffeled = new ArrayList<String>(expected);
+ List<String> expectedWithoutDuplicates = new ArrayList<>(
+ new LinkedHashSet<>(expected));
+ List<String> shuffeled = new ArrayList<>(expected);
Collections.shuffle(shuffeled, new Random(1));
TreeSet<String> sortedSet = new TreeSet<String>(
CommonUtils.STRING_ASCENDING_COMPARATOR);
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/prefpages/configuration/GlobalConfigurationPageTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/prefpages/configuration/GlobalConfigurationPageTest.java
index 5c12d43d8..2eb2191b1 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/prefpages/configuration/GlobalConfigurationPageTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/prefpages/configuration/GlobalConfigurationPageTest.java
@@ -378,7 +378,7 @@ public class GlobalConfigurationPageTest {
@Test
public void testRemoveValue() throws Exception {
- List<String> values = new ArrayList<String>(2);
+ List<String> values = new ArrayList<>(2);
values.add("true");
values.add("false");
config.setStringList(TESTSECTION, null, TESTNAME, values);
@@ -401,7 +401,7 @@ public class GlobalConfigurationPageTest {
@Test
public void testRemoveSubSection() throws Exception {
- List<String> values = new ArrayList<String>(2);
+ List<String> values = new ArrayList<>(2);
values.add("true");
values.add("false");
config.setStringList(TESTSECTION, null, TESTNAME, values);
@@ -427,7 +427,7 @@ public class GlobalConfigurationPageTest {
@Test
public void testRemoveSection() throws Exception {
- List<String> values = new ArrayList<String>(2);
+ List<String> values = new ArrayList<>(2);
values.add("true");
values.add("false");
config.setStringList(TESTSECTION, null, TESTNAME, values);
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
index 02bb84488..b6cf090f8 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
@@ -473,7 +473,7 @@ public class TestUtil {
*/
public static void assertRepositoryContainsFiles(Repository repository,
String[] paths) throws Exception {
- Set<String> expectedfiles = new HashSet<String>();
+ Set<String> expectedfiles = new HashSet<>();
for (String path : paths)
expectedfiles.add(path);
try (TreeWalk treeWalk = new TreeWalk(repository)) {
@@ -546,7 +546,7 @@ public class TestUtil {
private static HashMap<String, String> mkmap(String... args) {
if ((args.length % 2) > 0)
throw new IllegalArgumentException("needs to be pairs");
- HashMap<String, String> map = new HashMap<String, String>();
+ HashMap<String, String> map = new HashMap<>();
for (int i = 0; i < args.length; i += 2)
map.put(args[i], args[i+1]);
return map;
@@ -695,7 +695,7 @@ public class TestUtil {
* @return node containing the text
*/
public static SWTBotTreeItem getNode(SWTBotTreeItem[] nodes, String searchText) {
- List<String> texts = new ArrayList<String>();
+ List<String> texts = new ArrayList<>();
List<SWTBotTreeItem> matchingItems = new ArrayList<SWTBotTreeItem>();
for (SWTBotTreeItem item : nodes) {
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
index bf0adfd57..393cdf280 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
@@ -110,7 +110,7 @@ public class SharingWizardTest extends LocalRepositoryTestCase {
@After
public void after() throws Exception {
- Set<File> d = new TreeSet<File>();
+ Set<File> d = new TreeSet<>();
erase(projectName0, d);
erase(projectName1, d);
erase(projectName2, d);

Back to the top