{"thread":{"id":"7786","subject":"[EGIT PATCH 1/4] Drop unneeded GitTreeStorage","startedAt":"2007-04-22T21:35:51Z","lastAt":"2007-04-24T17:09:18Z","messageCount":8,"participants":["Robin Rosenberg","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"40155","messageId":"20070422212907.26396.12810.stgit@lathund.dewire.com","threadId":"7786","inReplyTo":null,"subject":"[EGIT PATCH 0/4] Unit test for plugin and then some","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2007-04-22T21:35:51Z","receivedAt":"2007-04-22T21:35:51Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"This adds a JUnit test for the plugin. It doesn't test much\nyet, but rather than having more people add the infrastructure\nI submit the skeleton and two small samples here. A writeRef\nmethod is implemented to be able to set up the test repository\nwithout using native Git. \n\nI also found an unneeded class when using Eclipse 3.3M6. Exterminated.\n\nI also dropped the non-git sort order of trees.  This isn't too good looking, but\nI expect it to be improved in later versions.\n\n-- robin\n"},{"id":"40154","messageId":"20070422213557.26396.46824.stgit@lathund.dewire.com","threadId":"7786","inReplyTo":"20070422212907.26396.12810.stgit@lathund.dewire.com","subject":"[EGIT PATCH 1/4] Drop unneeded GitTreeStorage","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2007-04-22T21:35:57Z","receivedAt":"2007-04-22T21:35:57Z","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\n .../src/org/spearce/egit/core/GitTreeStorage.java  |  484 -----------------------\n 1 files changed, 0 insertions(+), 484 deletions(-)\n\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitTreeStorage.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitTreeStorage.java\ndeleted file mode 100644\nindex 044ea60..0000000\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitTreeStorage.java\n+++ /dev/null\n@@ -1,484 +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.IOException;\n-import java.net.URI;\n-\n-import org.eclipse.core.resources.IContainer;\n-import org.eclipse.core.resources.IFile;\n-import org.eclipse.core.resources.IFolder;\n-import org.eclipse.core.resources.IMarker;\n-import org.eclipse.core.resources.IProject;\n-import org.eclipse.core.resources.IProjectDescription;\n-import org.eclipse.core.resources.IResource;\n-import org.eclipse.core.resources.IResourceProxy;\n-import org.eclipse.core.resources.IResourceProxyVisitor;\n-import org.eclipse.core.resources.IResourceVisitor;\n-import org.eclipse.core.resources.IWorkspace;\n-import org.eclipse.core.resources.ResourceAttributes;\n-import org.eclipse.core.runtime.CoreException;\n-import org.eclipse.core.runtime.IPath;\n-import org.eclipse.core.runtime.IProgressMonitor;\n-import org.eclipse.core.runtime.QualifiedName;\n-import org.eclipse.core.runtime.jobs.ISchedulingRule;\n-import org.eclipse.team.core.RepositoryProvider;\n-import org.spearce.egit.core.project.RepositoryMapping;\n-import org.spearce.jgit.lib.ObjectId;\n-import org.spearce.jgit.lib.Tree;\n-\n-public class GitTreeStorage implements IContainer {\n-\n-\tprivate Tree entry;\n-\n-\tpublic GitTreeStorage(ObjectId treeId, IResource resource, String relativeResourceName) {\n-\t\tif (treeId == null)\n-\t\t\treturn;\n-\n-\t\tGitProvider provider = (GitProvider) RepositoryProvider\n-\t\t\t\t.getProvider(resource.getProject());\n-\t\tRepositoryMapping repositoryMapping = provider.getData()\n-\t\t\t\t.getRepositoryMapping(resource.getProject());\n-\t\tTree tree;\n-\t\ttry {\n-\t\t\ttree = repositoryMapping.getRepository().mapTree(treeId);\n-\t\t\tString prefix = repositoryMapping.getSubset();\n-\t\t\tif (prefix != null)\n-\t\t\t\tprefix = prefix + \"/\";\n-\t\t\telse\n-\t\t\t\tprefix = \"\";\n-\t\t\tString name = prefix + resource.getProjectRelativePath().toString();\n-\t\t\tentry = (Tree)tree.findMember(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 boolean exists(IPath path) {\n-\t\ttry {\n-\t\t\treturn entry.findMember(path.toString()) != null;\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\treturn false;\n-\t}\n-\n-\tpublic IFile[] findDeletedMembersWithHistory(int depth,\n-\t\t\tIProgressMonitor monitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IResource findMember(String name) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IResource findMember(IPath path) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IResource findMember(String name, boolean includePhantoms) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IResource findMember(IPath path, boolean includePhantoms) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic String getDefaultCharset() throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic String getDefaultCharset(boolean checkImplicit) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IFile getFile(IPath path) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IFolder getFolder(IPath path) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IResource[] members() throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IResource[] members(boolean includePhantoms) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IResource[] members(int memberFlags) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic void setDefaultCharset(String charset) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void setDefaultCharset(String charset, IProgressMonitor monitor)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void accept(IResourceVisitor visitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void accept(IResourceProxyVisitor visitor, int memberFlags)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void accept(IResourceVisitor visitor, int depth,\n-\t\t\tboolean includePhantoms) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void accept(IResourceVisitor visitor, int depth, int memberFlags)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void clearHistory(IProgressMonitor monitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void copy(IPath destination, boolean force, IProgressMonitor monitor)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void copy(IPath destination, int updateFlags,\n-\t\t\tIProgressMonitor monitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void copy(IProjectDescription description, boolean force,\n-\t\t\tIProgressMonitor monitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void copy(IProjectDescription description, int updateFlags,\n-\t\t\tIProgressMonitor monitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic IMarker createMarker(String type) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IResourceProxy createProxy() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic void delete(boolean force, IProgressMonitor monitor)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void delete(int updateFlags, IProgressMonitor monitor)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void deleteMarkers(String type, boolean includeSubtypes, int depth)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic boolean exists() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic IMarker findMarker(long id) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IMarker[] findMarkers(String type, boolean includeSubtypes, int depth)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic String getFileExtension() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IPath getFullPath() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic long getLocalTimeStamp() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn 0;\n-\t}\n-\n-\tpublic IPath getLocation() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic URI getLocationURI() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IMarker getMarker(long id) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic long getModificationStamp() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn 0;\n-\t}\n-\n-\tpublic String getName() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IContainer getParent() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic String getPersistentProperty(QualifiedName key) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IProject getProject() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IPath getProjectRelativePath() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic IPath getRawLocation() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic URI getRawLocationURI() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic ResourceAttributes getResourceAttributes() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic Object getSessionProperty(QualifiedName key) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic int getType() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn 0;\n-\t}\n-\n-\tpublic IWorkspace getWorkspace() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic boolean isAccessible() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean isDerived() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean isLinked() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean isLinked(int options) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean isLocal(int depth) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean isPhantom() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean isReadOnly() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean isSynchronized(int depth) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean isTeamPrivateMember() {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic void move(IPath destination, boolean force, IProgressMonitor monitor)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void move(IPath destination, int updateFlags,\n-\t\t\tIProgressMonitor monitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void move(IProjectDescription description, int updateFlags,\n-\t\t\tIProgressMonitor monitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void move(IProjectDescription description, boolean force,\n-\t\t\tboolean keepHistory, IProgressMonitor monitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void refreshLocal(int depth, IProgressMonitor monitor)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void revertModificationStamp(long value) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void setDerived(boolean isDerived) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void setLocal(boolean flag, int depth, IProgressMonitor monitor)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic long setLocalTimeStamp(long value) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn 0;\n-\t}\n-\n-\tpublic void setPersistentProperty(QualifiedName key, String value)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void setReadOnly(boolean readOnly) {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void setResourceAttributes(ResourceAttributes attributes)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void setSessionProperty(QualifiedName key, Object value)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void setTeamPrivateMember(boolean isTeamPrivate)\n-\t\t\tthrows CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic void touch(IProgressMonitor monitor) throws CoreException {\n-\t\t// TODO Auto-generated method stub\n-\n-\t}\n-\n-\tpublic Object getAdapter(Class adapter) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn null;\n-\t}\n-\n-\tpublic boolean contains(ISchedulingRule rule) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean isConflicting(ISchedulingRule rule) {\n-\t\t// TODO Auto-generated method stub\n-\t\treturn false;\n-\t}\n-}\n"},{"id":"40157","messageId":"20070422213602.26396.59463.stgit@lathund.dewire.com","threadId":"7786","inReplyTo":"20070422212907.26396.12810.stgit@lathund.dewire.com","subject":"[EGIT PATCH 2/4] Use the Git sort order.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2007-04-22T21:36:03Z","receivedAt":"2007-04-22T21:36:03Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Do not resort trees when reading into memory. This requires\nthat a number of routines learn to sort tree\nentries as if they end with a '/'. To do that a parameter\nmust be passed. I do this by passing a NUL or '/' byte as\nan extra parameter for the comparison routines.\n\nNo noticeable performance difference can be noted. The reason\nfor this patch is to simply implementation of the git index\nand make jgit more git-like.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n\n .../src/org/spearce/egit/core/GitBlobStorage.java  |    2 -\n .../org/spearce/egit/core/GitMoveDeleteHook.java   |   17 ++++-\n .../src/org/spearce/egit/core/GitStorage.java      |    5 +\n .../egit/core/internal/mapping/GitFileHistory.java |   11 ++-\n .../core/internal/mapping/GitFileRevision.java     |    5 +\n .../org/spearce/egit/core/op/TrackOperation.java   |    8 +-\n .../org/spearce/egit/core/op/UntrackOperation.java |    6 +-\n .../spearce/egit/core/project/GitProjectData.java  |   10 ++-\n .../egit/core/project/RepositoryMapping.java       |    2 -\n .../org.spearce.jgit--All-Tests.launch             |    6 ++\n .../src/org/spearce/jgit/lib/MergedTree.java       |   27 +++++--\n .../src/org/spearce/jgit/lib/ObjectWriter.java     |    7 --\n .../src/org/spearce/jgit/lib/SubtreeSorter.java    |   40 -----------\n .../src/org/spearce/jgit/lib/Tree.java             |   85 ++++++++++++++++-------\n .../src/org/spearce/jgit/lib/TreeEntry.java        |    9 ++\n .../tst/org/spearce/jgit/lib/T0002_Tree.java       |   33 +++++----\n .../org/spearce/jgit/lib/T0006_DeepSpeedTest.java  |    2 -\n 17 files changed, 160 insertions(+), 115 deletions(-)\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\nindex c947e2b..3ab2184 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitBlobStorage.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitBlobStorage.java\n@@ -59,7 +59,7 @@ public class GitBlobStorage implements IStorage {\n \t\t\telse\n \t\t\t\tprefix = \"\";\n \t\t\tString name = prefix + resource.getProjectRelativePath().toString();\n-\t\t\tentry = tree.findMember(name);\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();\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java\nindex e09ac76..389fc76 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitMoveDeleteHook.java\n@@ -122,7 +122,7 @@ class GitMoveDeleteHook implements IMoveDeleteHook {\n \n \t\tif (s != null && m != null && m.getCacheTree() != null) {\n \t\t\ttry {\n-\t\t\t\tfinal TreeEntry e = m.getCacheTree().findMember(s);\n+\t\t\t\tfinal TreeEntry e = m.getCacheTree().findTreeMember(s);\n \t\t\t\tif (e != null) {\n \t\t\t\t\te.delete();\n \t\t\t\t\tm.recomputeMerge();\n@@ -182,7 +182,10 @@ class GitMoveDeleteHook implements IMoveDeleteHook {\n \t\t}\n \n \t\ttry {\n-\t\t\tsrcEnt = srcMap.getCacheTree().findMember(srcPath);\n+\t\t\tif (src.getType() == IResource.FILE)\n+\t\t\t\tsrcEnt = srcMap.getCacheTree().findBlobMember(srcPath);\n+\t\t\telse\n+\t\t\t\tsrcEnt = srcMap.getCacheTree().findTreeMember(srcPath);\n \t\t\tif (srcEnt == null) {\n \t\t\t\treturn FINISH_FOR_ME;\n \t\t\t}\n@@ -199,7 +202,11 @@ class GitMoveDeleteHook implements IMoveDeleteHook {\n \t\t\tif (dstPath == null) {\n \t\t\t\tdstTree = dstMap.getCacheTree();\n \t\t\t} else {\n-\t\t\t\tfinal TreeEntry e = dstMap.getCacheTree().findMember(dstPath);\n+\t\t\t\tfinal TreeEntry e;\n+\t\t\t\tif (src.getType() == IResource.FILE)\n+\t\t\t\t\te = dstMap.getCacheTree().findBlobMember(dstPath);\n+\t\t\t\telse\n+\t\t\t\t\te = dstMap.getCacheTree().findTreeMember(dstPath);\n \t\t\t\tif (e == null) {\n \t\t\t\t\tdstTree = dstMap.getCacheTree().addTree(dstPath);\n \t\t\t\t} else if (e instanceof Tree) {\n@@ -216,7 +223,9 @@ class GitMoveDeleteHook implements IMoveDeleteHook {\n \t\t\t// What? Something already exists at the destination? Assume\n \t\t\t// Eclipse meant for us to replace the item.\n \t\t\t//\n-\t\t\tfinal TreeEntry existing = dstTree.findMember(dstName);\n+\t\t\tTreeEntry existing = dstTree.findTreeMember(dstName);\n+\t\t\tif (existing == null)\n+\t\t\t\tdstTree.findBlobMember(dstName);\n \t\t\tif (existing != null) {\n \t\t\t\texisting.delete();\n \t\t\t}\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 ce4ff71..edef5db 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@@ -62,7 +62,10 @@ public class GitStorage implements IStorage {\n \t\t\telse\n \t\t\t\tprefix = \"\";\n \t\t\tString name = prefix + resource.getProjectRelativePath().toString();\n-\t\t\tentry = tree.findMember(name);\n+\t\t\tif (resource.getType() == IResource.FILE)\n+\t\t\t\tentry = tree.findBlobMember(name);\n+\t\t\telse\n+\t\t\t\tentry = tree.findTreeMember(name);\n \t\t} catch (IOException e) {\n \t\t\t// TODO Auto-generated catch block\n \t\t\te.printStackTrace();\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 51109fb..0569862 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@@ -147,7 +147,11 @@ public class GitFileHistory extends FileHistory implements IAdaptable {\n \t\t\tObjectId[] currentResourceHash = new ObjectId[lastResourceHash.length];\n \t\t\tTree t = current.getTree();\n \t\t\tfor (int i = 0; i < currentResourceHash.length; ++i) {\n-\t\t\t\tTreeEntry m = t.findMember(relativeResourceName[i]);\n+\t\t\t\tTreeEntry m;\n+\t\t\t\tif (i == relativeResourceName.length-1 && resource.getType() == IResource.FILE)\n+\t\t\t\t\tm = t.findBlobMember(relativeResourceName[i]);\n+\t\t\t\telse\n+\t\t\t\t\tm = t.findTreeMember(relativeResourceName[i]);\n \t\t\t\tif (m != null) {\n \t\t\t\t\tObjectId id = m.getId();\n \t\t\t\t\tcurrentResourceHash[i] = id;\n@@ -251,7 +255,10 @@ public class GitFileHistory extends FileHistory implements IAdaptable {\n \t\t\t}\n \t\t\tTreeEntry currentEntry = current.getTree();\n \t\t\tfor (int i=0; i < relativeResourceName.length && currentEntry != null; ++i) {\n-\t\t\t\t((Tree)currentEntry).findMember(relativeResourceName[i]);\n+\t\t\t\tif (i == relativeResourceName.length-1 && resource.getType() == IResource.FILE)\n+\t\t\t\t\t((Tree)currentEntry).findBlobMember(relativeResourceName[i]);\n+\t\t\t\telse\n+\t\t\t\t\t((Tree)currentEntry).findTreeMember(relativeResourceName[i]);\n \t\t\t}\n \t\t\tif (currentEntry != null)\n \t\t\t\trevisions = new IFileRevision[] { new GitFileRevision(current, resource,\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 def142f..63d8486 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@@ -156,7 +156,10 @@ public class GitFileRevision extends FileRevision {\n \t\t\t\telse {\n \t\t\t\t\tprefix = prefix + \"/\";\n \t\t\t\t\tString name = prefix + relPath;\n-\t\t\t\t\treturn tree.findMember(name);\n+\t\t\t\t\tif (resource.getType() == IResource.FILE)\n+\t\t\t\t\t\treturn tree.findBlobMember(name);\n+\t\t\t\t\telse\n+\t\t\t\t\t\treturn tree.findTreeMember(name);\n \t\t\t\t}\n \t\t\t} else\n \t\t\t\treturn tree;\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java\nindex 2f4488d..df3dba7 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java\n@@ -137,12 +137,14 @@ public class TrackOperation implements IWorkspaceRunnable {\n \t\t\t// Uh, what? Why are we adding a phantom resource? Just say no!\n \t\t\t//\n \t\t} else if (toAdd instanceof IFile) {\n-\t\t\tif (!t.exists(path)) {\n-\t\t\t\tt.addFile(path);\n+\t\t\tif (!t.existsTree(path)) {\n+\t\t\t\tif (!t.existsBlob(path)) {\t\t\t\t\n+\t\t\t\t\tt.addFile(path);\n+\t\t\t\t}\n \t\t\t}\n \t\t} else if (toAdd instanceof IContainer) {\n \t\t\tfinal IResource[] m = ((IContainer) toAdd).members();\n-\t\t\tfinal TreeEntry e = t.findMember(path);\n+\t\t\tfinal TreeEntry e = t.findTreeMember(path);\n \t\t\tfinal Tree c;\n \t\t\tc = e instanceof Tree ? (Tree) e : e == null ? t.addTree(path)\n \t\t\t\t\t: null;\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java\nindex 1a81192..d477644 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java\n@@ -120,7 +120,11 @@ public class UntrackOperation implements IWorkspaceRunnable {\n \n \t\ttry {\n \t\t\tfinal Tree t = m.getCacheTree();\n-\t\t\tfinal TreeEntry e = t.findMember(s);\n+\t\t\tfinal TreeEntry e;\n+\t\t\tif (torm.getType() == IResource.FILE)\n+\t\t\t\te = t.findBlobMember(s);\n+\t\t\telse\n+\t\t\t\te = t.findTreeMember(s);\n \t\t\tif (e != null) {\n \t\t\t\te.delete();\n \t\t\t\ttomerge.put(m, m);\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 10cc3a0..0c4683e 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@@ -296,7 +296,10 @@ public class GitProjectData {\n \n \t\tif (s != null && m != null && m.getActiveDiff() != null) {\n \t\t\ttry {\n-\t\t\t\treturn m.getActiveDiff().findMember(s);\n+\t\t\t\tif (r.getType() == IResource.FILE)\n+\t\t\t\t\treturn m.getActiveDiff().findBlobMember(s);\n+\t\t\t\telse\n+\t\t\t\t\treturn m.getActiveDiff().findTreeMember(s);\n \t\t\t} catch (IOException ioe) {\n \t\t\t\tthrow Activator.error(\n \t\t\t\t\t\tCoreText.GitProjectData_lazyResolveFailed, ioe);\n@@ -416,7 +419,10 @@ public class GitProjectData {\n \t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\tsynchronized (cacheTree) {\n \t\t\t\t\t\t\t\t\tfinal TreeEntry e;\n-\t\t\t\t\t\t\t\t\te = cacheTree.findMember(s);\n+\t\t\t\t\t\t\t\t\tif (r.getType() == IResource.FILE)\n+\t\t\t\t\t\t\t\t\t\te = cacheTree.findBlobMember(s);\n+\t\t\t\t\t\t\t\t\telse\n+\t\t\t\t\t\t\t\t\t\te = cacheTree.findTreeMember(s);\n \t\t\t\t\t\t\t\t\tif (e instanceof FileTreeEntry) {\n \t\t\t\t\t\t\t\t\t\ttrace(\"modified \" + r + \" -> \"\n \t\t\t\t\t\t\t\t\t\t\t\t+ e.getFullName());\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 df10665..6b9beed 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@@ -210,7 +210,7 @@ public class RepositoryMapping {\n \t\tTree head = getRepository().mapTree(Constants.HEAD);\n \t\tif (head != null) {\n \t\t\tif (getSubset() != null) {\n-\t\t\t\tfinal TreeEntry e = head.findMember(getSubset());\n+\t\t\t\tfinal TreeEntry e = head.findTreeMember(getSubset());\n \t\t\t\te.detachParent();\n \t\t\t\thead = e instanceof Tree ? (Tree) e : null;\n \t\t\t}\ndiff --git a/org.spearce.jgit/org.spearce.jgit--All-Tests.launch b/org.spearce.jgit/org.spearce.jgit--All-Tests.launch\nindex bdbfdea..0ff3d23 100644\n--- a/org.spearce.jgit/org.spearce.jgit--All-Tests.launch\n+++ b/org.spearce.jgit/org.spearce.jgit--All-Tests.launch\n@@ -3,11 +3,17 @@\n <booleanAttribute key=\"org.eclipse.jdt.junit.KEEPRUNNING_ATTR\" value=\"false\"/>\n <stringAttribute key=\"org.eclipse.jdt.launching.MAIN_TYPE\" value=\"\"/>\n <stringAttribute key=\"org.eclipse.jdt.junit.TESTNAME\" value=\"\"/>\n+<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES\">\n+<listEntry value=\"4\"/>\n+</listAttribute>\n <stringAttribute key=\"org.eclipse.jdt.launching.PROJECT_ATTR\" value=\"org.spearce.jgit\"/>\n <listAttribute key=\"org.eclipse.debug.ui.favoriteGroups\">\n <listEntry value=\"org.eclipse.debug.ui.launchGroup.run\"/>\n <listEntry value=\"org.eclipse.debug.ui.launchGroup.debug\"/>\n </listAttribute>\n+<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_PATHS\">\n+<listEntry value=\"/org.spearce.jgit\"/>\n+</listAttribute>\n <stringAttribute key=\"org.eclipse.jdt.junit.CONTAINER\" value=\"=org.spearce.jgit\"/>\n <booleanAttribute key=\"org.eclipse.debug.core.appendEnvironmentVariables\" value=\"true\"/>\n <stringAttribute key=\"org.eclipse.jdt.junit.TEST_KIND\" value=\"org.eclipse.jdt.junit.loader.junit3\"/>\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/MergedTree.java b/org.spearce.jgit/src/org/spearce/jgit/lib/MergedTree.java\nindex e5b2967..165adc3 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/MergedTree.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/MergedTree.java\n@@ -53,7 +53,7 @@ public class MergedTree {\n \t}\n \n \tprivate static final int binarySearch(final TreeEntry[] entries,\n-\t\t\tfinal int width, final byte[] nameUTF8, final int nameStart,\n+\t\t\tfinal int width, final byte[] nameUTF8, final byte nameUTF8last, final int nameStart,\n \t\t\tfinal int nameEnd) {\n \t\tif (entries.length == 0)\n \t\t\treturn -1;\n@@ -66,7 +66,7 @@ public class MergedTree {\n \t\t\twhile (entries[ix] == null)\n \t\t\t\tix++;\n \t\t\tcmp = Tree.compareNames(entries[ix].getNameUTF8(), nameUTF8,\n-\t\t\t\t\tnameStart, nameEnd);\n+\t\t\t\t\tnameStart, nameEnd, TreeEntry.lastChar(entries[ix]), nameUTF8last);\n \t\t\tif (cmp < 0)\n \t\t\t\tlow = mid + 1;\n \t\t\telse if (cmp == 0)\n@@ -95,11 +95,11 @@ public class MergedTree {\n \t\treturn isModified(sources);\n \t}\n \n-\tpublic TreeEntry[] findMember(final String s) throws IOException {\n-\t\treturn findMember(s.getBytes(Constants.CHARACTER_ENCODING), 0);\n+\tpublic TreeEntry[] findMember(final String s, final byte slast) throws IOException {\n+\t\treturn findMember(s.getBytes(Constants.CHARACTER_ENCODING), slast, 0);\n \t}\n \n-\tpublic TreeEntry[] findMember(final byte[] s, final int offset)\n+\tpublic TreeEntry[] findMember(final byte[] s, final byte slast, final int offset)\n \t\t\tthrows IOException {\n \t\tfinal int srcCnt = sources.length;\n \t\tint slash;\n@@ -108,7 +108,8 @@ public class MergedTree {\n \t\tfor (slash = offset; slash < s.length && s[slash] != '/'; slash++) {\n \t\t\t// search for path component terminator\n \t\t}\n-\t\tp = binarySearch(merged, srcCnt, s, offset, slash);\n+\t\tbyte xlast = slash<s.length ? (byte)'/' : slast;\n+\t\tp = binarySearch(merged, srcCnt, s, xlast, offset, slash);\n \t\tif (p < 0)\n \t\t\treturn null;\n \n@@ -127,7 +128,15 @@ public class MergedTree {\n \t\t\t\tsubs[j] = merged[k] instanceof Tree ? (Tree) merged[k] : null;\n \t\t\tsubtrees[p] = new MergedTree(subs);\n \t\t}\n-\t\treturn subtrees[p].findMember(s, slash + 1);\n+\t\treturn subtrees[p].findMember(s, slast, slash + 1);\n+\t}\n+\n+\tpublic TreeEntry[] findBlobMember(String s) throws IOException {\n+\t\treturn findMember(s,(byte)0);\n+\t}\n+\n+\tpublic TreeEntry[] findTreeMember(String s) throws IOException {\n+\t\treturn findMember(s,(byte)'/');\n \t}\n \n \tprivate void matchByName() throws IOException {\n@@ -160,6 +169,7 @@ public class MergedTree {\n \t\tnewMerged = new TreeEntry[pos * srcCnt];\n \t\tfor (pos = 0, treeId = 0; done < srcCnt; pos += srcCnt, treeId++) {\n \t\t\tbyte[] minName = null;\n+\t\t\tint minNameLast = 0;\n \n \t\t\tif ((pos + srcCnt) >= newMerged.length) {\n \t\t\t\tfinal TreeEntry[] t = new TreeEntry[newMerged.length * 2];\n@@ -176,10 +186,11 @@ public class MergedTree {\n \n \t\t\t\tfinal TreeEntry thisEntry = ents[ti];\n \t\t\t\tfinal int cmp = minName == null ? -1 : Tree.compareNames(\n-\t\t\t\t\t\tthisEntry.getNameUTF8(), minName);\n+\t\t\t\t\t\tthisEntry.getNameUTF8(), minName, TreeEntry.lastChar(thisEntry), minNameLast);\n \n \t\t\t\tif (cmp < 0) {\n \t\t\t\t\tminName = thisEntry.getNameUTF8();\n+\t\t\t\t\tminNameLast = TreeEntry.lastChar(thisEntry);\n \t\t\t\t\tfor (int j = srcId - 1; j >= 0; j--) {\n \t\t\t\t\t\tif (newMerged[pos + j] != null) {\n \t\t\t\t\t\t\tnewMerged[pos + j] = null;\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectWriter.java\nindex 5722eec..f9f2bde 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectWriter.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectWriter.java\n@@ -25,7 +25,6 @@ import java.io.IOException;\n import java.io.InputStream;\n import java.io.OutputStreamWriter;\n import java.security.MessageDigest;\n-import java.util.Arrays;\n import java.util.Iterator;\n import java.util.zip.Deflater;\n import java.util.zip.DeflaterOutputStream;\n@@ -82,12 +81,6 @@ public class ObjectWriter {\n \tpublic ObjectId writeTree(final Tree t) throws IOException {\n \t\tfinal ByteArrayOutputStream o = new ByteArrayOutputStream();\n \t\tfinal TreeEntry[] items = t.members();\n-\t\tfor (int k = items.length - 1; k >= 0; k--) {\n-\t\t\tif (items[k] instanceof Tree) {\n-\t\t\t\tArrays.sort(items, SubtreeSorter.INSTANCE);\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n \t\tfor (int k = 0; k < items.length; k++) {\n \t\t\tfinal TreeEntry e = items[k];\n \t\t\tfinal ObjectId id = e.getId();\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/SubtreeSorter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/SubtreeSorter.java\ndeleted file mode 100644\nindex 2557525..0000000\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/SubtreeSorter.java\n+++ /dev/null\n@@ -1,40 +0,0 @@\n-package org.spearce.jgit.lib;\n-\n-import java.util.Comparator;\n-\n-public class SubtreeSorter implements Comparator {\n-\tpublic static final SubtreeSorter INSTANCE = new SubtreeSorter();\n-\n-\tpublic int compare(final Object o1, final Object o2) {\n-\t\tfinal TreeEntry a = (TreeEntry) o1;\n-\t\tfinal TreeEntry b = (TreeEntry) o2;\n-\t\tfinal byte[] aName = a.getNameUTF8();\n-\t\tfinal byte[] bName = b.getNameUTF8();\n-\n-\t\tfor (int k = 0; k < aName.length && k < bName.length; k++) {\n-\t\t\tif (aName[k] < bName[k])\n-\t\t\t\treturn -1;\n-\t\t\telse if (aName[k] > bName[k])\n-\t\t\t\treturn 1;\n-\t\t}\n-\n-\t\tif (aName.length < bName.length) {\n-\t\t\tif (a instanceof Tree && '/' > bName[aName.length])\n-\t\t\t\treturn 1;\n-\t\t\treturn -1;\n-\t\t} else if (aName.length == bName.length) {\n-\t\t\tif (a instanceof Tree && b instanceof Tree)\n-\t\t\t\treturn 0;\n-\t\t\telse if (a instanceof Tree)\n-\t\t\t\treturn 1;\n-\t\t\telse if (b instanceof Tree)\n-\t\t\t\treturn -1;\n-\t\t\telse\n-\t\t\t\treturn 0;\n-\t\t} else {\n-\t\t\tif (b instanceof Tree && aName[bName.length] < '/')\n-\t\t\t\treturn -1;\n-\t\t\treturn 1;\n-\t\t}\n-\t}\n-}\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Tree.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Tree.java\nindex 65ed400..73a5e2c 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Tree.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Tree.java\n@@ -17,7 +17,6 @@\n package org.spearce.jgit.lib;\n \n import java.io.IOException;\n-import java.util.Arrays;\n \n import org.spearce.jgit.errors.CorruptObjectException;\n import org.spearce.jgit.errors.EntryExistsException;\n@@ -26,13 +25,14 @@ import org.spearce.jgit.errors.MissingObjectException;\n public class Tree extends TreeEntry implements Treeish {\n \tpublic static final TreeEntry[] EMPTY_TREE = {};\n \n-\tpublic static final int compareNames(final byte[] a, final byte[] b) {\n-\t\treturn compareNames(a, b, 0, b.length);\n+\tpublic static final int compareNames(final byte[] a, final byte[] b, final int lasta,final int lastb) {\n+\t\treturn compareNames(a, b, 0, b.length, lasta, lastb);\n \t}\n \n \tpublic static final int compareNames(final byte[] a, final byte[] nameUTF8,\n-\t\t\tfinal int nameStart, final int nameEnd) {\n-\t\tfor (int j = 0, k = nameStart; j < a.length && k < nameEnd; j++, k++) {\n+\t\t\tfinal int nameStart, final int nameEnd, final int lasta, int lastb) {\n+\t\tint j,k;\n+\t\tfor (j = 0, k = nameStart; j < a.length && k < nameEnd; j++, k++) {\n \t\t\tfinal int aj = a[j] & 0xff;\n \t\t\tfinal int bk = nameUTF8[k] & 0xff;\n \t\t\tif (aj < bk)\n@@ -40,6 +40,28 @@ public class Tree extends TreeEntry implements Treeish {\n \t\t\telse if (aj > bk)\n \t\t\t\treturn 1;\n \t\t}\n+\t\tif (j < a.length) {\n+\t\t\tint aj = a[j]&0xff;\n+\t\t\tif (aj < lastb)\n+\t\t\t\treturn -1;\n+\t\t\telse if (aj > lastb)\n+\t\t\t\treturn 1;\n+\t\t\telse\n+\t\t\t\treturn 0;\n+\t\t}\n+\t\tif (k < nameEnd) {\n+\t\t\tint bk = nameUTF8[k] & 0xff;\n+\t\t\tif (lasta < bk)\n+\t\t\t\treturn -1;\n+\t\t\telse if (lasta > bk)\n+\t\t\t\treturn 1;\n+\t\t\telse\n+\t\t\t\treturn 0;\n+\t\t}\n+\t\tif (lasta < lastb)\n+\t\t\treturn -1;\n+\t\telse if (lasta > lastb)\n+\t\t\treturn 1;\n \n \t\tfinal int namelength = nameEnd - nameStart;\n \t\tif (a.length == namelength)\n@@ -60,7 +82,7 @@ public class Tree extends TreeEntry implements Treeish {\n \t}\n \n \tprivate static final int binarySearch(final TreeEntry[] entries,\n-\t\t\tfinal byte[] nameUTF8, final int nameStart, final int nameEnd) {\n+\t\t\tfinal byte[] nameUTF8, final int nameUTF8last, final int nameStart, final int nameEnd) {\n \t\tif (entries.length == 0)\n \t\t\treturn -1;\n \t\tint high = entries.length;\n@@ -68,7 +90,7 @@ public class Tree extends TreeEntry implements Treeish {\n \t\tdo {\n \t\t\tfinal int mid = (low + high) / 2;\n \t\t\tfinal int cmp = compareNames(entries[mid].getNameUTF8(), nameUTF8,\n-\t\t\t\t\tnameStart, nameEnd);\n+\t\t\t\t\tnameStart, nameEnd, TreeEntry.lastChar(entries[mid]), nameUTF8last);\n \t\t\tif (cmp < 0)\n \t\t\t\tlow = mid + 1;\n \t\t\telse if (cmp == 0)\n@@ -151,7 +173,8 @@ public class Tree extends TreeEntry implements Treeish {\n \t\t}\n \n \t\tensureLoaded();\n-\t\tp = binarySearch(contents, s, offset, slash);\n+\t\tbyte xlast = slash<s.length ? (byte)'/' : 0;\n+\t\tp = binarySearch(contents, s, xlast, offset, slash);\n \t\tif (p >= 0 && slash < s.length && contents[p] instanceof Tree)\n \t\t\treturn ((Tree) contents[p]).addFile(s, slash + 1);\n \n@@ -184,7 +207,7 @@ public class Tree extends TreeEntry implements Treeish {\n \t\t}\n \n \t\tensureLoaded();\n-\t\tp = binarySearch(contents, s, offset, slash);\n+\t\tp = binarySearch(contents, s, (byte)'/', offset, slash);\n \t\tif (p >= 0 && slash < s.length && contents[p] instanceof Tree)\n \t\t\treturn ((Tree) contents[p]).addTree(s, slash + 1);\n \n@@ -202,7 +225,7 @@ public class Tree extends TreeEntry implements Treeish {\n \t\tfinal int p;\n \n \t\tensureLoaded();\n-\t\tp = binarySearch(contents, e.getNameUTF8(), 0, e.getNameUTF8().length);\n+\t\tp = binarySearch(contents, e.getNameUTF8(), TreeEntry.lastChar(e), 0, e.getNameUTF8().length);\n \t\tif (p < 0) {\n \t\t\te.attachParent(this);\n \t\t\tinsertEntry(p, e);\n@@ -227,7 +250,7 @@ public class Tree extends TreeEntry implements Treeish {\n \n \tvoid removeEntry(final TreeEntry e) {\n \t\tfinal TreeEntry[] c = contents;\n-\t\tfinal int p = binarySearch(c, e.getNameUTF8(), 0,\n+\t\tfinal int p = binarySearch(c, e.getNameUTF8(), TreeEntry.lastChar(e), 0,\n \t\t\t\te.getNameUTF8().length);\n \t\tif (p >= 0) {\n \t\t\tfinal TreeEntry[] n = new TreeEntry[c.length - 1];\n@@ -257,15 +280,23 @@ public class Tree extends TreeEntry implements Treeish {\n \t\t\treturn c;\n \t}\n \n-\tpublic boolean exists(final String s) throws IOException {\n-\t\treturn findMember(s) != null;\n+\tpublic boolean exists(final String s, byte slast) throws IOException {\n+\t\treturn findMember(s, slast) != null;\n \t}\n \n-\tpublic TreeEntry findMember(final String s) throws IOException {\n-\t\treturn findMember(s.getBytes(Constants.CHARACTER_ENCODING), 0);\n+\tpublic boolean existsTree(String path) throws IOException {\n+\t\treturn exists(path,(byte)'/');\n \t}\n \n-\tpublic TreeEntry findMember(final byte[] s, final int offset)\n+\tpublic boolean existsBlob(String path) throws IOException {\n+\t\treturn exists(path,(byte)0);\n+\t}\n+\n+\tpublic TreeEntry findMember(final String s, byte slast) throws IOException {\n+\t\treturn findMember(s.getBytes(Constants.CHARACTER_ENCODING), slast, 0);\n+\t}\n+\n+\tpublic TreeEntry findMember(final byte[] s, final byte slast, final int offset)\n \t\t\tthrows IOException {\n \t\tint slash;\n \t\tint p;\n@@ -275,17 +306,26 @@ public class Tree extends TreeEntry implements Treeish {\n \t\t}\n \n \t\tensureLoaded();\n-\t\tp = binarySearch(contents, s, offset, slash);\n+\t\tbyte xlast = slash<s.length ? (byte)'/' : slast;\n+\t\tp = binarySearch(contents, s, xlast, offset, slash);\n \t\tif (p >= 0) {\n \t\t\tfinal TreeEntry r = contents[p];\n \t\t\tif (slash < s.length)\n-\t\t\t\treturn r instanceof Tree ? ((Tree) r).findMember(s, slash + 1)\n+\t\t\t\treturn r instanceof Tree ? ((Tree) r).findMember(s, slast, slash + 1)\n \t\t\t\t\t\t: null;\n \t\t\treturn r;\n \t\t}\n \t\treturn null;\n \t}\n \n+\tpublic TreeEntry findBlobMember(String s) throws IOException {\n+\t\treturn findMember(s,(byte)0);\n+\t}\n+\n+\tpublic TreeEntry findTreeMember(String s) throws IOException {\n+\t\treturn findMember(s,(byte)'/');\n+\t}\n+\n \tpublic void accept(final TreeVisitor tv, final int flags)\n \t\t\tthrows IOException {\n \t\tfinal TreeEntry[] c;\n@@ -326,7 +366,6 @@ public class Tree extends TreeEntry implements Treeish {\n \t\tint rawPtr = 0;\n \t\tTreeEntry[] temp = new TreeEntry[64];\n \t\tint nextIndex = 0;\n-\t\tboolean resort = false;\n \n \t\twhile (rawPtr < raw.length) {\n \t\t\tint c = raw[rawPtr++] & 0xff;\n@@ -362,7 +401,6 @@ public class Tree extends TreeEntry implements Treeish {\n \t\t\t\tent = new FileTreeEntry(this, id, name, true);\n \t\t\telse if (FileMode.TREE.equals(mode)) {\n \t\t\t\tent = new Tree(this, id, name);\n-\t\t\t\tresort = true;\n \t\t\t} else if (FileMode.SYMLINK.equals(mode))\n \t\t\t\tent = new SymlinkTreeEntry(this, id, name);\n \t\t\telse\n@@ -388,12 +426,6 @@ public class Tree extends TreeEntry implements Treeish {\n \t\t\tcontents = n;\n \t\t}\n \n-\t\t// Resort contents using our internal sorting order. Git sorts\n-\t\t// subtrees as though their names end in '/' but that's not how\n-\t\t// we sort them in memory. Its all the fault of the index...\n-\t\t//\n-\t\tif (resort)\n-\t\t\tArrays.sort(contents);\n \t}\n \n \tpublic String toString() {\n@@ -403,4 +435,5 @@ public class Tree extends TreeEntry implements Treeish {\n \t\tr.append(getFullName());\n \t\treturn r.toString();\n \t}\n+\n }\n\\ No newline at end of file\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/TreeEntry.java b/org.spearce.jgit/src/org/spearce/jgit/lib/TreeEntry.java\nindex 084a9f3..1219846 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/TreeEntry.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/TreeEntry.java\n@@ -126,10 +126,17 @@ public abstract class TreeEntry implements Comparable {\n \t\tif (this == o)\n \t\t\treturn 0;\n \t\tif (o instanceof TreeEntry)\n-\t\t\treturn Tree.compareNames(nameUTF8, ((TreeEntry) o).nameUTF8);\n+\t\t\treturn Tree.compareNames(nameUTF8, ((TreeEntry) o).nameUTF8, lastChar(this), lastChar((TreeEntry)o));\n \t\treturn -1;\n \t}\n \n+\tfinal public static int lastChar(TreeEntry treeEntry) {\n+\t\tif (treeEntry instanceof FileTreeEntry)\n+\t\t\treturn '\\0';\n+\t\telse\n+\t\t\treturn '/';\n+\t}\n+\n \tpublic void accept(final TreeVisitor tv) throws IOException {\n \t\taccept(tv, 0);\n \t}\ndiff --git a/org.spearce.jgit/tst/org/spearce/jgit/lib/T0002_Tree.java b/org.spearce.jgit/tst/org/spearce/jgit/lib/T0002_Tree.java\nindex e757ef8..62df113 100644\n--- a/org.spearce.jgit/tst/org/spearce/jgit/lib/T0002_Tree.java\n+++ b/org.spearce.jgit/tst/org/spearce/jgit/lib/T0002_Tree.java\n@@ -38,7 +38,8 @@ public class T0002_Tree extends RepositoryTestCase {\n \t\tassertTrue(\"no id\", t.getId() == null);\n \t\tassertTrue(\"tree is self\", t.getTree() == t);\n \t\tassertTrue(\"database is r\", t.getRepository() == db);\n-\t\tassertTrue(\"no foo child\", t.findMember(\"foo\") == null);\n+\t\tassertTrue(\"no foo child\", t.findTreeMember(\"foo\") == null);\n+\t\tassertTrue(\"no foo child\", t.findBlobMember(\"foo\") == null);\n \t}\n \n \tpublic void test002_addFile() throws IOException {\n@@ -57,7 +58,7 @@ public class T0002_Tree extends RepositoryTestCase {\n \t\tassertTrue(\"no id\", f.getId() == null);\n \t\tassertTrue(\"is modified\", t.isModified());\n \t\tassertTrue(\"has no id\", t.getId() == null);\n-\t\tassertTrue(\"found bob\", t.findMember(f.getName()) == f);\n+\t\tassertTrue(\"found bob\", t.findBlobMember(f.getName()) == f);\n \n \t\tfinal TreeEntry[] i = t.members();\n \t\tassertTrue(\"iterator is not empty\", i != null && i.length > 0);\n@@ -87,7 +88,7 @@ public class T0002_Tree extends RepositoryTestCase {\n \t\tassertTrue(\"tree is self\", f.getTree() == f);\n \t\tassertTrue(\"parent is modified\", t.isModified());\n \t\tassertTrue(\"parent has no id\", t.getId() == null);\n-\t\tassertTrue(\"found bob child\", t.findMember(f.getName()) == f);\n+\t\tassertTrue(\"found bob child\", t.findTreeMember(f.getName()) == f);\n \n \t\tfinal TreeEntry[] i = t.members();\n \t\tassertTrue(\"iterator is not empty\", i.length > 0);\n@@ -145,14 +146,14 @@ public class T0002_Tree extends RepositoryTestCase {\n \t\tassertTrue(\"t not modified.\", !t.isModified());\n \n \t\tassertEquals(\"full path of h ok\", \"f/g/h\", h.getFullName());\n-\t\tassertTrue(\"Can find h\", t.findMember(h.getFullName()) == h);\n-\t\tassertTrue(\"Can't find f/z\", t.findMember(\"f/z\") == null);\n-\t\tassertTrue(\"Can't find y/z\", t.findMember(\"y/z\") == null);\n+\t\tassertTrue(\"Can find h\", t.findTreeMember(h.getFullName()) == h);\n+\t\tassertTrue(\"Can't find f/z\", t.findBlobMember(\"f/z\") == null);\n+\t\tassertTrue(\"Can't find y/z\", t.findBlobMember(\"y/z\") == null);\n \n \t\tfinal FileTreeEntry i = h.addFile(\"i\");\n \t\tassertNotNull(i);\n \t\tassertEquals(\"full path of i ok\", \"f/g/h/i\", i.getFullName());\n-\t\tassertTrue(\"Can find i\", t.findMember(i.getFullName()) == i);\n+\t\tassertTrue(\"Can find i\", t.findBlobMember(i.getFullName()) == i);\n \t\tassertTrue(\"h modified\", h.isModified());\n \t\tassertTrue(\"g modified\", g.isModified());\n \t\tassertTrue(\"f modified\", f.isModified());\n@@ -190,17 +191,17 @@ public class T0002_Tree extends RepositoryTestCase {\n \n \tpublic void test008_SubtreeInternalSorting() throws IOException {\n \t\tfinal Tree t = new Tree(db);\n-\t\tfinal FileTreeEntry e0 = t.addFile(\"a-\");\n-\t\tfinal FileTreeEntry e1 = t.addFile(\"a-b\");\n-\t\tfinal Tree e2 = t.addTree(\"a\");\n-\t\tfinal FileTreeEntry e3 = t.addFile(\"a=\");\n-\t\tfinal FileTreeEntry e4 = t.addFile(\"a=b\");\n+\t\tfinal FileTreeEntry e0 = t.addFile(\"a-b\");\n+\t\tfinal FileTreeEntry e1 = t.addFile(\"a-\");\n+\t\tfinal FileTreeEntry e2 = t.addFile(\"a=b\");\n+\t\tfinal Tree e3 = t.addTree(\"a\");\n+\t\tfinal FileTreeEntry e4 = t.addFile(\"a=\");\n \n \t\tfinal TreeEntry[] ents = t.members();\n-\t\tassertSame(e2, ents[0]);\n+\t\tassertSame(e1, ents[0]);\n \t\tassertSame(e0, ents[1]);\n-\t\tassertSame(e1, ents[2]);\n-\t\tassertSame(e3, ents[3]);\n-\t\tassertSame(e4, ents[4]);\n+\t\tassertSame(e3, ents[2]);\n+\t\tassertSame(e4, ents[3]);\n+\t\tassertSame(e2, ents[4]);\n \t}\n }\ndiff --git a/org.spearce.jgit/tst/org/spearce/jgit/lib/T0006_DeepSpeedTest.java b/org.spearce.jgit/tst/org/spearce/jgit/lib/T0006_DeepSpeedTest.java\nindex 2ae9d42..b4ae4b8 100644\n--- a/org.spearce.jgit/tst/org/spearce/jgit/lib/T0006_DeepSpeedTest.java\n+++ b/org.spearce.jgit/tst/org/spearce/jgit/lib/T0006_DeepSpeedTest.java\n@@ -39,7 +39,7 @@ public class T0006_DeepSpeedTest extends SpeedTestBase {\n \t\t\tif (parent.size() > 0) {\n \t\t\t\tObjectId parentId = (ObjectId) parent.get(0);\n \t\t\t\tcommit = db.mapCommit(parentId);\n-\t\t\t\tTreeEntry m = commit.getTree().findMember(\"net/netfilter/nf_queue.c\");\n+\t\t\t\tTreeEntry m = commit.getTree().findBlobMember(\"net/netfilter/nf_queue.c\");\n \t\t\t\tif (m != null)\n \t\t\t\t\tcommit.getCommitId().toString();\n \t\t\t\t++n;\n"},{"id":"40156","messageId":"20070422213608.26396.16129.stgit@lathund.dewire.com","threadId":"7786","inReplyTo":"20070422212907.26396.12810.stgit@lathund.dewire.com","subject":"[EGIT PATCH 3/4] Add writeRef method and make writeSymref public.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2007-04-22T21:36:09Z","receivedAt":"2007-04-22T21:36:09Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"The writeRef method is for creating tags and branches. writeSymref\nis for creating symbols like HEAD.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n\n .../src/org/spearce/jgit/lib/Repository.java       |   31 ++++++++++++++++++++++-\n 1 files changed, 30 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\nindex b4d6473..0f2a900 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n@@ -349,7 +349,36 @@ public class Repository {\n \t\t}\n \t}\n \n-\tprivate void writeSymref(final String name, final String target)\n+    public void writeRef(String name, ObjectId id) throws IOException {\n+\t\tFile f = new File(gitDir, name);\n+\t\tFile t = File.createTempFile(\"ref\", null, gitDir);\n+\t\tFileWriter w = new FileWriter(t);\n+\t\ttry {\n+\t\t\tw.write(id.toString());\n+\t\t\tw.write('\\n');\n+\t\t\tw.close();\n+\t\t\tw = null;\n+\t\t\tif (!t.renameTo(f)) {\n+\t\t\t\tf.getParentFile().mkdirs();\n+\t\t\t\tif (!t.renameTo(f)) {\n+\t\t\t\t\tf.delete();\n+\t\t\t\t\tif (!t.renameTo(f)) {\n+\t\t\t\t\t\tt.delete();\n+\t\t\t\t\t\tthrow new ObjectWritingException(\"Unable to\"\n+\t\t\t\t\t\t\t\t+ \" write ref \" + name + \" to point to \"\n+\t\t\t\t\t\t\t\t+ id.toString());\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t} finally {\n+\t\t\tif (w != null) {\n+\t\t\t\tw.close();\n+\t\t\t\tt.delete();\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+    public void writeSymref(final String name, final String target)\n \t\t\tthrows IOException {\n \t\tfinal File s = new File(gitDir, name);\n \t\tfinal File t = File.createTempFile(\"srf\", null, gitDir);\n"},{"id":"40158","messageId":"20070422213615.26396.98374.stgit@lathund.dewire.com","threadId":"7786","inReplyTo":"20070422212907.26396.12810.stgit@lathund.dewire.com","subject":"[EGIT PATCH 4/4] Add a JUnit test project for egit.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2007-04-22T21:36:16Z","receivedAt":"2007-04-22T21:36:16Z","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\n org.spearce.egit.core.test/.classpath              |    7 \n org.spearce.egit.core.test/.project                |   28 ++\n .../.settings/org.eclipse.jdt.core.prefs           |  320 +++++++++++++++++++++++\n .../.settings/org.eclipse.jdt.ui.prefs             |   10 +\n org.spearce.egit.core.test/META-INF/MANIFEST.MF    |   19 +\n org.spearce.egit.core.test/build.properties        |    4 \n .../org.spearce.egit.core--All-Tests.launch        |   39 +++\n .../egit/core/internal/mapping/T0002_history.java  |  108 ++++++++\n .../op/T0001_ConnectProviderOperationTest.java     |  118 ++++++++\n .../src/org/spearce/egit/core/test/Activator.java  |   50 ++++\n .../org/spearce/egit/core/test/GitTestCase.java    |   46 +++\n .../org/spearce/egit/core/test/TestProject.java    |  169 ++++++++++++\n 12 files changed, 918 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.egit.core.test/.classpath b/org.spearce.egit.core.test/.classpath\nnew file mode 100644\nindex 0000000..751c8f2\n--- /dev/null\n+++ b/org.spearce.egit.core.test/.classpath\n@@ -0,0 +1,7 @@\n+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<classpath>\n+\t<classpathentry kind=\"src\" path=\"src\"/>\n+\t<classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER\"/>\n+\t<classpathentry kind=\"con\" path=\"org.eclipse.pde.core.requiredPlugins\"/>\n+\t<classpathentry kind=\"output\" path=\"bin\"/>\n+</classpath>\ndiff --git a/org.spearce.egit.core.test/.project b/org.spearce.egit.core.test/.project\nnew file mode 100644\nindex 0000000..3b7fb2f\n--- /dev/null\n+++ b/org.spearce.egit.core.test/.project\n@@ -0,0 +1,28 @@\n+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<projectDescription>\n+\t<name>org.spearce.egit.core.test</name>\n+\t<comment></comment>\n+\t<projects>\n+\t</projects>\n+\t<buildSpec>\n+\t\t<buildCommand>\n+\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n+\t\t\t<arguments>\n+\t\t\t</arguments>\n+\t\t</buildCommand>\n+\t\t<buildCommand>\n+\t\t\t<name>org.eclipse.pde.ManifestBuilder</name>\n+\t\t\t<arguments>\n+\t\t\t</arguments>\n+\t\t</buildCommand>\n+\t\t<buildCommand>\n+\t\t\t<name>org.eclipse.pde.SchemaBuilder</name>\n+\t\t\t<arguments>\n+\t\t\t</arguments>\n+\t\t</buildCommand>\n+\t</buildSpec>\n+\t<natures>\n+\t\t<nature>org.eclipse.pde.PluginNature</nature>\n+\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n+\t</natures>\n+</projectDescription>\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\nnew file mode 100644\nindex 0000000..16fbddc\n--- /dev/null\n+++ b/org.spearce.egit.core.test/.settings/org.eclipse.jdt.core.prefs\n@@ -0,0 +1,320 @@\n+#Mon Jan 29 20:50:25 EST 2007\n+eclipse.preferences.version=1\n+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled\n+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4\n+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve\n+org.eclipse.jdt.core.compiler.compliance=1.4\n+org.eclipse.jdt.core.compiler.debug.lineNumber=generate\n+org.eclipse.jdt.core.compiler.debug.localVariable=generate\n+org.eclipse.jdt.core.compiler.debug.sourceFile=generate\n+org.eclipse.jdt.core.compiler.doc.comment.support=enabled\n+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning\n+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\n+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore\n+org.eclipse.jdt.core.compiler.problem.deprecation=warning\n+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled\n+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled\n+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning\n+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning\n+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\n+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning\n+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning\n+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning\n+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error\n+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error\n+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error\n+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning\n+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore\n+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error\n+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error\n+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled\n+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled\n+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled\n+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.missingJavadocCommentsOverriding=disabled\n+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected\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+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning\n+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error\n+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error\n+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore\n+org.eclipse.jdt.core.compiler.problem.nullReference=warning\n+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning\n+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore\n+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error\n+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore\n+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled\n+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error\n+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled\n+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning\n+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning\n+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning\n+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning\n+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning\n+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning\n+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error\n+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore\n+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error\n+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled\n+org.eclipse.jdt.core.compiler.problem.unusedImport=error\n+org.eclipse.jdt.core.compiler.problem.unusedLabel=error\n+org.eclipse.jdt.core.compiler.problem.unusedLocal=error\n+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning\n+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled\n+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled\n+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error\n+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error\n+org.eclipse.jdt.core.compiler.source=1.4\n+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false\n+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16\n+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16\n+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16\n+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16\n+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16\n+org.eclipse.jdt.core.formatter.alignment_for_assignment=0\n+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16\n+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16\n+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80\n+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0\n+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16\n+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16\n+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16\n+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16\n+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16\n+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16\n+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16\n+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16\n+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16\n+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16\n+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1\n+org.eclipse.jdt.core.formatter.blank_lines_after_package=1\n+org.eclipse.jdt.core.formatter.blank_lines_before_field=1\n+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0\n+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1\n+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1\n+org.eclipse.jdt.core.formatter.blank_lines_before_method=1\n+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1\n+org.eclipse.jdt.core.formatter.blank_lines_before_package=0\n+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1\n+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line\n+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line\n+org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false\n+org.eclipse.jdt.core.formatter.comment.format_comments=true\n+org.eclipse.jdt.core.formatter.comment.format_header=false\n+org.eclipse.jdt.core.formatter.comment.format_html=true\n+org.eclipse.jdt.core.formatter.comment.format_source_code=true\n+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true\n+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true\n+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert\n+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert\n+org.eclipse.jdt.core.formatter.comment.line_length=80\n+org.eclipse.jdt.core.formatter.compact_else_if=true\n+org.eclipse.jdt.core.formatter.continuation_indentation=2\n+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2\n+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false\n+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true\n+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true\n+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true\n+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true\n+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true\n+org.eclipse.jdt.core.formatter.indent_empty_lines=false\n+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true\n+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true\n+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true\n+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false\n+org.eclipse.jdt.core.formatter.indentation.size=4\n+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert\n+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert\n+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert\n+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert\n+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert\n+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert\n+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert\n+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert\n+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert\n+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert\n+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert\n+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert\n+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert\n+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert\n+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert\n+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false\n+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false\n+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false\n+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false\n+org.eclipse.jdt.core.formatter.lineSplit=80\n+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0\n+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1\n+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true\n+org.eclipse.jdt.core.formatter.tabulation.char=tab\n+org.eclipse.jdt.core.formatter.tabulation.size=4\n+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false\ndiff --git a/org.spearce.egit.core.test/.settings/org.eclipse.jdt.ui.prefs b/org.spearce.egit.core.test/.settings/org.eclipse.jdt.ui.prefs\nnew file mode 100644\nindex 0000000..273e64b\n--- /dev/null\n+++ b/org.spearce.egit.core.test/.settings/org.eclipse.jdt.ui.prefs\n@@ -0,0 +1,10 @@\n+#Mon Jan 29 20:38:19 EST 2007\n+eclipse.preferences.version=1\n+formatter_profile=_EGit\n+formatter_settings_version=10\n+internal.default.compliance=user\n+org.eclipse.jdt.ui.ignorelowercasenames=true\n+org.eclipse.jdt.ui.importorder=java;javax;org;com;\n+org.eclipse.jdt.ui.ondemandthreshold=99\n+org.eclipse.jdt.ui.staticondemandthreshold=99\n+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\\=\"1.0\" encoding\\=\"UTF-8\"?><templates/>\ndiff --git a/org.spearce.egit.core.test/META-INF/MANIFEST.MF b/org.spearce.egit.core.test/META-INF/MANIFEST.MF\nnew file mode 100644\nindex 0000000..e201e46\n--- /dev/null\n+++ b/org.spearce.egit.core.test/META-INF/MANIFEST.MF\n@@ -0,0 +1,19 @@\n+Manifest-Version: 1.0\n+Bundle-ManifestVersion: 2\n+Bundle-Name: Test Plug-in\n+Bundle-SymbolicName: org.spearce.egit.core.test\n+Bundle-Version: 0.2.0\n+Bundle-Activator: org.spearce.egit.core.test.Activator\n+Require-Bundle: org.eclipse.core.runtime,\n+ org.eclipse.team.core,\n+ org.junit,\n+ org.spearce.egit.core,\n+ org.spearce.egit.ui,\n+ org.spearce.jgit,\n+ org.eclipse.core.filesystem\n+Eclipse-LazyStart: true\n+Import-Package: org.eclipse.core.resources,\n+ org.eclipse.jdt.core,\n+ org.eclipse.jdt.junit,\n+ org.eclipse.jdt.launching\n+Export-Package: org.spearce.egit.core.internal.mapping\ndiff --git a/org.spearce.egit.core.test/build.properties b/org.spearce.egit.core.test/build.properties\nnew file mode 100644\nindex 0000000..34d2e4d\n--- /dev/null\n+++ b/org.spearce.egit.core.test/build.properties\n@@ -0,0 +1,4 @@\n+source.. = src/\n+output.. = bin/\n+bin.includes = META-INF/,\\\n+               .\ndiff --git a/org.spearce.egit.core.test/org.spearce.egit.core--All-Tests.launch b/org.spearce.egit.core.test/org.spearce.egit.core--All-Tests.launch\nnew file mode 100644\nindex 0000000..f4c9d3c\n--- /dev/null\n+++ b/org.spearce.egit.core.test/org.spearce.egit.core--All-Tests.launch\n@@ -0,0 +1,39 @@\n+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<launchConfiguration type=\"org.eclipse.pde.ui.JunitLaunchConfig\">\n+<stringAttribute key=\"product\" value=\"org.eclipse.sdk.ide\"/>\n+<stringAttribute key=\"bootstrap\" value=\"\"/>\n+<booleanAttribute key=\"useProduct\" value=\"true\"/>\n+<booleanAttribute key=\"tracing\" value=\"false\"/>\n+<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES\">\n+<listEntry value=\"4\"/>\n+</listAttribute>\n+<listAttribute key=\"org.eclipse.debug.ui.favoriteGroups\">\n+<listEntry value=\"org.eclipse.debug.ui.launchGroup.run\"/>\n+<listEntry value=\"org.eclipse.debug.ui.launchGroup.debug\"/>\n+</listAttribute>\n+<stringAttribute key=\"org.eclipse.jdt.junit.CONTAINER\" value=\"=org.spearce.egit.core.test\"/>\n+<booleanAttribute key=\"automaticValidate\" value=\"false\"/>\n+<booleanAttribute key=\"org.eclipse.jdt.junit.KEEPRUNNING_ATTR\" value=\"false\"/>\n+<booleanAttribute key=\"automaticAdd\" value=\"true\"/>\n+<stringAttribute key=\"checked\" value=\"[NONE]\"/>\n+<stringAttribute key=\"location\" value=\"${workspace_loc}/../junit-workspace\"/>\n+<stringAttribute key=\"configLocation\" value=\"${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit\"/>\n+<booleanAttribute key=\"clearws\" value=\"true\"/>\n+<stringAttribute key=\"org.eclipse.jdt.launching.MAIN_TYPE\" value=\"\"/>\n+<stringAttribute key=\"pde.version\" value=\"3.3\"/>\n+<stringAttribute key=\"org.eclipse.jdt.launching.VM_ARGUMENTS\" value=\"-ea\"/>\n+<booleanAttribute key=\"default\" value=\"true\"/>\n+<booleanAttribute key=\"clearConfig\" value=\"true\"/>\n+<booleanAttribute key=\"org.eclipse.debug.core.appendEnvironmentVariables\" value=\"true\"/>\n+<stringAttribute key=\"org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER\" value=\"org.eclipse.pde.ui.workbenchClasspathProvider\"/>\n+<booleanAttribute key=\"useDefaultConfigArea\" value=\"false\"/>\n+<booleanAttribute key=\"useDefaultConfig\" value=\"true\"/>\n+<stringAttribute key=\"org.eclipse.jdt.junit.TESTNAME\" value=\"\"/>\n+<stringAttribute key=\"org.eclipse.jdt.launching.PROJECT_ATTR\" value=\"org.spearce.egit.core.test\"/>\n+<booleanAttribute key=\"askclear\" value=\"false\"/>\n+<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_PATHS\">\n+<listEntry value=\"/org.spearce.egit.core.test\"/>\n+</listAttribute>\n+<booleanAttribute key=\"includeOptional\" value=\"true\"/>\n+<stringAttribute key=\"org.eclipse.jdt.junit.TEST_KIND\" value=\"org.eclipse.jdt.junit.loader.junit3\"/>\n+</launchConfiguration>\ndiff --git a/org.spearce.egit.core.test/src/org/spearce/egit/core/internal/mapping/T0002_history.java b/org.spearce.egit.core.test/src/org/spearce/egit/core/internal/mapping/T0002_history.java\nnew file mode 100644\nindex 0000000..aaf9dce\n--- /dev/null\n+++ b/org.spearce.egit.core.test/src/org/spearce/egit/core/internal/mapping/T0002_history.java\n@@ -0,0 +1,108 @@\n+/*\n+ *  Copyright (C) 2006  Robin Rosenberg <robin.rosenberg@dewire.com>\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.internal.mapping;\n+\n+import java.io.File;\n+import java.io.FileWriter;\n+import java.io.IOException;\n+import java.util.Date;\n+\n+import org.eclipse.core.runtime.NullProgressMonitor;\n+import org.eclipse.team.core.RepositoryProvider;\n+import org.eclipse.team.core.history.IFileHistory;\n+import org.eclipse.team.core.history.IFileHistoryProvider;\n+import org.eclipse.team.core.history.IFileRevision;\n+import org.spearce.egit.core.GitProvider;\n+import org.spearce.egit.core.op.ConnectProviderOperation;\n+import org.spearce.egit.core.test.GitTestCase;\n+import org.spearce.jgit.lib.Commit;\n+import org.spearce.jgit.lib.FileTreeEntry;\n+import org.spearce.jgit.lib.ObjectId;\n+import org.spearce.jgit.lib.ObjectWriter;\n+import org.spearce.jgit.lib.PersonIdent;\n+import org.spearce.jgit.lib.Repository;\n+import org.spearce.jgit.lib.Tree;\n+\n+public class T0002_history extends GitTestCase {\n+\n+\tprotected static final PersonIdent jauthor;\n+\n+\tprotected static final PersonIdent jcommitter;\n+\n+\tstatic {\n+\t\tjauthor = new PersonIdent(\"J. Author\", \"jauthor@example.com\");\n+\t\tjcommitter = new PersonIdent(\"J. Committer\", \"jcommitter@example.com\");\n+\t}\n+\n+\tprivate File workDir;\n+\tprivate File gitDir;\n+\tprivate Repository thisGit;\n+\tprivate Tree tree;\n+\tprivate ObjectWriter objectWriter;\n+\n+\tprotected void setUp() throws Exception {\n+\t\tsuper.setUp();\n+\t\tproject.createSourceFolder();\n+\t\tgitDir = new File(project.getProject().getWorkspace().getRoot()\n+\t\t\t\t.getRawLocation().toFile(), \".git\");\n+\t\tworkDir = gitDir.getParentFile();\n+\t\tthisGit = new Repository(gitDir);\n+\t\tthisGit.create();\n+\t\tobjectWriter = new ObjectWriter(thisGit);\n+\n+\t\ttree = new Tree(thisGit);\n+\t\tTree projectTree = tree.addTree(\"Project-1\");\n+\t\tFile project1_a_txt = createFile(\"Project-1/A.txt\",\"A.txt - first version\\n\");\n+\t\taddFile(projectTree,project1_a_txt);\n+\t\tprojectTree.setId(objectWriter.writeTree(projectTree));\n+\t\ttree.setId(objectWriter.writeTree(tree));\n+\t\tCommit commit = new Commit(thisGit);\n+\t\tcommit.setAuthor(new PersonIdent(jauthor, new Date(0L)));\n+\t\tcommit.setCommitter(new PersonIdent(jcommitter, new Date(0L)));\n+\t\tcommit.setMessage(\"Foo\\n\\nMessage\");\n+\t\tcommit.setTree(tree);\n+\t\tObjectId commitId = objectWriter.writeCommit(commit);\n+\t\tthisGit.writeRef(\"refs/heads/master\", commitId);\n+\n+\t\tConnectProviderOperation operation = new ConnectProviderOperation(\n+\t\t\t\tproject.getProject(), null);\n+\t\toperation.run(null);\n+\t}\n+\t\n+\tprivate void addFile(Tree t,File f) throws IOException {\n+\t\tObjectId id = objectWriter.writeBlob(f);\n+\t\tt.addEntry(new FileTreeEntry(t,id,f.getName().getBytes(\"UTF-8\"),false));\n+\t}\n+\n+\tprivate File createFile(String name, String content) throws IOException {\n+\t\tFile f = new File(workDir, name);\n+\t\tFileWriter fileWriter = new FileWriter(f);\n+\t\tfileWriter.write(content);\n+\t\tfileWriter.close();\n+\t\treturn f;\n+\t}\n+\n+\tpublic void testShallowHistory() {\n+\t\tGitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);\n+\t\tassertNotNull(provider);\n+\t\tIFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();\n+\t\tIFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember(\"Project-1/A.txt\"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());\n+\t\tIFileRevision[] fileRevisions = fileHistory.getFileRevisions();\n+\t\tassertEquals(1, fileRevisions.length);\n+\t\tassertEquals(\"e2eadee5e6de7315df91cf03a75a8b2194a69af2\", fileRevisions[0].getContentIdentifier());\n+\t}\n+}\ndiff --git a/org.spearce.egit.core.test/src/org/spearce/egit/core/op/T0001_ConnectProviderOperationTest.java b/org.spearce.egit.core.test/src/org/spearce/egit/core/op/T0001_ConnectProviderOperationTest.java\nnew file mode 100644\nindex 0000000..63ba83e\n--- /dev/null\n+++ b/org.spearce.egit.core.test/src/org/spearce/egit/core/op/T0001_ConnectProviderOperationTest.java\n@@ -0,0 +1,118 @@\n+package org.spearce.egit.core.op;\n+\n+import java.io.ByteArrayInputStream;\n+import java.io.File;\n+import java.io.IOException;\n+import java.util.Date;\n+import java.util.TimeZone;\n+\n+import org.eclipse.core.resources.IFile;\n+import org.eclipse.core.runtime.CoreException;\n+import org.eclipse.core.runtime.IProgressMonitor;\n+import org.eclipse.core.runtime.IStatus;\n+import org.eclipse.core.runtime.jobs.Job;\n+import org.eclipse.team.core.RepositoryProvider;\n+import org.spearce.egit.core.test.GitTestCase;\n+import org.spearce.jgit.lib.Commit;\n+import org.spearce.jgit.lib.FileTreeEntry;\n+import org.spearce.jgit.lib.ObjectId;\n+import org.spearce.jgit.lib.ObjectWriter;\n+import org.spearce.jgit.lib.PersonIdent;\n+import org.spearce.jgit.lib.Repository;\n+import org.spearce.jgit.lib.Tree;\n+\n+public class T0001_ConnectProviderOperationTest extends GitTestCase {\n+\n+\tpublic void testNoRepository() throws CoreException {\n+\n+\t\tConnectProviderOperation operation = new ConnectProviderOperation(\n+\t\t\t\tproject.getProject(), null);\n+\t\toperation.run(null);\n+\n+\t\t// We are shared because we declared as shared\n+\t\tassertTrue(RepositoryProvider.isShared(project.getProject()));\n+\t\tassertTrue(!gitDir.exists());\n+\t}\n+\n+\tpublic void testNewRepository() throws CoreException {\n+\n+\t\tFile gitDir = new File(project.getProject().getWorkspace().getRoot()\n+\t\t\t\t.getRawLocation().toFile(), \".git\");\n+\t\tConnectProviderOperation operation = new ConnectProviderOperation(\n+\t\t\t\tproject.getProject(), gitDir);\n+\t\toperation.run(null);\n+\n+\t\tassertTrue(RepositoryProvider.isShared(project.getProject()));\n+\n+\t\tassertTrue(gitDir.exists());\n+\t}\n+\n+\tpublic void testNewUnsharedFile() throws CoreException, IOException,\n+\t\t\tInterruptedException {\n+\n+\t\tproject.createSourceFolder();\n+\t\tIFile fileA = project.getProject().getFolder(\"src\").getFile(\"A.java\");\n+\t\tString srcA = \"class A {\\n\" + \"}\\n\";\n+\t\tfileA.create(new ByteArrayInputStream(srcA.getBytes()), false, null);\n+\n+\t\tFile gitDir = new File(project.getProject().getWorkspace().getRoot()\n+\t\t\t\t.getRawLocation().toFile(), \".git\");\n+\t\tRepository thisGit = new Repository(gitDir);\n+\t\tthisGit.create();\n+\t\tTree rootTree = new Tree(thisGit);\n+\t\tTree prjTree = rootTree.addTree(project.getProject().getName());\n+\t\tTree srcTree = prjTree.addTree(\"src\");\n+\t\tFileTreeEntry entryA = srcTree.addFile(\"A.java\");\n+\t\tObjectWriter writer = new ObjectWriter(thisGit);\n+\t\tentryA.setId(writer.writeBlob(fileA.getRawLocation().toFile()));\n+\t\tsrcTree.setId(writer.writeTree(srcTree));\n+\t\tprjTree.setId(writer.writeTree(prjTree));\n+\t\trootTree.setId(writer.writeTree(rootTree));\n+\t\tCommit commit = new Commit(thisGit);\n+\t\tcommit.setTree(rootTree);\n+\t\tcommit.setAuthor(new PersonIdent(\"J. Git\", \"j.git@egit.org\", new Date(\n+\t\t\t\t1999, 1, 1), TimeZone.getTimeZone(\"GMT+1\")));\n+\t\tcommit.setCommitter(commit.getAuthor());\n+\t\tcommit.setMessage(\"testNewUnsharedFile\\n\\nJunit tests\\n\");\n+\t\tObjectId id = writer.writeCommit(commit);\n+\t\tthisGit.writeRef(\"refs/heads/master\", id);\n+\n+\t\t// helper asserts, this is not what we are really testing\n+\t\tassertTrue(\"blob missing\", new File(gitDir,\n+\t\t\t\t\"objects/2e/2439c32d01f0ef39644d561945e8f4b2239489\").exists());\n+\n+\t\tassertTrue(\"tree missing\", new File(gitDir,\n+\t\t\t\t\"objects/87/a105cc4bc0a79885d07ec560c3eee49438acf0\").exists());\n+\t\tassertTrue(\"tree missing\", new File(gitDir,\n+\t\t\t\t\"objects/08/ccc3d91a14d337a45f355d3d63bd97fd5e4db9\").exists());\n+\t\tassertTrue(\"tree missing\", new File(gitDir,\n+\t\t\t\t\"objects/9d/aeec817090098f05eeca858e3a552d78b0a346\").exists());\n+\n+\t\tassertTrue(\"commit missing\", new File(gitDir,\n+\t\t\t\t\"objects/45/df73fd9abbc2c61620c036948b1157e4d21253\").exists());\n+\n+\t\tConnectProviderOperation operation = new ConnectProviderOperation(\n+\t\t\t\tproject.getProject(), null);\n+\t\toperation.run(null);\n+\n+\t\tfinal boolean f[] = new boolean[1];\n+\t\tnew Job(\"wait\") {\n+\t\t\tprotected IStatus run(IProgressMonitor monitor) {\n+\n+\t\t\t\tSystem.out.println(\"MyJob\");\n+\t\t\t\tf[0] = true;\n+\t\t\t\treturn null;\n+\t\t\t}\n+\n+\t\t\t{\n+\t\t\t\tsetRule(project.getProject());\n+\t\t\t\tschedule();\n+\t\t\t}\n+\t\t};\n+\t\twhile (!f[0]) {\n+\t\t\tSystem.out.println(\"Waiting\");\n+\t\t\tThread.sleep(1000);\n+\t\t}\n+\t\tSystem.out.println(\"DONE\");\n+\t}\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\nnew file mode 100644\nindex 0000000..9807c84\n--- /dev/null\n+++ b/org.spearce.egit.core.test/src/org/spearce/egit/core/test/Activator.java\n@@ -0,0 +1,50 @@\n+package org.spearce.egit.core.test;\n+\n+import org.eclipse.core.runtime.Plugin;\n+import org.osgi.framework.BundleContext;\n+\n+/**\n+ * The activator class controls the plug-in life cycle\n+ */\n+public class Activator extends Plugin {\n+\n+\t// The plug-in ID\n+\tpublic static final String PLUGIN_ID = \"org.spearce.egit.core.test\";\n+\n+\t// The shared instance\n+\tprivate static Activator plugin;\n+\n+\t/**\n+\t * The constructor\n+\t */\n+\tpublic Activator() {\n+\t}\n+\n+\t/*\n+\t * (non-Javadoc)\n+\t * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)\n+\t */\n+\tpublic void start(BundleContext context) throws Exception {\n+\t\tsuper.start(context);\n+\t\tplugin = this;\n+\t}\n+\n+\t/*\n+\t * (non-Javadoc)\n+\t * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)\n+\t */\n+\tpublic void stop(BundleContext context) throws Exception {\n+\t\tplugin = null;\n+\t\tsuper.stop(context);\n+\t}\n+\n+\t/**\n+\t * Returns the shared instance\n+\t *\n+\t * @return the shared instance\n+\t */\n+\tpublic static Activator getDefault() {\n+\t\treturn plugin;\n+\t}\n+\n+}\ndiff --git a/org.spearce.egit.core.test/src/org/spearce/egit/core/test/GitTestCase.java b/org.spearce.egit.core.test/src/org/spearce/egit/core/test/GitTestCase.java\nnew file mode 100644\nindex 0000000..4e4fbf0\n--- /dev/null\n+++ b/org.spearce.egit.core.test/src/org/spearce/egit/core/test/GitTestCase.java\n@@ -0,0 +1,46 @@\n+package org.spearce.egit.core.test;\n+\n+import java.io.File;\n+import java.io.IOException;\n+\n+import junit.framework.TestCase;\n+\n+public abstract class GitTestCase extends TestCase {\n+\n+\tprotected TestProject project;\n+\n+\tprotected File gitDir;\n+\n+\tprotected void setUp() throws Exception {\n+\t\tsuper.setUp();\n+\t\tproject = new TestProject();\n+\t\tgitDir = new File(project.getProject().getWorkspace().getRoot()\n+\t\t\t\t.getRawLocation().toFile(), \".git\");\n+\t\trmrf(gitDir);\n+\t}\n+\n+\tprotected void tearDown() throws Exception {\n+\t\tsuper.tearDown();\n+\t\tproject.dispose();\n+\t\trmrf(gitDir);\n+\t}\n+\n+\tprivate void rmrf(File d) throws IOException {\n+\t\tif (!d.exists())\n+\t\t\treturn;\n+\n+\t\tFile[] files = d.listFiles();\n+\t\tif (files != null) {\n+\t\t\tfor (int i = 0; i < files.length; ++i) {\n+\t\t\t\tif (files[i].isDirectory())\n+\t\t\t\t\trmrf(files[i]);\n+\t\t\t\telse if (!files[i].delete())\n+\t\t\t\t\tthrow new IOException(files[i] + \" in use or undeletable\");\n+\t\t\t}\n+\t\t}\n+\t\tif (!d.delete())\n+\t\t\tthrow new IOException(d + \" in use or undeletable\");\n+\t\tassert !d.exists();\n+\t}\n+\n+}\ndiff --git a/org.spearce.egit.core.test/src/org/spearce/egit/core/test/TestProject.java b/org.spearce.egit.core.test/src/org/spearce/egit/core/test/TestProject.java\nnew file mode 100644\nindex 0000000..63c0d4b\n--- /dev/null\n+++ b/org.spearce.egit.core.test/src/org/spearce/egit/core/test/TestProject.java\n@@ -0,0 +1,169 @@\n+package org.spearce.egit.core.test;\n+\n+import java.io.IOException;\n+import java.net.MalformedURLException;\n+import java.net.URL;\n+\n+import org.eclipse.core.resources.IFolder;\n+import org.eclipse.core.resources.IProject;\n+import org.eclipse.core.resources.IProjectDescription;\n+import org.eclipse.core.resources.IWorkspaceRoot;\n+import org.eclipse.core.resources.ResourcesPlugin;\n+import org.eclipse.core.runtime.CoreException;\n+import org.eclipse.core.runtime.IPath;\n+import org.eclipse.core.runtime.IPluginDescriptor;\n+import org.eclipse.core.runtime.IPluginRegistry;\n+import org.eclipse.core.runtime.Path;\n+import org.eclipse.core.runtime.Platform;\n+import org.eclipse.jdt.core.IClasspathEntry;\n+import org.eclipse.jdt.core.ICompilationUnit;\n+import org.eclipse.jdt.core.IJavaProject;\n+import org.eclipse.jdt.core.IPackageFragment;\n+import org.eclipse.jdt.core.IPackageFragmentRoot;\n+import org.eclipse.jdt.core.IType;\n+import org.eclipse.jdt.core.JavaCore;\n+import org.eclipse.jdt.core.JavaModelException;\n+import org.eclipse.jdt.launching.JavaRuntime;\n+\n+public class TestProject {\n+\tpublic IProject project;\n+\n+\tpublic IJavaProject javaProject;\n+\n+\tprivate IPackageFragmentRoot sourceFolder;\n+\n+\tpublic TestProject() throws CoreException {\n+\t\tIWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();\n+\t\tproject = root.getProject(\"Project-1\");\n+\t\tproject.create(null);\n+\t\tproject.open(null);\n+\t\tjavaProject = JavaCore.create(project);\n+\t\tIFolder binFolder = createBinFolder();\n+\t\tsetJavaNature();\n+\t\tjavaProject.setRawClasspath(new IClasspathEntry[0], null);\n+\t\tcreateOutputFolder(binFolder);\n+\t\taddSystemLibraries();\n+\t}\n+\n+\tpublic IProject getProject() {\n+\t\treturn project;\n+\t}\n+\n+\tpublic IJavaProject getJavaProject() {\n+\t\treturn javaProject;\n+\t}\n+\n+\tpublic void addJar(String plugin, String jar) throws MalformedURLException,\n+\t\t\tIOException, JavaModelException {\n+\t\tPath result = findFileInPlugin(plugin, jar);\n+\t\tIClasspathEntry[] oldEntries = javaProject.getRawClasspath();\n+\t\tIClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];\n+\t\tSystem.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);\n+\t\tnewEntries[oldEntries.length] = JavaCore.newLibraryEntry(result, null,\n+\t\t\t\tnull);\n+\t\tjavaProject.setRawClasspath(newEntries, null);\n+\t}\n+\n+\tpublic IPackageFragment createPackage(String name) throws CoreException {\n+\t\tif (sourceFolder == null)\n+\t\t\tsourceFolder = createSourceFolder();\n+\t\treturn sourceFolder.createPackageFragment(name, false, null);\n+\t}\n+\n+\tpublic IType createType(IPackageFragment pack, String cuName, String source)\n+\t\t\tthrows JavaModelException {\n+\t\tStringBuffer buf = new StringBuffer();\n+\t\tbuf.append(\"package \" + pack.getElementName() + \";\\n\");\n+\t\tbuf.append(\"\\n\");\n+\t\tbuf.append(source);\n+\t\tICompilationUnit cu = pack.createCompilationUnit(cuName,\n+\t\t\t\tbuf.toString(), false, null);\n+\t\treturn cu.getTypes()[0];\n+\t}\n+\n+\tpublic void dispose() throws CoreException {\n+\t\twaitForIndexer();\n+\t\tproject.delete(true, true, null);\n+\t}\n+\n+\tprivate IFolder createBinFolder() throws CoreException {\n+\t\tIFolder binFolder = project.getFolder(\"bin\");\n+\t\tbinFolder.create(false, true, null);\n+\t\treturn binFolder;\n+\t}\n+\n+\tprivate void setJavaNature() throws CoreException {\n+\t\tIProjectDescription description = project.getDescription();\n+\t\tdescription.setNatureIds(new String[] { JavaCore.NATURE_ID });\n+\t\tproject.setDescription(description, null);\n+\t}\n+\n+\tprivate void createOutputFolder(IFolder binFolder)\n+\t\t\tthrows JavaModelException {\n+\t\tIPath outputLocation = binFolder.getFullPath();\n+\t\tjavaProject.setOutputLocation(outputLocation, null);\n+\t}\n+\n+\tpublic IPackageFragmentRoot createSourceFolder() throws CoreException {\n+\t\tIFolder folder = project.getFolder(\"src\");\n+\t\tfolder.create(false, true, null);\n+\t\tIPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);\n+\t\tIClasspathEntry[] oldEntries = javaProject.getRawClasspath();\n+\t\tIClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];\n+\t\tSystem.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);\n+\t\tnewEntries[oldEntries.length] = JavaCore.newSourceEntry(root.getPath());\n+\t\tjavaProject.setRawClasspath(newEntries, null);\n+\t\treturn root;\n+\t}\n+\n+\tprivate void addSystemLibraries() throws JavaModelException {\n+\t\tIClasspathEntry[] oldEntries = javaProject.getRawClasspath();\n+\t\tIClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];\n+\t\tSystem.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);\n+\t\tnewEntries[oldEntries.length] = JavaRuntime\n+\t\t\t\t.getDefaultJREContainerEntry();\n+\t\tjavaProject.setRawClasspath(newEntries, null);\n+\t}\n+\n+\tprivate Path findFileInPlugin(String plugin, String file)\n+\t\t\tthrows MalformedURLException, IOException {\n+\t\tIPluginRegistry registry = Platform.getPluginRegistry();\n+\t\tIPluginDescriptor descriptor = registry.getPluginDescriptor(plugin);\n+\t\tURL pluginURL = descriptor.getInstallURL();\n+\t\tURL jarURL = new URL(pluginURL, file);\n+\t\tURL localJarURL = Platform.asLocalURL(jarURL);\n+\t\treturn new Path(localJarURL.getPath());\n+\t}\n+\n+\tpublic void waitForIndexer() {\n+\t\t//                new SearchEngine().searchAllTypeNames(ResourcesPlugin.getWorkspace(),\n+\t\t//                                null, null, IJavaSearchConstants.EXACT_MATCH,\n+\t\t//                                IJavaSearchConstants.CASE_SENSITIVE,\n+\t\t//                                IJavaSearchConstants.CLASS, SearchEngine\n+\t\t//                                                .createJavaSearchScope(new IJavaElement[0]),\n+\t\t//                                new ITypeNameRequestor() {\n+\t\t//                                        public void acceptClass(char[] packageName,\n+\t\t//                                                        char[] simpleTypeName, char[][] enclosingTypeNames,\n+\t\t//                                                        String path) {\n+\t\t//                                        }\n+\t\t//                                        public void acceptInterface(char[] packageName,\n+\t\t//                                                        char[] simpleTypeName, char[][] enclosingTypeNames,\n+\t\t//                                                        String path) {\n+\t\t//                                        }\n+\t\t//                                }, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);\n+\t}\n+\n+\t/**\n+\t * @return Returns the sourceFolder.\n+\t */\n+\tpublic IPackageFragmentRoot getSourceFolder() {\n+\t\treturn sourceFolder;\n+\t}\n+\n+\t/**\n+\t * @param sourceFolder The sourceFolder to set.\n+\t */\n+\tpublic void setSourceFolder(IPackageFragmentRoot sourceFolder) {\n+\t\tthis.sourceFolder = sourceFolder;\n+\t}\n+}\n"},{"id":"40249","messageId":"200704240039.48892.robin.rosenberg.lists@dewire.com","threadId":"7786","inReplyTo":"20070422213602.26396.59463.stgit@lathund.dewire.com","subject":"Re: [EGIT PATCH 2/4] Use the Git sort order.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-04-23T22:39:48Z","receivedAt":"2007-04-23T22:39:48Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Oops, lost the decoration here.\n\n-- robin\n\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java b/org.spearce.egit.core/src/org/spearce/egit\n/core/project/GitProjectData.java\nindex 0c4683e..5c250c0 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@@ -274,11 +274,11 @@ public class GitProjectData {\n                return (RepositoryMapping) c2mapping.get(r);\n        }\n\n-       public TreeEntry[] getActiveDiffTreeEntries(IResource r)\n+       public TreeEntry[] getActiveDiffTreeEntries(IResource res)\n                        throws CoreException {\n                String s = null;\n                RepositoryMapping m = null;\n-\n+               IResource r = res;\n                while (r != null) {\n                        m = getRepositoryMapping(r);\n                        if (m != null) {\n@@ -296,7 +296,7 @@ public class GitProjectData {\n\n                if (s != null && m != null && m.getActiveDiff() != null) {\n                        try {\n-                               if (r.getType() == IResource.FILE)\n+                               if (res.getType() == IResource.FILE)\n                                        return m.getActiveDiff().findBlobMember(s);\n                                else\n                                        return m.getActiveDiff().findTreeMember(s);\n"},{"id":"40250","messageId":"200704240041.44466.robin.rosenberg.lists@dewire.com","threadId":"7786","inReplyTo":"20070422213615.26396.98374.stgit@lathund.dewire.com","subject":"Re: [EGIT PATCH 4/4] Add a JUnit test project for egit.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-04-23T22:41:44Z","receivedAt":"2007-04-23T22:41:44Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Match the version number of this plugin.\n\n-- robin\n\ndiff --git a/org.spearce.egit.core.test/META-INF/MANIFEST.MF b/org.spearce.egit.core.test/META-INF/MANIFEST.MF\nindex e201e46..667100f 100644\n--- a/org.spearce.egit.core.test/META-INF/MANIFEST.MF\n+++ b/org.spearce.egit.core.test/META-INF/MANIFEST.MF\n@@ -2,7 +2,7 @@ Manifest-Version: 1.0\n Bundle-ManifestVersion: 2\n Bundle-Name: Test Plug-in\n Bundle-SymbolicName: org.spearce.egit.core.test\n-Bundle-Version: 0.2.0\n+Bundle-Version: 0.2.1.qualifier\n Bundle-Activator: org.spearce.egit.core.test.Activator\n Require-Bundle: org.eclipse.core.runtime,\n  org.eclipse.team.core,\n"},{"id":"40348","messageId":"20070424170918.GA5923@spearce.org","threadId":"7786","inReplyTo":"200704240039.48892.robin.rosenberg.lists@dewire.com","subject":"Re: [EGIT PATCH 2/4] Use the Git sort order.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-04-24T17:09:18Z","receivedAt":"2007-04-24T17:09:18Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:\n> Oops, lost the decoration here.\n\nThanks, I applied all 6 patches.  Good stuff.\n\nUnfortunately this particular patch was totally damaged beyond\nrepair.  What happened to it?  I redid the changes by hand, as even\nafter fixing the line wrapping on the `diff --git` header line\n`git-am -3 --whitespace=strip` was unable to apply the patch to\n0c4683e.  The patch doesn't apply, at all, to that blob.\n\n> diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java b/org.spearce.egit.core/src/org/spearce/egit\n> /core/project/GitProjectData.java\n> index 0c4683e..5c250c0 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> @@ -274,11 +274,11 @@ public class GitProjectData {\n>                 return (RepositoryMapping) c2mapping.get(r);\n>         }\n> \n> -       public TreeEntry[] getActiveDiffTreeEntries(IResource r)\n> +       public TreeEntry[] getActiveDiffTreeEntries(IResource res)\n>                         throws CoreException {\n>                 String s = null;\n>                 RepositoryMapping m = null;\n> -\n> +               IResource r = res;\n>                 while (r != null) {\n>                         m = getRepositoryMapping(r);\n>                         if (m != null) {\n> @@ -296,7 +296,7 @@ public class GitProjectData {\n> \n>                 if (s != null && m != null && m.getActiveDiff() != null) {\n>                         try {\n> -                               if (r.getType() == IResource.FILE)\n> +                               if (res.getType() == IResource.FILE)\n>                                         return m.getActiveDiff().findBlobMember(s);\n>                                 else\n>                                         return m.getActiveDiff().findTreeMember(s);\n\n-- \nShawn.\n"}]}