aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/merge
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2017-02-20 13:17:27 +0900
committerMatthias Sohn <matthias.sohn@sap.com>2017-02-20 22:47:23 +0100
commit3b4448637fbb9d74e0c9d44048ba76bb7c1214ce (patch)
tree85bbb116d5b0336cb365a3f5a4d6c074afe80cc6 /org.eclipse.jgit/src/org/eclipse/jgit/merge
parent43eb8511f5d8225c0b4e2f899db2126334e5facf (diff)
downloadjgit-3b4448637fbb9d74e0c9d44048ba76bb7c1214ce.tar.gz
jgit-3b4448637fbb9d74e0c9d44048ba76bb7c1214ce.zip
Enable and fix warnings about redundant specification of type arguments
Since the introduction of generic type parameter inference in Java 7, it's not necessary to explicitly specify the type of generic parameters. Enable the warning in Eclipse, and fix all occurrences. Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/merge')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java14
6 files changed, 19 insertions, 19 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java
index 112550a1de..04c65effb8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java
@@ -98,11 +98,11 @@ public final class MergeAlgorithm {
*/
public <S extends Sequence> MergeResult<S> merge(
SequenceComparator<S> cmp, S base, S ours, S theirs) {
- List<S> sequences = new ArrayList<S>(3);
+ List<S> sequences = new ArrayList<>(3);
sequences.add(base);
sequences.add(ours);
sequences.add(theirs);
- MergeResult<S> result = new MergeResult<S>(sequences);
+ MergeResult<S> result = new MergeResult<>(sequences);
if (ours.size() == 0) {
if (theirs.size() != 0) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java
index ee6095aa71..43876a6227 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java
@@ -105,7 +105,7 @@ public class MergeFormatter {
@SuppressWarnings("unchecked")
public void formatMerge(OutputStream out, MergeResult res, String baseName,
String oursName, String theirsName, String charsetName) throws IOException {
- List<String> names = new ArrayList<String>(3);
+ List<String> names = new ArrayList<>(3);
names.add(baseName);
names.add(oursName);
names.add(theirsName);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
index 82cbf368c7..ca0e18a0ef 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
@@ -71,11 +71,11 @@ public class MergeMessageFormatter {
StringBuilder sb = new StringBuilder();
sb.append("Merge "); //$NON-NLS-1$
- List<String> branches = new ArrayList<String>();
- List<String> remoteBranches = new ArrayList<String>();
- List<String> tags = new ArrayList<String>();
- List<String> commits = new ArrayList<String>();
- List<String> others = new ArrayList<String>();
+ List<String> branches = new ArrayList<>();
+ List<String> remoteBranches = new ArrayList<>();
+ List<String> tags = new ArrayList<>();
+ List<String> commits = new ArrayList<>();
+ List<String> others = new ArrayList<>();
for (Ref ref : refsToMerge) {
if (ref.getName().startsWith(Constants.R_HEADS)) {
branches.add("'" + Repository.shortenRefName(ref.getName()) //$NON-NLS-1$
@@ -95,7 +95,7 @@ public class MergeMessageFormatter {
}
}
- List<String> listings = new ArrayList<String>();
+ List<String> listings = new ArrayList<>();
if (!branches.isEmpty())
listings.add(joinNames(branches, "branch", "branches")); //$NON-NLS-1$//$NON-NLS-2$
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java
index c5e615ed87..656480e468 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java
@@ -80,7 +80,7 @@ public abstract class MergeStrategy {
*/
public static final ThreeWayMergeStrategy RECURSIVE = new StrategyRecursive();
- private static final HashMap<String, MergeStrategy> STRATEGIES = new HashMap<String, MergeStrategy>();
+ private static final HashMap<String, MergeStrategy> STRATEGIES = new HashMap<>();
static {
register(OURS);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java
index e0556447ce..f8e1998ed7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java
@@ -147,7 +147,7 @@ public class RecursiveMerger extends ResolveMerger {
*/
protected RevCommit getBaseCommit(RevCommit a, RevCommit b, int callDepth)
throws IOException {
- ArrayList<RevCommit> baseCommits = new ArrayList<RevCommit>();
+ ArrayList<RevCommit> baseCommits = new ArrayList<>();
walk.reset();
walk.setRevFilter(RevFilter.MERGE_BASE);
walk.markStart(a);
@@ -181,7 +181,7 @@ public class RecursiveMerger extends ResolveMerger {
dircache = DirCache.read(reader, currentBase.getTree());
inCore = true;
- List<RevCommit> parents = new ArrayList<RevCommit>();
+ List<RevCommit> parents = new ArrayList<>();
parents.add(currentBase);
for (int commitIdx = 1; commitIdx < baseCommits.size(); commitIdx++) {
RevCommit nextBase = baseCommits.get(commitIdx);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
index fd5e7ef7ba..f667af278a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
@@ -180,14 +180,14 @@ public class ResolveMerger extends ThreeWayMerger {
*
* @since 3.4
*/
- protected List<String> unmergedPaths = new ArrayList<String>();
+ protected List<String> unmergedPaths = new ArrayList<>();
/**
* Files modified during this merge operation.
*
* @since 3.4
*/
- protected List<String> modifiedFiles = new LinkedList<String>();
+ protected List<String> modifiedFiles = new LinkedList<>();
/**
* If the merger has nothing to do for a file but check it out at the end of
@@ -195,7 +195,7 @@ public class ResolveMerger extends ThreeWayMerger {
*
* @since 3.4
*/
- protected Map<String, DirCacheEntry> toBeCheckedOut = new HashMap<String, DirCacheEntry>();
+ protected Map<String, DirCacheEntry> toBeCheckedOut = new HashMap<>();
/**
* Paths in this list will be deleted from the local copy at the end of the
@@ -203,7 +203,7 @@ public class ResolveMerger extends ThreeWayMerger {
*
* @since 3.4
*/
- protected List<String> toBeDeleted = new ArrayList<String>();
+ protected List<String> toBeDeleted = new ArrayList<>();
/**
* Low-level textual merge results. Will be passed on to the callers in case
@@ -211,14 +211,14 @@ public class ResolveMerger extends ThreeWayMerger {
*
* @since 3.4
*/
- protected Map<String, MergeResult<? extends Sequence>> mergeResults = new HashMap<String, MergeResult<? extends Sequence>>();
+ protected Map<String, MergeResult<? extends Sequence>> mergeResults = new HashMap<>();
/**
* Paths for which the merge failed altogether.
*
* @since 3.4
*/
- protected Map<String, MergeFailureReason> failingPaths = new HashMap<String, MergeFailureReason>();
+ protected Map<String, MergeFailureReason> failingPaths = new HashMap<>();
/**
* Updated as we merge entries of the tree walk. Tells us whether we should
@@ -518,7 +518,7 @@ public class ResolveMerger extends ThreeWayMerger {
unmergedPaths.add(tw.getPathString());
mergeResults.put(
tw.getPathString(),
- new MergeResult<RawText>(Collections
+ new MergeResult<>(Collections
.<RawText> emptyList()));
}
return true;