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;
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()) {
import java.io.File;
import java.text.MessageFormat;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.List;
import javax.servlet.Filter;
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}.
*/
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;
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;
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();
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.
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();
}
}
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;
*/
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) {
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;
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) {
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;
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();
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;
@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());
}
import static org.junit.Assert.assertEquals;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.jgit.api.Git;
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) {
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;
}
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);
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;
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));
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();
}
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashSet;
-import java.util.LinkedList;
import java.util.List;
import java.util.Set;
*/
protected CheckoutCommand(Repository repo) {
super(repo);
- this.paths = new LinkedList<>();
+ this.paths = new ArrayList<>();
}
@Override
import java.io.IOException;
import java.text.MessageFormat;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
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;
UnmergedPathsException, ConcurrentRefUpdateException,
WrongRepositoryStateException, NoHeadException {
RevCommit newHead = null;
- List<Ref> cherryPickedRefs = new LinkedList<>();
+ List<Ref> cherryPickedRefs = new ArrayList<>();
checkCallable();
try (RevWalk revWalk = new RevWalk(repo)) {
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;
* 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;
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;
private ContentMergeStrategy contentStrategy;
- private List<Ref> commits = new LinkedList<>();
+ private List<Ref> commits = new ArrayList<>();
private Boolean squash;
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;
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)) {
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;
private ResetType mode;
- private Collection<String> filepaths = new LinkedList<>();
+ private Collection<String> filepaths = new ArrayList<>();
private boolean isReflogDisabled;
import java.io.IOException;
import java.text.MessageFormat;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
* >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;
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;
*/
public RmCommand(Repository repo) {
super(repo);
- filepatterns = new LinkedList<>();
+ filepatterns = new ArrayList<>();
}
/**
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;
*/
public StatusCommand addPath(String path) {
if (paths == null)
- paths = new LinkedList<>();
+ paths = new ArrayList<>();
paths.add(path);
return this;
}
*/
package org.eclipse.jgit.api.errors;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.List;
/**
*/
CheckoutConflictException addConflictingPath(String conflictingPath) {
if (conflictingPaths == null)
- conflictingPaths = new LinkedList<>();
+ conflictingPaths = new ArrayList<>();
conflictingPaths.add(conflictingPath);
return this;
}
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;
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();
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;
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);
}
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;
}
}
- List<ObjectIdSet> excluded = new LinkedList<>();
+ List<ObjectIdSet> excluded = new ArrayList<>();
for (Pack p : repo.getObjectDatabase().getPacks()) {
checkCancelled();
if (!shouldPackKeptObjects() && p.shouldBeKept()) {
}
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();
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;
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<>();
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;
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;
@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)
*/
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;
* @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);
* @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;
}
* @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);
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;
}
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) {
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;
* 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<>();
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
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;
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);
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;
*/
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;
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;
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;
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;
String name = prefix + Transport.class.getName();
return ldr.getResources(name);
} catch (IOException err) {
- return new Vector<URL>().elements();
+ return Collections.emptyEnumeration();
}
}
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) {
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;
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);
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));
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;
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}.
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<>();
LOCALLY_SEEN = revWalk.newFlag("LOCALLY_SEEN"); //$NON-NLS-1$
localCommitQueue = new DateRevQueue();
- workQueue = new LinkedList<>();
+ workQueue = new ArrayDeque<>();
}
@Override
private Iterator<ObjectId> swapFetchQueue() {
final Iterator<ObjectId> r = workQueue.iterator();
- workQueue = new LinkedList<>();
+ workQueue = new ArrayDeque<>();
return r;
}
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;
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()));
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;
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
* 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;
}
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.
}
};
- private final LinkedList<InputStream> streams = new LinkedList<>();
+ private final Deque<InputStream> streams = new ArrayDeque<>();
/**
* Create an empty InputStream that is currently at EOF state.
"-Xep:JavaPeriodGetDays:ERROR",
"-Xep:JavaTimeDefaultTimeZone:ERROR",
"-Xep:JavaUtilDate:WARN",
- "-Xep:JdkObsolete:WARN",
+ "-Xep:JdkObsolete:ERROR",
"-Xep:JodaConstructors:ERROR",
"-Xep:JodaDateTimeConstants:ERROR",
"-Xep:JodaDurationWithMillis:ERROR",