Remove redundant specification of type arguments

Change-Id: I8289e0a6ca9154d6411993d250176a35df7cb905
This commit is contained in:
Matthias Sohn 2023-07-16 15:11:17 +02:00
parent 760bdd09b1
commit b2f7dc189a
7 changed files with 12 additions and 10 deletions

View File

@ -160,7 +160,7 @@ private void parseHeaders(String[] headers) {
String value = header.substring(i + 1).trim();
if (!headerFields.containsKey(key))
headerFields.put(key, new ArrayList<String>());
headerFields.put(key, new ArrayList<>());
List<String> values = headerFields.get(key);
values.add(value);

View File

@ -53,8 +53,8 @@ public void testRecursiveFiltering() throws IOException {
@Test
public void testEdgeCases() throws IOException {
ObjectId treeId = createTree("abc", "abcd", "bcd", "c");
assertEquals(new ArrayList<String>(), getMatchingPaths("xbcd", treeId));
assertEquals(new ArrayList<String>(), getMatchingPaths("abcx", treeId));
assertEquals(new ArrayList<>(), getMatchingPaths("xbcd", treeId));
assertEquals(new ArrayList<>(), getMatchingPaths("abcx", treeId));
assertEquals(Arrays.asList("abcd"), getMatchingPaths("abcd", treeId));
assertEquals(Arrays.asList("abcd", "bcd"), getMatchingPaths("bcd", treeId));
assertEquals(Arrays.asList("abc", "c"), getMatchingPaths("c", treeId));

View File

@ -181,7 +181,7 @@ public RepoProject(String name, String path, String revision,
*/
public RepoProject(String name, String path, String revision,
String remote, String groupsParam) {
this(name, path, revision, remote, new HashSet<String>(), null);
this(name, path, revision, remote, new HashSet<>(), null);
if (groupsParam != null && groupsParam.length() > 0)
this.setGroups(groupsParam);
}

View File

@ -58,7 +58,7 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex {
* ObjectId (name); it will be resorted in place.
*/
public PackBitmapIndexBuilder(List<ObjectToPack> objects) {
super(new ObjectIdOwnerMap<StoredBitmap>());
super(new ObjectIdOwnerMap<>());
byOffset = new BlockList<>(objects.size());
sortByOffsetAndIndex(byOffset, positionEntries, objects);

View File

@ -84,7 +84,7 @@ public Thread newThread(Runnable runnable) {
throws IOException {
// An entry is object id, xor offset, flag byte, and a length encoded
// bitmap. The object id is an int32 of the nth position sorted by name.
super(new ObjectIdOwnerMap<StoredBitmap>());
super(new ObjectIdOwnerMap<>());
this.bitmaps = getBitmaps();
// Optionally start loading reverse index in parallel to loading bitmap

View File

@ -1986,8 +1986,10 @@ private void findObjectsToPack(@NonNull ProgressMonitor countingMonitor,
final long countingStart = System.currentTimeMillis();
beginPhase(PackingPhase.COUNTING, countingMonitor, ProgressMonitor.UNKNOWN);
stats.interestingObjects = Collections.unmodifiableSet(new HashSet<ObjectId>(want));
stats.uninterestingObjects = Collections.unmodifiableSet(new HashSet<ObjectId>(have));
stats.interestingObjects = Collections
.unmodifiableSet(new HashSet<>(want));
stats.uninterestingObjects = Collections
.unmodifiableSet(new HashSet<>(have));
excludeFromBitmapSelection = noBitmaps;
canBuildBitmaps = config.isBuildBitmaps()

View File

@ -265,7 +265,7 @@ public static final class FileStoreAttributes {
*/
private static final ExecutorService FUTURE_RUNNER = new ThreadPoolExecutor(
0, 5, 30L, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(),
new LinkedBlockingQueue<>(),
runnable -> {
Thread t = new Thread(runnable,
"JGit-FileStoreAttributeReader-" //$NON-NLS-1$
@ -289,7 +289,7 @@ public static final class FileStoreAttributes {
*/
private static final ExecutorService SAVE_RUNNER = new ThreadPoolExecutor(
0, 1, 1L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(),
new LinkedBlockingQueue<>(),
runnable -> {
Thread t = new Thread(runnable,
"JGit-FileStoreAttributeWriter-" //$NON-NLS-1$