JGit cleanups
cover JGit cleanups
Getting annoyed with all the noise I came up with series of cleanups. The hunk parsing fixes are the one's I'm not really sure about, but my attempts to find a case that would give an uncontrolled error did not find much success.
-- robin
Robin Rosenberg (10):
Require javadoc on protected methods in jgit core
Rename the objectsUrl in the nested HttpObjectDB to
Rename variables that hides others with different content in
FetchProcess
Rename a parameter i PackWriter that hides another with the same name Rename fields to avoid hiding of field names in ReadTreeTest Rename the gitDir fields to indicate they refer to another dir than
the default
Rename a parameter in PushProcessTest that hides another Drop unused end parameters in hunk parsing code
Drop unused File arguments in IndexTreeWalker and WorkdirCheckout Drop an effectively unused parameter in IndexTreeWalker.
.../.settings/org.eclipse.jdt.core.prefs | 7 +- .../src/org/spearce/jgit/pgm/ReceivePack.java | 10 +- .../src/org/spearce/jgit/pgm/TextBuiltin.java | 9 +- .../src/org/spearce/jgit/pgm/UploadPack.java | 10 +- .../tst/org/spearce/jgit/lib/ReadTreeTest.java | 118 ++++++++++---------- .../spearce/jgit/transport/PushProcessTest.java | 4 +- .../.settings/org.eclipse.jdt.core.prefs | 5 +- .../jgit/dircache/DirCacheBuildIterator.java | 2 +- .../spearce/jgit/dircache/DirCacheIterator.java | 2 +- .../src/org/spearce/jgit/lib/IndexTreeWalker.java | 12 +- .../src/org/spearce/jgit/lib/ObjectId.java | 2 +- .../src/org/spearce/jgit/lib/PackIndex.java | 6 +- .../src/org/spearce/jgit/lib/PackWriter.java | 8 +- .../jgit/lib/TreeVisitorWithCurrentDirectory.java | 4 +- .../src/org/spearce/jgit/lib/WorkDirCheckout.java | 17 ++-- .../org/spearce/jgit/merge/StrategyOneSided.java | 2 +- .../org/spearce/jgit/patch/CombinedHunkHeader.java | 2 +- .../src/org/spearce/jgit/patch/FileHeader.java | 18 ++-- .../src/org/spearce/jgit/patch/HunkHeader.java | 6 +- .../src/org/spearce/jgit/patch/Patch.java | 8 +- .../org/spearce/jgit/revplot/PlotCommitList.java | 9 ++ .../src/org/spearce/jgit/revplot/PlotWalk.java | 4 + .../org/spearce/jgit/transport/DaemonService.java | 4 +- .../org/spearce/jgit/transport/FetchProcess.java | 8 +- .../org/spearce/jgit/transport/OpenSshConfig.java | 2 +- .../spearce/jgit/transport/OperationResult.java | 10 +- .../spearce/jgit/transport/PackedObjectInfo.java | 2 +- .../src/org/spearce/jgit/transport/PushResult.java | 2 +- .../spearce/jgit/transport/RemoteRefUpdate.java | 6 +- .../org/spearce/jgit/transport/TransportHttp.java | 14 +- .../spearce/jgit/treewalk/WorkingTreeIterator.java | 7 + 31 files changed, 173 insertions(+), 147 deletions(-)
PATCH 1/10 Require javadoc on protected methods in jgit core
In general protected methods are part of a public API since they grant access to code outside of the package that declares the method or field.
A few protected fields and methods do not have javadocs, but it turns out all but one are not used outside the package that declares them so we can simply make them package private. This doesn't mean they aren't supposed to be an API, but we can upgrade them if necessary.
A few places are actually used outside the package and are valid uses. For those appropriate javadocs are added.
--- .../.settings/org.eclipse.jdt.core.prefs | 7 ++++--- .../src/org/spearce/jgit/pgm/TextBuiltin.java | 9 +++++++-- .../.settings/org.eclipse.jdt.core.prefs | 5 +++-- .../jgit/dircache/DirCacheBuildIterator.java | 2 +- .../spearce/jgit/dircache/DirCacheIterator.java | 2 +- .../src/org/spearce/jgit/lib/ObjectId.java | 2 +- .../src/org/spearce/jgit/lib/PackIndex.java | 6 +++--- .../src/org/spearce/jgit/lib/PackWriter.java | 2 +- .../jgit/lib/TreeVisitorWithCurrentDirectory.java | 4 ++-- .../src/org/spearce/jgit/lib/WorkDirCheckout.java | 14 +++++++------- .../org/spearce/jgit/merge/StrategyOneSided.java | 2 +- .../src/org/spearce/jgit/patch/FileHeader.java | 18 +++++++++--------- .../src/org/spearce/jgit/patch/HunkHeader.java | 4 ++-- .../org/spearce/jgit/revplot/PlotCommitList.java | 9 +++++++++ .../src/org/spearce/jgit/revplot/PlotWalk.java | 4 ++++ .../org/spearce/jgit/transport/DaemonService.java | 4 ++-- .../org/spearce/jgit/transport/OpenSshConfig.java | 2 +- .../spearce/jgit/transport/OperationResult.java | 10 +++++----- .../spearce/jgit/transport/PackedObjectInfo.java | 2 +- .../src/org/spearce/jgit/transport/PushResult.java | 2 +- .../spearce/jgit/transport/RemoteRefUpdate.java | 6 +++--- .../spearce/jgit/treewalk/WorkingTreeIterator.java | 7 +++++++ 22 files changed, 75 insertions(+), 48 deletions(-)
org.spearce.jgit.pgm/.settings/org.eclipse.jdt.core.prefs +4 -3
@@ -1,4 +1,4 @@ -#Sun Feb 03 03:16:45 CET 2008 +#Sun Mar 15 19:46:39 CET 2009 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
@@ -36,10 +36,11 @@ org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java +7 -2
@@ -207,18 +207,23 @@ public Repository getRepository() { return db; } - protected ObjectId resolve(final String s) throws IOException { + ObjectId resolve(final String s) throws IOException { final ObjectId r = db.resolve(s); if (r == null) throw die("Not a revision: " + s); return r; } + /** + * @param why + * textual explanation + * @return a runtime exception the caller is expected to throw + */ protected static Die die(final String why) { return new Die(why); } - protected String abbreviateRef(String dst, boolean abbreviateRemote) { + String abbreviateRef(String dst, boolean abbreviateRemote) { if (dst.startsWith(R_HEADS)) dst = dst.substring(R_HEADS.length()); else if (dst.startsWith(R_TAGS))
org.spearce.jgit/.settings/org.eclipse.jdt.core.prefs +3 -2
@@ -1,4 +1,4 @@ -#Sun Feb 03 03:16:45 CET 2008 +#Sun Mar 15 01:13:43 CET 2009 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
@@ -36,7 +36,8 @@ org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheBuildIterator.java +1 -1
@@ -91,7 +91,7 @@ public DirCacheBuildIterator(final DirCacheBuilder dcb) { builder = dcb; } - protected DirCacheBuildIterator(final DirCacheBuildIterator p, + DirCacheBuildIterator(final DirCacheBuildIterator p, final DirCacheTree dct) { super(p, dct); builder = p.builder;
org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheIterator.java +1 -1
@@ -105,7 +105,7 @@ public DirCacheIterator(final DirCache dc) { parseEntry(); } - protected DirCacheIterator(final DirCacheIterator p, final DirCacheTree dct) { + DirCacheIterator(final DirCacheIterator p, final DirCacheTree dct) { super(p, p.path, p.pathLen + 1); cache = p.cache; tree = dct;
org.spearce.jgit/src/org/spearce/jgit/lib/ObjectId.java +1 -1
@@ -238,7 +238,7 @@ private static final ObjectId fromHexString(final byte[] bs, int p) { } } - protected ObjectId(final int new_1, final int new_2, final int new_3, + ObjectId(final int new_1, final int new_2, final int new_3, final int new_4, final int new_5) { w1 = new_1; w2 = new_2;
org.spearce.jgit/src/org/spearce/jgit/lib/PackIndex.java +3 -3
@@ -243,7 +243,7 @@ abstract long findCRC32(AnyObjectId objId) throws MissingObjectException, * */ public static class MutableEntry { - protected final MutableObjectId idBuffer = new MutableObjectId(); + final MutableObjectId idBuffer = new MutableObjectId(); long offset;
@@ -281,12 +281,12 @@ public MutableEntry cloneEntry() { return r; } - protected void ensureId() { + void ensureId() { // Override in implementations. } } - protected abstract class EntriesIterator implements Iterator<MutableEntry> { + abstract class EntriesIterator implements Iterator<MutableEntry> { protected final MutableEntry entry = initEntry(); protected long returnedNumber = 0;
org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java +1 -1
@@ -931,7 +931,7 @@ boolean isDeltaRepresentation() { * @return true if object is already written; false otherwise. */ boolean isWritten() { - return offset != 0; + return getOffset() != 0; } PackedObjectLoader getReuseLoader() {
org.spearce.jgit/src/org/spearce/jgit/lib/TreeVisitorWithCurrentDirectory.java +2 -2
@@ -50,11 +50,11 @@ private File currentDirectory; - protected TreeVisitorWithCurrentDirectory(final File rootDirectory) { + TreeVisitorWithCurrentDirectory(final File rootDirectory) { currentDirectory = rootDirectory; } - protected File getCurrentDirectory() { + File getCurrentDirectory() { return currentDirectory; }
org.spearce.jgit/src/org/spearce/jgit/lib/WorkDirCheckout.java +7 -7
@@ -56,15 +56,15 @@ * Three-way merges are no performed. See {@link #setFailOnConflict(boolean)}. */ public class WorkDirCheckout { - protected Repository repo; + Repository repo; - protected File root; + File root; - protected GitIndex index; + GitIndex index; private boolean failOnConflict = true; - protected Tree merge; + Tree merge; /**
@@ -151,9 +151,9 @@ private void checkoutTwoTrees() throws FileNotFoundException, IOException { ArrayList<String> conflicts = new ArrayList<String>(); ArrayList<String> removed = new ArrayList<String>(); - protected Tree head = null; + Tree head = null; - protected HashMap<String, ObjectId> updated = new HashMap<String, ObjectId>(); + HashMap<String, ObjectId> updated = new HashMap<String, ObjectId>(); private void checkoutOutIndexNoHead() throws IOException { new IndexTreeWalker(index, merge, root, new AbstractIndexTreeVisitor() {
@@ -294,7 +294,7 @@ else if (file.isDirectory()) { conflicts.removeAll(removed); } - protected void processEntry(TreeEntry h, TreeEntry m, Entry i, + void processEntry(TreeEntry h, TreeEntry m, Entry i, File file) throws IOException { ObjectId iId = (i == null ? null : i.getObjectId()); ObjectId mId = (m == null ? null : m.getId());
org.spearce.jgit/src/org/spearce/jgit/merge/StrategyOneSided.java +1 -1
@@ -77,7 +77,7 @@ public Merger newMerger(final Repository db) { return new OneSide(db, treeIndex); } - protected static class OneSide extends Merger { + static class OneSide extends Merger { private final int treeIndex; protected OneSide(final Repository local, final int index) {
org.spearce.jgit/src/org/spearce/jgit/patch/FileHeader.java +9 -9
@@ -68,9 +68,9 @@ private static final byte[] NEW_MODE = encodeASCII("new mode "); - protected static final byte[] DELETED_FILE_MODE = encodeASCII("deleted file mode "); + static final byte[] DELETED_FILE_MODE = encodeASCII("deleted file mode "); - protected static final byte[] NEW_FILE_MODE = encodeASCII("new file mode "); + static final byte[] NEW_FILE_MODE = encodeASCII("new file mode "); private static final byte[] COPY_FROM = encodeASCII("copy from ");
@@ -88,7 +88,7 @@ private static final byte[] DISSIMILARITY_INDEX = encodeASCII("dissimilarity index "); - protected static final byte[] INDEX = encodeASCII("index "); + static final byte[] INDEX = encodeASCII("index "); static final byte[] OLD_NAME = encodeASCII("--- ");
@@ -220,7 +220,7 @@ public String getScriptText(Charset oldCharset, Charset newCharset) { return getScriptText(new Charset[] { oldCharset, newCharset }); } - protected String getScriptText(Charset[] charsetGuess) { + String getScriptText(Charset[] charsetGuess) { if (getHunks().isEmpty()) { // If we have no hunks then we can safely assume the entire // patch is a binary style patch, or a meta-data only style
@@ -562,19 +562,19 @@ int parseGitHeaders(int ptr, final int end) { return ptr; } - protected void parseOldName(int ptr, final int eol) { + void parseOldName(int ptr, final int eol) { oldName = p1(parseName(oldName, ptr + OLD_NAME.length, eol)); if (oldName == DEV_NULL) changeType = ChangeType.ADD; } - protected void parseNewName(int ptr, final int eol) { + void parseNewName(int ptr, final int eol) { newName = p1(parseName(newName, ptr + NEW_NAME.length, eol)); if (newName == DEV_NULL) changeType = ChangeType.DELETE; } - protected void parseNewFileMode(int ptr, final int eol) { + void parseNewFileMode(int ptr, final int eol) { oldMode = FileMode.MISSING; newMode = parseFileMode(ptr + NEW_FILE_MODE.length, eol); changeType = ChangeType.ADD;
@@ -633,7 +633,7 @@ private static String p1(final String r) { return s > 0 ? r.substring(s + 1) : r; } - protected FileMode parseFileMode(int ptr, final int end) { + FileMode parseFileMode(int ptr, final int end) { int tmp = 0; while (ptr < end - 1) { tmp <<= 3;
@@ -642,7 +642,7 @@ protected FileMode parseFileMode(int ptr, final int end) { return FileMode.fromBits(tmp); } - protected void parseIndexLine(int ptr, final int end) { + void parseIndexLine(int ptr, final int end) { // "index $asha1..$bsha1[ $mode]" where $asha1 and $bsha1 // can be unique abbreviations //
org.spearce.jgit/src/org/spearce/jgit/patch/HunkHeader.java +2 -2
@@ -307,7 +307,7 @@ void extractFileLines(final StringBuilder sb, final String[] text, } } - protected void copyLine(final StringBuilder sb, final String[] text, + void copyLine(final StringBuilder sb, final String[] text, final int[] offsets, final int fileIdx) { final String s = text[fileIdx]; final int start = offsets[fileIdx];
@@ -320,7 +320,7 @@ protected void copyLine(final StringBuilder sb, final String[] text, offsets[fileIdx] = end; } - protected void skipLine(final String[] text, final int[] offsets, + void skipLine(final String[] text, final int[] offsets, final int fileIdx) { final String s = text[fileIdx]; final int end = s.indexOf('\n', offsets[fileIdx]);
org.spearce.jgit/src/org/spearce/jgit/revplot/PlotCommitList.java +9 -0
@@ -171,10 +171,19 @@ private PlotLane nextFreeLane() { return p; } + /** + * @return a new Lane appropriate for this particular PlotList. + */ protected L createLane() { return (L) new PlotLane(); } + /** + * Return colors and other reusable information to the plotter when a lane + * is no longer needed. + * + * @param lane + */ protected void recycleLane(final L lane) { // Nothing. }
org.spearce.jgit/src/org/spearce/jgit/revplot/PlotWalk.java +4 -0
@@ -88,6 +88,10 @@ protected RevCommit createCommit(final AnyObjectId id) { return new PlotCommit(id, getTags(id)); } + /** + * @param commitId + * @return return the list of knows tags referring to this commit + */ protected Ref[] getTags(final AnyObjectId commitId) { Collection<Ref> list = reverseRefMap.get(commitId); Ref[] tags;
org.spearce.jgit/src/org/spearce/jgit/transport/DaemonService.java +2 -2
@@ -51,7 +51,7 @@ private boolean overridable; - protected DaemonService(final String cmdName, final String cfgName) { + DaemonService(final String cmdName, final String cfgName) { command = cmdName.startsWith("git-") ? cmdName : "git-" + cmdName; config = cfgName; overridable = true;
@@ -115,6 +115,6 @@ void execute(final DaemonClient client, final String commandLine) execute(client, db); } - protected abstract void execute(DaemonClient client, Repository db) + abstract void execute(DaemonClient client, Repository db) throws IOException; }
org.spearce.jgit/src/org/spearce/jgit/transport/OpenSshConfig.java +1 -1
@@ -95,7 +95,7 @@ public static OpenSshConfig get() { /** Cached entries read out of the configuration file. */ private Map<String, Host> hosts; - protected OpenSshConfig(final File h, final File cfg) { + OpenSshConfig(final File h, final File cfg) { home = h; configFile = cfg; hosts = Collections.emptyMap();
org.spearce.jgit/src/org/spearce/jgit/transport/OperationResult.java +5 -5
@@ -53,11 +53,11 @@ */ public abstract class OperationResult { - protected Map<String, Ref> advertisedRefs = Collections.emptyMap(); + Map<String, Ref> advertisedRefs = Collections.emptyMap(); - protected URIish uri; + URIish uri; - protected final SortedMap<String, TrackingRefUpdate> updates = new TreeMap<String, TrackingRefUpdate>(); + final SortedMap<String, TrackingRefUpdate> updates = new TreeMap<String, TrackingRefUpdate>(); /** * Get the URI this result came from.
@@ -122,12 +122,12 @@ public TrackingRefUpdate getTrackingRefUpdate(final String localName) { return updates.get(localName); } - protected void setAdvertisedRefs(final URIish u, final Map<String, Ref> ar) { + void setAdvertisedRefs(final URIish u, final Map<String, Ref> ar) { uri = u; advertisedRefs = ar; } - protected void add(final TrackingRefUpdate u) { + void add(final TrackingRefUpdate u) { updates.put(u.getLocalName(), u); } }
org.spearce.jgit/src/org/spearce/jgit/transport/PackedObjectInfo.java +1 -1
@@ -49,7 +49,7 @@ * objects from the pack. This extension of ObjectId includes the offset. */ public class PackedObjectInfo extends ObjectId { - protected long offset; + private long offset; private int crc;
org.spearce.jgit/src/org/spearce/jgit/transport/PushResult.java +1 -1
@@ -77,7 +77,7 @@ public RemoteRefUpdate getRemoteUpdate(final String refName) { return remoteUpdates.get(refName); } - protected void setRemoteUpdates( + void setRemoteUpdates( final Map<String, RemoteRefUpdate> remoteUpdates) { this.remoteUpdates = remoteUpdates; }
org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java +3 -3
@@ -315,15 +315,15 @@ public String getMessage() { return message; } - protected void setStatus(final Status status) { + void setStatus(final Status status) { this.status = status; } - protected void setFastForward(boolean fastForward) { + void setFastForward(boolean fastForward) { this.fastForward = fastForward; } - protected void setMessage(final String message) { + void setMessage(final String message) { this.message = message; }
org.spearce.jgit/src/org/spearce/jgit/treewalk/WorkingTreeIterator.java +7 -0
@@ -309,6 +309,13 @@ static int lastPathChar(final Entry e) { return e.getMode() == FileMode.TREE ? '/' : '\0'; } + /** + * Constructor helper. + * + * @param list + * files in the subtree of the work tree this iterator operates + * on + */ protected void init(final Entry[] list) { // Filter out nulls, . and .. as these are not valid tree entries, // also cache the encoded forms of the path names for efficient use
Signature · 1 line
1.6.1.285.g35d8b
PATCH 2/10 Rename the objectsUrl in the nested HttpObjectDB to
It is used for looking at alternate objects, so name it such
--- .../org/spearce/jgit/transport/TransportHttp.java | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
org.spearce.jgit/src/org/spearce/jgit/transport/TransportHttp.java +7 -7
@@ -112,15 +112,15 @@ public void close() { } class HttpObjectDB extends WalkRemoteObjectDatabase { - private final URL objectsUrl; + private final URL alternateObjectsUrl; HttpObjectDB(final URL b) { - objectsUrl = b; + alternateObjectsUrl = b; } @Override URIish getURI() { - return new URIish(objectsUrl); + return new URIish(alternateObjectsUrl); } @Override
@@ -143,7 +143,7 @@ URIish getURI() { @Override WalkRemoteObjectDatabase openAlternate(final String location) throws IOException { - return new HttpObjectDB(new URL(objectsUrl, location)); + return new HttpObjectDB(new URL(alternateObjectsUrl, location)); } @Override
@@ -171,7 +171,7 @@ WalkRemoteObjectDatabase openAlternate(final String location) @Override FileStream open(final String path) throws IOException { - final URL base = objectsUrl; + final URL base = alternateObjectsUrl; final URL u = new URL(base, path); final Proxy proxy = HttpSupport.proxyFor(proxySelector, u); final HttpURLConnection c;
@@ -201,10 +201,10 @@ FileStream open(final String path) throws IOException { } } catch (IOException err) { try { - throw new TransportException(new URL(objectsUrl, INFO_REFS) + throw new TransportException(new URL(alternateObjectsUrl, INFO_REFS) + ": cannot read available refs", err); } catch (MalformedURLException mue) { - throw new TransportException(objectsUrl + INFO_REFS + throw new TransportException(alternateObjectsUrl + INFO_REFS + ": cannot read available refs", err); } }
Signature · 1 line
1.6.1.285.g35d8b
PATCH 3/10 Rename variables that hides others with different content in FetchProcess
--- .../org/spearce/jgit/transport/FetchProcess.java | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
org.spearce.jgit/src/org/spearce/jgit/transport/FetchProcess.java +4 -4
@@ -298,7 +298,7 @@ private void expandSingle(final RefSpec spec, final Set<Ref> matched) private Collection<Ref> expandAutoFollowTags() throws TransportException { final Collection<Ref> additionalTags = new ArrayList<Ref>(); - final Map<String, Ref> have = transport.local.getAllRefs(); + final Map<String, Ref> haveRefs = transport.local.getAllRefs(); for (final Ref r : conn.getRefs()) { if (!isTag(r)) continue;
@@ -307,7 +307,7 @@ private void expandSingle(final RefSpec spec, final Set<Ref> matched) continue; } - final Ref local = have.get(r.getName()); + final Ref local = haveRefs.get(r.getName()); if (local != null) { if (!r.getObjectId().equals(local.getObjectId())) wantTag(r);
@@ -321,11 +321,11 @@ private void expandSingle(final RefSpec spec, final Set<Ref> matched) } private void expandFetchTags() throws TransportException { - final Map<String, Ref> have = transport.local.getAllRefs(); + final Map<String, Ref> haveRefs = transport.local.getAllRefs(); for (final Ref r : conn.getRefs()) { if (!isTag(r)) continue; - final Ref local = have.get(r.getName()); + final Ref local = haveRefs.get(r.getName()); if (local == null || !r.getObjectId().equals(local.getObjectId())) wantTag(r); }
Signature · 1 line
1.6.1.285.g35d8b
PATCH 4/10 Rename a parameter i PackWriter that hides another with the same name
--- .../src/org/spearce/jgit/lib/PackWriter.java | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java +3 -3
@@ -447,7 +447,7 @@ public void preparePack(final Iterator<RevObject> objectsSource) * @param uninterestingObjects * collection of objects to be marked as uninteresting (end * points of graph traversal). - * @param thin + * @param packthin * a boolean indicating whether writer may pack objects with * delta base object not within set of objects to pack, but * belonging to party repository (uninteresting/boundary) as
@@ -464,9 +464,9 @@ public void preparePack(final Iterator<RevObject> objectsSource) public void preparePack( final Collection<? extends ObjectId> interestingObjects, final Collection<? extends ObjectId> uninterestingObjects, - final boolean thin, final boolean ignoreMissingUninteresting) + final boolean packthin, final boolean ignoreMissingUninteresting) throws IOException { - this.thin = thin; + this.thin = packthin; ObjectWalk walker = setUpWalker(interestingObjects, uninterestingObjects, ignoreMissingUninteresting); findObjectsToPack(walker);
Signature · 1 line
1.6.1.285.g35d8b
PATCH 5/10 Rename fields to avoid hiding of field names in ReadTreeTest
--- .../tst/org/spearce/jgit/lib/ReadTreeTest.java | 118 ++++++++++---------- 1 files changed, 59 insertions(+), 59 deletions(-)
org.spearce.jgit.test/tst/org/spearce/jgit/lib/ReadTreeTest.java +59 -59
@@ -49,10 +49,10 @@ public class ReadTreeTest extends RepositoryTestCase { - private Tree head; - private Tree merge; - private GitIndex index; - private WorkDirCheckout readTree; + private Tree theHead; + private Tree theMerge; + private GitIndex theIndex; + private WorkDirCheckout theReadTree; // Each of these rules are from the read-tree manpage // go there to see what they mean. // Rule 0 is left out for obvious reasons :)
@@ -87,9 +87,9 @@ public void testRules1thru3_NoIndexEntry() throws IOException { void setupCase(HashMap<String, String> headEntries, HashMap<String, String> mergeEntries, HashMap<String, String> indexEntries) throws IOException { - head = buildTree(headEntries); - merge = buildTree(mergeEntries); - index = buildIndex(indexEntries); + theHead = buildTree(headEntries); + theMerge = buildTree(mergeEntries); + theIndex = buildIndex(indexEntries); } private GitIndex buildIndex(HashMap<String, String> indexEntries) throws IOException {
@@ -129,9 +129,9 @@ ObjectId genSha1(String data) { } private WorkDirCheckout go() throws IOException { - readTree = new WorkDirCheckout(db, trash, head, index, merge); - readTree.prescanTwoTrees(); - return readTree; + theReadTree = new WorkDirCheckout(db, trash, theHead, theIndex, theMerge); + theReadTree.prescanTwoTrees(); + return theReadTree; } // for these rules, they all have clean yes/no options
@@ -144,17 +144,17 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException { idxMap = new HashMap<String, String>(); idxMap.put("foo", "foo"); setupCase(null, null, idxMap); - readTree = go(); + theReadTree = go(); - assertTrue(readTree.updated.isEmpty()); - assertTrue(readTree.removed.isEmpty()); - assertTrue(readTree.conflicts.isEmpty()); + assertTrue(theReadTree.updated.isEmpty()); + assertTrue(theReadTree.removed.isEmpty()); + assertTrue(theReadTree.conflicts.isEmpty()); // rules 6 and 7 idxMap = new HashMap<String, String>(); idxMap.put("foo", "foo"); setupCase(null, idxMap, idxMap); - readTree = go(); + theReadTree = go(); assertAllEmpty();
@@ -166,9 +166,9 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException { setupCase(null, mergeMap, idxMap); go(); - assertTrue(readTree.updated.isEmpty()); - assertTrue(readTree.removed.isEmpty()); - assertTrue(readTree.conflicts.contains("foo")); + assertTrue(theReadTree.updated.isEmpty()); + assertTrue(theReadTree.removed.isEmpty()); + assertTrue(theReadTree.conflicts.contains("foo")); // rule 10
@@ -177,29 +177,29 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException { setupCase(headMap, null, idxMap); go(); - assertTrue(readTree.removed.contains("foo")); - assertTrue(readTree.updated.isEmpty()); - assertTrue(readTree.conflicts.isEmpty()); + assertTrue(theReadTree.removed.contains("foo")); + assertTrue(theReadTree.updated.isEmpty()); + assertTrue(theReadTree.conflicts.isEmpty()); // rule 11 setupCase(headMap, null, idxMap); new File(trash, "foo").delete(); writeTrashFile("foo", "bar"); - index.getMembers()[0].forceRecheck(); + theIndex.getMembers()[0].forceRecheck(); go(); - assertTrue(readTree.removed.isEmpty()); - assertTrue(readTree.updated.isEmpty()); - assertTrue(readTree.conflicts.contains("foo")); + assertTrue(theReadTree.removed.isEmpty()); + assertTrue(theReadTree.updated.isEmpty()); + assertTrue(theReadTree.conflicts.contains("foo")); // rule 12 & 13 headMap.put("foo", "head"); setupCase(headMap, null, idxMap); go(); - assertTrue(readTree.removed.isEmpty()); - assertTrue(readTree.updated.isEmpty()); - assertTrue(readTree.conflicts.contains("foo")); + assertTrue(theReadTree.removed.isEmpty()); + assertTrue(theReadTree.updated.isEmpty()); + assertTrue(theReadTree.conflicts.contains("foo")); // rules 14 & 15 setupCase(headMap, headMap, idxMap);
@@ -209,7 +209,7 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException { // rules 16 & 17 setupCase(headMap, mergeMap, idxMap); go(); - assertTrue(readTree.conflicts.contains("foo")); + assertTrue(theReadTree.conflicts.contains("foo")); // rules 18 & 19 setupCase(headMap, idxMap, idxMap); go();
@@ -217,51 +217,51 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException { // rule 20 setupCase(idxMap, mergeMap, idxMap); go(); - assertTrue(readTree.updated.containsKey("foo")); + assertTrue(theReadTree.updated.containsKey("foo")); // rules 21 setupCase(idxMap, mergeMap, idxMap); new File(trash, "foo").delete(); writeTrashFile("foo", "bar"); - index.getMembers()[0].forceRecheck(); + theIndex.getMembers()[0].forceRecheck(); go(); - assertTrue(readTree.conflicts.contains("foo")); + assertTrue(theReadTree.conflicts.contains("foo")); } private void assertAllEmpty() { - assertTrue(readTree.removed.isEmpty()); - assertTrue(readTree.updated.isEmpty()); - assertTrue(readTree.conflicts.isEmpty()); + assertTrue(theReadTree.removed.isEmpty()); + assertTrue(theReadTree.updated.isEmpty()); + assertTrue(theReadTree.conflicts.isEmpty()); } public void testDirectoryFileSimple() throws IOException { - index = new GitIndex(db); - index.add(trash, writeTrashFile("DF", "DF")); - Tree treeDF = db.mapTree(index.writeTree()); + theIndex = new GitIndex(db); + theIndex.add(trash, writeTrashFile("DF", "DF")); + Tree treeDF = db.mapTree(theIndex.writeTree()); recursiveDelete(new File(trash, "DF")); - index = new GitIndex(db); - index.add(trash, writeTrashFile("DF/DF", "DF/DF")); - Tree treeDFDF = db.mapTree(index.writeTree()); + theIndex = new GitIndex(db); + theIndex.add(trash, writeTrashFile("DF/DF", "DF/DF")); + Tree treeDFDF = db.mapTree(theIndex.writeTree()); - index = new GitIndex(db); + theIndex = new GitIndex(db); recursiveDelete(new File(trash, "DF")); - index.add(trash, writeTrashFile("DF", "DF")); - readTree = new WorkDirCheckout(db, trash, treeDF, index, treeDFDF); - readTree.prescanTwoTrees(); + theIndex.add(trash, writeTrashFile("DF", "DF")); + theReadTree = new WorkDirCheckout(db, trash, treeDF, theIndex, treeDFDF); + theReadTree.prescanTwoTrees(); - assertTrue(readTree.removed.contains("DF")); - assertTrue(readTree.updated.containsKey("DF/DF")); + assertTrue(theReadTree.removed.contains("DF")); + assertTrue(theReadTree.updated.containsKey("DF/DF")); recursiveDelete(new File(trash, "DF")); - index = new GitIndex(db); - index.add(trash, writeTrashFile("DF/DF", "DF/DF")); + theIndex = new GitIndex(db); + theIndex.add(trash, writeTrashFile("DF/DF", "DF/DF")); - readTree = new WorkDirCheckout(db, trash, treeDFDF, index, treeDF); - readTree.prescanTwoTrees(); - assertTrue(readTree.removed.contains("DF/DF")); - assertTrue(readTree.updated.containsKey("DF")); + theReadTree = new WorkDirCheckout(db, trash, treeDFDF, theIndex, treeDF); + theReadTree.prescanTwoTrees(); + assertTrue(theReadTree.removed.contains("DF/DF")); + assertTrue(theReadTree.updated.containsKey("DF")); } /*
@@ -467,19 +467,19 @@ private void cleanUpDF() throws Exception { } private void assertConflict(String s) { - assertTrue(readTree.conflicts.contains(s)); + assertTrue(theReadTree.conflicts.contains(s)); } private void assertUpdated(String s) { - assertTrue(readTree.updated.containsKey(s)); + assertTrue(theReadTree.updated.containsKey(s)); } private void assertRemoved(String s) { - assertTrue(readTree.removed.contains(s)); + assertTrue(theReadTree.removed.contains(s)); } private void assertNoConflicts() { - assertTrue(readTree.conflicts.isEmpty()); + assertTrue(theReadTree.conflicts.isEmpty()); } private void doit(HashMap<String, String> h, HashMap<String, String>m,
@@ -545,8 +545,8 @@ public void testCloseNameConflicts1() throws IOException { } private void checkout() throws IOException { - readTree = new WorkDirCheckout(db, trash, head, index, merge); - readTree.checkout(); + theReadTree = new WorkDirCheckout(db, trash, theHead, theIndex, theMerge); + theReadTree.checkout(); } public void testCheckoutOutChanges() throws IOException {
Signature · 1 line
1.6.1.285.g35d8b
PATCH 6/10 Rename the gitDir fields to indicate they refer to another dir than the default
--- .../src/org/spearce/jgit/pgm/ReceivePack.java | 10 +++++----- .../src/org/spearce/jgit/pgm/UploadPack.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-)
org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/ReceivePack.java +5 -5
@@ -45,7 +45,7 @@ @Command(common = false, usage = "Server side backend for 'jgit push'") class ReceivePack extends TextBuiltin { @Argument(index = 0, required = true, metaVar = "DIRECTORY", usage = "Repository to receive into") - File gitdir; + File newGitdir; @Override protected final boolean requiresRepository() {
@@ -56,11 +56,11 @@ protected final boolean requiresRepository() { protected void run() throws Exception { final org.spearce.jgit.transport.ReceivePack rp; - if (new File(gitdir, ".git").isDirectory()) - gitdir = new File(gitdir, ".git"); - db = new Repository(gitdir); + if (new File(newGitdir, ".git").isDirectory()) + newGitdir = new File(newGitdir, ".git"); + db = new Repository(newGitdir); if (!db.getObjectsDirectory().isDirectory()) - throw die("'" + gitdir.getPath() + "' not a git repository"); + throw die("'" + newGitdir.getPath() + "' not a git repository"); rp = new org.spearce.jgit.transport.ReceivePack(db); rp.receive(System.in, System.out, System.err); }
org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/UploadPack.java +5 -5
@@ -45,7 +45,7 @@ @Command(common = false, usage = "Server side backend for 'jgit fetch'") class UploadPack extends TextBuiltin { @Argument(index = 0, required = true, metaVar = "DIRECTORY", usage = "Repository to read from") - File gitdir; + File newGitdir; @Override protected final boolean requiresRepository() {
@@ -56,11 +56,11 @@ protected final boolean requiresRepository() { protected void run() throws Exception { final org.spearce.jgit.transport.UploadPack rp; - if (new File(gitdir, ".git").isDirectory()) - gitdir = new File(gitdir, ".git"); - db = new Repository(gitdir); + if (new File(newGitdir, ".git").isDirectory()) + newGitdir = new File(newGitdir, ".git"); + db = new Repository(newGitdir); if (!db.getObjectsDirectory().isDirectory()) - throw die("'" + gitdir.getPath() + "' not a git repository"); + throw die("'" + newGitdir.getPath() + "' not a git repository"); rp = new org.spearce.jgit.transport.UploadPack(db); rp.upload(System.in, System.out, System.err); }
Signature · 1 line
1.6.1.285.g35d8b
PATCH 7/10 Rename a parameter in PushProcessTest that hides another
--- .../spearce/jgit/transport/PushProcessTest.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
org.spearce.jgit.test/tst/org/spearce/jgit/transport/PushProcessTest.java +2 -2
@@ -401,9 +401,9 @@ public void close() { } public void push(ProgressMonitor monitor, - Map<String, RemoteRefUpdate> refUpdates) + Map<String, RemoteRefUpdate> refsToUpdate) throws TransportException { - for (final RemoteRefUpdate rru : refUpdates.values()) { + for (final RemoteRefUpdate rru : refsToUpdate.values()) { assertEquals(Status.NOT_ATTEMPTED, rru.getStatus()); rru.setStatus(connectionUpdateStatus); }
Signature · 1 line
1.6.1.285.g35d8b
PATCH 8/10 Drop unused end parameters in hunk parsing code
Is this safe, or should they actually be used?
--- .../org/spearce/jgit/patch/CombinedHunkHeader.java | 2 +- .../src/org/spearce/jgit/patch/HunkHeader.java | 2 +- .../src/org/spearce/jgit/patch/Patch.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
org.spearce.jgit/src/org/spearce/jgit/patch/CombinedHunkHeader.java +1 -1
@@ -90,7 +90,7 @@ public OldImage getOldImage(final int nthParent) { } @Override - void parseHeader(final int end) { + void parseHeader() { // Parse "@@@ -55,12 -163,13 +163,15 @@@ protected boolean" // final byte[] buf = file.buf;
org.spearce.jgit/src/org/spearce/jgit/patch/HunkHeader.java +1 -1
@@ -161,7 +161,7 @@ public int getLinesContext() { return nContext; } - void parseHeader(final int end) { + void parseHeader() { // Parse "@@ -236,9 +236,9 @@ protected boolean" // final byte[] buf = file.buf;
org.spearce.jgit/src/org/spearce/jgit/patch/Patch.java +4 -4
@@ -222,7 +222,7 @@ private int parseDiffGit(final byte[] buf, final int start, final int end) { final FileHeader fh = new FileHeader(buf, start); int ptr = fh.parseGitFileName(start + DIFF_GIT.length, end); if (ptr < 0) - return skipFile(buf, start, end); + return skipFile(buf, start); ptr = fh.parseGitHeaders(ptr, end); ptr = parseHunks(fh, ptr, end);
@@ -236,7 +236,7 @@ private int parseDiffCombined(final byte[] hdr, final byte[] buf, final CombinedFileHeader fh = new CombinedFileHeader(buf, start); int ptr = fh.parseGitFileName(start + hdr.length, end); if (ptr < 0) - return skipFile(buf, start, end); + return skipFile(buf, start); ptr = fh.parseGitHeaders(ptr, end); ptr = parseHunks(fh, ptr, end);
@@ -255,7 +255,7 @@ private int parseTraditionalPatch(final byte[] buf, final int start, return ptr; } - private static int skipFile(final byte[] buf, int ptr, final int end) { + private static int skipFile(final byte[] buf, int ptr) { ptr = nextLF(buf, ptr); if (match(buf, ptr, OLD_NAME) >= 0) ptr = nextLF(buf, ptr);
@@ -282,7 +282,7 @@ private int parseHunks(final FileHeader fh, int c, final int end) { if (isHunkHdr(buf, c, end) == fh.getParentCount()) { final HunkHeader h = fh.newHunkHeader(c); - h.parseHeader(end); + h.parseHeader(); c = h.parseBody(this, end); h.endOffset = c; fh.addHunk(h);
Signature · 1 line
1.6.1.285.g35d8b
PATCH 9/10 Drop unused File arguments in IndexTreeWalker and WorkdirCheckout
--- .../src/org/spearce/jgit/lib/IndexTreeWalker.java | 8 ++++---- .../src/org/spearce/jgit/lib/WorkDirCheckout.java | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-)
org.spearce.jgit/src/org/spearce/jgit/lib/IndexTreeWalker.java +4 -4
@@ -104,10 +104,10 @@ public IndexTreeWalker(GitIndex index, Tree mainTree, Tree newTree, File root, I * @throws IOException */ public void walk() throws IOException { - walk(mainTree, newTree, ""); + walk(mainTree, newTree); } - private void walk(Tree tree, Tree auxTree, String curDir) throws IOException { + private void walk(Tree tree, Tree auxTree) throws IOException { TreeIterator mi = new TreeIterator(tree, TreeIterator.Order.POSTORDER); TreeIterator ai = new TreeIterator(auxTree, TreeIterator.Order.POSTORDER); TreeEntry m = mi.hasNext() ? mi.next() : null;
@@ -124,7 +124,7 @@ private void walk(Tree tree, Tree auxTree, String curDir) throws IOException { Entry pi = cmpmi >= 0 && cmpai >= 0 ? i : null; if (pi != null) - visitEntry(pm, pa, pi, root); + visitEntry(pm, pa, pi); else finishVisitTree(pm, pa, curIndexPos, root);
@@ -135,7 +135,7 @@ private void walk(Tree tree, Tree auxTree, String curDir) throws IOException { } private void visitEntry(TreeEntry t1, TreeEntry t2, - Entry i, File root) throws IOException { + Entry i) throws IOException { assert t1 != null || t2 != null || i != null : "Needs at least one entry"; assert root != null : "Needs workdir";
org.spearce.jgit/src/org/spearce/jgit/lib/WorkDirCheckout.java +2 -3
@@ -259,7 +259,7 @@ public void visitEntry(TreeEntry treeEntry, TreeEntry auxEntry, if (treeEntry instanceof Tree || auxEntry instanceof Tree) { throw new IllegalArgumentException("Can't pass me a tree!"); } - processEntry(treeEntry, auxEntry, indexEntry, file); + processEntry(treeEntry, auxEntry, indexEntry); } @Override
@@ -294,8 +294,7 @@ else if (file.isDirectory()) { conflicts.removeAll(removed); } - void processEntry(TreeEntry h, TreeEntry m, Entry i, - File file) throws IOException { + void processEntry(TreeEntry h, TreeEntry m, Entry i) throws IOException { ObjectId iId = (i == null ? null : i.getObjectId()); ObjectId mId = (m == null ? null : m.getId()); ObjectId hId = (h == null ? null : h.getId());
Signature · 1 line
1.6.1.285.g35d8b
PATCH 10/10 Drop an effectively unused parameter in IndexTreeWalker.
The value was always the same as the field it shadowed
--- .../src/org/spearce/jgit/lib/IndexTreeWalker.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
org.spearce.jgit/src/org/spearce/jgit/lib/IndexTreeWalker.java +2 -2
@@ -126,7 +126,7 @@ private void walk(Tree tree, Tree auxTree) throws IOException { if (pi != null) visitEntry(pm, pa, pi); else - finishVisitTree(pm, pa, curIndexPos, root); + finishVisitTree(pm, pa, curIndexPos); if (pm != null) m = mi.hasNext() ? mi.next() : null; if (pa != null) a = ai.hasNext() ? ai.next() : null;
@@ -160,7 +160,7 @@ else if (t2 != null) visitor.visitEntry(t1, i, f); } - private void finishVisitTree(TreeEntry t1, TreeEntry t2, int curIndexPos, File root) + private void finishVisitTree(TreeEntry t1, TreeEntry t2, int curIndexPos) throws IOException { assert t1 != null || t2 != null : "Needs at least one entry";
Signature · 1 line
1.6.1.285.g35d8b
Re: [EGIT PATCH 08/10] Drop unused end parameters in hunk parsing code
In reply to Robin RosenbergQuoted 1 line · Robin Rosenberg
Is this safe, or should they actually be used?
Yea, these are safe to remove. At worst we move one line beyond the end marker given to us by the user in Patch.parse() and then abort the parse loop when we find ptr >= end. We should also never exceed the byte[] length; the ParseUtils methods we use do their own array bound checks internally.
Quoted 4 lines
.../org/spearce/jgit/patch/CombinedHunkHeader.java | 2 +- .../src/org/spearce/jgit/patch/HunkHeader.java | 2 +- .../src/org/spearce/jgit/patch/Patch.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
Shawn.
Re: [EGIT PATCH 02/10] Rename the objectsUrl in the nested HttpObjectDB to
In reply to Robin RosenbergQuoted 1 line · Robin Rosenberg
It is used for looking at alternate objects, so name it such
No SOB?
But I disagree with this name change. Its pointing at the objects directory of a repository. It may also be used to point at an alternate when opening an alternate, in which case it points at the alternate's objects directory.
IMHO, objectsUrl is the right name for this.
Quoted 14 lines
--- .../org/spearce/jgit/transport/TransportHttp.java | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)org.spearce.jgit/src/org/spearce/jgit/transport/TransportHttp.java +1
-1@@ -112,15 +112,15 @@ public void close() { } class HttpObjectDB extends WalkRemoteObjectDatabase { - private final URL objectsUrl; + private final URL alternateObjectsUrl;
Signature · 1 line
Shawn.
Re: [EGIT PATCH 02/10] Rename the objectsUrl in the nested HttpObjectDB to
måndag 16 mars 2009 21:25:13 skrev "Shawn O. Pearce" <[email protected]>:
Quoted 11 lines
Quoted 1 line · Robin Rosenberg
It is used for looking at alternate objects, so name it such
No SOB?
But I disagree with this name change. Its pointing at the objects directory of a repository. It may also be used to point at an alternate when opening an alternate, in which case it points at the alternate's objects directory.
IMHO, objectsUrl is the right name for this.
Ok, I missed the real reason in the comment. It is name hiding. objectsUrl is the name of another variable in the outer scope.
-- robin
Re: [EGIT PATCH 02/10] Rename the objectsUrl in the nested HttpObjectDB to
Quoted 11 lines · Robin Rosenberg
måndag 16 mars 2009 21:25:13 skrev "Shawn O. Pearce" <[email protected]>:
Quoted 10 lines
Quoted 1 line · Robin Rosenberg
It is used for looking at alternate objects, so name it such
No SOB?
But I disagree with this name change. Its pointing at the objects directory of a repository. It may also be used to point at an alternate when opening an alternate, in which case it points at the alternate's objects directory.
Quoted 4 lines
Quoted 1 line
IMHO, objectsUrl is the right name for this.
Ok, I missed the real reason in the comment. It is name hiding. objectsUrl is the name of another variable in the outer scope.
OK.
I still disagree with the name change. Can we hide the outer name by making it private? Or come up with a better name for the inner one?
Signature · 1 line
Shawn.