diff options
40 files changed, 106 insertions, 113 deletions
diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java index 6d806dee37..0cb6fe10d0 100644 --- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java +++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java @@ -25,10 +25,10 @@ import java.net.URL; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -300,7 +300,7 @@ public class HttpClientConnection implements HttpConnection { for (Header hdr : resp.getAllHeaders()) { List<String> list = ret.get(hdr.getName()); if (list == null) { - list = new LinkedList<>(); + list = new ArrayList<>(); ret.put(hdr.getName(), list); } for (HeaderElement hdrElem : hdr.getElements()) { diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java index 2f3eee41d6..703c0be8d9 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java @@ -12,7 +12,7 @@ package org.eclipse.jgit.http.server; import java.io.File; import java.text.MessageFormat; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import javax.servlet.Filter; @@ -65,9 +65,9 @@ public class GitFilter extends MetaFilter { private ReceivePackErrorHandler receivePackErrorHandler; - private final List<Filter> uploadPackFilters = new LinkedList<>(); + private final List<Filter> uploadPackFilters = new ArrayList<>(); - private final List<Filter> receivePackFilters = new LinkedList<>(); + private final List<Filter> receivePackFilters = new ArrayList<>(); /** * New servlet that will load its base directory from {@code web.xml}. diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java index d7d8d63775..1a4e85ded6 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java @@ -9,11 +9,11 @@ */ package org.eclipse.jgit.lfs.internal; +import static org.eclipse.jgit.lib.Constants.DEFAULT_REMOTE_NAME; import static org.eclipse.jgit.util.HttpSupport.ENCODING_GZIP; import static org.eclipse.jgit.util.HttpSupport.HDR_ACCEPT; import static org.eclipse.jgit.util.HttpSupport.HDR_ACCEPT_ENCODING; import static org.eclipse.jgit.util.HttpSupport.HDR_CONTENT_TYPE; -import static org.eclipse.jgit.lib.Constants.DEFAULT_REMOTE_NAME; import java.io.IOException; import java.net.ProxySelector; @@ -22,7 +22,7 @@ import java.net.URL; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.Map; import java.util.TreeMap; @@ -266,7 +266,7 @@ public class LfsConnectionFactory { Protocol.Request req = new Protocol.Request(); req.operation = operation; if (resources != null) { - req.objects = new LinkedList<>(); + req.objects = new ArrayList<>(); for (LfsPointer res : resources) { Protocol.ObjectSpec o = new Protocol.ObjectSpec(); o.oid = res.getOid().getName(); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java index 210e17277f..2a9f7acdb9 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java @@ -19,10 +19,10 @@ import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; -import java.util.Vector; /** * List of all commands known by jgit's command line tools. @@ -104,7 +104,7 @@ public class CommandCatalog { final String pfx = "META-INF/services/"; //$NON-NLS-1$ return ldr.getResources(pfx + TextBuiltin.class.getName()); } catch (IOException err) { - return new Vector<URL>().elements(); + return Collections.emptyEnumeration(); } } diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java index a00e5d96ac..96829b7365 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java @@ -18,9 +18,9 @@ import java.io.BufferedReader; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; @@ -65,7 +65,7 @@ public class KnownHostEntryReader { */ public static List<KnownHostEntry> readFromFile(Path path) throws IOException { - List<KnownHostEntry> result = new LinkedList<>(); + List<KnownHostEntry> result = new ArrayList<>(); try (BufferedReader r = Files.newBufferedReader(path, UTF_8)) { r.lines().forEachOrdered(l -> { if (l == null) { diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java index 65ba5be0c5..2b4f7e50ff 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java @@ -31,7 +31,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Random; @@ -587,7 +586,7 @@ public class OpenSshServerKeyDatabase if (rawEntries == null || rawEntries.isEmpty()) { return Collections.emptyList(); } - List<HostEntryPair> newEntries = new LinkedList<>(); + List<HostEntryPair> newEntries = new ArrayList<>(); for (KnownHostEntry entry : rawEntries) { AuthorizedKeyEntry keyPart = entry.getKeyEntry(); if (keyPart == null) { diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSession.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSession.java index b94ccc6d4f..96316ba1aa 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSession.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSession.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.EnumSet; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; @@ -263,7 +262,7 @@ public class SshdSession implements RemoteSession2 { private List<URIish> parseProxyJump(String proxyJump) throws URISyntaxException { String[] hops = proxyJump.split(","); //$NON-NLS-1$ - List<URIish> result = new LinkedList<>(); + List<URIish> result = new ArrayList<>(); for (String hop : hops) { // There shouldn't be any whitespace, but let's be lenient hop = hop.trim(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java index 0c0257df90..5c63c2df6b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java @@ -42,7 +42,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -124,16 +123,16 @@ public class ConfigTest { @Test public void test005_PutGetStringList() { Config c = new Config(); - final LinkedList<String> values = new LinkedList<>(); + List<String> values = new ArrayList<>(); values.add("value1"); values.add("value2"); c.setStringList("my", null, "somename", values); - final Object[] expArr = values.toArray(); - final String[] actArr = c.getStringList("my", null, "somename"); + Object[] expArr = values.toArray(); + String[] actArr = c.getStringList("my", null, "somename"); assertArrayEquals(expArr, actArr); - final String expText = "[my]\n\tsomename = value1\n\tsomename = value2\n"; + String expText = "[my]\n\tsomename = value1\n\tsomename = value2\n"; assertEquals(expText, c.toText()); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java index 49f832a1aa..e4bd8506e3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java @@ -11,7 +11,7 @@ package org.eclipse.jgit.revplot; import static org.junit.Assert.assertEquals; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.eclipse.jgit.api.Git; @@ -70,7 +70,7 @@ public class AbstractPlotRendererTest extends RepositoryTestCase { private static class TestPlotRenderer extends AbstractPlotRenderer<PlotLane, Object> { - List<Integer> indentations = new LinkedList<>(); + List<Integer> indentations = new ArrayList<>(); @Override protected int drawLabel(int x, int y, Ref ref) { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/http/JDKHttpConnectionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/http/JDKHttpConnectionTest.java index 37f9514494..f71781dcf3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/http/JDKHttpConnectionTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/http/JDKHttpConnectionTest.java @@ -16,9 +16,9 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.net.HttpURLConnection; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -74,7 +74,7 @@ public class JDKHttpConnectionTest { } private void assertValues(String key, String... values) { - List<String> l = new LinkedList<>(); + List<String> l = new ArrayList<>(); List<String> hf = c.getHeaderFields(key); if (hf != null) { l.addAll(hf); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/http/HttpCookiesMatcher.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/http/HttpCookiesMatcher.java index 5a2bd976c7..18faab5c9f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/http/HttpCookiesMatcher.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/http/HttpCookiesMatcher.java @@ -10,7 +10,7 @@ package org.eclipse.jgit.util.http; import java.net.HttpCookie; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hamcrest.Description; @@ -26,7 +26,7 @@ public final class HttpCookiesMatcher { public static Matcher<Iterable<? extends HttpCookie>> containsInOrder( Iterable<HttpCookie> expectedCookies, int allowedMaxAgeDelta) { - final List<Matcher<? super HttpCookie>> cookieMatchers = new LinkedList<>(); + final List<Matcher<? super HttpCookie>> cookieMatchers = new ArrayList<>(); for (HttpCookie cookie : expectedCookies) { cookieMatchers .add(new HttpCookieMatcher(cookie, allowedMaxAgeDelta)); diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java index 47acc11e7d..901452617d 100644 --- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java +++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java @@ -11,16 +11,17 @@ package org.eclipse.jgit.awtui; import java.awt.Color; -import java.util.LinkedList; +import java.util.ArrayDeque; +import java.util.Deque; import org.eclipse.jgit.revplot.PlotCommitList; import org.eclipse.jgit.revplot.PlotLane; class SwingCommitList extends PlotCommitList<SwingCommitList.SwingLane> { - final LinkedList<Color> colors; + final Deque<Color> colors; SwingCommitList() { - colors = new LinkedList<>(); + colors = new ArrayDeque<>(); repackColors(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java index a03ea01864..c133219d4d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java @@ -17,7 +17,6 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashSet; -import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -164,7 +163,7 @@ public class CheckoutCommand extends GitCommand<Ref> { */ protected CheckoutCommand(Repository repo) { super(repo); - this.paths = new LinkedList<>(); + this.paths = new ArrayList<>(); } @Override diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java index a1c64788bd..a353d1a135 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java @@ -14,7 +14,7 @@ import static org.eclipse.jgit.lib.Constants.OBJECT_ID_ABBREV_STRING_LENGTH; import java.io.IOException; import java.text.MessageFormat; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -63,7 +63,7 @@ import org.eclipse.jgit.treewalk.FileTreeIterator; public class CherryPickCommand extends GitCommand<CherryPickResult> { private String reflogPrefix = "cherry-pick:"; //$NON-NLS-1$ - private List<Ref> commits = new LinkedList<>(); + private List<Ref> commits = new ArrayList<>(); private String ourCommitName = null; @@ -102,7 +102,7 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> { UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, NoHeadException { RevCommit newHead = null; - List<Ref> cherryPickedRefs = new LinkedList<>(); + List<Ref> cherryPickedRefs = new ArrayList<>(); checkCallable(); try (RevWalk revWalk = new RevWalk(repo)) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java index 483b9602da..a1a2cc09d2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java @@ -16,7 +16,6 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import org.eclipse.jgit.annotations.NonNull; @@ -109,7 +108,7 @@ public class CommitCommand extends GitCommand<RevCommit> { * parents this commit should have. The current HEAD will be in this list * and also all commits mentioned in .git/MERGE_HEAD */ - private List<ObjectId> parents = new LinkedList<>(); + private List<ObjectId> parents = new ArrayList<>(); private String reflogComment; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java index ed4a5342b3..7064f5a57a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java @@ -13,9 +13,9 @@ package org.eclipse.jgit.api; import java.io.IOException; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; @@ -75,7 +75,7 @@ public class MergeCommand extends GitCommand<MergeResult> { private ContentMergeStrategy contentStrategy; - private List<Ref> commits = new LinkedList<>(); + private List<Ref> commits = new ArrayList<>(); private Boolean squash; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java index 757aff89c3..858bd961cd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java @@ -23,7 +23,6 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.regex.Matcher; @@ -1120,8 +1119,8 @@ public class RebaseCommand extends GitCommand<RebaseResult> { private void popSteps(int numSteps) throws IOException { if (numSteps == 0) return; - List<RebaseTodoLine> todoLines = new LinkedList<>(); - List<RebaseTodoLine> poppedLines = new LinkedList<>(); + List<RebaseTodoLine> todoLines = new ArrayList<>(); + List<RebaseTodoLine> poppedLines = new ArrayList<>(); for (RebaseTodoLine line : repo.readRebaseTodo( rebaseState.getPath(GIT_REBASE_TODO), true)) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java index 225c9996cf..47145a0563 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java @@ -11,8 +11,8 @@ package org.eclipse.jgit.api; import java.io.IOException; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Collection; -import java.util.LinkedList; import org.eclipse.jgit.api.errors.CheckoutConflictException; import org.eclipse.jgit.api.errors.GitAPIException; @@ -90,7 +90,7 @@ public class ResetCommand extends GitCommand<Ref> { private ResetType mode; - private Collection<String> filepaths = new LinkedList<>(); + private Collection<String> filepaths = new ArrayList<>(); private boolean isReflogDisabled; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java index 5231d4a327..855c3b1cf3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java @@ -13,7 +13,7 @@ import static org.eclipse.jgit.lib.Constants.OBJECT_ID_ABBREV_STRING_LENGTH; import java.io.IOException; import java.text.MessageFormat; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -58,13 +58,13 @@ import org.eclipse.jgit.treewalk.FileTreeIterator; * >Git documentation about revert</a> */ public class RevertCommand extends GitCommand<RevCommit> { - private List<Ref> commits = new LinkedList<>(); + private List<Ref> commits = new ArrayList<>(); private String ourCommitName = null; private boolean insertChangeId; - private List<Ref> revertedRefs = new LinkedList<>(); + private List<Ref> revertedRefs = new ArrayList<>(); private MergeResult failingResult; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java index 656f36a81a..7459e7298f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java @@ -13,7 +13,6 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; -import java.util.LinkedList; import java.util.List; import org.eclipse.jgit.api.errors.GitAPIException; @@ -71,7 +70,7 @@ public class RmCommand extends GitCommand<DirCache> { */ public RmCommand(Repository repo) { super(repo); - filepatterns = new LinkedList<>(); + filepatterns = new ArrayList<>(); } /** diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java index eab389460a..cdd078ea25 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java @@ -10,7 +10,7 @@ package org.eclipse.jgit.api; import java.io.IOException; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.eclipse.jgit.api.errors.GitAPIException; @@ -83,7 +83,7 @@ public class StatusCommand extends GitCommand<Status> { */ public StatusCommand addPath(String path) { if (paths == null) - paths = new LinkedList<>(); + paths = new ArrayList<>(); paths.add(path); return this; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java index 0224b3dbb3..5538711192 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java @@ -37,7 +37,7 @@ */ package org.eclipse.jgit.api.errors; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; /** @@ -99,7 +99,7 @@ public class CheckoutConflictException extends GitAPIException { */ CheckoutConflictException addConflictingPath(String conflictingPath) { if (conflictingPaths == null) - conflictingPaths = new LinkedList<>(); + conflictingPaths = new ArrayList<>(); conflictingPaths.add(conflictingPath); return this; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java index 1f1c35ac19..0d9815eceb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java @@ -31,12 +31,12 @@ import java.io.IOException; import java.io.InterruptedIOException; import java.io.OutputStream; import java.nio.ByteBuffer; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Optional; -import java.util.Stack; import org.eclipse.jgit.annotations.NonNull; import org.eclipse.jgit.annotations.Nullable; @@ -336,10 +336,10 @@ public class CommitGraphWriter { continue; } - Stack<RevCommit> commitStack = new Stack<>(); + ArrayDeque<RevCommit> commitStack = new ArrayDeque<>(); commitStack.push(cmit); - while (!commitStack.empty()) { + while (!commitStack.isEmpty()) { int maxGeneration = 0; boolean allParentComputed = true; RevCommit current = commitStack.peek(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java index a342796cbe..c939114f5f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java @@ -21,7 +21,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Optional; import java.util.Set; @@ -308,7 +307,7 @@ public class DfsReader extends ObjectReader implements ObjectReuseAsIs { private <T extends ObjectId> Iterable<FoundObject<T>> findAll( Iterable<T> objectIds) throws IOException { - Collection<T> pending = new LinkedList<>(); + Collection<T> pending = new ArrayList<>(); for (T id : objectIds) { pending.add(id); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java index 4c996730e8..cf26f8d284 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java @@ -49,7 +49,6 @@ import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -866,7 +865,7 @@ public class GC { } } - List<ObjectIdSet> excluded = new LinkedList<>(); + List<ObjectIdSet> excluded = new ArrayList<>(); for (Pack p : repo.getObjectDatabase().getPacks()) { checkCancelled(); if (!shouldPackKeptObjects() && p.shouldBeKept()) { @@ -1897,7 +1896,7 @@ public class GC { } private String getProcDesc() { - StringBuffer s = new StringBuffer(Long.toString(getPID())); + StringBuilder s = new StringBuilder(Long.toString(getPID())); s.append(' '); s.append(getHostName()); return s.toString(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java index 1da805503d..08d2b7178f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java @@ -11,9 +11,9 @@ package org.eclipse.jgit.internal.storage.file; import java.text.MessageFormat; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedList; import java.util.List; import org.eclipse.jgit.internal.JGitText; @@ -41,8 +41,7 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex { private final EWAHCompressedBitmap tags; private final BlockList<PositionEntry> byOffset; - private final LinkedList<StoredBitmap> - bitmapsToWriteXorBuffer = new LinkedList<>(); + private final ArrayDeque<StoredBitmap> bitmapsToWriteXorBuffer = new ArrayDeque<>(); private List<StoredEntry> bitmapsToWrite = new ArrayList<>(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java index 169dce1cc0..8e57bf9f2f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java @@ -41,11 +41,11 @@ import java.nio.file.Paths; import java.security.DigestInputStream; import java.security.MessageDigest; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; @@ -64,8 +64,8 @@ import org.eclipse.jgit.events.RefsChangedEvent; import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; -import org.eclipse.jgit.lib.CoreConfig.TrustPackedRefsStat; import org.eclipse.jgit.lib.CoreConfig.TrustLooseRefStat; +import org.eclipse.jgit.lib.CoreConfig.TrustPackedRefsStat; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectIdRef; import org.eclipse.jgit.lib.Ref; @@ -413,7 +413,7 @@ public class RefDirectory extends RefDatabase { @Override public List<Ref> getAdditionalRefs() throws IOException { - List<Ref> ret = new LinkedList<>(); + List<Ref> ret = new ArrayList<>(); for (String name : additionalRefsNames) { Ref r = exactRef(name); if (r != null) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/memory/TernarySearchTree.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/memory/TernarySearchTree.java index acc1c830d5..72434dbffe 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/memory/TernarySearchTree.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/memory/TernarySearchTree.java @@ -9,9 +9,9 @@ */ package org.eclipse.jgit.internal.storage.memory; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -340,7 +340,7 @@ public final class TernarySearchTree<Value> { * @return all keys */ public Iterable<String> getKeys() { - Queue<String> queue = new LinkedList<>(); + Queue<String> queue = new ArrayDeque<>(); lock.readLock().lock(); try { findKeysWithPrefix(root, new StringBuilder(), queue); @@ -358,7 +358,7 @@ public final class TernarySearchTree<Value> { * @return keys starting with given prefix */ public Iterable<String> getKeysWithPrefix(String prefix) { - Queue<String> keys = new LinkedList<>(); + Queue<String> keys = new ArrayDeque<>(); if (prefix == null) { return keys; } @@ -486,7 +486,7 @@ public final class TernarySearchTree<Value> { * @return keys matching given pattern. */ public Iterable<String> getKeysMatching(String pattern) { - Queue<String> keys = new LinkedList<>(); + Queue<String> keys = new ArrayDeque<>(); lock.readLock().lock(); try { findKeysWithPrefix(root, new StringBuilder(), 0, pattern, keys); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java index 9a3f4b07ee..03d6f16733 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java @@ -11,10 +11,10 @@ package org.eclipse.jgit.internal.storage.pack; import java.io.IOException; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.concurrent.Callable; @@ -232,14 +232,15 @@ final class DeltaTask implements Callable<Object> { } private final Block block; - final LinkedList<Slice> slices; + + final ArrayDeque<Slice> slices; private ObjectReader or; private DeltaWindow dw; DeltaTask(Block b) { this.block = b; - this.slices = new LinkedList<>(); + this.slices = new ArrayDeque<>(); } void add(Slice s) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFile.java index 29a2922136..3e75a9dde3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFile.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -100,7 +99,7 @@ public class OpenSshConfigFile implements SshConfigStore { * fully resolved entries created from that. */ private static class State { - List<HostEntry> entries = new LinkedList<>(); + List<HostEntry> entries = new ArrayList<>(); // Previous lookups, keyed by user@hostname:port Map<String, HostEntry> hosts = new HashMap<>(); @@ -218,7 +217,7 @@ public class OpenSshConfigFile implements SshConfigStore { private List<HostEntry> parse(BufferedReader reader) throws IOException { - final List<HostEntry> entries = new LinkedList<>(); + final List<HostEntry> entries = new ArrayList<>(); // The man page doesn't say so, but the openssh parser (readconf.c) // starts out in active mode and thus always applies any lines that diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java index c716f464d3..b036a0b6a1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java @@ -17,7 +17,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.eclipse.jgit.lib.RebaseTodoLine.Action; @@ -62,7 +62,7 @@ public class RebaseTodoFile { byte[] buf = IO.readFully(new File(repo.getDirectory(), path)); int ptr = 0; int tokenBegin = 0; - List<RebaseTodoLine> r = new LinkedList<>(); + List<RebaseTodoLine> r = new ArrayList<>(); while (ptr < buf.length) { tokenBegin = ptr; ptr = RawParseUtils.nextLF(buf, ptr); 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 825ef17c3f..1ad41be423 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java @@ -32,7 +32,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -106,9 +105,9 @@ public class ResolveMerger extends ThreeWayMerger { */ public static class Result { - private final List<String> modifiedFiles = new LinkedList<>(); + private final List<String> modifiedFiles = new ArrayList<>(); - private final List<String> failedToDelete = new LinkedList<>(); + private final List<String> failedToDelete = new ArrayList<>(); private ObjectId treeId = null; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java index a213dd47c6..be29dc3138 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java @@ -12,7 +12,7 @@ package org.eclipse.jgit.revwalk; import java.io.IOException; import java.text.MessageFormat; -import java.util.LinkedList; +import java.util.ArrayDeque; import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.errors.MissingObjectException; @@ -47,7 +47,8 @@ class MergeBaseGenerator extends Generator { private int recarryTest; private int recarryMask; private int mergeBaseAncestor = -1; - private LinkedList<RevCommit> ret = new LinkedList<>(); + + private ArrayDeque<RevCommit> ret = new ArrayDeque<>(); private CarryStack stack; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java index 4a02d6d452..b335675da5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java @@ -33,10 +33,8 @@ import java.util.Collection; import java.util.Collections; import java.util.Enumeration; import java.util.LinkedHashSet; -import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.Vector; import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.jgit.annotations.NonNull; @@ -109,7 +107,7 @@ public abstract class Transport implements AutoCloseable { String name = prefix + Transport.class.getName(); return ldr.getResources(name); } catch (IOException err) { - return new Vector<URL>().elements(); + return Collections.emptyEnumeration(); } } @@ -595,7 +593,7 @@ public abstract class Transport implements AutoCloseable { Collection<RefSpec> fetchSpecs) throws IOException { if (fetchSpecs == null) fetchSpecs = Collections.emptyList(); - final List<RemoteRefUpdate> result = new LinkedList<>(); + final List<RemoteRefUpdate> result = new ArrayList<>(); final Collection<RefSpec> procRefs = expandPushWildcardsFor(db, specs); for (RefSpec spec : procRefs) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java index 3162b89908..a65d0b756c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java @@ -66,7 +66,6 @@ import java.util.Collections; import java.util.EnumSet; import java.util.HashSet; import java.util.LinkedHashSet; -import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; @@ -763,7 +762,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, void processResponseCookies(HttpConnection conn) { if (cookieFile != null && http.getSaveCookies()) { - List<HttpCookie> foundCookies = new LinkedList<>(); + List<HttpCookie> foundCookies = new ArrayList<>(); List<String> cookieHeaderValues = conn .getHeaderFields(HDR_SET_COOKIE); @@ -795,7 +794,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, private List<HttpCookie> extractCookies(String headerKey, List<String> headerValues) { - List<HttpCookie> foundCookies = new LinkedList<>(); + List<HttpCookie> foundCookies = new ArrayList<>(); for (String headerValue : headerValues) { foundCookies .addAll(HttpCookie.parse(headerKey + ':' + headerValue)); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java index 8d89107c2b..3da76f38fa 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java @@ -16,12 +16,13 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.text.MessageFormat; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; +import java.util.Deque; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -112,16 +113,16 @@ class WalkFetchConnection extends BaseFetchConnection { private final DateRevQueue localCommitQueue; /** Objects we need to copy from the remote repository. */ - private LinkedList<ObjectId> workQueue; + private Deque<ObjectId> workQueue; /** Databases we have not yet obtained the list of packs from. */ - private final LinkedList<WalkRemoteObjectDatabase> noPacksYet; + private final Deque<WalkRemoteObjectDatabase> noPacksYet; /** Databases we have not yet obtained the alternates from. */ - private final LinkedList<WalkRemoteObjectDatabase> noAlternatesYet; + private final Deque<WalkRemoteObjectDatabase> noAlternatesYet; /** Packs we have discovered, but have not yet fetched locally. */ - private final LinkedList<RemotePack> unfetchedPacks; + private final Deque<RemotePack> unfetchedPacks; /** * Packs whose indexes we have looked at in {@link #unfetchedPacks}. @@ -163,13 +164,13 @@ class WalkFetchConnection extends BaseFetchConnection { remotes = new ArrayList<>(); remotes.add(w); - unfetchedPacks = new LinkedList<>(); + unfetchedPacks = new ArrayDeque<>(); packsConsidered = new HashSet<>(); - noPacksYet = new LinkedList<>(); + noPacksYet = new ArrayDeque<>(); noPacksYet.add(w); - noAlternatesYet = new LinkedList<>(); + noAlternatesYet = new ArrayDeque<>(); noAlternatesYet.add(w); fetchErrors = new HashMap<>(); @@ -183,7 +184,7 @@ class WalkFetchConnection extends BaseFetchConnection { LOCALLY_SEEN = revWalk.newFlag("LOCALLY_SEEN"); //$NON-NLS-1$ localCommitQueue = new DateRevQueue(); - workQueue = new LinkedList<>(); + workQueue = new ArrayDeque<>(); } @Override @@ -567,7 +568,7 @@ class WalkFetchConnection extends BaseFetchConnection { private Iterator<ObjectId> swapFetchQueue() { final Iterator<ObjectId> r = workQueue.iterator(); - workQueue = new LinkedList<>(); + workQueue = new ArrayDeque<>(); return r; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java index 8e9be1dde8..e20acadc4a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java @@ -20,7 +20,7 @@ import java.net.URL; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -152,7 +152,7 @@ public class JDKHttpConnection implements HttpConnection { private static List<String> mapValuesToListIgnoreCase(String keyName, Map<String, List<String>> m) { - List<String> fields = new LinkedList<>(); + List<String> fields = new ArrayList<>(); m.entrySet().stream().filter(e -> keyName.equalsIgnoreCase(e.getKey())) .filter(e -> e.getValue() != null) .forEach(e -> fields.addAll(e.getValue())); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java index 699ff6b68b..cfdc4dd358 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java @@ -10,8 +10,9 @@ package org.eclipse.jgit.treewalk.filter; import java.io.IOException; +import java.util.ArrayDeque; +import java.util.ArrayList; import java.util.HashSet; -import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -62,9 +63,9 @@ public class IndexDiffFilter extends TreeFilter { private final Set<String> ignoredPaths = new HashSet<>(); - private final LinkedList<String> untrackedParentFolders = new LinkedList<>(); + private final ArrayDeque<String> untrackedParentFolders = new ArrayDeque<>(); - private final LinkedList<String> untrackedFolders = new LinkedList<>(); + private final ArrayDeque<String> untrackedFolders = new ArrayDeque<>(); /** * Creates a new instance of this filter. Do not use an instance of this @@ -272,12 +273,14 @@ public class IndexDiffFilter extends TreeFilter { * empty list will be returned. */ public List<String> getUntrackedFolders() { - LinkedList<String> ret = new LinkedList<>(untrackedFolders); + ArrayList<String> ret = new ArrayList<>(untrackedFolders); if (!untrackedParentFolders.isEmpty()) { String toBeAdded = untrackedParentFolders.getLast(); - while (!ret.isEmpty() && ret.getLast().startsWith(toBeAdded)) - ret.removeLast(); - ret.addLast(toBeAdded); + while (!ret.isEmpty() + && ret.get(ret.size() - 1).startsWith(toBeAdded)) { + ret.remove(ret.size() - 1); + } + ret.add(toBeAdded); } return ret; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java index b37f28b161..c3a1c4e3bb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java @@ -12,8 +12,9 @@ package org.eclipse.jgit.util.io; import java.io.IOException; import java.io.InputStream; +import java.util.ArrayDeque; +import java.util.Deque; import java.util.Iterator; -import java.util.LinkedList; /** * An InputStream which reads from one or more InputStreams. @@ -34,7 +35,7 @@ public class UnionInputStream extends InputStream { } }; - private final LinkedList<InputStream> streams = new LinkedList<>(); + private final Deque<InputStream> streams = new ArrayDeque<>(); /** * Create an empty InputStream that is currently at EOF state. diff --git a/tools/BUILD b/tools/BUILD index dbec43b7fa..38c7e7fb8f 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -222,7 +222,7 @@ java_package_configuration( "-Xep:JavaPeriodGetDays:ERROR", "-Xep:JavaTimeDefaultTimeZone:ERROR", "-Xep:JavaUtilDate:WARN", - "-Xep:JdkObsolete:WARN", + "-Xep:JdkObsolete:ERROR", "-Xep:JodaConstructors:ERROR", "-Xep:JodaDateTimeConstants:ERROR", "-Xep:JodaDurationWithMillis:ERROR", |