{"thread":{"id":"11890","subject":"[EGIT PATCH 2/6] Cleanup unboxing/boxing","startedAt":"2008-02-05T00:15:28Z","lastAt":"2008-02-08T02:52:45Z","messageCount":13,"participants":["Robin Rosenberg","Roger C. Soares","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"67458","messageId":"1202170534-15788-1-git-send-email-robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":null,"subject":"[EGIT PATCH Series] Cleanups and javadocs","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-05T00:15:28Z","receivedAt":"2008-02-05T00:15:28Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Here is a number of small enhancements that reduce the number of warnings\ndisplayed and raises the standard on comments. We now get javadoc comments\non all public and protected methods which hopefully will make it slighly\neasier to get on the train for those interested in helping out with Egit/Jgit.\n\nDisabling the else-warning is probably fairly uncontroversial. Disabling some\nwarning about boxing/unboxing of integers might be as might be requiring\njavadoc comments.\n\n-- robin\n"},{"id":"67455","messageId":"1202170534-15788-2-git-send-email-robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":"1202170534-15788-1-git-send-email-robin.rosenberg@dewire.com","subject":"[EGIT PATCH 1/6] Comment some empty blocks that should be empty","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-05T00:15:29Z","receivedAt":"2008-02-05T00:15:29Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../src/org/spearce/egit/core/test/Activator.java  |    1 +\n .../internal/actions/AbstractOperationAction.java  |    1 +\n .../egit/ui/internal/dialogs/CommitDialog.java     |    3 +++\n .../ui/internal/preferences/GitPreferencePage.java |    1 +\n .../spearce/jgit/lib/AbstractIndexTreeVisitor.java |    4 ++++\n .../org/spearce/jgit/lib/TopologicalSorter.java    |    1 +\n 6 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.egit.core.test/src/org/spearce/egit/core/test/Activator.java b/org.spearce.egit.core.test/src/org/spearce/egit/core/test/Activator.java\nindex 9807c84..10d7d94 100644\n--- a/org.spearce.egit.core.test/src/org/spearce/egit/core/test/Activator.java\n+++ b/org.spearce.egit.core.test/src/org/spearce/egit/core/test/Activator.java\n@@ -18,6 +18,7 @@ public class Activator extends Plugin {\n \t * The constructor\n \t */\n \tpublic Activator() {\n+\t\t// Empty\n \t}\n \n \t/*\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractOperationAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractOperationAction.java\nindex c3f347e..0e96323 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractOperationAction.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/AbstractOperationAction.java\n@@ -73,6 +73,7 @@ public abstract class AbstractOperationAction implements IObjectActionDelegate {\n \t * A method to invoke when the operation is finished.\n \t */\n \tprotected void postOperation() {\n+\t\t// Empty\n \t}\n \n \tpublic void run(final IAction act) {\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/CommitDialog.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/CommitDialog.java\nindex 3778b94..064a2dc 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/CommitDialog.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/CommitDialog.java\n@@ -212,6 +212,7 @@ public class CommitDialog extends Dialog {\n \t\t\t}\n \t\t\n \t\t\tpublic void widgetDefaultSelected(SelectionEvent arg0) {\n+\t\t\t\t// Empty\n \t\t\t}\n \t\t});\n \t\t\n@@ -242,9 +243,11 @@ public class CommitDialog extends Dialog {\n \n \t\t\tpublic void inputChanged(Viewer viewer, Object oldInput,\n \t\t\t\t\tObject newInput) {\n+\t\t\t\t// Empty\n \t\t\t}\n \n \t\t\tpublic void dispose() {\n+\t\t\t\t// Empty\n \t\t\t}\n \n \t\t\tpublic Object[] getElements(Object inputElement) {\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitPreferencePage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitPreferencePage.java\nindex 780375b..8e6d3f3 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitPreferencePage.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitPreferencePage.java\n@@ -36,5 +36,6 @@ public class GitPreferencePage extends PreferencePage implements\n \t}\n \n \tpublic void init(final IWorkbench workbench) {\n+\t\t// Empty\n \t}\n }\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/AbstractIndexTreeVisitor.java b/org.spearce.jgit/src/org/spearce/jgit/lib/AbstractIndexTreeVisitor.java\nindex 40b42dd..6f5ede4 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/AbstractIndexTreeVisitor.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/AbstractIndexTreeVisitor.java\n@@ -31,17 +31,21 @@ import org.spearce.jgit.lib.GitIndex.Entry;\n public class AbstractIndexTreeVisitor implements IndexTreeVisitor {\n \tpublic void finishVisitTree(Tree tree, Tree auxTree, int i, String curDir)\n \t\t\tthrows IOException {\n+\t\t// Empty\n \t}\n \n \tpublic void finishVisitTree(Tree tree, int i, String curDir)\n \t\t\tthrows IOException {\n+\t\t// Empty\n \t}\n \n \tpublic void visitEntry(TreeEntry treeEntry, Entry indexEntry, File file)\n \t\t\tthrows IOException {\n+\t\t// Empty\n \t}\n \n \tpublic void visitEntry(TreeEntry treeEntry, TreeEntry auxEntry,\n \t\t\tEntry indexEntry, File file) throws IOException {\n+\t\t// Empty\n \t}\n }\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/TopologicalSorter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/TopologicalSorter.java\nindex 7b59490..c33334e 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/TopologicalSorter.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/TopologicalSorter.java\n@@ -292,6 +292,7 @@ public class TopologicalSorter<T> {\n \t\tprivate int number = -1;\n \n \t\tLane() {\n+\t\t\t// Empty\n \t\t}\n \n \t\t@Override\n-- \n1.5.4.rc4.25.g81cc\n"},{"id":"67452","messageId":"1202170534-15788-3-git-send-email-robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":"1202170534-15788-2-git-send-email-robin.rosenberg@dewire.com","subject":"[EGIT PATCH 2/6] Cleanup unboxing/boxing","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-05T00:15:30Z","receivedAt":"2008-02-05T00:15:30Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"These operation are relatively expensive in general so it is good to make them\nvisible, but when they are needed a lot we just want to do without explicit conversion\nso we ignore the warning there.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../src/org/spearce/egit/ui/GitHistoryPage.java    |    1 +\n .../internal/decorators/GitResourceDecorator.java  |   10 +++++-----\n .../tst/org/spearce/jgit/lib/LaneTest.java         |    1 +\n .../tst/org/spearce/jgit/lib/SuperListTest.java    |    1 +\n .../src/org/spearce/jgit/lib/PersonIdent.java      |    2 +-\n 5 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java\nindex 812747d..2fc7afa 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java\n@@ -864,6 +864,7 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n //\t\t\t\tSWT.COLOR_WHITE,\n \t\t\t\tSWT.COLOR_YELLOW\n \t\t\t};\n+\t\t\t@SuppressWarnings(\"boxing\")\n \t\t\tpublic void handleEvent(Event event) {\n \t\t\t\tTableItem item = (TableItem) event.item;\n \t\t\t\tif (event.index == 0) {\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\nindex c13c38a..7eb008b 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\n@@ -207,7 +207,7 @@ public class GitResourceDecorator extends LabelProvider implements\n \t\t\t\t\treturn Boolean.FALSE;\n \t\t\t\t}\n \n-\t\t\t\treturn mapped.isResourceChanged(rsrc);\n+\t\t\t\treturn new Boolean(mapped.isResourceChanged(rsrc));\n \t\t\t}\n \t\t\treturn null; // not mapped\n \t\t} catch (CoreException e) {\n@@ -244,8 +244,8 @@ public class GitResourceDecorator extends LabelProvider implements\n \t\t\t\t\t\tif (rsrc instanceof IContainer) {\n \t\t\t\t\t\t\tInteger df = (Integer) rsrc\n \t\t\t\t\t\t\t\t\t.getSessionProperty(GITFOLDERDIRTYSTATEPROPERTY);\n-\t\t\t\t\t\t\tBoolean f = df == null ? isDirty(rsrc) : df\n-\t\t\t\t\t\t\t\t\t.intValue() == CHANGED;\n+\t\t\t\t\t\t\tBoolean f = df == null ? isDirty(rsrc)\n+\t\t\t\t\t\t\t\t\t: new Boolean(df.intValue() == CHANGED);\n \t\t\t\t\t\t\tif (f != null) {\n \t\t\t\t\t\t\t\tif (f.booleanValue()) {\n \t\t\t\t\t\t\t\t\tdecoration.addPrefix(\">\"); // Have not\n@@ -358,7 +358,7 @@ public class GitResourceDecorator extends LabelProvider implements\n \t\ttry {\n \t\t\tInteger dirty = (Integer) rsrc.getSessionProperty(GITFOLDERDIRTYSTATEPROPERTY);\n \t\t\tif (dirty == null) {\n-\t\t\t\trsrc.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, flag);\n+\t\t\t\trsrc.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, new Integer(flag));\n \t\t\t\tActivator.trace(\"SETTING:\"+rsrc.getFullPath().toOSString()+\" => \"+flag);\n \t\t\t\torState(rsrc.getParent(), flag);\n \t\t\t\tDisplay.getDefault().asyncExec(new Runnable() {\n@@ -375,7 +375,7 @@ public class GitResourceDecorator extends LabelProvider implements\n \t\t\t\t});\n \t\t\t} else {\n \t\t\t\tif ((dirty.intValue() | flag) != dirty.intValue()) {\n-\t\t\t\t\tdirty = dirty | flag;\n+\t\t\t\t\tdirty = new Integer(dirty.intValue() | flag);\n \t\t\t\t\trsrc.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, dirty);\n \t\t\t\t\tActivator.trace(\"SETTING:\"+rsrc.getFullPath().toOSString()+\" => \"+dirty);\n \t\t\t\t\torState(rsrc.getParent(), dirty.intValue());\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/LaneTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/LaneTest.java\nindex 0f57075..707fb86 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/LaneTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/LaneTest.java\n@@ -498,6 +498,7 @@ public class LaneTest extends TestCase {\n \t\t\t\t, road);\n \t}\n \n+\t@SuppressWarnings(\"boxing\")\n \tprivate String drawAsAscii(TopologicalSorter<Data> counter) {\n \t\tStringWriter w = new StringWriter();\n \t\tList<Data> entries = counter.getEntries();\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/SuperListTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/SuperListTest.java\nindex 121bf9c..79f4da6 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/SuperListTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/SuperListTest.java\n@@ -28,6 +28,7 @@ public class SuperListTest extends TestCase {\n \t\tassertEquals(0, l.size());\n \t}\n \n+\t@SuppressWarnings(\"boxing\")\n \tpublic void testNonEmpty() {\n \t\tList<Integer> l = new SuperList<Integer>();\n \t\tList<Integer> sl1 = Arrays.asList(new Integer[] { 3,4 });\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java\nindex 5857cb7..6879eb7 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java\n@@ -62,7 +62,7 @@ public class PersonIdent {\n \n \t\tname = username;\n \t\temailAddress = email;\n-\t\twhen = Calendar.getInstance().getTimeInMillis();\n+\t\twhen = new Long(Calendar.getInstance().getTimeInMillis());\n \t\ttzOffset = TimeZone.getDefault().getOffset(when.longValue())\n \t\t\t\t/ (60 * 1000);\n \t}\n-- \n1.5.4.rc4.25.g81cc\n"},{"id":"67454","messageId":"1202170534-15788-4-git-send-email-robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":"1202170534-15788-3-git-send-email-robin.rosenberg@dewire.com","subject":"[EGIT PATCH 3/6] Do not require javadoc in egit.core test project","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-05T00:15:31Z","receivedAt":"2008-02-05T00:15:31Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../.settings/org.eclipse.jdt.core.prefs           |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/org.spearce.egit.core.test/.settings/org.eclipse.jdt.core.prefs b/org.spearce.egit.core.test/.settings/org.eclipse.jdt.core.prefs\nindex fb1bc6e..fb77da2 100644\n--- a/org.spearce.egit.core.test/.settings/org.eclipse.jdt.core.prefs\n+++ b/org.spearce.egit.core.test/.settings/org.eclipse.jdt.core.prefs\n@@ -1,4 +1,4 @@\n-#Wed May 16 23:05:36 EDT 2007\n+#Sun Feb 03 03:52:00 CET 2008\n eclipse.preferences.version=1\n org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\n org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5\n@@ -34,7 +34,7 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private\n org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning\n org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error\n org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore\n-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning\n+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore\n org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled\n org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected\n org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error\n-- \n1.5.4.rc4.25.g81cc\n"},{"id":"67457","messageId":"1202170534-15788-5-git-send-email-robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":"1202170534-15788-4-git-send-email-robin.rosenberg@dewire.com","subject":"[EGIT PATCH 4/6] Javadoc update for Egit","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-05T00:15:32Z","receivedAt":"2008-02-05T00:15:32Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Also includes reduced visibility for a few methods.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../src/org/spearce/egit/core/Activator.java       |   31 +++++++\n .../src/org/spearce/egit/core/CoreText.java        |   29 +++++++\n .../spearce/egit/core/GitIndexFileRevision.java    |    8 ++\n .../src/org/spearce/egit/core/GitProvider.java     |    7 ++\n .../src/org/spearce/egit/core/GitStorage.java      |   10 ++\n .../src/org/spearce/egit/core/GitTag.java          |    7 ++\n .../egit/core/GitWorkspaceFileRevision.java        |   13 +++\n .../org/spearce/egit/core/internal/UpdateJob.java  |   10 ++\n .../internal/mapping/GitCommitFileRevision.java    |   19 ++++\n .../egit/core/internal/mapping/GitFileHistory.java |   22 +++++\n .../internal/mapping/GitFileHistoryProvider.java   |   22 +++++-\n .../core/internal/mapping/GitFileRevision.java     |   34 ++++++++\n .../org/spearce/egit/core/op/BranchOperation.java  |    9 ++\n .../org/spearce/egit/core/op/ResetOperation.java   |   22 +++++\n .../spearce/egit/core/project/CheckpointJob.java   |    9 ++\n .../spearce/egit/core/project/GitProjectData.java  |   60 +++++++++++++-\n .../egit/core/project/RepositoryMapping.java       |   87 ++++++++++++++++----\n 17 files changed, 379 insertions(+), 20 deletions(-)\n\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/Activator.java b/org.spearce.egit.core/src/org/spearce/egit/core/Activator.java\nindex e3dc3a5..214de61 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/Activator.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/Activator.java\n@@ -24,22 +24,45 @@ import org.eclipse.core.runtime.Status;\n import org.osgi.framework.BundleContext;\n import org.spearce.egit.core.project.GitProjectData;\n \n+/**\n+ * The plugin class for the org.spearce.egit.core plugin. This\n+ * is a singleton class.\n+ */\n public class Activator extends Plugin {\n \tprivate static Activator plugin;\n \n+\t/**\n+\t * @return the singleton {@link Activator}\n+\t */\n \tpublic static Activator getDefault() {\n \t\treturn plugin;\n \t}\n \n+\t/**\n+\t * @return the name of this plugin\n+\t */\n \tpublic static String getPluginId() {\n \t\treturn getDefault().getBundle().getSymbolicName();\n \t}\n \n+\t/**\n+\t * Utility method to help throwing errors in the Egit plugin. This method\n+\t * does not actually throw the exception, but just creates an instance.\n+\t *\n+\t * @param message User comprehensible message\n+\t * @param thr cause\n+\t * @return an Initialized {@link CoreException}\n+\t */\n \tpublic static CoreException error(final String message, final Throwable thr) {\n \t\treturn new CoreException(new Status(IStatus.ERROR, getPluginId(), 0,\n \t\t\t\tmessage, thr));\n \t}\n \n+\t/**\n+\t * Utility method to log errors in the Egit plugin.\n+\t * @param message User comprehensible message\n+\t * @param thr The exception through which we noticed the error\n+\t */\n \tpublic static void logError(final String message, final Throwable thr) {\n \t\tgetDefault().getLog().log(\n \t\t\t\tnew Status(IStatus.ERROR, getPluginId(), 0, message, thr));\n@@ -51,6 +74,11 @@ public class Activator extends Plugin {\n \t\treturn value != null && value.equals(\"true\");\n \t}\n \n+\t/**\n+\t * Utility method for debug logging.\n+\t *\n+\t * @param what\n+\t */\n \tpublic static void trace(final String what) {\n \t\tif (getDefault().traceVerbose) {\n \t\t\tSystem.out.println(\"[\" + getPluginId() + \"] \" + what);\n@@ -59,6 +87,9 @@ public class Activator extends Plugin {\n \n \tprivate boolean traceVerbose;\n \n+\t/**\n+\t * Construct the {@link Activator} singleton instance\n+\t */\n \tpublic Activator() {\n \t\tplugin = this;\n \t}\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java b/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java\nindex 7281c90..e1e1cb3 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/CoreText.java\n@@ -18,57 +18,86 @@ package org.spearce.egit.core;\n \n import org.eclipse.osgi.util.NLS;\n \n+/**\n+ * Possibly Translated strings for the Egit plugin.\n+ */\n public class CoreText extends NLS {\n+\t/** */\n \tpublic static String AssumeUnchangedOperation_failed;\n \n+\t/** */\n \tpublic static String AssumeUnchangedOperation_adding;\n \n+\t/** */\n \tpublic static String UpdateOperation_updating;\n \n+\t/** */\n \tpublic static String UpdateOperation_failed;\n \n+\t/** */\n \tpublic static String ConnectProviderOperation_connecting;\n \n+\t/** */\n \tpublic static String ConnectProviderOperation_creating;\n \n+\t/** */\n \tpublic static String ConnectProviderOperation_recordingMapping;\n \n+\t/** */\n \tpublic static String ConnectProviderOperation_updatingCache;\n \n+\t/** */\n \tpublic static String DisconnectProviderOperation_disconnecting;\n \n+\t/** */\n \tpublic static String AddOperation_adding;\n \n+\t/** */\n \tpublic static String AddOperation_failed;\n \n+\t/** */\n \tpublic static String UntrackOperation_adding;\n \n+\t/** */\n \tpublic static String UntrackOperation_failed;\n \n+\t/** */\n \tpublic static String GitProjectData_lazyResolveFailed;\n \n+\t/** */\n \tpublic static String GitProjectData_mappedResourceGone;\n \n+\t/** */\n \tpublic static String GitProjectData_cannotReadHEAD;\n \n+\t/** */\n \tpublic static String GitProjectData_missing;\n \n+\t/** */\n \tpublic static String GitProjectData_saveFailed;\n \n+\t/** */\n \tpublic static String GitProjectData_notifyChangedFailed;\n \n+\t/** */\n \tpublic static String RepositoryFinder_finding;\n \n+\t/** */\n \tpublic static String MoveDeleteHook_cannotModifyFolder;\n \n+\t/** */\n \tpublic static String MoveDeleteHook_operationError;\n \n+\t/** */\n \tpublic static String Error_CanonicalFile;\n \n+\t/** */\n \tpublic static String CheckpointJob_writing;\n \n+\t/** */\n \tpublic static String CheckpointJob_name;\n \n+\t/** */\n \tpublic static String CheckpointJob_failed;\n \n \tstatic {\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitIndexFileRevision.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitIndexFileRevision.java\nindex 9ef272c..daae33b 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitIndexFileRevision.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitIndexFileRevision.java\n@@ -24,9 +24,17 @@ import org.eclipse.team.core.history.IFileRevision;\n import org.spearce.egit.core.internal.mapping.GitFileRevision;\n import org.spearce.jgit.lib.ObjectId;\n \n+/**\n+ * An {@link IFileRevision} for the version in the Git index.\n+ */\n public class GitIndexFileRevision extends GitFileRevision implements\n \t\tIFileRevision {\n \n+\t/**\n+\t * Construct a GitIndexFileRevision matching a certain resource.\n+\t * @param resource The corresponding workspace resource\n+\t * @param count index into the full list of results\n+\t */\n \tpublic GitIndexFileRevision(IResource resource, int count) {\n \t\tsuper(resource, count);\n \t}\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java\nindex f31eec5..e42f6fa 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java\n@@ -23,6 +23,9 @@ import org.eclipse.team.core.history.IFileHistoryProvider;\n import org.spearce.egit.core.internal.mapping.GitFileHistoryProvider;\n import org.spearce.egit.core.project.GitProjectData;\n \n+/**\n+ * The Team provider class for a Git repository.\n+ */\n public class GitProvider extends RepositoryProvider {\n \tprivate GitProjectData data;\n \n@@ -53,6 +56,10 @@ public class GitProvider extends RepositoryProvider {\n \t\treturn hook;\n \t}\n \n+\t/**\n+\t * @return information about the mapping of an Eclipse project\n+\t * to a Git repository.\n+\t */\n \tpublic synchronized GitProjectData getData() {\n \t\tif (data == null) {\n \t\t\tdata = GitProjectData.get(getProject());\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitStorage.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitStorage.java\nindex f791e31..86943ed 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitStorage.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitStorage.java\n@@ -36,6 +36,9 @@ import org.spearce.jgit.lib.Tree;\n import org.spearce.jgit.lib.TreeEntry;\n import org.spearce.jgit.lib.GitIndex.Entry;\n \n+/**\n+ * Implements access to a Git managed version of a resource.\n+ */\n public class GitStorage implements IStorage {\n \n \tprivate final IResource resource;\n@@ -44,6 +47,13 @@ public class GitStorage implements IStorage {\n \n \tprivate ObjectId treeId;\n \n+\t/**\n+\t * Construct an GitStorage instance corresponding to\n+\t * a certain workspace resource.\n+\t *\n+\t * @param treeId\n+\t * @param resource\n+\t */\n \tpublic GitStorage(ObjectId treeId, IResource resource) {\n \t\tthis.treeId = treeId;\n \t\tthis.resource = resource;\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitTag.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitTag.java\nindex b8d7c11..86b908c 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitTag.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitTag.java\n@@ -18,10 +18,17 @@ package org.spearce.egit.core;\n \n import org.eclipse.team.core.history.ITag;\n \n+/**\n+ * A representation of a Git tag in Eclipse.\n+ */\n public class GitTag implements ITag {\n \n \tprivate String name;\n \n+\t/**\n+\t * Construct a GitTag object with a give name.\n+\t * @param name the Git tag name\n+\t */\n \tpublic GitTag(String name) {\n \t\tthis.name = name;\n \t}\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitWorkspaceFileRevision.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitWorkspaceFileRevision.java\nindex aad79b4..7142671 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitWorkspaceFileRevision.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitWorkspaceFileRevision.java\n@@ -23,9 +23,22 @@ import org.eclipse.core.runtime.IProgressMonitor;\n import org.eclipse.team.core.history.IFileRevision;\n import org.spearce.egit.core.internal.mapping.GitFileRevision;\n \n+/**\n+ * An {@link IFileRevision} for the version in workspace.\n+ */\n public class GitWorkspaceFileRevision extends GitFileRevision implements\n \t\tIFileRevision {\n \n+\t/**\n+\t * Construct a GitWorkspaceFileRevision matching a certain resource. This is\n+\t * the same as the resource, which the possible distinction that this is the\n+\t * version on disk when unsaved.\n+\t *\n+\t * @param resource\n+\t *            The corresponding workspace resource\n+\t * @param count\n+\t *            index into the full list of results\n+\t */\n \tpublic GitWorkspaceFileRevision(IResource resource, int count) {\n \t\tsuper(resource, count);\n \t}\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/internal/UpdateJob.java b/org.spearce.egit.core/src/org/spearce/egit/core/internal/UpdateJob.java\nindex 72b4190..a1476bf 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/internal/UpdateJob.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/internal/UpdateJob.java\n@@ -40,10 +40,20 @@ import org.spearce.jgit.errors.NotSupportedException;\n import org.spearce.jgit.lib.GitIndex;\n import org.spearce.jgit.lib.GitIndex.Entry;\n \n+/**\n+ * This job updates the index with the content of all specified\n+ * and tracked resources. If a project is selected all tracked\n+ * resources withing that container are updated.\n+ */\n public class UpdateJob extends Job {\n \n \tprivate final Collection rsrcList;\n \n+\t/**\n+\t * Construct an UpdateJob for the specified resources.\n+\t *\n+\t * @param rsrcList\n+\t */\n \tpublic UpdateJob(Collection rsrcList) {\n \t\tsuper(\"Update index\");\n \t\tthis.rsrcList = rsrcList;\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitCommitFileRevision.java b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitCommitFileRevision.java\nindex 6d6f7ea..0ed5a92 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitCommitFileRevision.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitCommitFileRevision.java\n@@ -38,10 +38,21 @@ import org.spearce.jgit.lib.Repository;\n import org.spearce.jgit.lib.Tree;\n import org.spearce.jgit.lib.TreeEntry;\n \n+/**\n+ * An {@link IFileRevision} for a version of a specified resource in the\n+ * specified commit (revision).\n+ */\n public class GitCommitFileRevision extends GitFileRevision {\n \n \tprivate final ObjectId commitId;\n \n+\t/**\n+\t * Construct a {@link GitCommitFileRevision} for a resource in a specified commit.\n+\t *\n+\t * @param commitId\n+\t * @param resource\n+\t * @param count index to full list of commits.\n+\t */\n \tpublic GitCommitFileRevision(ObjectId commitId, IResource resource, int count) {\n \t\tsuper(resource, count);\n \t\tthis.commitId = commitId;\n@@ -109,6 +120,11 @@ public class GitCommitFileRevision extends GitFileRevision {\n \t\treturn (ITag[]) ret.toArray(new ITag[ret.size()]);\n \t}\n \n+\t/**\n+\t * Maps the commit id of this object and\n+\t *\n+\t * @return the {@link Commit} object this {@link IFileRevision} refers to\n+\t */\n \tpublic Commit getCommit() {\n \t\ttry {\n \t\t\treturn RepositoryMapping.getMapping(getResource()).getRepository().mapCommit(commitId);\n@@ -121,6 +137,9 @@ public class GitCommitFileRevision extends GitFileRevision {\n \t\treturn commitId;\n \t}\n \n+\t/**\n+\t * @return the {@link TreeEntry} this {@link IFileRevision} refers to.\n+\t */\n \tpublic TreeEntry getTreeEntry() {\n \t\tRepositoryMapping repositoryMapping = RepositoryMapping.getMapping(getResource());\n \t\tTree tree;\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileHistory.java b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileHistory.java\nindex 2d06405..d1e5733 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileHistory.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileHistory.java\n@@ -48,6 +48,11 @@ import org.spearce.jgit.lib.Tree;\n import org.spearce.jgit.lib.TreeEntry;\n import org.spearce.jgit.lib.GitIndex.Entry;\n \n+/**\n+ * A list of revisions for a specific resource according to some\n+ * filtering criterion. Though git really does not do file tracking,\n+ * this corresponds to listing all files with the same path.\n+ */\n public class GitFileHistory extends FileHistory implements IAdaptable {\n \n \tprivate final IResource resource;\n@@ -60,6 +65,20 @@ public class GitFileHistory extends FileHistory implements IAdaptable {\n \n \tprivate final boolean returnAll;\n \n+\t/**\n+\t * Construct a {@link GitFileHistory} object for a given resource (path)\n+\t * with some filtering applied. The filter could reduces the number of\n+\t * commitgs returned or just mark some versions as interesting.\n+\t *\n+\t * @param resource\n+\t * @param flags\n+\t *            See {@link IFileHistoryProvider}\n+\t * @param monitor\n+\t *            progress reporting facility\n+\t * @param returnAll\n+\t *            true if all versions should be collected even if the filter\n+\t *            does not match.\n+\t */\n \tpublic GitFileHistory(IResource resource, int flags, IProgressMonitor monitor, boolean returnAll) {\n \t\tthis.resource = resource;\n \t\tthis.flags = flags;\n@@ -160,6 +179,9 @@ public class GitFileHistory extends FileHistory implements IAdaptable {\n \t\treturn revisions.toArray(new IFileRevision[revisions.size()]);\n \t}\n \n+\t/**\n+\t * @return the list of revisions. The list may be lazy-evaluated.\n+\t */\n \tpublic List<IFileRevision> getFileRevisionsList() {\n \t\treturn revisions;\n \t}\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileHistoryProvider.java b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileHistoryProvider.java\nindex 298009f..eb7961b 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileHistoryProvider.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileHistoryProvider.java\n@@ -25,13 +25,16 @@ import org.eclipse.team.core.history.IFileRevision;\n import org.eclipse.team.core.history.provider.FileHistoryProvider;\n import org.spearce.egit.core.GitWorkspaceFileRevision;\n \n+/**\n+ * A {@link FileHistoryProvider} for Git. This class has methods for\n+ * retrieving specific versions of a tracked resource.\n+ */\n public class GitFileHistoryProvider extends FileHistoryProvider implements\n \t\tIFileHistoryProvider {\n \n \tpublic IFileHistory getFileHistoryFor(IResource resource, int flags,\n \t\t\tIProgressMonitor monitor) {\n-\t\t// TODO: implement flags\n-\t\treturn new GitFileHistory(resource, flags, monitor, false); // TODO: implement flags\n+\t\treturn new GitFileHistory(resource, flags, monitor, false);\n \t}\n \n \tpublic IFileRevision getWorkspaceFileRevision(IResource resource) {\n@@ -44,6 +47,21 @@ public class GitFileHistoryProvider extends FileHistoryProvider implements\n \t\treturn null;\n \t}\n \n+\t/**\n+\t * Get the history for a given resource as viewed using the specified\n+\t * filtering flags.\n+\t *\n+\t * @param resource\n+\t * @param flags\n+\t *            See {@link IFileHistoryProvider}\n+\t * @param monitor\n+\t *            progress monitor\n+\t * @param returnAll\n+\t *            true if all revisions are returned and interesting revisiosn.\n+\t *\n+\t * @return a {@link GitFileHistory} object.\n+\t *\n+\t */\n \tpublic GitFileHistory getHistoryFor(IResource resource, int flags, IProgressMonitor monitor, boolean returnAll) {\n \t\treturn new GitFileHistory(resource, flags, monitor, returnAll); // TODO: implement flags\n \t}\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileRevision.java b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileRevision.java\nindex e11a24c..c309b9d 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileRevision.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/internal/mapping/GitFileRevision.java\n@@ -26,6 +26,11 @@ import org.eclipse.team.core.history.provider.FileRevision;\n import org.spearce.jgit.lib.ObjectId;\n import org.spearce.jgit.lib.TopologicalSorter;\n \n+/**\n+ * A Git related {@link IFileRevision}. It references a version\n+ * and a resource, i.e. the version we think corresponds to the\n+ * resource in specific version.\n+ */\n public abstract class GitFileRevision extends FileRevision {\n \n \tprivate final IResource resource;\n@@ -34,6 +39,12 @@ public abstract class GitFileRevision extends FileRevision {\n \n \tprivate TopologicalSorter<ObjectId>.Lane lane;\n \n+\t/**\n+\t * Construct a {@link GitFileRevision}\n+\t *\n+\t * @param resource\n+\t * @param count index into the full list of commits\n+\t */\n \tpublic GitFileRevision(IResource resource, int count) {\n \t\tthis.count = count;\n \t\tthis.resource = resource;\n@@ -56,20 +67,43 @@ public abstract class GitFileRevision extends FileRevision {\n \t\treturn resource.getLocationURI();\n \t}\n \n+\t/**\n+\t * @return the {@link IResource} the {@link IFileRevision} refers to.\n+\t */\n \tpublic IResource getResource() {\n \t\treturn resource;\n \t}\n \n+\t/**\n+\t * @deprecated\n+\t * @return index into full list of versions\n+\t */\n \tpublic int getCount() {\n \t\treturn count;\n \t}\n \n+\t/**\n+\t * @return the swim lane assigned by the graph layout\n+\t */\n \tpublic TopologicalSorter<ObjectId>.Lane getLane() {\n \t\treturn lane;\n \t}\n \n+\t/**\n+\t * Set the swim where this revision is found. Invoked by the\n+\t * graph layout.\n+\t *\n+\t * @param lane\n+\t */\n \tpublic void setLane(TopologicalSorter<ObjectId>.Lane lane) {\n \t\tthis.lane = lane;\n \t}\n \n+\t/**\n+\t * @return the ObjectId this IFileRevision refers to.\n+\t */\n+\tpublic ObjectId getCommitId() {\n+\t\treturn null;\n+\t}\n+\n }\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/BranchOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/BranchOperation.java\nindex f3a0ccb..f1d6cf7 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/BranchOperation.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/BranchOperation.java\n@@ -34,12 +34,21 @@ import org.spearce.jgit.lib.Repository;\n import org.spearce.jgit.lib.Tree;\n import org.spearce.jgit.lib.WorkDirCheckout;\n \n+/**\n+ * This class implements checkouts of a specific revision. A check\n+ * is made that this can be done without data loss.\n+ */\n public class BranchOperation implements IWorkspaceRunnable {\n \n \tprivate final Repository repository;\n \n \tprivate final String refName;\n \n+\t/**\n+\t * Construct a {@link BranchOperation} object.\n+\t * @param repository\n+\t * @param refName Name of git ref to checkout\n+\t */\n \tpublic BranchOperation(Repository repository, String refName) {\n \t\tthis.repository = repository;\n \t\tthis.refName = refName;\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/ResetOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/ResetOperation.java\nindex 3c5b9bb..9fd5db1 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/ResetOperation.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/ResetOperation.java\n@@ -36,10 +36,25 @@ import org.spearce.jgit.lib.Tag;\n import org.spearce.jgit.lib.Tree;\n import org.spearce.jgit.lib.WorkDirCheckout;\n \n+/**\n+ * An class for changing a ref and possibly index and workdir too.\n+ */\n public class ResetOperation implements IWorkspaceRunnable {\n+\t/**\n+\t * Kind of reset\n+\t */\n \tpublic enum ResetType {\n+\t\t/**\n+\t\t * Just change the ref. The index and workdir are not changed.\n+\t\t */\n \t\tSOFT,\n+\t\t/**\n+\t\t * Change the ref and the index. The workdir is not changed.\n+\t\t */\n \t\tMIXED,\n+\t\t/**\n+\t\t * Change the ref, the index and the workdir\n+\t\t */\n \t\tHARD\n \t}\n \t\n@@ -52,6 +67,13 @@ public class ResetOperation implements IWorkspaceRunnable {\n \tprivate Tree newTree;\n \tprivate GitIndex index;\n \n+\t/**\n+\t * Construct a {@link ResetOperation}\n+\t *\n+\t * @param repository\n+\t * @param refName\n+\t * @param type\n+\t */\n \tpublic ResetOperation(Repository repository, String refName, ResetType type) {\n \t\tthis.repository = repository;\n \t\tthis.refName = refName;\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/CheckpointJob.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/CheckpointJob.java\nindex acc8f1f..bc8e8ed 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/CheckpointJob.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/CheckpointJob.java\n@@ -31,10 +31,19 @@ import org.spearce.egit.core.CoreText;\n import org.spearce.jgit.lib.GitIndex;\n import org.spearce.jgit.lib.GitIndex.Entry;\n \n+/**\n+ * This class updates the index with the content of all resources tracked by git\n+ * in the index.\n+ */\n public class CheckpointJob extends Job {\n \n \tprivate final RepositoryMapping rm;\n \n+\t/**\n+\t * Construct a {@link CheckpointJob} for the specified resource maping\n+\t *\n+\t * @param m\n+\t */\n \tpublic CheckpointJob(final RepositoryMapping m) {\n \t\tsuper(NLS.bind(CoreText.CheckpointJob_name, m.getContainer()\n \t\t\t\t.getFullPath()));\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java\nindex 97bb282..9e4cd87 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java\n@@ -48,6 +48,10 @@ import org.spearce.egit.core.CoreText;\n import org.spearce.egit.core.GitProvider;\n import org.spearce.jgit.lib.Repository;\n \n+/**\n+ * This class keeps information about how a project is mapped to\n+ * a Git repository.\n+ */\n public class GitProjectData {\n \tprivate static final Map projectDataCache = new HashMap();\n \n@@ -78,6 +82,11 @@ public class GitProjectData {\n \t\t}\n \t}\n \n+\t/**\n+\t * Start listening for resource changes.\n+\t *\n+\t * @param includeChange true to listen to content changes\n+\t */\n \tpublic static void attachToWorkspace(final boolean includeChange) {\n \t\ttrace(\"attachToWorkspace - addResourceChangeListener\");\n \t\tResourcesPlugin.getWorkspace().addResourceChangeListener(\n@@ -87,6 +96,9 @@ public class GitProjectData {\n \t\t\t\t\t\t| IResourceChangeEvent.PRE_DELETE);\n \t}\n \n+\t/**\n+\t * Stop listening to resource changes\n+\t */\n \tpublic static void detachFromWorkspace() {\n \t\ttrace(\"detachFromWorkspace - removeResourceChangeListener\");\n \t\tResourcesPlugin.getWorkspace().removeResourceChangeListener(rcl);\n@@ -134,6 +146,10 @@ public class GitProjectData {\n \t\treturn repositoryChangeListeners;\n \t}\n \n+\t/**\n+\t * @param p\n+\t * @return {@link GitProjectData} for the specified project\n+\t */\n \tpublic synchronized static GitProjectData get(final IProject p) {\n \t\ttry {\n \t\t\tGitProjectData d = lookup(p);\n@@ -149,6 +165,11 @@ public class GitProjectData {\n \t\t}\n \t}\n \n+\t/**\n+\t * Drop the Eclipse project from our assocation of projects/repositories\n+\t *\n+\t * @param p Eclipse project\n+\t */\n \tpublic static void delete(final IProject p) {\n \t\ttrace(\"delete(\" + p.getName() + \")\");\n \t\tGitProjectData d = lookup(p);\n@@ -218,6 +239,12 @@ public class GitProjectData {\n \n \tprivate final Set protectedResources;\n \n+\t/**\n+\t * Construct a {@link GitProjectData} for the mapping\n+\t * of a project.\n+\t *\n+\t * @param p Eclipse project\n+\t */\n \tpublic GitProjectData(final IProject p) {\n \t\tproject = p;\n \t\tmappings = new ArrayList();\n@@ -225,16 +252,29 @@ public class GitProjectData {\n \t\tprotectedResources = new HashSet();\n \t}\n \n+\t/**\n+\t * @return the Eclipse project mapped through this resource.\n+\t */\n \tpublic IProject getProject() {\n \t\treturn project;\n \t}\n \n+\t/**\n+\t * TODO: is this right?\n+\t *\n+\t * @param newMappings\n+\t */\n \tpublic void setRepositoryMappings(final Collection newMappings) {\n \t\tmappings.clear();\n \t\tmappings.addAll(newMappings);\n \t\tremapAll();\n \t}\n \n+\t/**\n+\t * Hide our private parts from the navigators other browsers.\n+\t *\n+\t * @throws CoreException\n+\t */\n \tpublic void markTeamPrivateResources() throws CoreException {\n \t\tfinal Iterator i = c2mapping.entrySet().iterator();\n \t\twhile (i.hasNext()) {\n@@ -258,15 +298,26 @@ public class GitProjectData {\n \t\t}\n \t}\n \n+\t/**\n+\t * @param f\n+\t * @return true if a resource is protected in this repository\n+\t */\n \tpublic boolean isProtected(final IResource f) {\n \t\treturn protectedResources.contains(f);\n \t}\n \n+\t/**\n+\t * TODO: check usage, we should probably declare the parameter\n+\t * as IProject.\n+\t *\n+\t * @param r Eclipse project\n+\t * @return the mapping for the specified project\n+\t */\n \tpublic RepositoryMapping getRepositoryMapping(final IResource r) {\n \t\treturn (RepositoryMapping) c2mapping.get(r);\n \t}\n \n-\tpublic void delete() {\n+\tprivate void delete() {\n \t\tfinal File dir = propertyFile().getParentFile();\n \t\tfinal File[] todel = dir.listFiles();\n \t\tif (todel != null) {\n@@ -281,6 +332,11 @@ public class GitProjectData {\n \t\tuncache(getProject());\n \t}\n \n+\t/**\n+\t * Store information about the repository connection in the workspace\n+\t *\n+\t * @throws CoreException\n+\t */\n \tpublic void store() throws CoreException {\n \t\tfinal File dat = propertyFile();\n \t\tfinal File tmp;\n@@ -385,7 +441,7 @@ public class GitProjectData {\n \t\t\t// We are in deep trouble. This should NOT have happend. Detach\n \t\t\t// our listeners and forget it ever did.\n \t\t\t//\n-\t\t\tattachToWorkspace(false);\n+\t\t\tdetachFromWorkspace();\n \t\t\tActivator.logError(CoreText.GitProjectData_notifyChangedFailed, ce);\n \t\t}\n \ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java\nindex b062a29..754a172 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java\n@@ -37,8 +37,11 @@ import org.spearce.jgit.lib.Tree;\n import org.spearce.jgit.lib.TreeEntry;\n import org.spearce.jgit.lib.GitIndex.Entry;\n \n+/**\n+ * This class keeps track\n+ */\n public class RepositoryMapping {\n-\tpublic static boolean isInitialKey(final String key) {\n+\tstatic boolean isInitialKey(final String key) {\n \t\treturn key.endsWith(\".gitdir\");\n \t}\n \n@@ -52,6 +55,12 @@ public class RepositoryMapping {\n \n \tprivate IContainer container;\n \n+\t/**\n+\t * Construct a {@link RepositoryMapping} for a previously connected project.\n+\t *\n+\t * @param p TODO\n+\t * @param initialKey TODO\n+\t */\n \tpublic RepositoryMapping(final Properties p, final String initialKey) {\n \t\tfinal int dot = initialKey.lastIndexOf('.');\n \t\tString s;\n@@ -62,6 +71,14 @@ public class RepositoryMapping {\n \t\tsubset = \"\".equals(s) ? null : s;\n \t}\n \n+\t/**\n+\t * Construct a {@link RepositoryMapping} for previously\n+\t * unknown project.\n+\t *\n+\t * @param mappedContainer\n+\t * @param gitDir\n+\t * @param subsetRoot\n+\t */\n \tpublic RepositoryMapping(final IContainer mappedContainer,\n \t\t\tfinal File gitDir, final String subsetRoot) {\n \t\tfinal IPath cLoc = mappedContainer.getLocation()\n@@ -103,55 +120,75 @@ public class RepositoryMapping {\n \t\t}\n \t}\n \n-\tpublic IPath getContainerPath() {\n+\tIPath getContainerPath() {\n \t\treturn Path.fromPortableString(containerPath);\n \t}\n \n-\tpublic IPath getGitDirPath() {\n+\tIPath getGitDirPath() {\n \t\treturn Path.fromPortableString(gitdirPath);\n \t}\n \n+\t/**\n+\t * Eclipse projects typically reside one or more levels\n+\t * below the repository. This method return the relative\n+\t * path to the project. Null is returned instead of \"\".\n+\t *\n+\t * @return relative path from repository to project, or null\n+\t */\n \tpublic String getSubset() {\n \t\treturn subset;\n \t}\n \n+\t/**\n+\t * @return the workdir file, i.e. where the files are checked out\n+\t */\n \tpublic File getWorkDir() {\n-//\t\tassert containerPath.endsWith(\"/\" + subset);\n-//\t\treturn Path.fromPortableString(\n-//\t\t\t\tcontainerPath.substring(containerPath.length() - 1\n-//\t\t\t\t\t\t- subset.length())).toFile();\n \t\treturn getRepository().getDirectory().getParentFile();\n \t}\n \n-\tpublic synchronized void clear() {\n+\tsynchronized void clear() {\n \t\tdb = null;\n \t\tcontainer = null;\n \t}\n \n+\t/**\n+\t * @return a reference to the repository object handled by this mapping\n+\t */\n \tpublic synchronized Repository getRepository() {\n \t\treturn db;\n \t}\n \n-\tpublic synchronized void setRepository(final Repository r) {\n+\tsynchronized void setRepository(final Repository r) {\n \t\tdb = r;\n \t}\n \n+\t/**\n+\t * @return the mapped container (currently project)\n+\t */\n \tpublic synchronized IContainer getContainer() {\n \t\treturn container;\n \t}\n \n-\tpublic synchronized void setContainer(final IContainer c) {\n+\tsynchronized void setContainer(final IContainer c) {\n \t\tcontainer = c;\n \t}\n \n-\tpublic synchronized void fullUpdate() {\n-\t\trecomputeMerge();\n-\t}\n-\n+\t/**\n+\t * @deprecated, leftover from the old \"index\"\n+\t * TODO: rename or replace\n+\t */\n \tpublic synchronized void recomputeMerge() {\n \t\tGitProjectData.fireRepositoryChanged(this);\n \t}\n \n+\t/**\n+\t * Retrieve the Git tree object matching the currently\n+\t * checked out version.\n+\t *\n+\t * @return the Git Tree matching the container mapped\n+\t * @throws IOException on general problems accessing the repository\n+\t * @throws MissingObjectException something is missing\n+\t */\n \tpublic synchronized Tree mapHEADTree() throws IOException,\n \t\t\tMissingObjectException {\n \t\tTree head = getRepository().mapTree(Constants.HEAD);\n@@ -168,7 +205,7 @@ public class RepositoryMapping {\n \t\treturn head;\n \t}\n \n-\tpublic synchronized void store(final Properties p) {\n+\tsynchronized void store(final Properties p) {\n \t\tp.setProperty(containerPath + \".gitdir\", gitdirPath);\n \t\tif (subset != null && !\"\".equals(subset)) {\n \t\t\tp.setProperty(containerPath + \".subset\", subset);\n@@ -179,6 +216,19 @@ public class RepositoryMapping {\n \t\treturn \"RepositoryMapping[\" + containerPath + \" -> \" + gitdirPath + \"]\";\n \t}\n \n+\t/**\n+\t * Check whether a resource has been changed relative to the checked out\n+\t * version. Content is assumed changed by this routine if the resource's\n+\t * modification time differs from what is recorded in the index, but the\n+\t * real content hasn't changed. The reason is performance.\n+\t *\n+\t * @param rsrc\n+\t * @return true if a resource differs in the workdir or index relative to\n+\t *         HEAD\n+\t *\n+\t * @throws IOException\n+\t * @throws UnsupportedEncodingException\n+\t */\n \tpublic boolean isResourceChanged(IResource rsrc) throws IOException, UnsupportedEncodingException {\n \t\tRepository repository = getRepository();\n \t\tGitIndex index = repository.getIndex();\n@@ -193,10 +243,13 @@ public class RepositoryMapping {\n \t\tif (blob == null)\n \t\t\treturn true; // added in index\n \t\tboolean hashesDiffer = !entry.getObjectId().equals(blob.getId());\n-//\t\tSystem.out.println(\"HashesDiffer: \" + rsrc);\n \t\treturn hashesDiffer || entry.isModified(getWorkDir());\n \t}\n \n+\t/**\n+\t * @param rsrc\n+\t * @return the path relative to the Git repository, including base name.\n+\t */\n \tpublic String getRepoRelativePath(IResource rsrc) {\n \t\tString prefix = getSubset();\n \t\tString projectRelativePath = rsrc.getProjectRelativePath().toString();\n@@ -208,6 +261,8 @@ public class RepositoryMapping {\n \t\t\t\trepoRelativePath = prefix + \"/\" + projectRelativePath;\n \t\t} else\n \t\t\trepoRelativePath = projectRelativePath;\n+\n+\t\tassert repoRelativePath != null;\n \t\treturn repoRelativePath;\n \t}\n \n-- \n1.5.4.rc4.25.g81cc\n"},{"id":"67456","messageId":"1202170534-15788-6-git-send-email-robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":"1202170534-15788-5-git-send-email-robin.rosenberg@dewire.com","subject":"[EGIT PATCH 5/6] Drop unused GitBlobStorage class","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-05T00:15:33Z","receivedAt":"2008-02-05T00:15:33Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../src/org/spearce/egit/core/GitBlobStorage.java  |   99 --------------------\n 1 files changed, 0 insertions(+), 99 deletions(-)\n delete mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/GitBlobStorage.java\n\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitBlobStorage.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitBlobStorage.java\ndeleted file mode 100644\nindex f7a062c..0000000\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitBlobStorage.java\n+++ /dev/null\n@@ -1,99 +0,0 @@\n-/*\n- *  Copyright (C) 2006  Robin Rosenberg\n- *\n- *  This library is free software; you can redistribute it and/or\n- *  modify it under the terms of the GNU Lesser General Public\n- *  License, version 2.1, as published by the Free Software Foundation.\n- *\n- *  This library is distributed in the hope that it will be useful,\n- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n- *  Lesser General Public License for more details.\n- *\n- *  You should have received a copy of the GNU Lesser General Public\n- *  License along with this library; if not, write to the Free Software\n- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301\n- */\n-package org.spearce.egit.core;\n-\n-import java.io.ByteArrayInputStream;\n-import java.io.FileNotFoundException;\n-import java.io.IOException;\n-import java.io.InputStream;\n-\n-import org.eclipse.core.internal.resources.ResourceException;\n-import org.eclipse.core.resources.IFile;\n-import org.eclipse.core.resources.IResource;\n-import org.eclipse.core.resources.IResourceStatus;\n-import org.eclipse.core.resources.IStorage;\n-import org.eclipse.core.runtime.CoreException;\n-import org.eclipse.core.runtime.IPath;\n-import org.spearce.egit.core.project.RepositoryMapping;\n-import org.spearce.jgit.lib.ObjectId;\n-import org.spearce.jgit.lib.ObjectLoader;\n-import org.spearce.jgit.lib.Tree;\n-import org.spearce.jgit.lib.TreeEntry;\n-\n-public class GitBlobStorage implements IStorage {\n-\n-\tprivate final IResource resource;\n-\n-\tprivate TreeEntry entry;\n-\n-\tpublic GitBlobStorage(ObjectId treeId, IResource resource, String relativeResourceName) {\n-\t\tthis.resource = resource;\n-\t\tif (treeId == null)\n-\t\t\treturn;\n-\n-\t\tRepositoryMapping repositoryMapping = RepositoryMapping.getMapping(resource);\n-\t\tTree tree;\n-\t\ttry {\n-\t\t\ttree = repositoryMapping.getRepository().mapTree(treeId);\n-\t\t\tString name = repositoryMapping.getRepoRelativePath(resource);\n-\t\t\tentry = tree.findBlobMember(name);\n-\t\t} catch (IOException e) {\n-\t\t\t// TODO Auto-generated catch block\n-\t\t\te.printStackTrace();\n-\t\t}\n-\t}\n-\n-\tpublic InputStream getContents() throws CoreException {\n-\t\ttry {\n-\t\t\tif (entry == null) {\n-\t\t\t\treturn ((IFile) resource).getContents();\n-\t\t\t} else {\n-\t\t\t\tObjectId id = entry.getId();\n-\t\t\t\tObjectLoader reader = entry.getRepository().openBlob(id);\n-\t\t\t\tbyte[] bytes = reader.getBytes();\n-\t\t\t\treturn new ByteArrayInputStream(bytes);\n-\t\t\t}\n-\t\t} catch (FileNotFoundException e) {\n-\t\t\tthrow new ResourceException(IResourceStatus.FAILED_READ_LOCAL,\n-\t\t\t\t\tresource.getFullPath(), \"Could not read file\", e);\n-\t\t} catch (IOException e) {\n-\t\t\t// TODO Auto-generated catch block\n-\t\t\te.printStackTrace();\n-\t\t\tthrow new ResourceException(33, resource.getFullPath(), e\n-\t\t\t\t\t.getMessage(), e);\n-\t\t}\n-\t}\n-\n-\tpublic IPath getFullPath() {\n-\t\treturn resource.getFullPath();\n-\t}\n-\n-\tpublic String getName() {\n-\t\treturn resource.getName();\n-\t}\n-\n-\tpublic boolean isReadOnly() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic Object getAdapter(Class adapter) {\n-\t\tSystem.out.println(\"GitStorage(\"+adapter.getName()+\")\");\n-\t\treturn null;\n-\t}\n-\n-}\n-- \n1.5.4.rc4.25.g81cc\n"},{"id":"67453","messageId":"1202170534-15788-7-git-send-email-robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":"1202170534-15788-6-git-send-email-robin.rosenberg@dewire.com","subject":"[EGIT PATCH 6/6] Tighten requirements on javadoc.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-05T00:15:34Z","receivedAt":"2008-02-05T00:15:34Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"All public and protected methods and members must be documented.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../.settings/org.eclipse.jdt.core.prefs           |    4 ++--\n .../.settings/org.eclipse.jdt.core.prefs           |    4 ++--\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/org.spearce.egit.core/.settings/org.eclipse.jdt.core.prefs b/org.spearce.egit.core/.settings/org.eclipse.jdt.core.prefs\nindex 322fe98..f94f9a8 100644\n--- a/org.spearce.egit.core/.settings/org.eclipse.jdt.core.prefs\n+++ b/org.spearce.egit.core/.settings/org.eclipse.jdt.core.prefs\n@@ -1,4 +1,4 @@\n-#Wed May 16 23:05:48 EDT 2007\n+#Sun Feb 03 18:48:30 CET 2008\n eclipse.preferences.version=1\n org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\n org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5\n@@ -34,7 +34,7 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private\n org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning\n org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error\n org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore\n-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning\n+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error\n org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled\n org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected\n org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error\ndiff --git a/org.spearce.jgit.test/.settings/org.eclipse.jdt.core.prefs b/org.spearce.jgit.test/.settings/org.eclipse.jdt.core.prefs\nindex 15190a0..8bfa5f1 100644\n--- a/org.spearce.jgit.test/.settings/org.eclipse.jdt.core.prefs\n+++ b/org.spearce.jgit.test/.settings/org.eclipse.jdt.core.prefs\n@@ -1,4 +1,4 @@\n-#Thu Dec 20 01:31:35 CET 2007\n+#Tue Feb 05 00:01:29 CET 2008\n eclipse.preferences.version=1\n org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\n org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5\n@@ -37,7 +37,7 @@ org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore\n org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore\n org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled\n org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public\n-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore\n+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error\n org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled\n org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private\n org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore\n-- \n1.5.4.rc4.25.g81cc\n"},{"id":"67522","messageId":"47A87C26.2070307@intelinet.com.br","threadId":"11890","inReplyTo":"1202170534-15788-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [EGIT PATCH Series] Cleanups and javadocs","fromName":"Roger C. Soares","fromEmail":"rogersoares@intelinet.com.br","sentAt":"2008-02-05T15:09:26Z","receivedAt":"2008-02-05T15:09:26Z","isPatch":true,"sender":{"key":"rogersoares@intelinet.com.br","avatar":null},"body":"\nRobin Rosenberg escreveu:\n> Here is a number of small enhancements that reduce the number of warnings\n> displayed and raises the standard on comments. We now get javadoc comments\n> on all public and protected methods which hopefully will make it slighly\n> easier to get on the train for those interested in helping out with Egit/Jgit.\n>\n> Disabling the else-warning is probably fairly uncontroversial. Disabling some\n> warning about boxing/unboxing of integers might be as might be requiring\n> javadoc comments.\n>\n>   \nHi Robin,\n\n[2, 3, 5 and 6] - looks fine to me.\n\n[1] - What about something like \"nothing to be done here\" and/or \n\"implementing interface method\"?\n\n[4] - Some typos:\n+     * Construct an GitStorage instance corresponding to\n+     * Construct a GitTag object with a give name.\n+     * with some filtering applied. The filter could reduces the number of\n+     * commitgs returned or just mark some versions as interesting.\n+     *            true if all revisions are returned and interesting \nrevisiosn.\n+ * An class for changing a ref and possibly index and workdir too.\n+     * Construct a {@link CheckpointJob} for the specified resource maping\n+     * Drop the Eclipse project from our assocation of \nprojects/repositories\n\nAnd\n+    /**\n+     * Maps the commit id of this object and\n+     *\n+     * @return the {@link Commit} object this {@link IFileRevision} \nrefers to\n+     */\nand what?\n\n[]s,\nRoger.\n"},{"id":"67561","messageId":"200802052247.47744.robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":"47A87C26.2070307@intelinet.com.br","subject":"Re: [EGIT PATCH Series] Cleanups and javadocs","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-05T21:47:47Z","receivedAt":"2008-02-05T21:47:47Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdagen den 5 februari 2008 skrev Roger C. Soares:\n> \n> Robin Rosenberg escreveu:\n> > Here is a number of small enhancements that reduce the number of warnings\n> > displayed and raises the standard on comments. We now get javadoc comments\n> > on all public and protected methods which hopefully will make it slighly\n> > easier to get on the train for those interested in helping out with Egit/Jgit.\n> >\n> > Disabling the else-warning is probably fairly uncontroversial. Disabling some\n> > warning about boxing/unboxing of integers might be as might be requiring\n> > javadoc comments.\n> >\n> >   \n> Hi Robin,\n> \n> [2, 3, 5 and 6] - looks fine to me.\nThanks for looking.\n\n> [1] - What about something like \"nothing to be done here\" and/or \n> \"implementing interface method\"?\n\"Empty\" is a marker that the block is *intentionally* empty, which\nis the point here.\n\n> [4] - Some typos:\nThanks\n\n-- robin\n"},{"id":"67619","messageId":"20080206070631.GM24004@spearce.org","threadId":"11890","inReplyTo":"1202170534-15788-3-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [EGIT PATCH 2/6] Cleanup unboxing/boxing","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-02-06T07:06:31Z","receivedAt":"2008-02-06T07:06:31Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Robin Rosenberg <robin.rosenberg@dewire.com> wrote:\n> These operation are relatively expensive in general so it is good to make them\n> visible, but when they are needed a lot we just want to do without explicit conversion\n> so we ignore the warning there.\n> @@ -207,7 +207,7 @@ public class GitResourceDecorator extends LabelProvider implements\n>  \t\t\t\t\treturn Boolean.FALSE;\n>  \t\t\t\t}\n>  \n> -\t\t\t\treturn mapped.isResourceChanged(rsrc);\n> +\t\t\t\treturn new Boolean(mapped.isResourceChanged(rsrc));\n>  \t\t\t}\n>  \t\t\treturn null; // not mapped\n>  \t\t} catch (CoreException e) {\n\nOooooooow.  That hurts.\n\nUse Boolean.valueOf(boolean) instead of new Boolean.  It recycles\nthe cached Boolean.TRUE and Boolean.FALSE and thus avoids creating\ngarbage that the GC needs to reclaim later.\n\n> @@ -358,7 +358,7 @@ public class GitResourceDecorator extends LabelProvider implements\n>  \t\ttry {\n>  \t\t\tInteger dirty = (Integer) rsrc.getSessionProperty(GITFOLDERDIRTYSTATEPROPERTY);\n>  \t\t\tif (dirty == null) {\n> -\t\t\t\trsrc.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, flag);\n> +\t\t\t\trsrc.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, new Integer(flag));\n>  \t\t\t\tActivator.trace(\"SETTING:\"+rsrc.getFullPath().toOSString()+\" => \"+flag);\n>  \t\t\t\torState(rsrc.getParent(), flag);\n>  \t\t\t\tDisplay.getDefault().asyncExec(new Runnable() {\n\nUse Integer.valueOf(int).  Post Java 5 implementations of the J2SE\nare required to cache values between -128 and 127 (inclusive).\n\nActually, when the Java compiler autoboxes values it does so through\nthese static valueOf methods, which were mostly introduced as part\nof the Java 5 API updates.  For small common values its cached and\nwill thus avoid garbage generation, for less common values it goes\nback to allocating the object.\n\n-- \nShawn.\n"},{"id":"67697","messageId":"200802062114.16756.robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":"20080206070631.GM24004@spearce.org","subject":"[EGIT PATCH 1/2] Use Boolean.valueOf instead of new Boolean","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-06T20:14:15Z","receivedAt":"2008-02-06T20:14:15Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"onsdagen den 6 februari 2008 skrev Shawn O. Pearce:\n> Robin Rosenberg <robin.rosenberg@dewire.com> wrote:\n> > These operation are relatively expensive in general so it is good to make them\n> > visible, but when they are needed a lot we just want to do without explicit conversion\n> > so we ignore the warning there.\n> > @@ -207,7 +207,7 @@ public class GitResourceDecorator extends LabelProvider implements\n> >  \t\t\t\t\treturn Boolean.FALSE;\n> >  \t\t\t\t}\n> >  \n> > -\t\t\t\treturn mapped.isResourceChanged(rsrc);\n> > +\t\t\t\treturn new Boolean(mapped.isResourceChanged(rsrc));\n> >  \t\t\t}\n> >  \t\t\treturn null; // not mapped\n> >  \t\t} catch (CoreException e) {\n> \n> Oooooooow.  That hurts.\nSorry :/\n\nI reuse Date and String, and Integer object elsewhere all the time, but the obvious\nsolution is too simple :)\n\nThanks Shawn.\n\n-- robin\n\n>From 4fbd3de89c53956abfbc1a4bb08113c6a9f83ab3 Mon Sep 17 00:00:00 2001\nFrom: Robin Rosenberg <robin.rosenberg@dewire.com>\nDate: Wed, 6 Feb 2008 18:40:25 +0100\nSubject: [EGIT PATCH 1/2] Use Boolean.valueOf instead of new Boolean\n\nThis use two singleton Booleans instead of allocating new\nobjects.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../internal/decorators/GitResourceDecorator.java  |    4 ++--\n .../src/org/spearce/jgit/lib/GitIndex.java         |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java \nb/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\nindex 7eb008b..9592817 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\n@@ -207,7 +207,7 @@ public class GitResourceDecorator extends LabelProvider implements\n \t\t\t\t\treturn Boolean.FALSE;\n \t\t\t\t}\n \n-\t\t\t\treturn new Boolean(mapped.isResourceChanged(rsrc));\n+\t\t\t\treturn Boolean.valueOf(mapped.isResourceChanged(rsrc));\n \t\t\t}\n \t\t\treturn null; // not mapped\n \t\t} catch (CoreException e) {\n@@ -245,7 +245,7 @@ public class GitResourceDecorator extends LabelProvider implements\n \t\t\t\t\t\t\tInteger df = (Integer) rsrc\n \t\t\t\t\t\t\t\t\t.getSessionProperty(GITFOLDERDIRTYSTATEPROPERTY);\n \t\t\t\t\t\t\tBoolean f = df == null ? isDirty(rsrc)\n-\t\t\t\t\t\t\t\t\t: new Boolean(df.intValue() == CHANGED);\n+\t\t\t\t\t\t\t\t\t: Boolean.valueOf(df.intValue() == CHANGED);\n \t\t\t\t\t\t\tif (f != null) {\n \t\t\t\t\t\t\t\tif (f.booleanValue()) {\n \t\t\t\t\t\t\t\t\tdecoration.addPrefix(\">\"); // Have not\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java\nindex 69ed270..3cd9de9 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java\n@@ -290,7 +290,7 @@ public class GitIndex {\n \t\tif (setExecute != null) {\n \t\t\ttry {\n \t\t\t\treturn ((Boolean) setExecute.invoke(f,\n-\t\t\t\t\t\tnew Object[] { new Boolean(value) })).booleanValue();\n+\t\t\t\t\t\tnew Object[] { Boolean.valueOf(value) })).booleanValue();\n \t\t\t} catch (IllegalArgumentException e) {\n \t\t\t\tthrow new Error(e);\n \t\t\t} catch (IllegalAccessException e) {\n-- \n1.5.4.rc4.25.g81cc\n"},{"id":"67698","messageId":"200802062115.38212.robin.rosenberg@dewire.com","threadId":"11890","inReplyTo":"20080206070631.GM24004@spearce.org","subject":"[EGIT PATCH 2/2] Use Integer.valueOf instead of new Integer","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-06T20:15:37Z","receivedAt":"2008-02-06T20:15:37Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"onsdagen den 6 februari 2008 skrev Shawn O. Pearce:\n> Use Integer.valueOf(int).  Post Java 5 implementations of the J2SE\n> are required to cache values between -128 and 127 (inclusive).\n> \n> Actually, when the Java compiler autoboxes values it does so through\n> these static valueOf methods, which were mostly introduced as part\n> of the Java 5 API updates.  For small common values its cached and\n> will thus avoid garbage generation, for less common values it goes\n> back to allocating the object.\n\nThank you for this information.\n\n-- robin\n\n>From 2f2248fc01c169d85e88d42d10693e4ec59a0c1d Mon Sep 17 00:00:00 2001\nFrom: Robin Rosenberg <robin.rosenberg@dewire.com>\nDate: Wed, 6 Feb 2008 21:06:08 +0100\nSubject: [EGIT PATCH 2/2] Use Integer.valueOf instead of new Integer\n\nJava 1.5+ has a cache for small numbers.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../src/org/spearce/egit/ui/FindResults.java       |   10 +++++-----\n .../internal/decorators/GitResourceDecorator.java  |    4 ++--\n .../tst/org/spearce/jgit/lib/MappedListTest.java   |    8 ++++----\n .../tst/org/spearce/jgit/lib/SuperListTest.java    |   12 ++++++------\n .../src/org/spearce/jgit/lib/SuperList.java        |    2 +-\n .../org/spearce/jgit/lib/TopologicalSorter.java    |    8 ++++----\n 6 files changed, 22 insertions(+), 22 deletions(-)\n\nThanks to Shawn\n\n-- robin\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/FindResults.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/FindResults.java\nindex 9484503..2b49597 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/FindResults.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/FindResults.java\n@@ -45,7 +45,7 @@ public class FindResults {\n \t *         <code>false</code> otherwise\n \t */\n \tpublic synchronized boolean isFoundAt(int index) {\n-\t\treturn matchesMap.containsKey(new Integer(index));\n+\t\treturn matchesMap.containsKey(Integer.valueOf(index));\n \t}\n \n \t/**\n@@ -59,7 +59,7 @@ public class FindResults {\n \t */\n \tpublic synchronized int getIndexAfter(int index) {\n \t\tInteger[] matches = getkeysArray();\n-\t\tint sres = Arrays.binarySearch(matches, new Integer(index));\n+\t\tint sres = Arrays.binarySearch(matches, Integer.valueOf(index));\n \t\tif (sres >= 0 && sres != matches.length - 1) {\n \t\t\treturn matches[sres + 1].intValue();\n \t\t} else if (sres < 0) {\n@@ -83,7 +83,7 @@ public class FindResults {\n \t */\n \tpublic synchronized int getIndexBefore(int index) {\n \t\tInteger[] matches = getkeysArray();\n-\t\tint sres = Arrays.binarySearch(matches, new Integer(index));\n+\t\tint sres = Arrays.binarySearch(matches, Integer.valueOf(index));\n \t\tif (sres >= 0 && sres != 0) {\n \t\t\treturn matches[sres - 1].intValue();\n \t\t} else if (sres < -1) {\n@@ -136,7 +136,7 @@ public class FindResults {\n \t *         list. Returns -1 if <code>index</code> doesn't contain a match\n \t */\n \tpublic synchronized int getMatchNumberFor(int index) {\n-\t\tInteger ix = matchesMap.get(new Integer(index));\n+\t\tInteger ix = matchesMap.get(Integer.valueOf(index));\n \t\tif (ix != null) {\n \t\t\treturn ix.intValue();\n \t\t}\n@@ -168,7 +168,7 @@ public class FindResults {\n \t *            the history table item index that matches a find pattern.\n \t */\n \tpublic synchronized void add(int matchIx) {\n-\t\tmatchesMap.put(new Integer(matchIx), new Integer(++matchesCount));\n+\t\tmatchesMap.put(Integer.valueOf(matchIx), Integer.valueOf(++matchesCount));\n \t\tkeysArray = null;\n \t}\n \ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java \nb/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\nindex 9592817..df2f569 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\n@@ -358,7 +358,7 @@ public class GitResourceDecorator extends LabelProvider implements\n \t\ttry {\n \t\t\tInteger dirty = (Integer) rsrc.getSessionProperty(GITFOLDERDIRTYSTATEPROPERTY);\n \t\t\tif (dirty == null) {\n-\t\t\t\trsrc.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, new Integer(flag));\n+\t\t\t\trsrc.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, Integer.valueOf(flag));\n \t\t\t\tActivator.trace(\"SETTING:\"+rsrc.getFullPath().toOSString()+\" => \"+flag);\n \t\t\t\torState(rsrc.getParent(), flag);\n \t\t\t\tDisplay.getDefault().asyncExec(new Runnable() {\n@@ -375,7 +375,7 @@ public class GitResourceDecorator extends LabelProvider implements\n \t\t\t\t});\n \t\t\t} else {\n \t\t\t\tif ((dirty.intValue() | flag) != dirty.intValue()) {\n-\t\t\t\t\tdirty = new Integer(dirty.intValue() | flag);\n+\t\t\t\t\tdirty = Integer.valueOf(dirty.intValue() | flag);\n \t\t\t\t\trsrc.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, dirty);\n \t\t\t\t\tActivator.trace(\"SETTING:\"+rsrc.getFullPath().toOSString()+\" => \"+dirty);\n \t\t\t\t\torState(rsrc.getParent(), dirty.intValue());\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/MappedListTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/MappedListTest.java\nindex ccc13a0..6513d99 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/MappedListTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/MappedListTest.java\n@@ -29,13 +29,13 @@ public class MappedListTest extends TestCase {\n \t\t\t\t\t\tnew Float(3.14f) })) {\n \t\t\t@Override\n \t\t\tprotected Integer map(Float from) {\n-\t\t\t\treturn new Integer((int) from.floatValue() * 2);\n+\t\t\t\treturn Integer.valueOf((int) from.floatValue() * 2);\n \t\t\t}\n \t\t};\n \n \t\tassertEquals(3, x.toArray().length);\n-\t\tassertEquals(new Integer(2), x.toArray()[0]);\n-\t\tassertEquals(new Integer(4), x.toArray()[1]);\n-\t\tassertEquals(new Integer(6), x.toArray()[2]);\n+\t\tassertEquals(Integer.valueOf(2), x.toArray()[0]);\n+\t\tassertEquals(Integer.valueOf(4), x.toArray()[1]);\n+\t\tassertEquals(Integer.valueOf(6), x.toArray()[2]);\n \t}\n }\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/SuperListTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/SuperListTest.java\nindex 79f4da6..be38b95 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/SuperListTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/SuperListTest.java\n@@ -38,14 +38,14 @@ public class SuperListTest extends TestCase {\n \t\tl.addAll(sl1);\n \t\tl.addAll(sl2);\n \t\tl.addAll(sl3);\n-\t\tl.add(new Integer(7));\n+\t\tl.add(Integer.valueOf(7));\n \n \t\tassertEquals(5, l.size());\n-\t\tassertEquals(new Integer(3), l.toArray()[0]);\n-\t\tassertEquals(new Integer(4), l.toArray()[1]);\n-\t\tassertEquals(new Integer(5), l.toArray()[2]);\n-\t\tassertEquals(new Integer(6), l.toArray()[3]);\n-\t\tassertEquals(new Integer(7), l.toArray()[4]);\n+\t\tassertEquals(Integer.valueOf(3), l.toArray()[0]);\n+\t\tassertEquals(Integer.valueOf(4), l.toArray()[1]);\n+\t\tassertEquals(Integer.valueOf(5), l.toArray()[2]);\n+\t\tassertEquals(Integer.valueOf(6), l.toArray()[3]);\n+\t\tassertEquals(Integer.valueOf(7), l.toArray()[4]);\n \n \t\tassertEquals(5, l.toArray().length);\n \t}\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/SuperList.java b/org.spearce.jgit/src/org/spearce/jgit/lib/SuperList.java\nindex 4a50794..04c9958 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/SuperList.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/SuperList.java\n@@ -48,7 +48,7 @@ public class SuperList<T> extends AbstractList<T> {\n \t */\n \tpublic boolean addAll(List<T> subList) {\n \t\tint lastEnd = subLists.size() > 0 ? subListEnd.get(subListEnd.size()-1).intValue() : 0;\n-\t\tsubListEnd.add(new Integer(lastEnd + subList.size()));\n+\t\tsubListEnd.add(Integer.valueOf(lastEnd + subList.size()));\n \t\tsubLists.add(subList);\n \t\treturn true;\n \t}\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/TopologicalSorter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/TopologicalSorter.java\nindex c33334e..d5c2430 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/TopologicalSorter.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/TopologicalSorter.java\n@@ -205,9 +205,9 @@ public class TopologicalSorter<T> {\n \t\tallNodes.add(edge.to);\n \t\tInteger n = inCount.get(edge.to);\n \t\tif (n == null)\n-\t\t\tinCount.put(edge.to, new Integer(1));\n+\t\t\tinCount.put(edge.to, Integer.valueOf(1));\n \t\telse\n-\t\t\tinCount.put(edge.to, new Integer(n.intValue() + 1));\n+\t\t\tinCount.put(edge.to, Integer.valueOf(n.intValue() + 1));\n \t}\n \n \t/**\n@@ -255,7 +255,7 @@ public class TopologicalSorter<T> {\n \t\t\t\t\tzeroIn.add(e.to);\n \t\t\t\t\tinCount.remove(e.to);\n \t\t\t\t} else {\n-\t\t\t\t\tinCount.put(e.to, new Integer(c.intValue() - 1));\n+\t\t\t\t\tinCount.put(e.to, Integer.valueOf(c.intValue() - 1));\n \t\t\t\t}\n \t\t\t}\n //\t\t\tallEdges.remove(from);\n@@ -356,7 +356,7 @@ public class TopologicalSorter<T> {\n \t\t}\n \t\tIterator<T> i = zeroIn.iterator();\n \t\tret = i.next();\n-\t\tinternalOrder.put(ret, new Integer(internalOrder.size()));\n+\t\tinternalOrder.put(ret, Integer.valueOf(internalOrder.size()));\n \t\ti.remove();\n \t\tremoveallfrom(ret);\n \t\treturn ret;\n-- \n1.5.4.rc4.25.g81cc\n"},{"id":"67885","messageId":"47ABC3FD.1000803@intelinet.com.br","threadId":"11890","inReplyTo":"200802062115.38212.robin.rosenberg@dewire.com","subject":"Re: [EGIT PATCH 2/2] Use Integer.valueOf instead of new Integer","fromName":"Roger C. Soares","fromEmail":"rogersoares@intelinet.com.br","sentAt":"2008-02-08T02:52:45Z","receivedAt":"2008-02-08T02:52:45Z","isPatch":true,"sender":{"key":"rogersoares@intelinet.com.br","avatar":null},"body":"\nRobin Rosenberg escreveu:\n> onsdagen den 6 februari 2008 skrev Shawn O. Pearce:\n>   \n>> Use Integer.valueOf(int).  Post Java 5 implementations of the J2SE\n>> are required to cache values between -128 and 127 (inclusive).\n>>\n>> Actually, when the Java compiler autoboxes values it does so through\n>> these static valueOf methods, which were mostly introduced as part\n>> of the Java 5 API updates.  For small common values its cached and\n>> will thus avoid garbage generation, for less common values it goes\n>> back to allocating the object.\n>>     \n>\n> Thank you for this information.\n>\n> -- robin\nYep, this is very good to know. Thanks from me too :)\nThis patches series looks fine to me.\n\n[]s,\nRoger.\n"}]}