]> source.dussan.org Git - jgit.git/commitdiff
Mark non-externalizable strings as such 51/8851/4
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Sun, 25 Nov 2012 16:17:20 +0000 (17:17 +0100)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Thu, 27 Dec 2012 15:57:38 +0000 (16:57 +0100)
A few classes such as Constanrs are marked with @SuppressWarnings, as are
toString() methods with many liternal, but otherwise $NLS-n$ is used for
string containing text that should not be translated. A few literals may
fall into the gray zone, but mostly I've tried to only tag the obvious
ones.

Change-Id: I22e50a77e2bf9e0b842a66bdf674e8fa1692f590

259 files changed:
org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleAuthenticator.java
org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AmazonS3Client.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandRef.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Config.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reflog.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadDirCache.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowDirCache.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/eclipse/Ipzilla.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtAuthenticator.java
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java
org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java
org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/PullResult.java
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/ConcurrentRefUpdateException.java
org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java
org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/Edit.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/EditList.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidObjectIdException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/PackProtocolException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/RevisionSyntaxException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/TranslationBundleLoadingException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/TranslationStringMissingException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/TransportException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedCredentialItem.java
org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerHandle.java
org.eclipse.jgit/src/org/eclipse/jgit/events/RepositoryEvent.java
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java
org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreRule.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/GitlinkTreeEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdRef.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/SymbolicRef.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/SymlinkTreeEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/TextProgressMonitor.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/TreeFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/SquashMessageFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategyResolve.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java
org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/Note.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMapMerger.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/NotesMergeConflictException.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/BinaryHunk.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/FormatError.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterKey.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/NotRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/PatternMatchRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/SubStringRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCacheConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackCompactor.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackDescription.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsRepository.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsRepositoryDescription.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/InMemoryRepository.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/CheckoutEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/GC.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LocalCachedPack.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LockFile.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectoryInserter.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectoryPackParser.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackLock.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/RefDirectoryUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ReflogEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WriteConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/BinaryDelta.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaIndex.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectToPack.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchHeadRecord.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandInputStream.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandProgressMonitor.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundle.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UsernamePasswordCredentialsProvider.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkEncryption.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/FileResolver.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotIgnoredFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotTreeFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/SkipWorkTreeFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/util/Base64.java
org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX_Java6.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java
org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java
org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java
org.eclipse.jgit/src/org/eclipse/jgit/util/IntList.java
org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java
org.eclipse.jgit/src/org/eclipse/jgit/util/QuotedString.java
org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java
org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java
org.eclipse.jgit/src/org/eclipse/jgit/util/RefMap.java
org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java
org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java
org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java
org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java
org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java
org.eclipse.jgit/src/org/eclipse/jgit/util/io/ThrowingPrintWriter.java

index 3df5e44331343eb0312efe61176bcfcce47df908..941205af3227f5abcb274f00053df9e1b6a835ea 100644 (file)
@@ -66,11 +66,11 @@ public class ConsoleAuthenticator extends CachedAuthenticator {
        @Override
        protected PasswordAuthentication promptPasswordAuthentication() {
                final String realm = formatRealm();
-               String username = cons.readLine(MessageFormat.format(ConsoleText.get().usernameFor + " ", realm));
+               String username = cons.readLine(MessageFormat.format(ConsoleText.get().usernameFor + " ", realm)); //$NON-NLS-1$
                if (username == null || username.isEmpty()) {
                        return null;
                }
-               char[] password = cons.readPassword(ConsoleText.get().password + " ");
+               char[] password = cons.readPassword(ConsoleText.get().password + " "); //$NON-NLS-1$
                if (password == null) {
                        password = new char[0];
                }
@@ -81,10 +81,10 @@ public class ConsoleAuthenticator extends CachedAuthenticator {
                final StringBuilder realm = new StringBuilder();
                if (getRequestorType() == RequestorType.PROXY) {
                        realm.append(getRequestorType());
-                       realm.append(" ");
+                       realm.append(" "); //$NON-NLS-1$
                        realm.append(getRequestingHost());
                        if (getRequestingPort() > 0) {
-                               realm.append(":");
+                               realm.append(":"); //$NON-NLS-1$
                                realm.append(getRequestingPort());
                        }
                } else {
index 972ce44a4d3dbee404db497272bc823246a69b47..91034fd2cc86d5130f39f423fb8d088f9cf8375e 100644 (file)
@@ -118,7 +118,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
 
        private boolean get(CredentialItem.StringType item) {
                if (item.isValueSecure()) {
-                       char[] v = cons.readPassword("%s: ", item.getPromptText());
+                       char[] v = cons.readPassword("%s: ", item.getPromptText()); //$NON-NLS-1$
                        if (v != null) {
                                item.setValue(new String(v));
                                return true;
@@ -126,7 +126,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
                                return false;
                        }
                } else {
-                       String v = cons.readLine("%s: ", item.getPromptText());
+                       String v = cons.readLine("%s: ", item.getPromptText()); //$NON-NLS-1$
                        if (v != null) {
                                item.setValue(v);
                                return true;
@@ -138,7 +138,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
 
        private boolean get(CredentialItem.CharArrayType item) {
                if (item.isValueSecure()) {
-                       char[] v = cons.readPassword("%s: ", item.getPromptText());
+                       char[] v = cons.readPassword("%s: ", item.getPromptText()); //$NON-NLS-1$
                        if (v != null) {
                                item.setValueNoCopy(v);
                                return true;
@@ -146,7 +146,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
                                return false;
                        }
                } else {
-                       String v = cons.readLine("%s: ", item.getPromptText());
+                       String v = cons.readLine("%s: ", item.getPromptText()); //$NON-NLS-1$
                        if (v != null) {
                                item.setValueNoCopy(v.toCharArray());
                                return true;
@@ -157,13 +157,13 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
        }
 
        private boolean get(CredentialItem.InformationalMessage item) {
-               cons.printf("%s\n", item.getPromptText());
+               cons.printf("%s\n", item.getPromptText()); //$NON-NLS-1$
                cons.flush();
                return true;
        }
 
        private boolean get(CredentialItem.YesNoType item) {
-               String r = cons.readLine("%s [%s/%s]? ", item.getPromptText(),
+               String r = cons.readLine("%s [%s/%s]? ", item.getPromptText(), //$NON-NLS-1$
                                ConsoleText.get().answerYes, ConsoleText.get().answerNo);
                if (r != null) {
                        item.setValue(ConsoleText.get().answerYes.equalsIgnoreCase(r));
index ed0236b811c5bf61303e1fe51768fb1f36c7d077..e4bca2a4961879c17550da910ccd0bc3facead24 100644 (file)
@@ -84,7 +84,7 @@ abstract class AbstractFetchCommand extends TextBuiltin {
                                        shownURI = true;
                                }
 
-                               outw.format(" %c %-17s %-10s -> %s", valueOf(type), longType,
+                               outw.format(" %c %-17s %-10s -> %s", valueOf(type), longType, //$NON-NLS-1$
                                                src, dst);
                                outw.println();
                        }
@@ -150,18 +150,18 @@ abstract class AbstractFetchCommand extends TextBuiltin {
                if (r == RefUpdate.Result.FORCED) {
                        final String aOld = safeAbbreviate(reader, u.getOldObjectId());
                        final String aNew = safeAbbreviate(reader, u.getNewObjectId());
-                       return aOld + "..." + aNew;
+                       return aOld + "..." + aNew; //$NON-NLS-1$
                }
 
                if (r == RefUpdate.Result.FAST_FORWARD) {
                        final String aOld = safeAbbreviate(reader, u.getOldObjectId());
                        final String aNew = safeAbbreviate(reader, u.getNewObjectId());
-                       return aOld + ".." + aNew;
+                       return aOld + ".." + aNew; //$NON-NLS-1$
                }
 
                if (r == RefUpdate.Result.NO_CHANGE)
                        return "[up to date]";
-               return "[" + r.name() + "]";
+               return "[" + r.name() + "]"; //$NON-NLS-1$//$NON-NLS-2$
        }
 
        private String safeAbbreviate(ObjectReader reader, ObjectId id) {
index 8485ab5f3829678ae715f69adea33670614a88e8..365d968aa54a2490deb4b54a10994eaefe1cf786 100644 (file)
@@ -83,7 +83,7 @@ class AmazonS3Client extends TextBuiltin {
        protected void run() throws Exception {
                final AmazonS3 s3 = new AmazonS3(properties());
 
-               if ("get".equals(op)) {
+               if ("get".equals(op)) { //$NON-NLS-1$
                        final URLConnection c = s3.get(bucket, key);
                        int len = c.getContentLength();
                        final InputStream in = c.getInputStream();
@@ -104,14 +104,14 @@ class AmazonS3Client extends TextBuiltin {
                                in.close();
                        }
 
-               } else if ("ls".equals(op) || "list".equals(op)) {
+               } else if ("ls".equals(op) || "list".equals(op)) { //$NON-NLS-1$//$NON-NLS-2$
                        for (final String k : s3.list(bucket, key))
                                outw.println(k);
 
-               } else if ("rm".equals(op) || "delete".equals(op)) {
+               } else if ("rm".equals(op) || "delete".equals(op)) { //$NON-NLS-1$ //$NON-NLS-2$
                        s3.delete(bucket, key);
 
-               } else if ("put".equals(op)) {
+               } else if ("put".equals(op)) { //$NON-NLS-1$
                        final OutputStream os = s3.beginPut(bucket, key, null, null);
                        final byte[] tmp = new byte[2048];
                        int n;
index 801e3972faf1b19618a2c621b5f3fd273c3a78fc..341a25b5160f2bb015d878b8c1f73346fc445161 100644 (file)
@@ -143,16 +143,16 @@ class Blame extends TextBuiltin {
                }
 
                if (abbrev == 0)
-                       abbrev = db.getConfig().getInt("core", "abbrev", 7);
+                       abbrev = db.getConfig().getInt("core", "abbrev", 7); //$NON-NLS-1$ //$NON-NLS-2$
                if (!showBlankBoundary)
-                       root = db.getConfig().getBoolean("blame", "blankboundary", false);
+                       root = db.getConfig().getBoolean("blame", "blankboundary", false); //$NON-NLS-1$ //$NON-NLS-2$
                if (!root)
-                       root = db.getConfig().getBoolean("blame", "showroot", false);
+                       root = db.getConfig().getBoolean("blame", "showroot", false); //$NON-NLS-1$ //$NON-NLS-2$
 
                if (showRawTimestamp)
-                       dateFmt = new SimpleDateFormat("ZZZZ");
+                       dateFmt = new SimpleDateFormat("ZZZZ"); //$NON-NLS-1$
                else
-                       dateFmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ZZZZ");
+                       dateFmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ZZZZ"); //$NON-NLS-1$
 
                BlameGenerator generator = new BlameGenerator(db, file);
                reader = db.newObjectReader();
@@ -170,7 +170,7 @@ class Blame extends TextBuiltin {
                                }
                                generator.reverse(rangeStart, rangeEnd);
                        } else if (revision != null) {
-                               generator.push(null, db.resolve(revision + "^{commit}"));
+                               generator.push(null, db.resolve(revision + "^{commit}")); //$NON-NLS-1$
                        } else {
                                generator.push(null, db.resolve(Constants.HEAD));
                                if (!db.isBare()) {
@@ -203,12 +203,12 @@ class Blame extends TextBuiltin {
                                maxSourceLine = Math.max(maxSourceLine, blame.getSourceLine(line));
                        }
 
-                       String pathFmt = MessageFormat.format(" %{0}s", valueOf(pathWidth));
-                       String numFmt = MessageFormat.format(" %{0}d",
+                       String pathFmt = MessageFormat.format(" %{0}s", valueOf(pathWidth)); //$NON-NLS-1$
+                       String numFmt = MessageFormat.format(" %{0}d", //$NON-NLS-1$
                                        valueOf(1 + (int) Math.log10(maxSourceLine + 1)));
-                       String lineFmt = MessageFormat.format(" %{0}d) ",
+                       String lineFmt = MessageFormat.format(" %{0}d) ", //$NON-NLS-1$
                                        valueOf(1 + (int) Math.log10(end + 1)));
-                       String authorFmt = MessageFormat.format(" (%-{0}s %{1}s",
+                       String authorFmt = MessageFormat.format(" (%-{0}s %{1}s", //$NON-NLS-1$
                                        valueOf(authorWidth), valueOf(dateWidth));
 
                        for (int line = begin; line < end; line++) {
@@ -233,8 +233,8 @@ class Blame extends TextBuiltin {
 
        private void parseLineRangeOption() {
                String beginStr, endStr;
-               if (rangeString.startsWith("/")) {
-                       int c = rangeString.indexOf("/,", 1);
+               if (rangeString.startsWith("/")) { //$NON-NLS-1$
+                       int c = rangeString.indexOf("/,", 1); //$NON-NLS-1$
                        if (c < 0) {
                                beginStr = rangeString;
                                endStr = String.valueOf(end);
@@ -249,7 +249,7 @@ class Blame extends TextBuiltin {
                                beginStr = rangeString;
                                endStr = String.valueOf(end);
                        } else if (c == 0) {
-                               beginStr = "0";
+                               beginStr = "0"; //$NON-NLS-1$
                                endStr = rangeString.substring(1);
                        } else {
                                beginStr = rangeString.substring(0, c);
@@ -257,20 +257,20 @@ class Blame extends TextBuiltin {
                        }
                }
 
-               if (beginStr.equals(""))
+               if (beginStr.equals("")) //$NON-NLS-1$
                        begin = 0;
-               else if (beginStr.startsWith("/"))
+               else if (beginStr.startsWith("/")) //$NON-NLS-1$
                        begin = findLine(0, beginStr);
                else
                        begin = Math.max(0, Integer.parseInt(beginStr) - 1);
 
-               if (endStr.equals(""))
+               if (endStr.equals("")) //$NON-NLS-1$
                        end = blame.getResultContents().size();
-               else if (endStr.startsWith("/"))
+               else if (endStr.startsWith("/")) //$NON-NLS-1$
                        end = findLine(begin, endStr);
-               else if (endStr.startsWith("-"))
+               else if (endStr.startsWith("-")) //$NON-NLS-1$
                        end = begin + Integer.parseInt(endStr);
-               else if (endStr.startsWith("+"))
+               else if (endStr.startsWith("+")) //$NON-NLS-1$
                        end = begin + Integer.parseInt(endStr.substring(1));
                else
                        end = Math.max(0, Integer.parseInt(endStr) - 1);
@@ -278,10 +278,10 @@ class Blame extends TextBuiltin {
 
        private int findLine(int b, String regex) {
                String re = regex.substring(1, regex.length() - 1);
-               if (!re.startsWith("^"))
-                       re = ".*" + re;
-               if (!re.endsWith("$"))
-                       re = re + ".*";
+               if (!re.startsWith("^")) //$NON-NLS-1$
+                       re = ".*" + re; //$NON-NLS-1$
+               if (!re.endsWith("$")) //$NON-NLS-1$
+                       re = re + ".*"; //$NON-NLS-1$
                Pattern p = Pattern.compile(re);
                RawText text = blame.getResultContents();
                for (int line = b; line < text.size(); line++) {
@@ -293,30 +293,30 @@ class Blame extends TextBuiltin {
 
        private String path(int line) {
                String p = blame.getSourcePath(line);
-               return p != null ? p : "";
+               return p != null ? p : ""; //$NON-NLS-1$
        }
 
        private String author(int line) {
                PersonIdent author = blame.getSourceAuthor(line);
                if (author == null)
-                       return "";
+                       return ""; //$NON-NLS-1$
                String name = showAuthorEmail ? author.getEmailAddress() : author
                                .getName();
-               return name != null ? name : "";
+               return name != null ? name : ""; //$NON-NLS-1$
        }
 
        private String date(int line) {
                if (blame.getSourceCommit(line) == null)
-                       return "";
+                       return ""; //$NON-NLS-1$
 
                PersonIdent author = blame.getSourceAuthor(line);
                if (author == null)
-                       return "";
+                       return ""; //$NON-NLS-1$
 
                dateFmt.setTimeZone(author.getTimeZone());
                if (!showRawTimestamp)
                        return dateFmt.format(author.getWhen());
-               return String.format("%d %s",
+               return String.format("%d %s", //$NON-NLS-1$
                                valueOf(author.getWhen().getTime() / 1000L),
                                dateFmt.format(author.getWhen()));
        }
@@ -338,9 +338,9 @@ class Blame extends TextBuiltin {
 
                } else if (!root && commit.getParentCount() == 0) {
                        if (showLongRevision)
-                               r = "^" + commit.name().substring(0, OBJECT_ID_STRING_LENGTH - 1);
+                               r = "^" + commit.name().substring(0, OBJECT_ID_STRING_LENGTH - 1); //$NON-NLS-1$
                        else
-                               r = "^" + reader.abbreviate(commit, abbrev).name();
+                               r = "^" + reader.abbreviate(commit, abbrev).name(); //$NON-NLS-1$
                } else {
                        if (showLongRevision)
                                r = commit.name();
index c20924d3a69ed394c13259ef56c9aff6f76547da..28e30bcbc2cb4843fc5773a5e7692f10a14347b4 100644 (file)
@@ -145,7 +145,7 @@ class Branch extends TextBuiltin {
                                else
                                        startBranch = Constants.HEAD;
                                Ref startRef = db.getRef(startBranch);
-                               ObjectId startAt = db.resolve(startBranch + "^0");
+                               ObjectId startAt = db.resolve(startBranch + "^0"); //$NON-NLS-1$
                                if (startRef != null)
                                        startBranch = startRef.getName();
                                else
@@ -180,7 +180,7 @@ class Branch extends TextBuiltin {
                if (head != null) {
                        String current = head.getLeaf().getName();
                        if (current.equals(Constants.HEAD))
-                               addRef("(no branch)", head);
+                               addRef("(no branch)", head); //$NON-NLS-1$
                        addRefs(refs, Constants.R_HEADS, !remote);
                        addRefs(refs, Constants.R_REMOTES, remote);
 
@@ -220,7 +220,7 @@ class Branch extends TextBuiltin {
                outw.print(ref);
                if (verbose) {
                        final int spaces = maxNameLength - ref.length() + 1;
-                       outw.format("%" + spaces + "s", "");
+                       outw.format("%" + spaces + "s", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        final ObjectId objectId = refObj.getObjectId();
                        outw.print(reader.abbreviate(objectId).name());
                        outw.print(' ');
index 31d8ec8e12ff1aad3c1124504580c8dbdb400885..ddae66e72cb085c3fa305d63ce89ed1aef6f6f18 100644 (file)
@@ -110,7 +110,7 @@ class Clone extends AbstractFetchCommand {
                dst = new FileRepository(gitdir);
                dst.create();
                final FileBasedConfig dstcfg = dst.getConfig();
-               dstcfg.setBoolean("core", null, "bare", false);
+               dstcfg.setBoolean("core", null, "bare", false); //$NON-NLS-1$ //$NON-NLS-2$
                dstcfg.save();
                db = dst;
 
@@ -131,8 +131,8 @@ class Clone extends AbstractFetchCommand {
                final RemoteConfig rc = new RemoteConfig(dstcfg, remoteName);
                rc.addURI(uri);
                rc.addFetchRefSpec(new RefSpec().setForceUpdate(true)
-                               .setSourceDestination(Constants.R_HEADS + "*",
-                                               Constants.R_REMOTES + remoteName + "/*"));
+                               .setSourceDestination(Constants.R_HEADS + "*", //$NON-NLS-1$
+                                               Constants.R_REMOTES + remoteName + "/*")); //$NON-NLS-1$
                rc.update(dstcfg);
                dstcfg.save();
        }
index 700e54118ad10817dad6394fe6404cfc6e44d1c9..2673cc887d339ffe3d74c6dc7cf94df1a41e668b 100644 (file)
@@ -132,7 +132,7 @@ public class CommandCatalog {
 
        private Enumeration<URL> catalogs() {
                try {
-                       final String pfx = "META-INF/services/";
+                       final String pfx = "META-INF/services/"; //$NON-NLS-1$
                        return ldr.getResources(pfx + TextBuiltin.class.getName());
                } catch (IOException err) {
                        return new Vector<URL>().elements();
@@ -143,7 +143,7 @@ public class CommandCatalog {
                final BufferedReader cIn;
                try {
                        final InputStream in = cUrl.openStream();
-                       cIn = new BufferedReader(new InputStreamReader(in, "UTF-8"));
+                       cIn = new BufferedReader(new InputStreamReader(in, "UTF-8")); //$NON-NLS-1$
                } catch (IOException err) {
                        // If we cannot read from the service list, go to the next.
                        //
@@ -153,7 +153,7 @@ public class CommandCatalog {
                try {
                        String line;
                        while ((line = cIn.readLine()) != null) {
-                               if (line.length() > 0 && !line.startsWith("#"))
+                               if (line.length() > 0 && !line.startsWith("#")) //$NON-NLS-1$
                                        load(line);
                        }
                } catch (IOException err) {
index d76a59b60c05c283aeb6367483ba0a70fae2f428..f637abad567548b7b9dd663ffff4e794c65cef77 100644 (file)
@@ -76,13 +76,13 @@ public class CommandRef {
        private CommandRef(final Class<? extends TextBuiltin> clazz, final String cn) {
                impl = clazz;
                name = cn;
-               usage = "";
+               usage = ""; //$NON-NLS-1$
        }
 
        private static String guessName(final Class<? extends TextBuiltin> clazz) {
                final StringBuilder s = new StringBuilder();
-               if (clazz.getName().startsWith("org.eclipse.jgit.pgm.debug."))
-                       s.append("debug-");
+               if (clazz.getName().startsWith("org.eclipse.jgit.pgm.debug.")) //$NON-NLS-1$
+                       s.append("debug-"); //$NON-NLS-1$
 
                boolean lastWasDash = true;
                for (final char c : clazz.getSimpleName().toCharArray()) {
index 0963286e9f5d2e694505ddbf09d085e002a94e9c..a50e744a80b7361f88a300480e09f8816827667e 100644 (file)
@@ -109,7 +109,7 @@ class Commit extends TextBuiltin {
                        if (branchName.startsWith(Constants.R_HEADS))
                                branchName = branchName.substring(Constants.R_HEADS.length());
                }
-               outw.println("[" + branchName + " " + commit.name() + "] "
+               outw.println("[" + branchName + " " + commit.name() + "] " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                                + commit.getShortMessage());
        }
 }
index cf5539f74711ea6c496f661729775e24400f5f76..0eb220407a5c22ae0823d7842ec32913ed57a38f 100644 (file)
@@ -103,7 +103,7 @@ class Config extends TextBuiltin {
                        Set<String> names = config.getNames(section);
                        for (String name : names) {
                                for (String value : config.getStringList(section, null, name))
-                                       outw.println(section + "." + name + "=" + value);
+                                       outw.println(section + "." + name + "=" + value); //$NON-NLS-1$ //$NON-NLS-2$
                        }
                        if (names.isEmpty()) {
                                for (String subsection : config.getSubsections(section)) {
@@ -111,8 +111,8 @@ class Config extends TextBuiltin {
                                        for (String name : names) {
                                                for (String value : config.getStringList(section,
                                                                subsection, name))
-                                                       outw.println(section + "." + subsection + "."
-                                                                       + name + "=" + value);
+                                                       outw.println(section + "." + subsection + "." //$NON-NLS-1$ //$NON-NLS-2$
+                                                                       + name + "=" + value); //$NON-NLS-1$
                                        }
                                }
                        }
index 465df38407d31d209bd05fd19cc416dd3611cd88..d38c53ac507d20b6a0ddcabf4a6b4c3a63ddbe55 100644 (file)
@@ -161,8 +161,8 @@ class Diff extends TextBuiltin {
 
        @Option(name = "--no-prefix", usage = "usage_noPrefix")
        void noPrefix(@SuppressWarnings("unused") boolean on) {
-               diffFmt.setOldPrefix("");
-               diffFmt.setNewPrefix("");
+               diffFmt.setOldPrefix(""); //$NON-NLS-1$
+               diffFmt.setNewPrefix(""); //$NON-NLS-1$
        }
 
        // END -- Options shared with Log
@@ -179,7 +179,7 @@ class Diff extends TextBuiltin {
                try {
                        if (cached) {
                                if (oldTree == null) {
-                                       ObjectId head = db.resolve(HEAD + "^{tree}");
+                                       ObjectId head = db.resolve(HEAD + "^{tree}"); //$NON-NLS-1$
                                        if (head == null)
                                                die(MessageFormat.format(CLIText.get().notATree, HEAD));
                                        CanonicalTreeParser p = new CanonicalTreeParser();
@@ -227,21 +227,21 @@ class Diff extends TextBuiltin {
                for (DiffEntry ent : files) {
                        switch (ent.getChangeType()) {
                        case ADD:
-                               out.println("A\t" + ent.getNewPath());
+                               out.println("A\t" + ent.getNewPath()); //$NON-NLS-1$
                                break;
                        case DELETE:
-                               out.println("D\t" + ent.getOldPath());
+                               out.println("D\t" + ent.getOldPath()); //$NON-NLS-1$
                                break;
                        case MODIFY:
-                               out.println("M\t" + ent.getNewPath());
+                               out.println("M\t" + ent.getNewPath()); //$NON-NLS-1$
                                break;
                        case COPY:
-                               out.format("C%1$03d\t%2$s\t%3$s", valueOf(ent.getScore()), //
+                               out.format("C%1$03d\t%2$s\t%3$s", valueOf(ent.getScore()), // //$NON-NLS-1$
                                                ent.getOldPath(), ent.getNewPath());
                                out.println();
                                break;
                        case RENAME:
-                               out.format("R%1$03d\t%2$s\t%3$s", valueOf(ent.getScore()), //
+                               out.format("R%1$03d\t%2$s\t%3$s", valueOf(ent.getScore()), // //$NON-NLS-1$
                                                ent.getOldPath(), ent.getNewPath());
                                out.println();
                                break;
index ae11f673176b3b51e9991a1825abcf55058248ae..faaf85f76e48468c508dbc974f60b3dc25d3431f 100644 (file)
@@ -104,7 +104,7 @@ class Glog extends RevWalkTextBuiltin {
                graphPane.getCommitList().source(walk);
                graphPane.getCommitList().fillTo(Integer.MAX_VALUE);
 
-               frame.setTitle("[" + repoName() + "]");
+               frame.setTitle("[" + repoName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
                frame.pack();
                frame.setVisible(true);
                return graphPane.getCommitList().size();
index 6ad27ae41afdb432a0a20adb6e4806b06578ec67..eaba6e5138884fa7cda0514e2d3af9b6c25181fc 100644 (file)
@@ -171,8 +171,8 @@ class Log extends RevWalkTextBuiltin {
 
        @Option(name = "--no-prefix", usage = "usage_noPrefix")
        void noPrefix(@SuppressWarnings("unused") boolean on) {
-               diffFmt.setOldPrefix("");
-               diffFmt.setNewPrefix("");
+               diffFmt.setOldPrefix(""); //$NON-NLS-1$
+               diffFmt.setNewPrefix(""); //$NON-NLS-1$
        }
 
        // END -- Options shared with Diff
@@ -238,18 +238,18 @@ class Log extends RevWalkTextBuiltin {
        @Override
        protected void show(final RevCommit c) throws Exception {
                outw.print(CLIText.get().commitLabel);
-               outw.print(" ");
+               outw.print(" "); //$NON-NLS-1$
                c.getId().copyTo(outbuffer, outw);
                if (decorate) {
                        Collection<Ref> list = allRefsByPeeledObjectId.get(c);
                        if (list != null) {
-                               outw.print(" (");
+                               outw.print(" ("); //$NON-NLS-1$
                                for (Iterator<Ref> i = list.iterator(); i.hasNext(); ) {
                                        outw.print(i.next().getName());
                                        if (i.hasNext())
-                                               outw.print(" ");
+                                               outw.print(" "); //$NON-NLS-1$
                                }
-                               outw.print(")");
+                               outw.print(")"); //$NON-NLS-1$
                        }
                }
                outw.println();
@@ -260,9 +260,9 @@ class Log extends RevWalkTextBuiltin {
                                dateFormatter.formatDate(author)));
 
                outw.println();
-               final String[] lines = c.getFullMessage().split("\n");
+               final String[] lines = c.getFullMessage().split("\n"); //$NON-NLS-1$
                for (final String s : lines) {
-                       outw.print("    ");
+                       outw.print("    "); //$NON-NLS-1$
                        outw.print(s);
                        outw.println();
                }
@@ -324,16 +324,16 @@ class Log extends RevWalkTextBuiltin {
                        outw.println();
                outw.print("Notes");
                if (label != null) {
-                       outw.print(" (");
+                       outw.print(" ("); //$NON-NLS-1$
                        outw.print(label);
-                       outw.print(")");
+                       outw.print(")"); //$NON-NLS-1$
                }
-               outw.println(":");
+               outw.println(":"); //$NON-NLS-1$
                try {
                        RawText rawText = new RawText(argWalk.getObjectReader()
                                        .open(blobId).getCachedBytes(Integer.MAX_VALUE));
                        for (int i = 0; i < rawText.size(); i++) {
-                               outw.print("    ");
+                               outw.print("    "); //$NON-NLS-1$
                                outw.println(rawText.getString(i));
                        }
                } catch (LargeObjectException e) {
index d59451c55e44f785dff448d88207f8977e08383d..282c79d1625ccedce4a22d4ddd8db9c95f433ee5 100644 (file)
@@ -71,7 +71,7 @@ class LsRemote extends TextBuiltin {
                        for (final Ref r : c.getRefs()) {
                                show(r.getObjectId(), r.getName());
                                if (r.getPeeledObjectId() != null)
-                                       show(r.getPeeledObjectId(), r.getName() + "^{}");
+                                       show(r.getPeeledObjectId(), r.getName() + "^{}"); //$NON-NLS-1$
                        }
                } finally {
                        c.close();
index 6c5cd2767c2898987cb40ee47e832b7c514e5c83..0d72e639a8c25f741befd5410e6742f757e845e7 100644 (file)
@@ -128,7 +128,7 @@ public class Main {
                                        && err instanceof TransportException)
                                System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getCause().getMessage()));
 
-                       if (err.getClass().getName().startsWith("org.eclipse.jgit.errors.")) {
+                       if (err.getClass().getName().startsWith("org.eclipse.jgit.errors.")) { //$NON-NLS-1$
                                System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage()));
                                if (showStackTrace)
                                        err.printStackTrace();
@@ -163,7 +163,7 @@ public class Main {
 
                if (argv.length == 0 || help) {
                        final String ex = clp.printExample(ExampleMode.ALL, CLIText.get().resourceBundle());
-                       writer.println("jgit" + ex + " command [ARG ...]");
+                       writer.println("jgit" + ex + " command [ARG ...]"); //$NON-NLS-1$
                        if (help) {
                                writer.println();
                                clp.printUsage(writer, CLIText.get().resourceBundle());
@@ -226,8 +226,8 @@ public class Main {
 
        private static boolean installConsole() {
                try {
-                       install("org.eclipse.jgit.console.ConsoleAuthenticator");
-                       install("org.eclipse.jgit.console.ConsoleCredentialsProvider");
+                       install("org.eclipse.jgit.console.ConsoleAuthenticator"); //$NON-NLS-1$
+                       install("org.eclipse.jgit.console.ConsoleCredentialsProvider"); //$NON-NLS-1$
                        return true;
                } catch (ClassNotFoundException e) {
                        return false;
@@ -253,7 +253,7 @@ public class Main {
                        throws IllegalAccessException, InvocationTargetException,
                        NoSuchMethodException, ClassNotFoundException {
                try {
-               Class.forName(name).getMethod("install").invoke(null);
+               Class.forName(name).getMethod("install").invoke(null); //$NON-NLS-1$
                } catch (InvocationTargetException e) {
                        if (e.getCause() instanceof RuntimeException)
                                throw (RuntimeException) e.getCause();
@@ -276,23 +276,23 @@ public class Main {
         *             the value in <code>http_proxy</code> is unsupportable.
         */
        private static void configureHttpProxy() throws MalformedURLException {
-               final String s = System.getenv("http_proxy");
-               if (s == null || s.equals(""))
+               final String s = System.getenv("http_proxy"); //$NON-NLS-1$
+               if (s == null || s.equals("")) //$NON-NLS-1$
                        return;
 
-               final URL u = new URL((s.indexOf("://") == -1) ? "http://" + s : s);
-               if (!"http".equals(u.getProtocol()))
+               final URL u = new URL((s.indexOf("://") == -1) ? "http://" + s : s); //$NON-NLS-1$ //$NON-NLS-2$
+               if (!"http".equals(u.getProtocol())) //$NON-NLS-1$
                        throw new MalformedURLException(MessageFormat.format(CLIText.get().invalidHttpProxyOnlyHttpSupported, s));
 
                final String proxyHost = u.getHost();
                final int proxyPort = u.getPort();
 
-               System.setProperty("http.proxyHost", proxyHost);
+               System.setProperty("http.proxyHost", proxyHost); //$NON-NLS-1$
                if (proxyPort > 0)
-                       System.setProperty("http.proxyPort", String.valueOf(proxyPort));
+                       System.setProperty("http.proxyPort", String.valueOf(proxyPort)); //$NON-NLS-1$
 
                final String userpass = u.getUserInfo();
-               if (userpass != null && userpass.contains(":")) {
+               if (userpass != null && userpass.contains(":")) { //$NON-NLS-1$
                        final int c = userpass.indexOf(':');
                        final String user = userpass.substring(0, c);
                        final String pass = userpass.substring(c + 1);
index 6fe68810a14268318ad650ccebba18d850b0db9c..7eaa5fa3510787cac736c9c6b7148f2f44cbb30e 100644 (file)
@@ -103,7 +103,7 @@ class Merge extends TextBuiltin {
 
                // determine the other revision we want to merge with HEAD
                final Ref srcRef = db.getRef(ref);
-               final ObjectId src = db.resolve(ref + "^{commit}");
+               final ObjectId src = db.resolve(ref + "^{commit}"); //$NON-NLS-1$
                if (src == null)
                        throw die(MessageFormat.format(
                                        CLIText.get().refDoesNotExistOrNoCommit, ref));
@@ -144,11 +144,11 @@ class Merge extends TextBuiltin {
                                case DIRTY_WORKTREE:
                                case DIRTY_INDEX:
                                        outw.println(CLIText.get().dontOverwriteLocalChanges);
-                                       outw.println("        " + entry.getKey());
+                                       outw.println("        " + entry.getKey()); //$NON-NLS-1$
                                        break;
                                case COULD_NOT_DELETE:
                                        outw.println(CLIText.get().cannotDeleteFile);
-                                       outw.println("        " + entry.getKey());
+                                       outw.println("        " + entry.getKey()); //$NON-NLS-1$
                                        break;
                                }
                        break;
@@ -157,7 +157,7 @@ class Merge extends TextBuiltin {
                        if (!isMergedInto(oldHead, src))
                                name = mergeStrategy.getName();
                        else
-                               name = "recursive";
+                               name = "recursive"; //$NON-NLS-1$
                        outw.println(MessageFormat.format(CLIText.get().mergeMadeBy, name));
                        break;
                case MERGED_SQUASHED:
index 534e6de2507982abd984643e19ea2f1dbc1f1f19..8239c96d4c920ddaaff747c632863ea6912aaa9c 100644 (file)
@@ -194,7 +194,7 @@ class Push extends TextBuiltin {
                                        final char flag = fastForward ? ' ' : '+';
                                        final String summary = safeAbbreviate(reader, oldRef
                                                        .getObjectId())
-                                                       + (fastForward ? ".." : "...")
+                                                       + (fastForward ? ".." : "...") //$NON-NLS-1$ //$NON-NLS-2$
                                                        + safeAbbreviate(reader, rru.getNewObjectId());
                                        final String message = fastForward ? null : CLIText.get().forcedUpdate;
                                        printUpdateLine(flag, summary, srcRef, remoteName, message);
@@ -252,14 +252,14 @@ class Push extends TextBuiltin {
        private void printUpdateLine(final char flag, final String summary,
                        final String srcRef, final String destRef, final String message)
                        throws IOException {
-               outw.format(" %c %-17s", valueOf(flag), summary);
+               outw.format(" %c %-17s", valueOf(flag), summary); //$NON-NLS-1$
 
                if (srcRef != null)
-                       outw.format(" %s ->", abbreviateRef(srcRef, true));
-               outw.format(" %s", abbreviateRef(destRef, true));
+                       outw.format(" %s ->", abbreviateRef(srcRef, true)); //$NON-NLS-1$
+               outw.format(" %s", abbreviateRef(destRef, true)); //$NON-NLS-1$
 
                if (message != null)
-                       outw.format(" (%s)", message);
+                       outw.format(" (%s)", message); //$NON-NLS-1$
 
                outw.println();
        }
index 4d877acd5cee916a030db21031c4b4a2290a4d09..4ac7ade5379605c625a1ebad6edc06a42db32f0f 100644 (file)
@@ -73,14 +73,14 @@ class Reflog extends TextBuiltin {
        private String toString(ReflogEntry entry, int i) {\r
                final StringBuilder s = new StringBuilder();\r
                s.append(entry.getNewId().abbreviate(7).name());\r
-               s.append(" ");\r
+               s.append(" "); //$NON-NLS-1$\r
                s.append(ref == null ? Constants.HEAD : Repository.shortenRefName(ref));\r
-               s.append("@{" + i + "}:");\r
-               s.append(" ");\r
+               s.append("@{" + i + "}:"); //$NON-NLS-1$ //$NON-NLS-2$\r
+               s.append(" "); //$NON-NLS-1$\r
                // temporary workaround for bug 393463\r
                if (entry.getOldId().equals(ObjectId.zeroId()))\r
-                       s.append(entry.getComment().replaceFirst("^commit:",\r
-                                       "commit (initial):"));\r
+                       s.append(entry.getComment().replaceFirst("^commit:", //$NON-NLS-1$\r
+                                       "commit (initial):")); //$NON-NLS-1$\r
                else\r
                        s.append(entry.getComment());\r
                return s.toString();\r
index 13dad7a9a06791b393a826522717e7d9bb4400c1..7d6a1713bc7894652c8499bbaaba0a5c25da0758 100644 (file)
@@ -154,14 +154,14 @@ class Show extends TextBuiltin {
 
        @Option(name = "--no-prefix", usage = "usage_noPrefix")
        void noPrefix(@SuppressWarnings("unused") boolean on) {
-               diffFmt.setOldPrefix("");
-               diffFmt.setNewPrefix("");
+               diffFmt.setOldPrefix(""); //$NON-NLS-1$
+               diffFmt.setNewPrefix(""); //$NON-NLS-1$
        }
 
        // END -- Options shared with Diff
 
        Show() {
-               fmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZZ", Locale.US);
+               fmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZZ", Locale.US); //$NON-NLS-1$
        }
 
        @SuppressWarnings("boxing")
@@ -198,7 +198,7 @@ class Show extends TextBuiltin {
                                        break;
 
                                case Constants.OBJ_TREE:
-                                       outw.print("tree ");
+                                       outw.print("tree "); //$NON-NLS-1$
                                        outw.print(objectName);
                                        outw.println();
                                        outw.println();
@@ -225,7 +225,7 @@ class Show extends TextBuiltin {
 
        private void show(RevTag tag) throws IOException {
                outw.print(CLIText.get().tagLabel);
-               outw.print(" ");
+               outw.print(" "); //$NON-NLS-1$
                outw.print(tag.getTagName());
                outw.println();
 
@@ -241,9 +241,9 @@ class Show extends TextBuiltin {
                }
 
                outw.println();
-               final String[] lines = tag.getFullMessage().split("\n");
+               final String[] lines = tag.getFullMessage().split("\n"); //$NON-NLS-1$
                for (final String s : lines) {
-                       outw.print("    ");
+                       outw.print("    "); //$NON-NLS-1$
                        outw.print(s);
                        outw.println();
                }
@@ -261,7 +261,7 @@ class Show extends TextBuiltin {
                        outw.print(walk.getPathString());
                        final FileMode mode = walk.getFileMode(0);
                        if (mode == FileMode.TREE)
-                               outw.print("/");
+                               outw.print("/"); //$NON-NLS-1$
                        outw.println();
                }
        }
@@ -270,7 +270,7 @@ class Show extends TextBuiltin {
                char[] outbuffer = new char[Constants.OBJECT_ID_LENGTH * 2];
 
                outw.print(CLIText.get().commitLabel);
-               outw.print(" ");
+               outw.print(" "); //$NON-NLS-1$
                c.getId().copyTo(outbuffer, outw);
                outw.println();
 
@@ -284,9 +284,9 @@ class Show extends TextBuiltin {
                                fmt.format(author.getWhen())));
 
                outw.println();
-               final String[] lines = c.getFullMessage().split("\n");
+               final String[] lines = c.getFullMessage().split("\n"); //$NON-NLS-1$
                for (final String s : lines) {
-                       outw.print("    ");
+                       outw.print("    "); //$NON-NLS-1$
                        outw.print(s);
                        outw.println();
                }
index 3e0f66109798e86df178540cd85f1520f2178aea..2c621ac897a1e383c7d677bc258faba153eaf640 100644 (file)
@@ -60,7 +60,7 @@ class ShowRef extends TextBuiltin {
                for (final Ref r : getSortedRefs()) {
                        show(r.getObjectId(), r.getName());
                        if (r.getPeeledObjectId() != null)
-                               show(r.getPeeledObjectId(), r.getName() + "^{}");
+                               show(r.getPeeledObjectId(), r.getName() + "^{}"); //$NON-NLS-1$
                }
        }
 
index 6abbfb0354ef34807d7030b4f6cf3c2ef7f59d90..4d2308e2141667221eafdf2959fb414930d3eadc 100644 (file)
@@ -99,7 +99,7 @@ class Status extends TextBuiltin {
                int nbNotStagedForCommit = notStagedForCommit.size();
                if (nbNotStagedForCommit > 0) {
                        if (!firstHeader)
-                               printSectionHeader("");
+                               printSectionHeader(""); //$NON-NLS-1$
                        printSectionHeader(CLIText.get().changesNotStagedForCommit);
                        printList(CLIText.get().statusModified,
                                        CLIText.get().statusRemoved, null, notStagedForCommit,
@@ -109,7 +109,7 @@ class Status extends TextBuiltin {
                int nbUnmerged = unmerged.size();
                if (nbUnmerged > 0) {
                        if (!firstHeader)
-                               printSectionHeader("");
+                               printSectionHeader(""); //$NON-NLS-1$
                        printSectionHeader(CLIText.get().unmergedPaths);
                        printList(unmerged);
                        firstHeader = false;
@@ -117,7 +117,7 @@ class Status extends TextBuiltin {
                int nbUntracked = untracked.size();
                if (nbUntracked > 0) {
                        if (!firstHeader)
-                               printSectionHeader("");
+                               printSectionHeader(""); //$NON-NLS-1$
                        printSectionHeader(CLIText.get().untrackedFiles);
                        printList(untracked);
                }
@@ -127,8 +127,8 @@ class Status extends TextBuiltin {
                        throws IOException {
                outw.println(CLIText.formatLine(MessageFormat
                                .format(pattern, arguments)));
-               if (!pattern.equals(""))
-                       outw.println(CLIText.formatLine(""));
+               if (!pattern.equals("")) //$NON-NLS-1$
+                       outw.println(CLIText.formatLine("")); //$NON-NLS-1$
                outw.flush();
        }
 
index 665b79dfa02499ac2b5bfad57994513038535e9f..23a16ab7468604e232b660c97165440042f22741 100644 (file)
@@ -68,7 +68,7 @@ class Tag extends TextBuiltin {
        private boolean force;
 
        @Option(name = "-m", metaVar = "metaVar_message", usage = "usage_tagMessage")
-       private String message = "";
+       private String message = ""; //$NON-NLS-1$
 
        @Argument(index = 0, metaVar = "metaVar_name")
        private String tagName;
index 87437107d8e62561e7e85c03d37602d6187db7b8..c4e89c34303be63569121f6a2ac93cbb73f13272 100644 (file)
@@ -134,8 +134,7 @@ public abstract class TextBuiltin {
        protected void init(final Repository repository, final String gitDir) {
                try {
                        final String outputEncoding = repository != null ? repository
-                                       .getConfig()
-                                       .getString("i18n", null, "logOutputEncoding") : null;
+                                       .getConfig().getString("i18n", null, "logOutputEncoding") : null; //$NON-NLS-1$ //$NON-NLS-2$
                        if (outs == null)
                                outs = new FileOutputStream(FileDescriptor.out);
                        BufferedWriter bufw;
@@ -208,7 +207,7 @@ public abstract class TextBuiltin {
         * @param clp
         */
        public void printUsageAndExit(final CmdLineParser clp) {
-               printUsageAndExit("", clp);
+               printUsageAndExit("", clp); //$NON-NLS-1$
        }
 
        /**
@@ -220,7 +219,7 @@ public abstract class TextBuiltin {
        public void printUsageAndExit(final String message, final CmdLineParser clp) {
                PrintWriter writer = new PrintWriter(System.err);
                writer.println(message);
-               writer.print("jgit ");
+               writer.print("jgit "); //$NON-NLS-1$
                writer.print(commandName);
                clp.printSingleLineUsage(writer, getResourceBundle());
                writer.println();
index 2a67b389ed4d86c107654e0c00a0ffa84806b448..663f16c6e4df52035bacb68c36a8ddc8682e2dea 100644 (file)
@@ -260,11 +260,11 @@ class DiffAlgorithms extends TextBuiltin {
                                "Algorithm", "Time(ns)", "Time(ns) on", "Time(ns) on");
                outw.format("%-25s %12s ( %12s  %12s )\n", //
                                "", "", "N=" + minN, "N=" + maxN);
-               outw.println("-----------------------------------------------------"
-                               + "----------------");
+               outw.println("-----------------------------------------------------" //$NON-NLS-1$
+                               + "----------------"); //$NON-NLS-1$
 
                for (Test test : all) {
-                       outw.format("%-25s %12d ( %12d  %12d )", //
+                       outw.format("%-25s %12d ( %12d  %12d )", // //$NON-NLS-1$
                                        test.algorithm.name, //
                                        valueOf(test.runningTimeNanos), //
                                        valueOf(test.minN.runningTimeNanos), //
index 9f6bcda2a1af493047e9faab8cc323f43dd2b792..ab4ec2f72b16bc3fcfeaa4aee31ed82dc1a92778 100644 (file)
@@ -59,7 +59,7 @@ class ReadDirCache extends TextBuiltin {
                for (int i = 0; i < cnt; i++)
                        db.readDirCache();
                final long end = System.currentTimeMillis();
-               outw.print(" ");
+               outw.print(" "); //$NON-NLS-1$
                outw.println(MessageFormat.format(CLIText.get().averageMSPerRead,
                                valueOf((end - start) / cnt)));
        }
index b01734e00af643a823a8f5d443d4fda592775ba8..7f1e332ff92d6afafe5e7fe5a63039790c61bd19 100644 (file)
@@ -95,7 +95,7 @@ import org.kohsuke.args4j.Option;
  * <p>
  */
 class RebuildCommitGraph extends TextBuiltin {
-       private static final String REALLY = "--destroy-this-repository";
+       private static final String REALLY = "--destroy-this-repository"; //$NON-NLS-1$
 
        @Option(name = REALLY, usage = "usage_approveDestructionOfRepository")
        boolean really;
@@ -138,7 +138,7 @@ class RebuildCommitGraph extends TextBuiltin {
                try {
                        String line;
                        while ((line = br.readLine()) != null) {
-                               final String[] parts = line.split("[ \t]{1,}");
+                               final String[] parts = line.split("[ \t]{1,}"); //$NON-NLS-1$
                                final ObjectId oldId = ObjectId.fromString(parts[0]);
                                try {
                                        rw.parseCommit(oldId);
@@ -165,8 +165,8 @@ class RebuildCommitGraph extends TextBuiltin {
                pm.beginTask("Rewriting commits", queue.size());
                final ObjectInserter oi = db.newObjectInserter();
                final ObjectId emptyTree = oi.insert(Constants.OBJ_TREE, new byte[] {});
-               final PersonIdent me = new PersonIdent("jgit rebuild-commitgraph",
-                               "rebuild-commitgraph@localhost");
+               final PersonIdent me = new PersonIdent("jgit rebuild-commitgraph", //$NON-NLS-1$
+                               "rebuild-commitgraph@localhost"); //$NON-NLS-1$
                while (!queue.isEmpty()) {
                        final ListIterator<ToRewrite> itr = queue
                                        .listIterator(queue.size());
@@ -196,7 +196,7 @@ class RebuildCommitGraph extends TextBuiltin {
                                newc.setAuthor(new PersonIdent(me, new Date(t.commitTime)));
                                newc.setCommitter(newc.getAuthor());
                                newc.setParentIds(newParents);
-                               newc.setMessage("ORIGINAL " + t.oldId.name() + "\n");
+                               newc.setMessage("ORIGINAL " + t.oldId.name() + "\n"); //$NON-NLS-2$
                                t.newId = oi.insert(newc);
                                rewrites.put(t.oldId, t.newId);
                                pm.update(1);
@@ -277,7 +277,7 @@ class RebuildCommitGraph extends TextBuiltin {
                try {
                        String line;
                        while ((line = br.readLine()) != null) {
-                               final String[] parts = line.split("[ \t]{1,}");
+                               final String[] parts = line.split("[ \t]{1,}"); //$NON-NLS-1$
                                final ObjectId origId = ObjectId.fromString(parts[0]);
                                final String type = parts[1];
                                final String name = parts[2];
index e96e6543c645ccd90be8c42caa01e7e44423fc10..a0b461d4eea33cff8952c376a3da42043ed91b6a 100644 (file)
@@ -103,7 +103,7 @@ class ShowCommands extends TextBuiltin {
                                final ClassLoader ldr = c.getImplementationClassLoader();
 
                                String cn = c.getImplementationClassName();
-                               cn = cn.replace('.', '/') + ".class";
+                               cn = cn.replace('.', '/') + ".class"; //$NON-NLS-1$
 
                                final URL url = ldr.getResource(cn);
                                if (url == null) {
index 040b2e50e7b0929d6964a7fa8fa972110725ae84..e69738c09f2f353e0a48f3d664ac423d4c9a3ce4 100644 (file)
@@ -71,7 +71,7 @@ class ShowDirCache extends TextBuiltin {
                        final int stage = ent.getStage();
 
                        outw.print(mode);
-                       outw.format(" %6d", valueOf(len));
+                       outw.format(" %6d", valueOf(len)); //$NON-NLS-1$
                        outw.print(' ');
                        outw.print(fmt.format(mtime));
                        outw.print(' ');
index df7058f1381680de4e1dedb1ee9db9b5012738aa..e2da0d5fceb25ae73c97b318835e7abf3350521f 100644 (file)
@@ -347,19 +347,19 @@ class TextHashFunctions extends TextBuiltin {
                        File parent = db.getDirectory().getParentFile();
                        if (name.equals(Constants.DOT_GIT) && parent != null)
                                name = parent.getName();
-                       outw.println(name + ":");
+                       outw.println(name + ":"); //$NON-NLS-1$
                }
                outw.format("  %6d files; %5d avg. unique lines/file\n", //
                                valueOf(fileCnt), //
                                valueOf(lineCnt / fileCnt));
                outw.format("%-20s %-15s %9s\n", "Hash", "Fold", "Max Len");
-               outw.println("-----------------------------------------------");
+               outw.println("-----------------------------------------------"); //$NON-NLS-1$
                String lastHashName = null;
                for (Function fun : all) {
                        String hashName = fun.hash.name;
                        if (hashName.equals(lastHashName))
-                               hashName = "";
-                       outw.format("%-20s %-15s %9d\n", //
+                               hashName = ""; //$NON-NLS-1$
+                       outw.format("%-20s %-15s %9d\n", // //$NON-NLS-1$
                                        hashName, //
                                        fun.fold.name, //
                                        valueOf(fun.maxChainLength));
index 6653209a65fb41a8c1045036bd0af30fad5094c6..a6ec91408d8fb00529bfae5f279961b4cecb2d9f 100644 (file)
@@ -59,7 +59,7 @@ import org.kohsuke.args4j.Option;
 @Command(name = "eclipse-ipzilla", common = false, usage = "usage_synchronizeIPZillaData")
 class Ipzilla extends TextBuiltin {
        @Option(name = "--url", metaVar = "metaVar_url", usage = "usage_IPZillaURL")
-       private String url = "https://dev.eclipse.org/ipzilla/";
+       private String url = "https://dev.eclipse.org/ipzilla/"; //$NON-NLS-1$
 
        @Option(name = "--username", metaVar = "metaVar_user", usage = "usage_IPZillaUsername")
        private String username;
index b14130f4aa7ef562cc24f6087c5967dbd0a2cda2..cea32099e2c5f281eab1054ce932e649f559bcbb 100644 (file)
@@ -127,13 +127,13 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser {
                final ArrayList<String> tmp = new ArrayList<String>(args.length);
                for (int argi = 0; argi < args.length; argi++) {
                        final String str = args[argi];
-                       if (str.equals("--")) {
+                       if (str.equals("--")) { //$NON-NLS-1$
                                while (argi < args.length)
                                        tmp.add(args[argi++]);
                                break;
                        }
 
-                       if (str.startsWith("--")) {
+                       if (str.startsWith("--")) { //$NON-NLS-1$
                                final int eq = str.indexOf('=');
                                if (eq > 0) {
                                        tmp.add(str.substring(0, eq));
index bf1753634c33bb91f4b9c7fc5813305d527b0fc3..4d917dcbd3bf562a3b86d1f92284576715f57b0c 100644 (file)
@@ -88,12 +88,12 @@ public class RevCommitHandler extends OptionHandler<RevCommit> {
                String name = params.getParameter(0);
 
                boolean interesting = true;
-               if (name.startsWith("^")) {
+               if (name.startsWith("^")) { //$NON-NLS-1$
                        name = name.substring(1);
                        interesting = false;
                }
 
-               final int dot2 = name.indexOf("..");
+               final int dot2 = name.indexOf(".."); //$NON-NLS-1$
                if (dot2 != -1) {
                        if (!option.isMultiValued())
                                throw new CmdLineException(MessageFormat.format(CLIText.get().onlyOneMetaVarExpectedIn
index e699a72cfaf5166aa8b0c87881dad791ac88bcdc..25d9f97ced120f8b226d2a1ba8c88737326389ce 100644 (file)
@@ -176,7 +176,7 @@ final class AWTPlotRenderer extends AbstractPlotRenderer<SwingLane, Color>
                        g.setBackground(new Color(colorComponents[0],colorComponents[1],colorComponents[2]));
                }
                if (txt.length() > 12)
-                       txt = txt.substring(0,11) + "\u2026"; // ellipsis "…" (in UTF-8)
+                       txt = txt.substring(0,11) + "\u2026"; // ellipsis "…" (in UTF-8) //$NON-NLS-1$
 
                final int texth = g.getFontMetrics().getHeight();
                int textw = g.getFontMetrics().stringWidth(txt);
index 6728d616da268854564c6791bd08e5b96bc5918e..486bbf6ab60eba70f365a933048805b2e985ed46 100644 (file)
@@ -75,13 +75,13 @@ public class AwtAuthenticator extends CachedAuthenticator {
 
                final StringBuilder instruction = new StringBuilder();
                instruction.append(UIText.get().enterUsernameAndPasswordFor);
-               instruction.append(" ");
+               instruction.append(" "); //$NON-NLS-1$
                if (getRequestorType() == RequestorType.PROXY) {
                        instruction.append(getRequestorType());
-                       instruction.append(" ");
+                       instruction.append(" "); //$NON-NLS-1$
                        instruction.append(getRequestingHost());
                        if (getRequestingPort() > 0) {
-                               instruction.append(":");
+                               instruction.append(":"); //$NON-NLS-1$
                                instruction.append(getRequestingPort());
                        }
                } else {
index 9c9d1f4a5c0b94a21b01db4cca13d755e73431a9..0752dceec4bca248da1a4b9a229b73e659409b11 100644 (file)
@@ -94,7 +94,8 @@ public class CommitGraphPane extends JTable {
                int h = 0;
                for (int i = 0; i<getColumnCount(); ++i) {
                        TableCellRenderer renderer = getDefaultRenderer(getColumnClass(i));
-                       Component c = renderer.getTableCellRendererComponent(this, "Ã…Oj", false, false, 0, i);
+                       Component c = renderer.getTableCellRendererComponent(this,
+                                       "Ã…Oj", false, false, 0, i); //$NON-NLS-1$
                        h = Math.max(h, c.getPreferredSize().height);
                }
                setRowHeight(h + getRowMargin());
@@ -129,7 +130,7 @@ public class CommitGraphPane extends JTable {
                final TableColumn author = cols.getColumn(1);
                final TableColumn date = cols.getColumn(2);
 
-               graph.setHeaderValue("");
+               graph.setHeaderValue(""); //$NON-NLS-1$
                author.setHeaderValue(UIText.get().author);
                date.setHeaderValue(UIText.get().date);
 
@@ -186,9 +187,9 @@ public class CommitGraphPane extends JTable {
 
                        final String valueStr;
                        if (pi != null)
-                               valueStr = pi.getName() + " <" + pi.getEmailAddress() + ">";
+                               valueStr = pi.getName() + " <" + pi.getEmailAddress() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
                        else
-                               valueStr = "";
+                               valueStr = ""; //$NON-NLS-1$
                        return super.getTableCellRendererComponent(table, valueStr,
                                        isSelected, hasFocus, row, column);
                }
@@ -198,7 +199,7 @@ public class CommitGraphPane extends JTable {
                private static final long serialVersionUID = 1L;
 
                private final DateFormat fmt = new SimpleDateFormat(
-                               "yyyy-MM-dd HH:mm:ss");
+                               "yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$
 
                public Component getTableCellRendererComponent(final JTable table,
                                final Object value, final boolean isSelected,
@@ -209,7 +210,7 @@ public class CommitGraphPane extends JTable {
                        if (pi != null)
                                valueStr = fmt.format(pi.getWhen());
                        else
-                               valueStr = "";
+                               valueStr = ""; //$NON-NLS-1$
                        return super.getTableCellRendererComponent(table, valueStr,
                                        isSelected, hasFocus, row, column);
                }
index f89f3e480c9763b64745c1b23af1d7989814a925..ef2e987b4e13a0e4a0178953806064909f66a188 100644 (file)
@@ -130,7 +130,7 @@ public class AddCommand extends GitCommand<DirCache> {
                checkCallable();
                DirCache dc = null;
                boolean addAll = false;
-               if (filepatterns.contains("."))
+               if (filepatterns.contains(".")) //$NON-NLS-1$
                        addAll = true;
 
                ObjectInserter inserter = repo.newObjectInserter();
index e6070eccf83bd73e801f3b5ad4c9a6d67d283637..2bda76c323d7c8ad826f76f3805379fc81f48595 100644 (file)
@@ -227,14 +227,14 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
                        }
                }
                if (!isNoNewlineAtEndOfFile(fh))
-                       newLines.add("");
+                       newLines.add(""); //$NON-NLS-1$
                if (!rt.isMissingNewlineAtEnd())
-                       oldLines.add("");
+                       oldLines.add(""); //$NON-NLS-1$
                if (!isChanged(oldLines, newLines))
                        return; // don't touch the file
                StringBuilder sb = new StringBuilder();
                final String eol = rt.size() == 0
-                               || (rt.size() == 1 && rt.isMissingNewlineAtEnd()) ? "\n" : rt
+                               || (rt.size() == 1 && rt.isMissingNewlineAtEnd()) ? "\n" : rt //$NON-NLS-1$
                                .getLineDelimiter();
                for (String l : newLines) {
                        sb.append(l);
index ef227dc85457c7921a36653ffa2ff1ca1a95a738..eb447f3142a03a0a5d3cb9d955958fba30316672 100644 (file)
@@ -218,7 +218,7 @@ public class CheckoutCommand extends GitCommand<Ref> {
 
                        Ref headRef = repo.getRef(Constants.HEAD);
                        String shortHeadRef = getShortBranchName(headRef);
-                       String refLogMessage = "checkout: moving from " + shortHeadRef;
+                       String refLogMessage = "checkout: moving from " + shortHeadRef; //$NON-NLS-1$
                        ObjectId branch = repo.resolve(name);
                        if (branch == null)
                                throw new RefNotFoundException(MessageFormat.format(JGitText
@@ -252,7 +252,7 @@ public class CheckoutCommand extends GitCommand<Ref> {
                        String toName = Repository.shortenRefName(name);
                        RefUpdate refUpdate = repo.updateRef(Constants.HEAD, ref == null);
                        refUpdate.setForceUpdate(force);
-                       refUpdate.setRefLogMessage(refLogMessage + " to " + toName, false);
+                       refUpdate.setRefLogMessage(refLogMessage + " to " + toName, false); //$NON-NLS-1$
                        Result updateResult;
                        if (ref != null)
                                updateResult = refUpdate.link(ref.getName());
@@ -469,7 +469,7 @@ public class CheckoutCommand extends GitCommand<Ref> {
                                && (name == null || !Repository
                                                .isValidRefName(Constants.R_HEADS + name)))
                        throw new InvalidRefNameException(MessageFormat.format(JGitText
-                                       .get().branchNameInvalid, name == null ? "<null>" : name));
+                                       .get().branchNameInvalid, name == null ? "<null>" : name)); //$NON-NLS-1$
        }
 
        /**
index 3d3b47d0896152562899128b5469b6b693b4a9aa..dca7197d180bbd4eab244a37a9176ff32cdce6a5 100644 (file)
@@ -148,7 +148,7 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {
 
                                String ourName = calculateOurName(headRef);
                                String cherryPickName = srcCommit.getId().abbreviate(7).name()
-                                               + " " + srcCommit.getShortMessage();
+                                               + " " + srcCommit.getShortMessage(); //$NON-NLS-1$
 
                                ResolveMerger merger = (ResolveMerger) MergeStrategy.RESOLVE
                                                .newMerger(repo);
@@ -168,7 +168,7 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {
                                        newHead = new Git(getRepository()).commit()
                                                        .setMessage(srcCommit.getFullMessage())
                                                        .setReflogComment(
-                                                                       "cherry-pick: "
+                                                                       "cherry-pick: " //$NON-NLS-1$
                                                                                        + srcCommit.getShortMessage())
                                                        .setAuthor(srcCommit.getAuthorIdent()).call();
                                        cherryPickedRefs.add(src);
index f76d98afd3a4ef41baa617aaadc0af90827d77c2..b42c80f67b40a15801a5ad5240db27eb2ad4b8d0 100644 (file)
@@ -131,7 +131,7 @@ public class CleanCommand extends GitCommand<Set<String>> {
                                                if (!dryRun)
                                                        FileUtils.delete(new File(repo.getWorkTree(), dir),
                                                                        FileUtils.RECURSIVE);
-                                               files.add(dir + "/");
+                                               files.add(dir + "/"); //$NON-NLS-1$
                                        }
                } catch (IOException e) {
                        throw new JGitInternalException(e.getMessage(), e);
index e4c55698e0bbf597c00fb3bb2ba07312e67442e1..22bda612fb75cd3740efe4f058fe4dacd37ff057 100644 (file)
@@ -158,7 +158,8 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
                                + config.getName();
                RefSpec refSpec = new RefSpec();
                refSpec = refSpec.setForceUpdate(true);
-               refSpec = refSpec.setSourceDestination(Constants.R_HEADS + "*", dst + "/*"); //$NON-NLS-1$ //$NON-NLS-2$
+               refSpec = refSpec.setSourceDestination(
+                               Constants.R_HEADS + "*", dst + "/*"); //$NON-NLS-1$ //$NON-NLS-2$
 
                config.addFetchRefSpec(refSpec);
                config.update(clonedRepo.getConfig());
index eab2e8d4b87b2def8c63b2b0b7cccdfb5fb29a47..5f559bcbf8951c0cd3c0a277da3304619a6f110f 100644 (file)
@@ -159,7 +159,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
                                Git git = new Git(repo);
                                try {
                                        git.add()
-                                                       .addFilepattern(".")
+                                                       .addFilepattern(".") //$NON-NLS-1$
                                                        .setUpdate(true).call();
                                } catch (NoFilepatternException e) {
                                        // should really not happen
@@ -173,7 +173,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
                                                JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);
 
                        // determine the current HEAD and the commit it is referring to
-                       ObjectId headId = repo.resolve(Constants.HEAD + "^{commit}");
+                       ObjectId headId = repo.resolve(Constants.HEAD + "^{commit}"); //$NON-NLS-1$
                        if (headId == null && amend)
                                throw new WrongRepositoryStateException(
                                                JGitText.get().commitAmendOnInitialNotPossible);
@@ -226,7 +226,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
                                                if (reflogComment != null) {
                                                        ru.setRefLogMessage(reflogComment, false);
                                                } else {
-                                                       String prefix = amend ? "commit (amend): "
+                                                       String prefix = amend ? "commit (amend): " //$NON-NLS-1$
                                                                        : "commit: ";
                                                        ru.setRefLogMessage(
                                                                        prefix + revCommit.getShortMessage(), false);
@@ -287,9 +287,9 @@ public class CommitCommand extends GitCommand<RevCommit> {
                                author, committer, message);
                message = ChangeIdUtil.insertId(message, changeId);
                if (changeId != null)
-                       message = message.replaceAll("\nChange-Id: I"
-                                       + ObjectId.zeroId().getName() + "\n", "\nChange-Id: I"
-                                       + changeId.getName() + "\n");
+                       message = message.replaceAll("\nChange-Id: I" //$NON-NLS-1$
+                                       + ObjectId.zeroId().getName() + "\n", "\nChange-Id: I" //$NON-NLS-1$ //$NON-NLS-2$
+                                       + changeId.getName() + "\n"); //$NON-NLS-1$
        }
 
        private DirCache createTemporaryIndex(ObjectId headId, DirCache index)
@@ -455,7 +455,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
                        while (true) {
                                if (p.equals(o))
                                        return i;
-                               int l = p.lastIndexOf("/");
+                               int l = p.lastIndexOf("/"); //$NON-NLS-1$
                                if (l < 1)
                                        break;
                                p = p.substring(0, l);
@@ -633,8 +633,8 @@ public class CommitCommand extends GitCommand<RevCommit> {
                checkCallable();
                if (!only.isEmpty())
                        throw new JGitInternalException(MessageFormat.format(
-                                       JGitText.get().illegalCombinationOfArguments, "--all",
-                                       "--only"));
+                                       JGitText.get().illegalCombinationOfArguments, "--all", //$NON-NLS-1$
+                                       "--only")); //$NON-NLS-1$
                this.all = all;
                return this;
        }
@@ -668,9 +668,9 @@ public class CommitCommand extends GitCommand<RevCommit> {
                checkCallable();
                if (all)
                        throw new JGitInternalException(MessageFormat.format(
-                                       JGitText.get().illegalCombinationOfArguments, "--only",
-                                       "--all"));
-               String o = only.endsWith("/") ? only.substring(0, only.length() - 1)
+                                       JGitText.get().illegalCombinationOfArguments, "--only", //$NON-NLS-1$
+                                       "--all")); //$NON-NLS-1$
+               String o = only.endsWith("/") ? only.substring(0, only.length() - 1) //$NON-NLS-1$
                                : only;
                // ignore duplicates
                if (!this.only.contains(o))
index 0cd478cd54c306ca0124e01a18dd4c7fae602fa4..aa1484c0f94434637455f25c7a659f6f45314ddb 100644 (file)
@@ -144,7 +144,7 @@ public class CreateBranchCommand extends GitCommand<Ref> {
                        // determine whether we are based on a commit,
                        // a branch, or a tag and compose the reflog message
                        String refLogMessage;
-                       String baseBranch = "";
+                       String baseBranch = ""; //$NON-NLS-1$
                        if (startPointFullName == null) {
                                String baseCommit;
                                if (startCommit != null)
@@ -155,26 +155,26 @@ public class CreateBranchCommand extends GitCommand<Ref> {
                                        baseCommit = commit.getShortMessage();
                                }
                                if (exists)
-                                       refLogMessage = "branch: Reset start-point to commit "
+                                       refLogMessage = "branch: Reset start-point to commit " //$NON-NLS-1$
                                                        + baseCommit;
                                else
-                                       refLogMessage = "branch: Created from commit " + baseCommit;
+                                       refLogMessage = "branch: Created from commit " + baseCommit; //$NON-NLS-1$
 
                        } else if (startPointFullName.startsWith(Constants.R_HEADS)
                                        || startPointFullName.startsWith(Constants.R_REMOTES)) {
                                baseBranch = startPointFullName;
                                if (exists)
-                                       refLogMessage = "branch: Reset start-point to branch "
+                                       refLogMessage = "branch: Reset start-point to branch " //$NON-NLS-1$
                                                        + startPointFullName; // TODO
                                else
-                                       refLogMessage = "branch: Created from branch " + baseBranch;
+                                       refLogMessage = "branch: Created from branch " + baseBranch; //$NON-NLS-1$
                        } else {
                                startAt = revWalk.peel(revWalk.parseAny(startAt));
                                if (exists)
-                                       refLogMessage = "branch: Reset start-point to tag "
+                                       refLogMessage = "branch: Reset start-point to tag " //$NON-NLS-1$
                                                        + startPointFullName;
                                else
-                                       refLogMessage = "branch: Created from tag "
+                                       refLogMessage = "branch: Created from tag " //$NON-NLS-1$
                                                        + startPointFullName;
                        }
 
@@ -233,9 +233,9 @@ public class CreateBranchCommand extends GitCommand<Ref> {
                                String autosetupflag = repo.getConfig().getString(
                                                ConfigConstants.CONFIG_BRANCH_SECTION, null,
                                                ConfigConstants.CONFIG_KEY_AUTOSETUPMERGE);
-                               if ("false".equals(autosetupflag)) {
+                               if ("false".equals(autosetupflag)) { //$NON-NLS-1$
                                        doConfigure = false;
-                               } else if ("always".equals(autosetupflag)) {
+                               } else if ("always".equals(autosetupflag)) { //$NON-NLS-1$
                                        doConfigure = true;
                                } else {
                                        // in this case, the default is to configure
@@ -246,8 +246,8 @@ public class CreateBranchCommand extends GitCommand<Ref> {
 
                        if (doConfigure) {
                                StoredConfig config = repo.getConfig();
-                               String[] tokens = baseBranch.split("/", 4);
-                               boolean isRemote = tokens[1].equals("remotes");
+                               String[] tokens = baseBranch.split("/", 4); //$NON-NLS-1$
+                               boolean isRemote = tokens[1].equals("remotes"); //$NON-NLS-1$
                                if (isRemote) {
                                        // refs/remotes/<remote name>/<branch>
                                        String remoteName = tokens[2];
@@ -262,7 +262,7 @@ public class CreateBranchCommand extends GitCommand<Ref> {
                                } else {
                                        // set "." as remote
                                        config.setString(ConfigConstants.CONFIG_BRANCH_SECTION,
-                                                       name, ConfigConstants.CONFIG_KEY_REMOTE, ".");
+                                                       name, ConfigConstants.CONFIG_KEY_REMOTE, "."); //$NON-NLS-1$
                                        config.setString(ConfigConstants.CONFIG_BRANCH_SECTION,
                                                        name, ConfigConstants.CONFIG_KEY_MERGE, baseBranch);
                                }
@@ -298,7 +298,7 @@ public class CreateBranchCommand extends GitCommand<Ref> {
                if (name == null
                                || !Repository.isValidRefName(Constants.R_HEADS + name))
                        throw new InvalidRefNameException(MessageFormat.format(JGitText
-                                       .get().branchNameInvalid, name == null ? "<null>" : name));
+                                       .get().branchNameInvalid, name == null ? "<null>" : name)); //$NON-NLS-1$
        }
 
        /**
index 0d03162543b976e350a5fd2144de82b040960713..30b27f22c782c8abad1fce4170cce887f445fcba 100644 (file)
@@ -138,7 +138,7 @@ public class DeleteBranchCommand extends GitCommand<List<String>> {
                                                                                        JGitText.get().cannotDeleteCheckedOutBranch,
                                                                                        branchName));
                                RefUpdate update = repo.updateRef(fullName);
-                               update.setRefLogMessage("branch deleted", false);
+                               update.setRefLogMessage("branch deleted", false); //$NON-NLS-1$
                                update.setForceUpdate(true);
                                Result deleteResult = update.delete();
 
index 9b4476d628e6005b0d16156aa300847cda70cdda..f31198f9460388a48b1c02666bfa3ea7a056314c 100644 (file)
@@ -120,7 +120,7 @@ public class DiffCommand extends GitCommand<List<DiffEntry>> {
                try {
                        if (cached) {
                                if (oldTree == null) {
-                                       ObjectId head = repo.resolve(HEAD + "^{tree}");
+                                       ObjectId head = repo.resolve(HEAD + "^{tree}"); //$NON-NLS-1$
                                        if (head == null)
                                                throw new NoHeadException(JGitText.get().cannotReadTree);
                                        CanonicalTreeParser p = new CanonicalTreeParser();
index 8777be55462d2ae6035e37abb4ac4c8eea0d1125..bf43e90d4285b822fcb403c669e1457eb165a6b2 100644 (file)
@@ -80,7 +80,7 @@ public class InitCommand implements Callable<Git> {
                                        d = new File(d, Constants.DOT_GIT);
                                builder.setGitDir(d);
                        } else if (builder.getGitDir() == null) {
-                               File d = new File(".");
+                               File d = new File("."); //$NON-NLS-1$
                                if (d.getParentFile() != null)
                                        d = d.getParentFile();
                                if (!bare)
index c450ea962cf55f2fcc68eec0c3461f2a0bf04bad..3843dc4a1833d458f4f41d4ccd045a9bde34e1ac 100644 (file)
@@ -161,9 +161,9 @@ public class LsRemoteCommand extends
                        Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1);
                        if (tags)
                                refSpecs.add(new RefSpec(
-                                               "refs/tags/*:refs/remotes/origin/tags/*"));
+                                               "refs/tags/*:refs/remotes/origin/tags/*")); //$NON-NLS-1$
                        if (heads)
-                               refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*"));
+                               refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*")); //$NON-NLS-1$
                        Collection<Ref> refs;
                        Map<String, Ref> refmap = new HashMap<String, Ref>();
                        fc = transport.openFetch();
index a884c70cb098ddbbf23391aad86d93a17214de87..04d91af4b07a1d237b93c85dad582f91a817ffc7 100644 (file)
@@ -151,7 +151,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
                        if (head == null)
                                throw new NoHeadException(
                                                JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);
-                       StringBuilder refLogMessage = new StringBuilder("merge ");
+                       StringBuilder refLogMessage = new StringBuilder("merge "); //$NON-NLS-1$
 
                        // Check for FAST_FORWARD, ALREADY_UP_TO_DATE
                        revWalk = new RevWalk(repo);
@@ -179,7 +179,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
                                                .updateRef(head.getTarget().getName());
                                refUpdate.setNewObjectId(objectId);
                                refUpdate.setExpectedOldObjectId(null);
-                               refUpdate.setRefLogMessage("initial pull", false);
+                               refUpdate.setRefLogMessage("initial pull", false); //$NON-NLS-1$
                                if (refUpdate.update() != Result.NEW)
                                        throw new NoHeadException(
                                                        JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);
@@ -200,7 +200,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
                                        && fastForwardMode == FastForwardMode.FF) {
                                // FAST_FORWARD detected: skip doing a real merge but only
                                // update HEAD
-                               refLogMessage.append(": " + MergeStatus.FAST_FORWARD);
+                               refLogMessage.append(": " + MergeStatus.FAST_FORWARD); //$NON-NLS-1$
                                dco = new DirCacheCheckout(repo,
                                                headCommit.getTree(), repo.lockDirCache(),
                                                srcCommit.getTree());
@@ -233,7 +233,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
                                                        new ObjectId[] { headCommit, srcCommit },
                                                        MergeStatus.ABORTED, mergeStrategy, null, null);
                                }
-                               String mergeMessage = "";
+                               String mergeMessage = ""; //$NON-NLS-1$
                                if (!squash) {
                                        mergeMessage = new MergeMessageFormatter().format(
                                                        commits, head);
@@ -254,7 +254,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
                                if (merger instanceof ResolveMerger) {
                                        ResolveMerger resolveMerger = (ResolveMerger) merger;
                                        resolveMerger.setCommitNames(new String[] {
-                                                       "BASE", "HEAD", ref.getName() });
+                                                       "BASE", "HEAD", ref.getName() }); //$NON-NLS-1$
                                        resolveMerger.setWorkingTreeIterator(new FileTreeIterator(repo));
                                        noProblems = merger.merge(headCommit, srcCommit);
                                        lowLevelResults = resolveMerger
@@ -263,11 +263,11 @@ public class MergeCommand extends GitCommand<MergeResult> {
                                        unmergedPaths = resolveMerger.getUnmergedPaths();
                                } else
                                        noProblems = merger.merge(headCommit, srcCommit);
-                               refLogMessage.append(": Merge made by ");
+                               refLogMessage.append(": Merge made by "); //$NON-NLS-1$
                                if (!revWalk.isMergedInto(headCommit, srcCommit))
                                        refLogMessage.append(mergeStrategy.getName());
                                else
-                                       refLogMessage.append("recursive");
+                                       refLogMessage.append("recursive"); //$NON-NLS-1$
                                refLogMessage.append('.');
                                if (noProblems) {
                                        dco = new DirCacheCheckout(repo,
index 8485a15440b3fd222beafcd87a1cf3389cd58021..1c930ebeb33aeea24ff7f98b8939d06b8731b240 100644 (file)
@@ -324,6 +324,7 @@ public class MergeResult {
                return base;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                boolean first = true;
index 81790988851ae31d6bc5a6a447b0cbdff135b92e..4c935095c33d0847410bd3f3a0848e5a37f34cd5 100644 (file)
@@ -76,7 +76,7 @@ import org.eclipse.jgit.transport.FetchResult;
  */
 public class PullCommand extends TransportCommand<PullCommand, PullResult> {
 
-       private final static String DOT = ".";
+       private final static String DOT = "."; //$NON-NLS-1$
 
        private ProgressMonitor monitor = NullProgressMonitor.INSTANCE;
 
@@ -218,7 +218,7 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> {
                                        JGitText.get().missingConfigurationForKey, missingKey));
                }
 
-               final boolean isRemote = !remote.equals(".");
+               final boolean isRemote = !remote.equals("."); //$NON-NLS-1$
                String remoteUri;
                FetchResult fetchRes;
                if (isRemote) {
index 49327fc9b92cdc18f614232ce69f3e90c699e319..c1eb89db7f8e721758caaaae8c058bd4e793e028 100644 (file)
@@ -112,6 +112,7 @@ public class PullResult {
                return true;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                StringBuilder sb = new StringBuilder();
index 0022672744aad3cbbb5480422c8a42026f59c0cf..3f7feb936f4fbba37c3ff2c4253d1a0755e7c763 100644 (file)
@@ -110,40 +110,40 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
        /**
         * The name of the "rebase-merge" folder
         */
-       public static final String REBASE_MERGE = "rebase-merge";
+       public static final String REBASE_MERGE = "rebase-merge"; //$NON-NLS-1$
 
        /**
         * The name of the "stopped-sha" file
         */
-       public static final String STOPPED_SHA = "stopped-sha";
+       public static final String STOPPED_SHA = "stopped-sha"; //$NON-NLS-1$
 
-       private static final String AUTHOR_SCRIPT = "author-script";
+       private static final String AUTHOR_SCRIPT = "author-script"; //$NON-NLS-1$
 
-       private static final String DONE = "done";
+       private static final String DONE = "done"; //$NON-NLS-1$
 
-       private static final String GIT_AUTHOR_DATE = "GIT_AUTHOR_DATE";
+       private static final String GIT_AUTHOR_DATE = "GIT_AUTHOR_DATE"; //$NON-NLS-1$
 
-       private static final String GIT_AUTHOR_EMAIL = "GIT_AUTHOR_EMAIL";
+       private static final String GIT_AUTHOR_EMAIL = "GIT_AUTHOR_EMAIL"; //$NON-NLS-1$
 
-       private static final String GIT_AUTHOR_NAME = "GIT_AUTHOR_NAME";
+       private static final String GIT_AUTHOR_NAME = "GIT_AUTHOR_NAME"; //$NON-NLS-1$
 
-       private static final String GIT_REBASE_TODO = "git-rebase-todo";
+       private static final String GIT_REBASE_TODO = "git-rebase-todo"; //$NON-NLS-1$
 
-       private static final String HEAD_NAME = "head-name";
+       private static final String HEAD_NAME = "head-name"; //$NON-NLS-1$
 
-       private static final String INTERACTIVE = "interactive";
+       private static final String INTERACTIVE = "interactive"; //$NON-NLS-1$
 
-       private static final String MESSAGE = "message";
+       private static final String MESSAGE = "message"; //$NON-NLS-1$
 
-       private static final String ONTO = "onto";
+       private static final String ONTO = "onto"; //$NON-NLS-1$
 
-       private static final String ONTO_NAME = "onto-name";
+       private static final String ONTO_NAME = "onto-name"; //$NON-NLS-1$
 
-       private static final String PATCH = "patch";
+       private static final String PATCH = "patch"; //$NON-NLS-1$
 
-       private static final String REBASE_HEAD = "head";
+       private static final String REBASE_HEAD = "head"; //$NON-NLS-1$
 
-       private static final String AMEND = "amend";
+       private static final String AMEND = "amend"; //$NON-NLS-1$
 
        /**
         * The available operations
@@ -275,9 +275,9 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                                        for (Step step : steps) {
                                                sb.setLength(0);
                                                sb.append(step.action.token);
-                                               sb.append(" ");
+                                               sb.append(" "); //$NON-NLS-1$
                                                sb.append(step.commit.name());
-                                               sb.append(" ");
+                                               sb.append(" "); //$NON-NLS-1$
                                                sb.append(RawParseUtils.decode(step.shortMessage)
                                                                .trim());
                                                fw.write(sb.toString());
@@ -398,7 +398,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
        }
 
        private RevCommit checkoutCurrentHead() throws IOException, NoHeadException {
-               ObjectId headTree = repo.resolve(Constants.HEAD + "^{tree}");
+               ObjectId headTree = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$
                if (headTree == null)
                        throw new NoHeadException(
                                        JGitText.get().cannotRebaseWithoutCurrentHead);
@@ -442,7 +442,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                treeWalk.reset();
                treeWalk.setRecursive(true);
                treeWalk.addTree(new DirCacheIterator(dc));
-               ObjectId id = repo.resolve(Constants.HEAD + "^{tree}");
+               ObjectId id = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$
                if (id == null)
                        throw new NoHeadException(
                                        JGitText.get().cannotRebaseWithoutCurrentHead);
@@ -496,23 +496,23 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
        String toAuthorScript(PersonIdent author) {
                StringBuilder sb = new StringBuilder(100);
                sb.append(GIT_AUTHOR_NAME);
-               sb.append("='");
+               sb.append("='"); //$NON-NLS-1$
                sb.append(author.getName());
-               sb.append("'\n");
+               sb.append("'\n"); //$NON-NLS-1$
                sb.append(GIT_AUTHOR_EMAIL);
-               sb.append("='");
+               sb.append("='"); //$NON-NLS-1$
                sb.append(author.getEmailAddress());
-               sb.append("'\n");
+               sb.append("'\n"); //$NON-NLS-1$
                // the command line uses the "external String"
                // representation for date and timezone
                sb.append(GIT_AUTHOR_DATE);
-               sb.append("='");
-               sb.append("@"); // @ for time in seconds since 1970
+               sb.append("='"); //$NON-NLS-1$
+               sb.append("@"); // @ for time in seconds since 1970 //$NON-NLS-1$
                String externalString = author.toExternalString();
                sb
                                .append(externalString.substring(externalString
                                                .lastIndexOf('>') + 2));
-               sb.append("'\n");
+               sb.append("'\n"); //$NON-NLS-1$
                return sb.toString();
        }
 
@@ -655,7 +655,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                createFile(rebaseDir, HEAD_NAME, headName);
                createFile(rebaseDir, ONTO, upstreamCommit.name());
                createFile(rebaseDir, ONTO_NAME, upstreamCommitName);
-               createFile(rebaseDir, INTERACTIVE, "");
+               createFile(rebaseDir, INTERACTIVE, ""); //$NON-NLS-1$
                BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(
                                new FileOutputStream(new File(rebaseDir, GIT_REBASE_TODO)),
                                Constants.CHARACTER_ENCODING));
@@ -668,9 +668,9 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                        for (RevCommit commit : cherryPickList) {
                                sb.setLength(0);
                                sb.append(Action.PICK.toToken());
-                               sb.append(" ");
+                               sb.append(" "); //$NON-NLS-1$
                                sb.append(reader.abbreviate(commit).name());
-                               sb.append(" ");
+                               sb.append(" "); //$NON-NLS-1$
                                sb.append(commit.getShortMessage());
                                fw.write(sb.toString());
                                fw.newLine();
@@ -747,8 +747,8 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                                RefUpdate rup = repo.updateRef(headName);
                                rup.setExpectedOldObjectId(oldCommit);
                                rup.setNewObjectId(newCommit);
-                               rup.setRefLogMessage("Fast-foward from " + oldCommit.name()
-                                               + " to " + newCommit.name(), false);
+                               rup.setRefLogMessage("Fast-foward from " + oldCommit.name() //$NON-NLS-1$
+                                               + " to " + newCommit.name(), false); //$NON-NLS-1$
                                Result res = rup.update(walk);
                                switch (res) {
                                case FAST_FORWARD:
@@ -756,7 +756,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                                case FORCED:
                                        break;
                                default:
-                                       throw new IOException("Could not fast-forward");
+                                       throw new IOException("Could not fast-forward"); //$NON-NLS-1$
                                }
                        }
                        return newCommit;
@@ -1082,11 +1082,11 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
         */
        public static enum Action {
                /** Use commit */
-               PICK("pick", "p"),
+               PICK("pick", "p"), //$NON-NLS-1$ //$NON-NLS-2$
                /** Use commit, but edit the commit message */
-               REWORD("reword", "r"),
+               REWORD("reword", "r"), //$NON-NLS-1$ //$NON-NLS-2$
                /** Use commit, but stop for amending */
-               EDIT("edit", "e"); // later add SQUASH, FIXUP, etc.
+               EDIT("edit", "e"); // later add SQUASH, FIXUP, etc. //$NON-NLS-1$ //$NON-NLS-2$
 
                private final String token;
 
@@ -1104,6 +1104,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                        return this.token;
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
                        return "Action[" + token + "]";
@@ -1165,9 +1166,12 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                        return shortMessage;
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
-                       return "Step[" + action + ", "
+                       return "Step["
+                                       + action
+                                       + ", "
                                        + ((commit == null) ? "null" : commit)
                                        + ", "
                                        + ((shortMessage == null) ? "null" : new String(
@@ -1199,7 +1203,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
 
                // the time is saved as <seconds since 1970> <timezone offset>
                int timeStart = 0;
-               if (time.startsWith("@"))
+               if (time.startsWith("@")) //$NON-NLS-1$
                        timeStart = 1;
                else
                        timeStart = 0;
index 22f4ef986268508300c4e1f66b23f6d387312eb1..607253b76d6f7d9c3370452cd45c4d0f3a587d2f 100644 (file)
@@ -101,7 +101,7 @@ public class RenameBranchCommand extends GitCommand<Ref> {
 
                if (newName == null)
                        throw new InvalidRefNameException(MessageFormat.format(JGitText
-                                       .get().branchNameInvalid, "<null>"));
+                                       .get().branchNameInvalid, "<null>")); //$NON-NLS-1$
 
                try {
                        String fullOldName;
index 36c3334b82e6a81b87d4f5fb3bec4afbcc118ebb..80abbec2e320adcda4ae4eb3c9dda468dfaab85c 100644 (file)
@@ -153,7 +153,7 @@ public class ResetCommand extends GitCommand<Ref> {
                        // resolve the ref to a commit
                        final ObjectId commitId;
                        try {
-                               commitId = repo.resolve(ref + "^{commit}");
+                               commitId = repo.resolve(ref + "^{commit}"); //$NON-NLS-1$
                                if (commitId == null) {
                                        // @TODO throw an InvalidRefNameException. We can't do that
                                        // now because this would break the API
@@ -253,7 +253,7 @@ public class ResetCommand extends GitCommand<Ref> {
                if (!filepaths.isEmpty())
                        throw new JGitInternalException(MessageFormat.format(
                                        JGitText.get().illegalCombinationOfArguments,
-                                       "[--mixed | --soft | --hard]", "<paths>..."));
+                                       "[--mixed | --soft | --hard]", "<paths>...")); //$NON-NLS-1$
                this.mode = mode;
                return this;
        }
@@ -267,7 +267,7 @@ public class ResetCommand extends GitCommand<Ref> {
                if (mode != null)
                        throw new JGitInternalException(MessageFormat.format(
                                        JGitText.get().illegalCombinationOfArguments, "<paths>...",
-                                       "[--mixed | --soft | --hard]"));
+                                       "[--mixed | --soft | --hard]")); //$NON-NLS-1$
                filepaths.add(file);
                return this;
        }
index fde6b94d2d8183c65da7dce7a1152f84af7c4463..910637d0e8e1259651ef91e959478bbd5cda4f79 100644 (file)
@@ -164,13 +164,13 @@ public class RevertCommand extends GitCommand<RevCommit> {
                                                        merger.getResultTreeId());
                                        dco.setFailOnConflict(true);
                                        dco.checkout();
-                                       String shortMessage = "Revert \"" + srcCommit.getShortMessage() + "\"";
-                                       String newMessage = shortMessage + "\n\n"
-                                                       + "This reverts commit "
-                                                       + srcCommit.getId().getName() + ".\n";
+                                       String shortMessage = "Revert \"" + srcCommit.getShortMessage() + "\""; //$NON-NLS-2$
+                                       String newMessage = shortMessage + "\n\n" //$NON-NLS-1$
+                                                       + "This reverts commit " //$NON-NLS-1$
+                                                       + srcCommit.getId().getName() + ".\n"; //$NON-NLS-1$
                                        newHead = new Git(getRepository()).commit()
                                                        .setMessage(newMessage)
-                                                       .setReflogComment("revert: " + shortMessage).call();
+                                                       .setReflogComment("revert: " + shortMessage).call(); //$NON-NLS-1$
                                        revertedRefs.add(src);
                                } else {
                                        unmergedPaths = merger.getUnmergedPaths();
index c26a48525d2a8872d7820445a320ef164e35d735..5a6a4c785b3a3b128a3ac3a4800226a27a82c7ee 100644 (file)
@@ -84,7 +84,7 @@ import org.eclipse.jgit.util.FileUtils;
  */
 public class StashApplyCommand extends GitCommand<ObjectId> {
 
-       private static final String DEFAULT_REF = Constants.STASH + "@{0}";
+       private static final String DEFAULT_REF = Constants.STASH + "@{0}"; //$NON-NLS-1$
 
        /**
         * Stash diff filter that looks for differences in the first three trees
@@ -115,7 +115,7 @@ public class StashApplyCommand extends GitCommand<ObjectId> {
 
                @Override
                public String toString() {
-                       return "STASH_DIFF";
+                       return "STASH_DIFF"; //$NON-NLS-1$
                }
        }
 
@@ -192,7 +192,7 @@ public class StashApplyCommand extends GitCommand<ObjectId> {
        private ObjectId getHeadTree() throws GitAPIException {
                final ObjectId headTree;
                try {
-                       headTree = repo.resolve(Constants.HEAD + "^{tree}");
+                       headTree = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$
                } catch (IOException e) {
                        throw new JGitInternalException(JGitText.get().cannotReadTree, e);
                }
index 8d887e354813c18ecbf556f2b56603f323b3c96c..1784acd79ba2e1e60cad2323fdcf2ccfcdc0253a 100644 (file)
@@ -120,7 +120,7 @@ public class TagCommand extends GitCommand<Ref> {
 
                        // if no id is set, we should attempt to use HEAD
                        if (id == null) {
-                               ObjectId objectId = repo.resolve(Constants.HEAD + "^{commit}");
+                               ObjectId objectId = repo.resolve(Constants.HEAD + "^{commit}"); //$NON-NLS-1$
                                if (objectId == null)
                                        throw new NoHeadException(
                                                        JGitText.get().tagOnRepoWithoutHEADCurrentlyNotSupported);
@@ -142,7 +142,7 @@ public class TagCommand extends GitCommand<Ref> {
                                        RefUpdate tagRef = repo.updateRef(refName);
                                        tagRef.setNewObjectId(tagId);
                                        tagRef.setForceUpdate(forceUpdate);
-                                       tagRef.setRefLogMessage("tagged " + name, false);
+                                       tagRef.setRefLogMessage("tagged " + name, false); //$NON-NLS-1$
                                        Result updateResult = tagRef.update(revWalk);
                                        switch (updateResult) {
                                        case NEW:
index a6ab5bc66d394b18367606a8cbd62ba472a1b117..b5e87f1f5cbff99a68ea9e14536aa67c899338c3 100644 (file)
@@ -62,7 +62,7 @@ public class ConcurrentRefUpdateException extends GitAPIException {
         */
        public ConcurrentRefUpdateException(String message, Ref ref,
                        RefUpdate.Result rc, Throwable cause) {
-               super((rc == null) ? message : message + ". "
+               super((rc == null) ? message : message + ". " //$NON-NLS-1$
                                + MessageFormat.format(JGitText.get().refUpdateReturnCodeWas, rc), cause);
                this.rc = rc;
                this.ref = ref;
@@ -75,7 +75,7 @@ public class ConcurrentRefUpdateException extends GitAPIException {
         */
        public ConcurrentRefUpdateException(String message, Ref ref,
                        RefUpdate.Result rc) {
-               super((rc == null) ? message : message + ". "
+               super((rc == null) ? message : message + ". " //$NON-NLS-1$
                                + MessageFormat.format(JGitText.get().refUpdateReturnCodeWas, rc));
                this.rc = rc;
                this.ref = ref;
index cea719ad707a8e879aef91e913f7030c13f48975..b7ad9d1a1fa2a742ea273480afc8383d6cbc1179 100644 (file)
@@ -177,7 +177,7 @@ public class BlameGenerator {
                        revPool = new RevWalk(getRepository());
 
                revPool.setRetainBody(true);
-               SEEN = revPool.newFlag("SEEN");
+               SEEN = revPool.newFlag("SEEN"); //$NON-NLS-1$
                reader = revPool.getObjectReader();
                treeWalk = new TreeWalk(reader);
                treeWalk.setRecursive(true);
index d7a958feeb49cdd9a77380593d511122302ee004..2d445fd7b25c474c1e80de0fe37b29568cdeeb10 100644 (file)
@@ -321,7 +321,7 @@ public class BlameResult {
        @Override
        public String toString() {
                StringBuilder r = new StringBuilder();
-               r.append("BlameResult: ");
+               r.append("BlameResult: "); //$NON-NLS-1$
                r.append(getResultPath());
                return r.toString();
        }
index 2e4e7844b9acdcc6c820a15fd481ad3aea1a94ab..95b4cec02ccd091b3f69e709f9a56083a917aedf 100644 (file)
@@ -275,6 +275,7 @@ class Candidate {
                return r;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                StringBuilder r = new StringBuilder();
@@ -324,7 +325,7 @@ class Candidate {
 
                @Override
                public String toString() {
-                       return "Reverse" + super.toString();
+                       return "Reverse" + super.toString(); //$NON-NLS-1$
                }
        }
 
@@ -380,7 +381,7 @@ class Candidate {
 
                @Override
                PersonIdent getAuthor() {
-                       return new PersonIdent(description, "");
+                       return new PersonIdent(description, ""); //$NON-NLS-1$
                }
        }
 }
index cf0dce4ee512401cbc143cbeaa4bb0d2293ce4f8..13874004d5ca406c98096a083b80e0b807d1a406 100644 (file)
@@ -78,10 +78,10 @@ public class DiffConfig {
        private final int renameLimit;
 
        private DiffConfig(final Config rc) {
-               noPrefix = rc.getBoolean("diff", "noprefix", false);
-               renameDetectionType = parseRenameDetectionType(rc.getString("diff",
-                               null, "renames"));
-               renameLimit = rc.getInt("diff", "renamelimit", 200);
+               noPrefix = rc.getBoolean("diff", "noprefix", false); //$NON-NLS-1$ //$NON-NLS-2$
+               renameDetectionType = parseRenameDetectionType(rc.getString("diff", //$NON-NLS-1$
+                               null, "renames")); //$NON-NLS-1$
+               renameLimit = rc.getInt("diff", "renamelimit", 200); //$NON-NLS-1$ //$NON-NLS-2$
        }
 
        /** @return true if the prefix "a/" and "b/" should be suppressed. */
@@ -108,16 +108,16 @@ public class DiffConfig {
                        final String renameString) {
                if (renameString == null)
                        return RenameDetectionType.FALSE;
-               else if (StringUtils.equalsIgnoreCase("copy", renameString)
-                               || StringUtils.equalsIgnoreCase("copies", renameString))
+               else if (StringUtils.equalsIgnoreCase("copy", renameString) //$NON-NLS-1$
+                               || StringUtils.equalsIgnoreCase("copies", renameString)) //$NON-NLS-1$
                        return RenameDetectionType.COPY;
                else {
                        final Boolean renameBoolean = StringUtils
                                        .toBooleanOrNull(renameString);
                        if (renameBoolean == null)
                                throw new IllegalArgumentException(MessageFormat.format(
-                                               JGitText.get().enumValueNotSupported2, "diff",
-                                               "renames", renameString));
+                                               JGitText.get().enumValueNotSupported2, "diff", //$NON-NLS-1$
+                                               "renames", renameString)); //$NON-NLS-1$
                        else if (renameBoolean.booleanValue())
                                return RenameDetectionType.TRUE;
                        else
index 5084e9d57ca4ebd766a4dcf978406465dbcd7361..cc8d285d95a8885973684def21cec209fb64a25c 100644 (file)
@@ -63,7 +63,7 @@ public class DiffEntry {
                        .fromObjectId(ObjectId.zeroId());
 
        /** Magical file name used for file adds or deletes. */
-       public static final String DEV_NULL = "/dev/null";
+       public static final String DEV_NULL = "/dev/null"; //$NON-NLS-1$
 
        /** General type of change a single file-level patch describes. */
        public static enum ChangeType {
@@ -407,6 +407,7 @@ public class DiffEntry {
                return side == Side.OLD ? getOldId() : getNewId();
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                StringBuilder buf = new StringBuilder();
index 4258f74094e6f935c29115bfcafde2dc8026fa7b..4af1084bf40a95ac8336feb17fc760c4c1b530f5 100644 (file)
@@ -105,7 +105,7 @@ import org.eclipse.jgit.util.io.DisabledOutputStream;
 public class DiffFormatter {
        private static final int DEFAULT_BINARY_FILE_THRESHOLD = PackConfig.DEFAULT_BIG_FILE_THRESHOLD;
 
-       private static final byte[] noNewLine = encodeASCII("\\ No newline at end of file\n");
+       private static final byte[] noNewLine = encodeASCII("\\ No newline at end of file\n"); //$NON-NLS-1$
 
        /** Magic return content indicating it is empty or no content present. */
        private static final byte[] EMPTY = new byte[] {};
@@ -129,9 +129,9 @@ public class DiffFormatter {
 
        private int binaryFileThreshold = DEFAULT_BINARY_FILE_THRESHOLD;
 
-       private String oldPrefix = "a/";
+       private String oldPrefix = "a/"; //$NON-NLS-1$
 
-       private String newPrefix = "b/";
+       private String newPrefix = "b/"; //$NON-NLS-1$
 
        private TreeFilter pathFilter = TreeFilter.ALL;
 
@@ -179,8 +179,8 @@ public class DiffFormatter {
 
                DiffConfig dc = db.getConfig().get(DiffConfig.KEY);
                if (dc.isNoPrefix()) {
-                       setOldPrefix("");
-                       setNewPrefix("");
+                       setOldPrefix(""); //$NON-NLS-1$
+                       setNewPrefix(""); //$NON-NLS-1$
                }
                setDetectRenames(dc.isRenameDetectionEnabled());
 
@@ -633,12 +633,12 @@ public class DiffFormatter {
        private void writeGitLinkDiffText(OutputStream o, DiffEntry ent)
                        throws IOException {
                if (ent.getOldMode() == GITLINK) {
-                       o.write(encodeASCII("-Subproject commit " + ent.getOldId().name()
-                                       + "\n"));
+                       o.write(encodeASCII("-Subproject commit " + ent.getOldId().name() //$NON-NLS-1$
+                                       + "\n")); //$NON-NLS-1$
                }
                if (ent.getNewMode() == GITLINK) {
-                       o.write(encodeASCII("+Subproject commit " + ent.getNewId().name()
-                                       + "\n"));
+                       o.write(encodeASCII("+Subproject commit " + ent.getNewId().name() //$NON-NLS-1$
+                                       + "\n")); //$NON-NLS-1$
                }
        }
 
@@ -918,7 +918,7 @@ public class DiffFormatter {
                        if (aRaw == BINARY || bRaw == BINARY //
                                        || RawText.isBinary(aRaw) || RawText.isBinary(bRaw)) {
                                formatOldNewPaths(buf, ent);
-                               buf.write(encodeASCII("Binary files differ\n"));
+                               buf.write(encodeASCII("Binary files differ\n")); //$NON-NLS-1$
                                editList = new EditList();
                                type = PatchType.BINARY;
 
@@ -1016,7 +1016,7 @@ public class DiffFormatter {
                final FileMode oldMode = ent.getOldMode();
                final FileMode newMode = ent.getNewMode();
 
-               o.write(encodeASCII("diff --git "));
+               o.write(encodeASCII("diff --git ")); //$NON-NLS-1$
                o.write(encode(quotePath(oldPrefix + (type == ADD ? newp : oldp))));
                o.write(' ');
                o.write(encode(quotePath(newPrefix + (type == DELETE ? oldp : newp))));
@@ -1024,40 +1024,40 @@ public class DiffFormatter {
 
                switch (type) {
                case ADD:
-                       o.write(encodeASCII("new file mode "));
+                       o.write(encodeASCII("new file mode ")); //$NON-NLS-1$
                        newMode.copyTo(o);
                        o.write('\n');
                        break;
 
                case DELETE:
-                       o.write(encodeASCII("deleted file mode "));
+                       o.write(encodeASCII("deleted file mode ")); //$NON-NLS-1$
                        oldMode.copyTo(o);
                        o.write('\n');
                        break;
 
                case RENAME:
-                       o.write(encodeASCII("similarity index " + ent.getScore() + "%"));
+                       o.write(encodeASCII("similarity index " + ent.getScore() + "%")); //$NON-NLS-1$ //$NON-NLS-2$
                        o.write('\n');
 
-                       o.write(encode("rename from " + quotePath(oldp)));
+                       o.write(encode("rename from " + quotePath(oldp))); //$NON-NLS-1$
                        o.write('\n');
 
-                       o.write(encode("rename to " + quotePath(newp)));
+                       o.write(encode("rename to " + quotePath(newp))); //$NON-NLS-1$
                        o.write('\n');
                        break;
 
                case COPY:
-                       o.write(encodeASCII("similarity index " + ent.getScore() + "%"));
+                       o.write(encodeASCII("similarity index " + ent.getScore() + "%")); //$NON-NLS-1$ //$NON-NLS-2$
                        o.write('\n');
 
-                       o.write(encode("copy from " + quotePath(oldp)));
+                       o.write(encode("copy from " + quotePath(oldp))); //$NON-NLS-1$
                        o.write('\n');
 
-                       o.write(encode("copy to " + quotePath(newp)));
+                       o.write(encode("copy to " + quotePath(newp))); //$NON-NLS-1$
                        o.write('\n');
 
                        if (!oldMode.equals(newMode)) {
-                               o.write(encodeASCII("new file mode "));
+                               o.write(encodeASCII("new file mode ")); //$NON-NLS-1$
                                newMode.copyTo(o);
                                o.write('\n');
                        }
@@ -1065,19 +1065,19 @@ public class DiffFormatter {
 
                case MODIFY:
                        if (0 < ent.getScore()) {
-                               o.write(encodeASCII("dissimilarity index "
-                                               + (100 - ent.getScore()) + "%"));
+                               o.write(encodeASCII("dissimilarity index " //$NON-NLS-1$
+                                               + (100 - ent.getScore()) + "%")); //$NON-NLS-1$
                                o.write('\n');
                        }
                        break;
                }
 
                if ((type == MODIFY || type == RENAME) && !oldMode.equals(newMode)) {
-                       o.write(encodeASCII("old mode "));
+                       o.write(encodeASCII("old mode ")); //$NON-NLS-1$
                        oldMode.copyTo(o);
                        o.write('\n');
 
-                       o.write(encodeASCII("new mode "));
+                       o.write(encodeASCII("new mode ")); //$NON-NLS-1$
                        newMode.copyTo(o);
                        o.write('\n');
                }
@@ -1097,9 +1097,9 @@ public class DiffFormatter {
         */
        protected void formatIndexLine(OutputStream o, DiffEntry ent)
                        throws IOException {
-               o.write(encodeASCII("index " //
+               o.write(encodeASCII("index " // //$NON-NLS-1$
                                + format(ent.getOldId()) //
-                               + ".." //
+                               + ".." // //$NON-NLS-1$
                                + format(ent.getNewId())));
                if (ent.getOldMode().equals(ent.getNewMode())) {
                        o.write(' ');
@@ -1133,8 +1133,8 @@ public class DiffFormatter {
                        break;
                }
 
-               o.write(encode("--- " + oldp + "\n"));
-               o.write(encode("+++ " + newp + "\n"));
+               o.write(encode("--- " + oldp + "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+               o.write(encode("+++ " + newp + "\n")); //$NON-NLS-1$ //$NON-NLS-2$
        }
 
        private int findCombinedEnd(final List<Edit> edits, final int i) {
index f0c7cdac5fafd03fbd74fc14ca5b7586ceae7271..684c06699b727f21ac188b0a61ea4e913f1754e7 100644 (file)
@@ -233,6 +233,7 @@ public class Edit {
                return false;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                final Type t = getType();
index be753bee8cd0c22c7823859167997d7652853cf3..14f7b4293f35c57eeacd8850489107b602af8fc6 100644 (file)
@@ -80,6 +80,6 @@ public class EditList extends ArrayList<Edit> {
 
        @Override
        public String toString() {
-               return "EditList" + super.toString();
+               return "EditList" + super.toString(); //$NON-NLS-1$
        }
 }
index f0bf5c63054c30ea2ce1f9c3b0fb4dfc43188ed1..55aece3ca9bc7beb7f3f2aa4de15ca20ba61649e 100644 (file)
@@ -181,7 +181,7 @@ public class RawText extends Sequence {
         */
        public String getString(int begin, int end, boolean dropLF) {
                if (begin == end)
-                       return "";
+                       return ""; //$NON-NLS-1$
 
                int s = getStart(begin);
                int e = getEnd(end - 1);
@@ -290,8 +290,8 @@ public class RawText extends Sequence {
                if (content[e - 1] != '\n')
                        return null;
                if (content.length > 1 && content[e - 2] == '\r')
-                       return "\r\n";
+                       return "\r\n"; //$NON-NLS-1$
                else
-                       return "\n";
+                       return "\n"; //$NON-NLS-1$
        }
 }
index 48f2304943bbe1f0ff7772de99321ce77b5593d1..6088d72f3b729a17971a70eba6c3433de06a5745 100644 (file)
@@ -320,8 +320,8 @@ class SimilarityRenameDetector {
        }
 
        static int nameScore(String a, String b) {
-           int aDirLen = a.lastIndexOf("/") + 1;
-           int bDirLen = b.lastIndexOf("/") + 1;
+           int aDirLen = a.lastIndexOf("/") + 1; //$NON-NLS-1$
+           int bDirLen = b.lastIndexOf("/") + 1; //$NON-NLS-1$
 
            int dirMin = Math.min(aDirLen, bDirLen);
            int dirMax = Math.max(aDirLen, bDirLen);
index f24c9b2a5b7bf46516eb99a8cf4363135df04f1b..353c2375c038833635ad90028a7036f5050330ab 100644 (file)
@@ -555,7 +555,7 @@ public class DirCache {
 
        private static String formatExtensionName(final byte[] hdr)
                        throws UnsupportedEncodingException {
-               return "'" + new String(hdr, 0, 4, "ISO-8859-1") + "'";
+               return "'" + new String(hdr, 0, 4, "ISO-8859-1") + "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }
 
        private static boolean is_DIRC(final byte[] hdr) {
@@ -855,8 +855,8 @@ public class DirCache {
                        System.arraycopy(sortedEntries, 0, r, 0, sortedEntries.length);
                        return r;
                }
-               if (!path.endsWith("/"))
-                       path += "/";
+               if (!path.endsWith("/")) //$NON-NLS-1$
+                       path += "/"; //$NON-NLS-1$
                final byte[] p = Constants.encode(path);
                final int pLen = p.length;
 
index ee8ab22071eb901c244bb7176ab0df90a3b5f11b..6c7a70c52ede1bcd031bb502d2a838b7690a11c4 100644 (file)
@@ -244,7 +244,7 @@ public class DirCacheBuilder extends BaseDirCacheEditor {
 
        private static IllegalStateException bad(final DirCacheEntry a,
                        final String msg) {
-               return new IllegalStateException(msg + ": " + a.getStage() + " "
+               return new IllegalStateException(msg + ": " + a.getStage() + " " //$NON-NLS-1$ //$NON-NLS-2$
                                + a.getPathString());
        }
 }
index 9780993659714026afadf9606879bd7d353ef78b..7629de64346f4d760c04f4872a06c08c8867146a 100644 (file)
@@ -417,7 +417,7 @@ public class DirCacheCheckout {
                        builder.finish();
 
                        File file = null;
-                       String last = "";
+                       String last = ""; //$NON-NLS-1$
                        // when deleting files process them in the opposite order as they have
                        // been reported. This ensures the files are deleted before we delete
                        // their parent folders
@@ -965,7 +965,7 @@ public class DirCacheCheckout {
                ObjectLoader ol = or.open(entry.getObjectId());
                File parentDir = f.getParentFile();
                parentDir.mkdirs();
-               File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir);
+               File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir); //$NON-NLS-1$
                WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY);
                FileOutputStream rawChannel = new FileOutputStream(tmpFile);
                OutputStream channel;
@@ -1007,10 +1007,10 @@ public class DirCacheCheckout {
 
        private static byte[][] forbidden;
        static {
-               String[] list = new String[] { "AUX", "COM1", "COM2", "COM3", "COM4",
-                               "COM5", "COM6", "COM7", "COM8", "COM9", "CON", "LPT1", "LPT2",
-                               "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", "NUL",
-                               "PRN" };
+               String[] list = new String[] { "AUX", "COM1", "COM2", "COM3", "COM4", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+                               "COM5", "COM6", "COM7", "COM8", "COM9", "CON", "LPT1", "LPT2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
+                               "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", "NUL", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
+                               "PRN" }; //$NON-NLS-1$
                forbidden = new byte[list.length][];
                for (int i = 0; i < list.length; ++i)
                        forbidden[i] = Constants.encodeASCII(list[i]);
index 95bc1129c356036911128e3dbb6f63b0c1a677b7..aa48c60414fe7292870e68b040147e9fee04260d 100644 (file)
@@ -637,6 +637,7 @@ public class DirCacheEntry {
        /**
         * Use for debugging only !
         */
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return getFileMode() + " " + getLength() + " " + getLastModified()
index dd46b28a472b239eaf5f46484917422d18a2fe93..db29f3f15b2a167de9f0f785ad02dd024dd82d9d 100644 (file)
@@ -77,7 +77,7 @@ public class CheckoutConflictException extends IOException {
        private static String buildList(String[] files) {
                StringBuilder builder = new StringBuilder();
                for (String f : files) {
-                       builder.append("\n");
+                       builder.append("\n"); //$NON-NLS-1$
                        builder.append(f);
                }
                return builder.toString();
index 53da1ee5d8b3ec3e7f8ce065945d2ed2a2f4b648..55b64eeb9023c9dc4c50b844ddee53439a958e4d 100644 (file)
@@ -58,9 +58,9 @@ public class CompoundException extends Exception {
                final StringBuilder msg = new StringBuilder();
                msg.append(JGitText.get().failureDueToOneOfTheFollowing);
                for (final Throwable c : causes) {
-                       msg.append("  ");
+                       msg.append("  "); //$NON-NLS-1$
                        msg.append(c.getMessage());
-                       msg.append("\n");
+                       msg.append("\n"); //$NON-NLS-1$
                }
                return msg.toString();
        }
index fab4ca11e28b98d9c431a6cc1f717db0aa7b05bc..b545312ae75e08917dba6e1818ec887a8a69af9d 100644 (file)
@@ -69,11 +69,11 @@ public class InvalidObjectIdException extends IllegalArgumentException {
 
        private static String asAscii(byte[] bytes, int offset, int length) {
                try {
-                       return ": " + new String(bytes, offset, length, "US-ASCII");
+                       return ": " + new String(bytes, offset, length, "US-ASCII"); //$NON-NLS-1$ //$NON-NLS-2$
                } catch (UnsupportedEncodingException e2) {
-                       return "";
+                       return ""; //$NON-NLS-1$
                } catch (StringIndexOutOfBoundsException e2) {
-                       return "";
+                       return ""; //$NON-NLS-1$
                }
        }
 }
index e62c65852c15214c3a4d78bfa7302f5c6a2e3ece..09bb4a914f03a9cc7b8a4dec19d25775e64626b4 100644 (file)
@@ -60,10 +60,10 @@ public class MissingBundlePrerequisiteException extends TransportException {
                final StringBuilder r = new StringBuilder();
                r.append(JGitText.get().missingPrerequisiteCommits);
                for (final Map.Entry<ObjectId, String> e : missingCommits.entrySet()) {
-                       r.append("\n  ");
+                       r.append("\n  "); //$NON-NLS-1$
                        r.append(e.getKey().name());
                        if (e.getValue() != null)
-                               r.append(" ").append(e.getValue());
+                               r.append(" ").append(e.getValue()); //$NON-NLS-1$
                }
                return r.toString();
        }
index 56816a6418125533dfb7c173e44b75ebce0a3438..5503bd19e2f00eb63829672c2141868866da7708 100644 (file)
@@ -63,7 +63,7 @@ public class PackProtocolException extends TransportException {
         *            message
         */
        public PackProtocolException(final URIish uri, final String s) {
-               super(uri + ": " + s);
+               super(uri + ": " + s); //$NON-NLS-1$
        }
 
        /**
@@ -79,7 +79,7 @@ public class PackProtocolException extends TransportException {
         */
        public PackProtocolException(final URIish uri, final String s,
                        final Throwable cause) {
-               this(uri + ": " + s, cause);
+               this(uri + ": " + s, cause); //$NON-NLS-1$
        }
 
        /**
index 386d4c9e09ff319aaf6788638e46410659c05ab5..a039c7d14e2d9dce62f8e6c95348b08b34ac5f81 100644 (file)
@@ -79,6 +79,6 @@ public class RevisionSyntaxException extends IllegalArgumentException {
 
        @Override
        public String toString() {
-               return super.toString() + ":" + revstr;
+               return super.toString() + ":" + revstr; //$NON-NLS-1$
        }
 }
index 6bfe900481ad6a789b5184a6ade97bbf0f6de96a..4f297b982b23e8f5162c2928a19326f949a67fdd 100644 (file)
@@ -65,8 +65,8 @@ public class TranslationBundleLoadingException extends TranslationBundleExceptio
         *            {@link ResourceBundle#getBundle(String, Locale)} method.
         */
        public TranslationBundleLoadingException(Class bundleClass, Locale locale, Exception cause) {
-               super("Loading of translation bundle failed for ["
-                               + bundleClass.getName() + ", " + locale.toString() + "]",
+               super("Loading of translation bundle failed for [" //$NON-NLS-1$
+                               + bundleClass.getName() + ", " + locale.toString() + "]", //$NON-NLS-1$ //$NON-NLS-2$
                                bundleClass, locale, cause);
        }
 }
\ No newline at end of file
index a3c35b8dafb1ec48fec47b2e42eab6b031e23545..05c38424eca457f51049a1eb8334a3cf71a29cc4 100644 (file)
@@ -69,8 +69,8 @@ public class TranslationStringMissingException extends TranslationBundleExceptio
         *            {@link ResourceBundle#getString(String)} method.
         */
        public TranslationStringMissingException(Class bundleClass, Locale locale, String key, Exception cause) {
-               super("Translation missing for [" + bundleClass.getName() + ", "
-                               + locale.toString() + ", " + key + "]", bundleClass, locale,
+               super("Translation missing for [" + bundleClass.getName() + ", " //$NON-NLS-1$ //$NON-NLS-2$
+                               + locale.toString() + ", " + key + "]", bundleClass, locale, //$NON-NLS-1$ //$NON-NLS-2$
                                cause);
                this.key = key;
        }
index dfa035d60b6259e623de30749b79c48e4b270e1d..86dea8284f7c5e1eb2b11a2367baf07c6de3e6e9 100644 (file)
@@ -65,7 +65,7 @@ public class TransportException extends IOException {
         *            message
         */
        public TransportException(final URIish uri, final String s) {
-               super(uri.setPass(null) + ": " + s);
+               super(uri.setPass(null) + ": " + s); //$NON-NLS-1$
        }
 
        /**
@@ -81,7 +81,7 @@ public class TransportException extends IOException {
         */
        public TransportException(final URIish uri, final String s,
                        final Throwable cause) {
-               this(uri.setPass(null) + ": " + s, cause);
+               this(uri.setPass(null) + ": " + s, cause); //$NON-NLS-1$
        }
 
        /**
index eb09588fb598b3aa901996663e6f7117f3f81a85..daba576ca42b685e1efa860dddf44223af1ccb34 100644 (file)
@@ -64,6 +64,6 @@ public class UnsupportedCredentialItem extends RuntimeException {
         *            message
         */
        public UnsupportedCredentialItem(final URIish uri, final String s) {
-               super(uri.setPass(null) + ": " + s);
+               super(uri.setPass(null) + ": " + s); //$NON-NLS-1$
        }
 }
index ef90b2205cfb6c9c2e957ace62d73e0d07c2fb62..d8cd756d998b8b92f08d91ea7ddd7a5af69ec198 100644 (file)
@@ -64,6 +64,7 @@ public class ListenerHandle {
                parent.remove(this);
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return type.getSimpleName() + "[" + listener + "]";
index ba1c81d5d880ef114552157c0b49bf3b2aa1aced..1b7d28c333abdbeb6dca421f6a718e160c9cfed7 100644 (file)
@@ -85,6 +85,7 @@ public abstract class RepositoryEvent<T extends RepositoryListener> {
         */
        public abstract void dispatch(T listener);
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                String type = getClass().getSimpleName();
index 582123bb5bcfe2b193c50de57486edd8656d0613..22840fb71ce085c189e8b3dd021fd8df09b26d56 100644 (file)
@@ -86,7 +86,7 @@ public class FileNameMatcher {
        static final List<Head> EMPTY_HEAD_LIST = Collections.emptyList();
 
        private static final Pattern characterClassStartPattern = Pattern
-                       .compile("\\[[.:=]");
+                       .compile("\\[[.:=]"); //$NON-NLS-1$
 
        private List<Head> headsStartValue;
 
@@ -185,7 +185,7 @@ public class FileNameMatcher {
                int firstValidEndBracketIndex = indexOfStartBracket + 2;
 
                if (indexOfStartBracket + 1 >= pattern.length())
-                       throw new NoClosingBracketException(indexOfStartBracket, "[", "]",
+                       throw new NoClosingBracketException(indexOfStartBracket, "[", "]", //$NON-NLS-1$ //$NON-NLS-2$
                                        pattern);
 
                if (pattern.charAt(firstValidCharClassIndex) == '!') {
@@ -202,8 +202,8 @@ public class FileNameMatcher {
                        final int possibleGroupEnd = pattern.indexOf(']',
                                        firstValidEndBracketIndex);
                        if (possibleGroupEnd == -1)
-                               throw new NoClosingBracketException(indexOfStartBracket, "[",
-                                               "]", pattern);
+                               throw new NoClosingBracketException(indexOfStartBracket, "[", //$NON-NLS-1$
+                                               "]", pattern); //$NON-NLS-1$
 
                        final boolean foundCharClass = charClassStartMatcher
                                        .find(firstValidCharClassIndex);
@@ -212,7 +212,7 @@ public class FileNameMatcher {
                                        && charClassStartMatcher.start() < possibleGroupEnd) {
 
                                final String classStart = charClassStartMatcher.group(0);
-                               final String classEnd = classStart.charAt(1) + "]";
+                               final String classEnd = classStart.charAt(1) + "]"; //$NON-NLS-1$
 
                                final int classStartIndex = charClassStartMatcher.start();
                                final int classEndIndex = pattern.indexOf(classEnd,
index 3911e72f7ad98b3428677dfbbeaedee1e0094856..0243bdc211a36abc53cd229460e0baf1e668f471 100644 (file)
@@ -57,7 +57,7 @@ final class GroupHead extends AbstractHead {
        private final List<CharacterPattern> characterClasses;
 
        private static final Pattern REGEX_PATTERN = Pattern
-                       .compile("([^-][-][^-]|\\[[.:=].*?[.:=]\\])");
+                       .compile("([^-][-][^-]|\\[[.:=].*?[.:=]\\])"); //$NON-NLS-1$
 
        private final boolean inverse;
 
@@ -65,7 +65,7 @@ final class GroupHead extends AbstractHead {
                        throws InvalidPatternException {
                super(false);
                this.characterClasses = new ArrayList<CharacterPattern>();
-               this.inverse = pattern.startsWith("!");
+               this.inverse = pattern.startsWith("!"); //$NON-NLS-1$
                if (inverse) {
                        pattern = pattern.substring(1);
                }
@@ -76,40 +76,40 @@ final class GroupHead extends AbstractHead {
                                final char start = characterClass.charAt(0);
                                final char end = characterClass.charAt(2);
                                characterClasses.add(new CharacterRange(start, end));
-                       } else if (characterClass.equals("[:alnum:]")) {
+                       } else if (characterClass.equals("[:alnum:]")) { //$NON-NLS-1$
                                characterClasses.add(LetterPattern.INSTANCE);
                                characterClasses.add(DigitPattern.INSTANCE);
-                       } else if (characterClass.equals("[:alpha:]")) {
+                       } else if (characterClass.equals("[:alpha:]")) { //$NON-NLS-1$
                                characterClasses.add(LetterPattern.INSTANCE);
-                       } else if (characterClass.equals("[:blank:]")) {
+                       } else if (characterClass.equals("[:blank:]")) { //$NON-NLS-1$
                                characterClasses.add(new OneCharacterPattern(' '));
                                characterClasses.add(new OneCharacterPattern('\t'));
-                       } else if (characterClass.equals("[:cntrl:]")) {
+                       } else if (characterClass.equals("[:cntrl:]")) { //$NON-NLS-1$
                                characterClasses.add(new CharacterRange('\u0000', '\u001F'));
                                characterClasses.add(new OneCharacterPattern('\u007F'));
-                       } else if (characterClass.equals("[:digit:]")) {
+                       } else if (characterClass.equals("[:digit:]")) { //$NON-NLS-1$
                                characterClasses.add(DigitPattern.INSTANCE);
-                       } else if (characterClass.equals("[:graph:]")) {
+                       } else if (characterClass.equals("[:graph:]")) { //$NON-NLS-1$
                                characterClasses.add(new CharacterRange('\u0021', '\u007E'));
                                characterClasses.add(LetterPattern.INSTANCE);
                                characterClasses.add(DigitPattern.INSTANCE);
-                       } else if (characterClass.equals("[:lower:]")) {
+                       } else if (characterClass.equals("[:lower:]")) { //$NON-NLS-1$
                                characterClasses.add(LowerPattern.INSTANCE);
-                       } else if (characterClass.equals("[:print:]")) {
+                       } else if (characterClass.equals("[:print:]")) { //$NON-NLS-1$
                                characterClasses.add(new CharacterRange('\u0020', '\u007E'));
                                characterClasses.add(LetterPattern.INSTANCE);
                                characterClasses.add(DigitPattern.INSTANCE);
-                       } else if (characterClass.equals("[:punct:]")) {
+                       } else if (characterClass.equals("[:punct:]")) { //$NON-NLS-1$
                                characterClasses.add(PunctPattern.INSTANCE);
-                       } else if (characterClass.equals("[:space:]")) {
+                       } else if (characterClass.equals("[:space:]")) { //$NON-NLS-1$
                                characterClasses.add(WhitespacePattern.INSTANCE);
-                       } else if (characterClass.equals("[:upper:]")) {
+                       } else if (characterClass.equals("[:upper:]")) { //$NON-NLS-1$
                                characterClasses.add(UpperPattern.INSTANCE);
-                       } else if (characterClass.equals("[:xdigit:]")) {
+                       } else if (characterClass.equals("[:xdigit:]")) { //$NON-NLS-1$
                                characterClasses.add(new CharacterRange('0', '9'));
                                characterClasses.add(new CharacterRange('a', 'f'));
                                characterClasses.add(new CharacterRange('A', 'F'));
-                       } else if (characterClass.equals("[:word:]")) {
+                       } else if (characterClass.equals("[:word:]")) { //$NON-NLS-1$
                                characterClasses.add(new OneCharacterPattern('_'));
                                characterClasses.add(LetterPattern.INSTANCE);
                                characterClasses.add(DigitPattern.INSTANCE);
@@ -120,7 +120,7 @@ final class GroupHead extends AbstractHead {
                                throw new InvalidPatternException(message, wholePattern);
                        }
 
-                       pattern = matcher.replaceFirst("");
+                       pattern = matcher.replaceFirst(""); //$NON-NLS-1$
                        matcher.reset(pattern);
                }
                // pattern contains now no ranges
@@ -219,7 +219,7 @@ final class GroupHead extends AbstractHead {
        private static final class PunctPattern implements CharacterPattern {
                static final GroupHead.PunctPattern INSTANCE = new PunctPattern();
 
-               private static String punctCharacters = "-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~";
+               private static String punctCharacters = "-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~"; //$NON-NLS-1$
 
                public boolean matches(char c) {
                        return punctCharacters.indexOf(c) != -1;
index 575b9d60a5551e5a66eaee3be544ddae741068bf..fb65e0ce340253b08b0b805ff8f63096f953b577 100644 (file)
@@ -102,7 +102,7 @@ public class IgnoreNode {
                String txt;
                while ((txt = br.readLine()) != null) {
                        txt = txt.trim();
-                       if (txt.length() > 0 && !txt.startsWith("#"))
+                       if (txt.length() > 0 && !txt.startsWith("#")) //$NON-NLS-1$
                                rules.add(new IgnoreRule(txt));
                }
        }
index f631bb270cd033c84bce2b728e631ae342226b74..e0c780feecba5337ecd5ecc3162eca3713ff6aca 100644 (file)
@@ -82,28 +82,28 @@ public class IgnoreRule {
        private void setup() {
                int startIndex = 0;
                int endIndex = pattern.length();
-               if (pattern.startsWith("!")) {
+               if (pattern.startsWith("!")) { //$NON-NLS-1$
                        startIndex++;
                        negation = true;
                }
 
-               if (pattern.endsWith("/")) {
+               if (pattern.endsWith("/")) { //$NON-NLS-1$
                        endIndex --;
                        dirOnly = true;
                }
 
                pattern = pattern.substring(startIndex, endIndex);
-               boolean hasSlash = pattern.contains("/");
+               boolean hasSlash = pattern.contains("/"); //$NON-NLS-1$
 
                if (!hasSlash)
                        nameOnly = true;
-               else if (!pattern.startsWith("/")) {
+               else if (!pattern.startsWith("/")) { //$NON-NLS-1$
                        //Contains "/" but does not start with one
                        //Adding / to the start should not interfere with matching
-                       pattern = "/" + pattern;
+                       pattern = "/" + pattern; //$NON-NLS-1$
                }
 
-               if (pattern.contains("*") || pattern.contains("?") || pattern.contains("[")) {
+               if (pattern.contains("*") || pattern.contains("?") || pattern.contains("[")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                        try {
                                matcher = new FileNameMatcher(pattern, Character.valueOf('/'));
                        } catch (InvalidPatternException e) {
@@ -164,8 +164,8 @@ public class IgnoreRule {
         *                        the target is ignored. Call {@link IgnoreRule#getResult() getResult()} for the result.
         */
        public boolean isMatch(String target, boolean isDirectory) {
-               if (!target.startsWith("/"))
-                       target = "/" + target;
+               if (!target.startsWith("/")) //$NON-NLS-1$
+                       target = "/" + target; //$NON-NLS-1$
 
                if (matcher == null) {
                        if (target.equals(pattern)) {
@@ -183,12 +183,12 @@ public class IgnoreRule {
                         * "/src/new" to /src/newfile" but allows "/src/new" to match
                         * "/src/new/newfile", as is the git standard
                         */
-                       if ((target).startsWith(pattern + "/"))
+                       if ((target).startsWith(pattern + "/")) //$NON-NLS-1$
                                return true;
 
                        if (nameOnly) {
                                //Iterate through each sub-name
-                               final String[] segments = target.split("/");
+                               final String[] segments = target.split("/"); //$NON-NLS-1$
                                for (int idx = 0; idx < segments.length; idx++) {
                                        final String segmentName = segments[idx];
                                        if (segmentName.equals(pattern) &&
@@ -202,7 +202,7 @@ public class IgnoreRule {
                        if (matcher.isMatch())
                                return true;
 
-                       final String[] segments = target.split("/");
+                       final String[] segments = target.split("/"); //$NON-NLS-1$
                        if (nameOnly) {
                                for (int idx = 0; idx < segments.length; idx++) {
                                        final String segmentName = segments[idx];
@@ -220,7 +220,7 @@ public class IgnoreRule {
                                for (int idx = 0; idx < segments.length; idx++) {
                                        final String segmentName = segments[idx];
                                        if (segmentName.length() > 0) {
-                                               matcher.append("/" + segmentName);
+                                               matcher.append("/" + segmentName); //$NON-NLS-1$
                                        }
 
                                        if (matcher.isMatch() &&
index 44460fe6539e90389b2437c7caa9db295ef9092d..87dabd49029a7e0c6157d37a06b68fce3c341ca2 100644 (file)
@@ -375,8 +375,9 @@ public final class AbbreviatedObjectId implements Serializable {
                return new String(b, 0, nibbles);
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
-               return "AbbreviatedObjectId[" + name() + "]";
+               return "AbbreviatedObjectId[" + name() + "]"; //$NON-NLS-1$
        }
 }
index 9d2babd047a215198b8b47061fd6f14698faf325..e408c79a3b3ea32c8d1568c75de291687585496f 100644 (file)
@@ -489,6 +489,7 @@ public abstract class AnyObjectId implements Comparable<Object> {
                        dst[o--] = '0';
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return "AnyObjectId[" + name() + "]";
index f80c803605e2471ea2801fa3bcf9b6853835d826..a0f4418c586d5f4bf60c4ff34d908a228456a9e1 100644 (file)
@@ -487,7 +487,7 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
         */
        public B findGitDir() {
                if (getGitDir() == null)
-                       findGitDir(new File("").getAbsoluteFile());
+                       findGitDir(new File("").getAbsoluteFile()); //$NON-NLS-1$
                return self();
        }
 
@@ -628,7 +628,7 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
                        if (getGitDir() == null)
                                setGitDir(getWorkTree().getParentFile());
                        if (getIndexFile() == null)
-                               setIndexFile(new File(getGitDir(), "index"));
+                               setIndexFile(new File(getGitDir(), "index")); //$NON-NLS-1$
                }
        }
 
@@ -640,7 +640,7 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
         */
        protected void setupInternals() throws IOException {
                if (getObjectDirectory() == null && getGitDir() != null)
-                       setObjectDirectory(safeFS().resolve(getGitDir(), "objects"));
+                       setObjectDirectory(safeFS().resolve(getGitDir(), "objects")); //$NON-NLS-1$
        }
 
        /**
index e198e07e4dec882f33ecee52552d29cff77fbb71..98c264719038781c712536d931766f3cfd4991c1 100644 (file)
@@ -168,7 +168,7 @@ public class BatchRefUpdate {
                if (msg == null && !appendStatus)
                        disableRefLog();
                else if (msg == null && appendStatus) {
-                       refLogMessage = "";
+                       refLogMessage = ""; //$NON-NLS-1$
                        refLogIncludeResult = true;
                } else {
                        refLogMessage = msg;
index 83857649ce04b9fc3251385ad8c102ff570a4756..39856c0c98869f2427d5c55fc78e00eda82487c7 100644 (file)
@@ -69,7 +69,7 @@ public abstract class BatchingProgressMonitor implements ProgressMonitor {
 
                                        public Thread newThread(Runnable taskBody) {
                                                Thread thr = baseFactory.newThread(taskBody);
-                                               thr.setName("JGit-AlarmQueue");
+                                               thr.setName("JGit-AlarmQueue"); //$NON-NLS-1$
                                                thr.setDaemon(true);
                                                return thr;
                                        }
index b0883e3f434199468139cab22329915913e6b114..2c51931ff6ac825631ae608b89d9cf99161ff8dd 100644 (file)
@@ -81,7 +81,7 @@ public class BranchConfig {
                if (remote == null || mergeRef == null)
                        return null;
 
-               if (remote.equals("."))
+               if (remote.equals(".")) //$NON-NLS-1$
                        return mergeRef;
 
                return findRemoteTrackingBranch(remote, mergeRef);
index 239140713c6a9a1533faedfb91399a96f8a6044e..c5c488dac373525fcf76d1448103f550c66a0e92 100644 (file)
@@ -66,15 +66,15 @@ import java.util.List;
 public class CommitBuilder {
        private static final ObjectId[] EMPTY_OBJECTID_LIST = new ObjectId[0];
 
-       private static final byte[] htree = Constants.encodeASCII("tree");
+       private static final byte[] htree = Constants.encodeASCII("tree"); //$NON-NLS-1$
 
-       private static final byte[] hparent = Constants.encodeASCII("parent");
+       private static final byte[] hparent = Constants.encodeASCII("parent"); //$NON-NLS-1$
 
-       private static final byte[] hauthor = Constants.encodeASCII("author");
+       private static final byte[] hauthor = Constants.encodeASCII("author"); //$NON-NLS-1$
 
-       private static final byte[] hcommitter = Constants.encodeASCII("committer");
+       private static final byte[] hcommitter = Constants.encodeASCII("committer"); //$NON-NLS-1$
 
-       private static final byte[] hencoding = Constants.encodeASCII("encoding");
+       private static final byte[] hencoding = Constants.encodeASCII("encoding"); //$NON-NLS-1$
 
        private ObjectId treeId;
 
@@ -322,6 +322,7 @@ public class CommitBuilder {
                return build();
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                StringBuilder r = new StringBuilder();
index 15bd37e69f5927f377a064e4b2eea1c306445e0b..84d77ce32b3812778e745bd564dab6c7d21bc4e8 100644 (file)
@@ -134,24 +134,24 @@ public class Config {
                                        r.append('"');
                                        inquote = false;
                                }
-                               r.append("\\n\\\n");
+                               r.append("\\n\\\n"); //$NON-NLS-1$
                                lineStart = r.length();
                                break;
 
                        case '\t':
-                               r.append("\\t");
+                               r.append("\\t"); //$NON-NLS-1$
                                break;
 
                        case '\b':
-                               r.append("\\b");
+                               r.append("\\b"); //$NON-NLS-1$
                                break;
 
                        case '\\':
-                               r.append("\\\\");
+                               r.append("\\\\"); //$NON-NLS-1$
                                break;
 
                        case '"':
-                               r.append("\\\"");
+                               r.append("\\\""); //$NON-NLS-1$
                                break;
 
                        case ';':
@@ -354,7 +354,7 @@ public class Config {
        @SuppressWarnings("unchecked")
        private static <T> T[] allValuesOf(final T value) {
                try {
-                       return (T[]) value.getClass().getMethod("values").invoke(null);
+                       return (T[]) value.getClass().getMethod("values").invoke(null); //$NON-NLS-1$
                } catch (Exception err) {
                        String typeName = value.getClass().getName();
                        String msg = MessageFormat.format(
@@ -393,9 +393,9 @@ public class Config {
                for (T e : all) {
                        if (StringUtils.equalsIgnoreCase(e.name(), n))
                                return e;
-                       else if (StringUtils.equalsIgnoreCase(e.name(), "TRUE"))
+                       else if (StringUtils.equalsIgnoreCase(e.name(), "TRUE")) //$NON-NLS-1$
                                trueState = e;
-                       else if (StringUtils.equalsIgnoreCase(e.name(), "FALSE"))
+                       else if (StringUtils.equalsIgnoreCase(e.name(), "FALSE")) //$NON-NLS-1$
                                falseState = e;
                }
 
@@ -664,11 +664,11 @@ public class Config {
                final String s;
 
                if (value >= GiB && (value % GiB) == 0)
-                       s = String.valueOf(value / GiB) + " g";
+                       s = String.valueOf(value / GiB) + " g"; //$NON-NLS-1$
                else if (value >= MiB && (value % MiB) == 0)
-                       s = String.valueOf(value / MiB) + " m";
+                       s = String.valueOf(value / MiB) + " m"; //$NON-NLS-1$
                else if (value >= KiB && (value % KiB) == 0)
-                       s = String.valueOf(value / KiB) + " k";
+                       s = String.valueOf(value / KiB) + " k"; //$NON-NLS-1$
                else
                        s = String.valueOf(value);
 
@@ -695,7 +695,7 @@ public class Config {
         */
        public void setBoolean(final String section, final String subsection,
                        final String name, final boolean value) {
-               setString(section, subsection, name, value ? "true" : "false");
+               setString(section, subsection, name, value ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
        }
 
        /**
@@ -937,8 +937,8 @@ public class Config {
                                        out.append(' ');
                                        String escaped = escapeValue(e.subsection);
                                        // make sure to avoid double quotes here
-                                       boolean quoted = escaped.startsWith("\"")
-                                                       && escaped.endsWith("\"");
+                                       boolean quoted = escaped.startsWith("\"") //$NON-NLS-1$
+                                                       && escaped.endsWith("\""); //$NON-NLS-1$
                                        if (!quoted)
                                                out.append('"');
                                        out.append(escaped);
@@ -947,11 +947,11 @@ public class Config {
                                }
                                out.append(']');
                        } else if (e.section != null && e.name != null) {
-                               if (e.prefix == null || "".equals(e.prefix))
+                               if (e.prefix == null || "".equals(e.prefix)) //$NON-NLS-1$
                                        out.append('\t');
                                out.append(e.name);
                                if (MAGIC_EMPTY_VALUE != e.value) {
-                                       out.append(" =");
+                                       out.append(" ="); //$NON-NLS-1$
                                        if (e.value != null) {
                                                out.append(' ');
                                                out.append(escapeValue(e.value));
@@ -1005,7 +1005,7 @@ public class Config {
                        } else if (e.section == null && Character.isWhitespace(c)) {
                                // Save the leading whitespace (if any).
                                if (e.prefix == null)
-                                       e.prefix = "";
+                                       e.prefix = ""; //$NON-NLS-1$
                                e.prefix += c;
 
                        } else if ('[' == c) {
@@ -1018,7 +1018,7 @@ public class Config {
                                }
                                if (']' != input)
                                        throw new ConfigInvalidException(JGitText.get().badGroupHeader);
-                               e.suffix = "";
+                               e.suffix = ""; //$NON-NLS-1$
 
                        } else if (last != null) {
                                // Read a value.
@@ -1026,7 +1026,7 @@ public class Config {
                                e.subsection = last.subsection;
                                in.reset();
                                e.name = readKeyName(in);
-                               if (e.name.endsWith("\n")) {
+                               if (e.name.endsWith("\n")) { //$NON-NLS-1$
                                        e.name = e.name.substring(0, e.name.length() - 1);
                                        e.value = MAGIC_EMPTY_VALUE;
                                } else
index c20006e38e5153cd23cecefbf042289c0d8e0d31..dbaa043e215257359668455c270658cca27d52cc 100644 (file)
@@ -47,6 +47,7 @@ package org.eclipse.jgit.lib;
  * Constants for use with the Configuration classes: section names,
  * configuration keys
  */
+@SuppressWarnings("nls")
 public class ConfigConstants {
        /** The "core" section */
        public static final String CONFIG_CORE_SECTION = "core";
index 2715f5f94a15c63616342609aaace350c5ede9b1..8a49bdb4f360261a8eadf9c69ca8a8c17ee69bdd 100644 (file)
@@ -112,6 +112,7 @@ class ConfigLine {
                return a.equals(b);
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                if (section == null)
index cc5fe25e52320b2a2c37437d68716ed6dc1726fa..b7c4c6432180d8756d805f036486848e5acae151 100644 (file)
@@ -98,7 +98,7 @@ class ConfigSnapshot {
 
        Set<String> getNames(String section, String subsection) {
                List<ConfigLine> s = sorted();
-               int idx = find(s, section, subsection, "");
+               int idx = find(s, section, subsection, ""); //$NON-NLS-1$
                if (idx < 0)
                        idx = -(idx + 1);
 
index e66e3a8354672938c5354ff2b5c89ac3d8cac73b..262f7ce7f3ace40c558d67d641210bc1d50d4598 100644 (file)
@@ -56,6 +56,7 @@ import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.util.MutableInteger;
 
 /** Misc. constants used throughout JGit. */
+@SuppressWarnings("nls")
 public final class Constants {
        /** Hash function used natively by Git for all objects. */
        private static final String HASH_FUNCTION = "SHA-1";
index 7348773aa4cd0b4c37e78a1c25a27c7286859d63..936fd82bfdac8bb707128ed44a3553d80773a891 100644 (file)
@@ -80,7 +80,7 @@ public class GitlinkTreeEntry extends TreeEntry {
        public String toString() {
                final StringBuilder r = new StringBuilder();
                r.append(ObjectId.toString(getId()));
-               r.append(" G ");
+               r.append(" G "); //$NON-NLS-1$
                r.append(getFullName());
                return r.toString();
        }
index 0da9e4224e1e55dddd6f0b5acf9d424c20c872a7..d32eb9979274eab826e38479f9db1c08b7697f26 100644 (file)
@@ -227,7 +227,7 @@ public class IndexDiff {
         * @throws IOException
         */
        public boolean diff() throws IOException {
-               return diff(null, 0, 0, "");
+               return diff(null, 0, 0, ""); //$NON-NLS-1$
        }
 
        /**
index 5fc1e832528fcee3a97de895175b106eb6ec6b5c..bb67befae1c0365b9d618e09b06542aa22c800dc 100644 (file)
@@ -67,31 +67,31 @@ import org.eclipse.jgit.util.MutableInteger;
  */
 public class ObjectChecker {
        /** Header "tree " */
-       public static final byte[] tree = Constants.encodeASCII("tree ");
+       public static final byte[] tree = Constants.encodeASCII("tree "); //$NON-NLS-1$
 
        /** Header "parent " */
-       public static final byte[] parent = Constants.encodeASCII("parent ");
+       public static final byte[] parent = Constants.encodeASCII("parent "); //$NON-NLS-1$
 
        /** Header "author " */
-       public static final byte[] author = Constants.encodeASCII("author ");
+       public static final byte[] author = Constants.encodeASCII("author "); //$NON-NLS-1$
 
        /** Header "committer " */
-       public static final byte[] committer = Constants.encodeASCII("committer ");
+       public static final byte[] committer = Constants.encodeASCII("committer "); //$NON-NLS-1$
 
        /** Header "encoding " */
-       public static final byte[] encoding = Constants.encodeASCII("encoding ");
+       public static final byte[] encoding = Constants.encodeASCII("encoding "); //$NON-NLS-1$
 
        /** Header "object " */
-       public static final byte[] object = Constants.encodeASCII("object ");
+       public static final byte[] object = Constants.encodeASCII("object "); //$NON-NLS-1$
 
        /** Header "type " */
-       public static final byte[] type = Constants.encodeASCII("type ");
+       public static final byte[] type = Constants.encodeASCII("type "); //$NON-NLS-1$
 
        /** Header "tag " */
-       public static final byte[] tag = Constants.encodeASCII("tag ");
+       public static final byte[] tag = Constants.encodeASCII("tag "); //$NON-NLS-1$
 
        /** Header "tagger " */
-       public static final byte[] tagger = Constants.encodeASCII("tagger ");
+       public static final byte[] tagger = Constants.encodeASCII("tagger "); //$NON-NLS-1$
 
        private final MutableObjectId tempId = new MutableObjectId();
 
index babfc6f0752f1c1dd9cb5feed500fb94cc8be1e3..f481c772dc3ca3aef4f42b589b0478fe605e3c00 100644 (file)
@@ -178,7 +178,7 @@ public abstract class ObjectIdRef implements Ref {
        @Override
        public String toString() {
                StringBuilder r = new StringBuilder();
-               r.append("Ref[");
+               r.append("Ref["); //$NON-NLS-1$
                r.append(getName());
                r.append('=');
                r.append(ObjectId.toString(getObjectId()));
index f81d9c5a845cd396f15b260999798c29913b2eb8..69f7fd4404aed3bc6fe4c10443ff695646a63be6 100644 (file)
@@ -217,7 +217,7 @@ public class PersonIdent implements Serializable {
         */
        public TimeZone getTimeZone() {
                StringBuilder tzId = new StringBuilder(8);
-               tzId.append("GMT");
+               tzId.append("GMT"); //$NON-NLS-1$
                appendTimezone(tzId);
                return TimeZone.getTimeZone(tzId.toString());
        }
@@ -255,9 +255,9 @@ public class PersonIdent implements Serializable {
        public String toExternalString() {
                final StringBuilder r = new StringBuilder();
                r.append(getName());
-               r.append(" <");
+               r.append(" <"); //$NON-NLS-1$
                r.append(getEmailAddress());
-               r.append("> ");
+               r.append("> "); //$NON-NLS-1$
                r.append(when / 1000);
                r.append(' ');
                appendTimezone(r);
@@ -291,6 +291,7 @@ public class PersonIdent implements Serializable {
                r.append(offsetMins);
        }
 
+       @SuppressWarnings("nls")
        public String toString() {
                final StringBuilder r = new StringBuilder();
                final SimpleDateFormat dtfmt;
index 3cfb75a6091031d66b4255890820181f286dc68a..05eb31183db4db8b31e15a8c152364c1174dbecd 100644 (file)
@@ -77,12 +77,12 @@ public abstract class RefRename {
                source = src;
                destination = dst;
 
-               String cmd = "";
+               String cmd = ""; //$NON-NLS-1$
                if (source.getName().startsWith(Constants.R_HEADS)
                                && destination.getName().startsWith(Constants.R_HEADS))
-                       cmd = "Branch: ";
-               setRefLogMessage(cmd + "renamed "
-                               + Repository.shortenRefName(source.getName()) + " to "
+                       cmd = "Branch: "; //$NON-NLS-1$
+               setRefLogMessage(cmd + "renamed " //$NON-NLS-1$
+                               + Repository.shortenRefName(source.getName()) + " to " //$NON-NLS-1$
                                + Repository.shortenRefName(destination.getName()));
        }
 
@@ -132,7 +132,7 @@ public abstract class RefRename {
 
        /** Don't record this rename in the ref's associated reflog. */
        public void disableRefLog() {
-               destination.setRefLogMessage("", false);
+               destination.setRefLogMessage("", false); //$NON-NLS-1$
        }
 
        /**
index 83f1981494ea34906ccd443f24f5c0ff38099031..394af295340fdb2a432ab87f186849c68b53565c 100644 (file)
@@ -190,7 +190,7 @@ public abstract class RefUpdate {
        protected RefUpdate(final Ref ref) {
                this.ref = ref;
                oldValue = ref.getObjectId();
-               refLogMessage = "";
+               refLogMessage = ""; //$NON-NLS-1$
        }
 
        /** @return the reference database this update modifies. */
@@ -372,7 +372,7 @@ public abstract class RefUpdate {
                if (msg == null && !appendStatus)
                        disableRefLog();
                else if (msg == null && appendStatus) {
-                       refLogMessage = "";
+                       refLogMessage = ""; //$NON-NLS-1$
                        refLogIncludeResult = true;
                } else {
                        refLogMessage = msg;
index 4acb3ecd897d3fac3283fc88b09e22126e94817d..8acac42fa65ab0c1fa1470f7feeb3b4eed78cb2e 100644 (file)
@@ -128,7 +128,7 @@ public abstract class RefWriter {
                                r.getPeeledObjectId().copyTo(tmp, w);
                                w.write('\t');
                                w.write(r.getName());
-                               w.write("^{}\n");
+                               w.write("^{}\n"); //$NON-NLS-1$
                        }
                }
                writeFile(Constants.INFO_REFS, Constants.encode(w.toString()));
index 10efb9f21a0298048dbc4bc8dc6ae62c7cde2965..9b2b8a7f0fbad0097cf78c6809cb89a24ad28cca 100644 (file)
@@ -491,16 +491,16 @@ public abstract class Repository {
                                                }
                                                i = k;
                                                if (item != null)
-                                                       if (item.equals("tree")) {
+                                                       if (item.equals("tree")) { //$NON-NLS-1$
                                                                rev = rw.parseTree(rev);
-                                                       } else if (item.equals("commit")) {
+                                                       } else if (item.equals("commit")) { //$NON-NLS-1$
                                                                rev = rw.parseCommit(rev);
-                                                       } else if (item.equals("blob")) {
+                                                       } else if (item.equals("blob")) { //$NON-NLS-1$
                                                                rev = rw.peel(rev);
                                                                if (!(rev instanceof RevBlob))
                                                                        throw new IncorrectObjectTypeException(rev,
                                                                                        Constants.TYPE_BLOB);
-                                                       } else if (item.equals("")) {
+                                                       } else if (item.equals("")) { //$NON-NLS-1$
                                                                rev = rw.peel(rev);
                                                        } else
                                                                throw new RevisionSyntaxException(revstr);
@@ -596,14 +596,14 @@ public abstract class Repository {
                                        }
                                }
                                if (time != null) {
-                                       if (time.equals("upstream")) {
+                                       if (time.equals("upstream")) { //$NON-NLS-1$
                                                if (name == null)
                                                        name = new String(revChars, done, i);
-                                               if (name.equals(""))
+                                               if (name.equals("")) //$NON-NLS-1$
                                                        // Currently checked out branch, HEAD if
                                                        // detached
                                                        name = Constants.HEAD;
-                                               if (!Repository.isValidRefName("x/" + name))
+                                               if (!Repository.isValidRefName("x/" + name)) //$NON-NLS-1$
                                                        throw new RevisionSyntaxException(revstr);
                                                Ref ref = getRef(name);
                                                name = null;
@@ -616,7 +616,7 @@ public abstract class Repository {
                                                RemoteConfig remoteConfig;
                                                try {
                                                        remoteConfig = new RemoteConfig(getConfig(),
-                                                                       "origin");
+                                                                       "origin"); //$NON-NLS-1$
                                                } catch (URISyntaxException e) {
                                                        throw new RevisionSyntaxException(revstr);
                                                }
@@ -637,7 +637,7 @@ public abstract class Repository {
                                                }
                                                if (name == null)
                                                        throw new RevisionSyntaxException(revstr);
-                                       } else if (time.matches("^-\\d+$")) {
+                                       } else if (time.matches("^-\\d+$")) { //$NON-NLS-1$
                                                if (name != null)
                                                        throw new RevisionSyntaxException(revstr);
                                                else {
@@ -651,9 +651,9 @@ public abstract class Repository {
                                        } else {
                                                if (name == null)
                                                        name = new String(revChars, done, i);
-                                               if (name.equals(""))
+                                               if (name.equals("")) //$NON-NLS-1$
                                                        name = Constants.HEAD;
-                                               if (!Repository.isValidRefName("x/" + name))
+                                               if (!Repository.isValidRefName("x/" + name)) //$NON-NLS-1$
                                                        throw new RevisionSyntaxException(revstr);
                                                Ref ref = getRef(name);
                                                name = null;
@@ -674,7 +674,7 @@ public abstract class Repository {
                                if (rev == null) {
                                        if (name == null)
                                                name = new String(revChars, done, i);
-                                       if (name.equals(""))
+                                       if (name.equals("")) //$NON-NLS-1$
                                                name = Constants.HEAD;
                                        rev = parseSimple(rw, name);
                                        name = null;
@@ -702,7 +702,7 @@ public abstract class Repository {
                if (done == revstr.length())
                        return null;
                name = revstr.substring(done);
-               if (!Repository.isValidRefName("x/" + name))
+               if (!Repository.isValidRefName("x/" + name)) //$NON-NLS-1$
                        throw new RevisionSyntaxException(revstr);
                if (getRef(name) != null)
                        return name;
@@ -732,7 +732,7 @@ public abstract class Repository {
                if (ObjectId.isId(revstr))
                        return ObjectId.fromString(revstr);
 
-               if (Repository.isValidRefName("x/" + revstr)) {
+               if (Repository.isValidRefName("x/" + revstr)) { //$NON-NLS-1$
                        Ref r = getRefDatabase().getRef(revstr);
                        if (r != null)
                                return r.getObjectId();
@@ -741,7 +741,7 @@ public abstract class Repository {
                if (AbbreviatedObjectId.isId(revstr))
                        return resolveAbbreviation(revstr);
 
-               int dashg = revstr.indexOf("-g");
+               int dashg = revstr.indexOf("-g"); //$NON-NLS-1$
                if ((dashg + 5) < revstr.length() && 0 <= dashg
                                && isHex(revstr.charAt(dashg + 2))
                                && isHex(revstr.charAt(dashg + 3))
@@ -827,14 +827,15 @@ public abstract class Repository {
                getRefDatabase().close();
        }
 
+       @SuppressWarnings("nls")
        public String toString() {
                String desc;
                if (getDirectory() != null)
                        desc = getDirectory().getPath();
                else
-                       desc = getClass().getSimpleName() + "-"
+                       desc = getClass().getSimpleName() + "-" //$NON-NLS-1$
                                        + System.identityHashCode(this);
-               return "Repository[" + desc + "]";
+               return "Repository[" + desc + "]"; //$NON-NLS-1$
        }
 
        /**
@@ -1068,22 +1069,22 @@ public abstract class Repository {
                        return RepositoryState.BARE;
 
                // Pre Git-1.6 logic
-               if (new File(getWorkTree(), ".dotest").exists())
+               if (new File(getWorkTree(), ".dotest").exists()) //$NON-NLS-1$
                        return RepositoryState.REBASING;
-               if (new File(getDirectory(), ".dotest-merge").exists())
+               if (new File(getDirectory(), ".dotest-merge").exists()) //$NON-NLS-1$
                        return RepositoryState.REBASING_INTERACTIVE;
 
                // From 1.6 onwards
-               if (new File(getDirectory(),"rebase-apply/rebasing").exists())
+               if (new File(getDirectory(),"rebase-apply/rebasing").exists()) //$NON-NLS-1$
                        return RepositoryState.REBASING_REBASING;
-               if (new File(getDirectory(),"rebase-apply/applying").exists())
+               if (new File(getDirectory(),"rebase-apply/applying").exists()) //$NON-NLS-1$
                        return RepositoryState.APPLY;
-               if (new File(getDirectory(),"rebase-apply").exists())
+               if (new File(getDirectory(),"rebase-apply").exists()) //$NON-NLS-1$
                        return RepositoryState.REBASING;
 
-               if (new File(getDirectory(),"rebase-merge/interactive").exists())
+               if (new File(getDirectory(),"rebase-merge/interactive").exists()) //$NON-NLS-1$
                        return RepositoryState.REBASING_INTERACTIVE;
-               if (new File(getDirectory(),"rebase-merge").exists())
+               if (new File(getDirectory(),"rebase-merge").exists()) //$NON-NLS-1$
                        return RepositoryState.REBASING_MERGE;
 
                // Both versions
@@ -1102,7 +1103,7 @@ public abstract class Repository {
                        return RepositoryState.MERGING;
                }
 
-               if (new File(getDirectory(), "BISECT_LOG").exists())
+               if (new File(getDirectory(), "BISECT_LOG").exists()) //$NON-NLS-1$
                        return RepositoryState.BISECTING;
 
                if (new File(getDirectory(), Constants.CHERRY_PICK_HEAD).exists()) {
@@ -1136,7 +1137,7 @@ public abstract class Repository {
                final int len = refName.length();
                if (len == 0)
                        return false;
-               if (refName.endsWith(".lock"))
+               if (refName.endsWith(".lock")) //$NON-NLS-1$
                        return false;
 
                int components = 1;
@@ -1194,7 +1195,7 @@ public abstract class Repository {
                        File absWd = workDir.isAbsolute() ? workDir : workDir.getAbsoluteFile();
                        File absFile = file.isAbsolute() ? file : file.getAbsoluteFile();
                        if (absWd == workDir && absFile == file)
-                               return "";
+                               return ""; //$NON-NLS-1$
                        return stripWorkDir(absWd, absFile);
                }
 
index dc5eae5173daddb9fdb47df1fbbc6319f7503698..5132eb90b61f5697ee1b0d569c3a337fe39a5fdd 100644 (file)
@@ -354,15 +354,15 @@ public class RepositoryCache {
                 *         Git directory.
                 */
                public static boolean isGitRepository(final File dir, FS fs) {
-                       return fs.resolve(dir, "objects").exists()
-                                       && fs.resolve(dir, "refs").exists()
+                       return fs.resolve(dir, "objects").exists() //$NON-NLS-1$
+                                       && fs.resolve(dir, "refs").exists() //$NON-NLS-1$
                                        && isValidHead(new File(dir, Constants.HEAD));
                }
 
                private static boolean isValidHead(final File head) {
                        final String ref = readFirstLine(head);
                        return ref != null
-                                       && (ref.startsWith("ref: refs/") || ObjectId.isId(ref));
+                                       && (ref.startsWith("ref: refs/") || ObjectId.isId(ref)); //$NON-NLS-1$
                }
 
                private static String readFirstLine(final File head) {
index d169d61f1c82d098891e5f46c8a54979b9bdee87..43b1510f94a0bd45615b48dca710b93571e24235 100644 (file)
@@ -102,6 +102,7 @@ public class SymbolicRef implements Ref {
                return getLeaf().isPeeled();
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                StringBuilder r = new StringBuilder();
index e408be1750d44bf94c7b65f1de1a651efb28f02c..c7e41bce041fa816d9265cc479496ee418bab368 100644 (file)
@@ -78,7 +78,7 @@ public class SymlinkTreeEntry extends TreeEntry {
        public String toString() {
                final StringBuilder r = new StringBuilder();
                r.append(ObjectId.toString(getId()));
-               r.append(" S ");
+               r.append(" S "); //$NON-NLS-1$
                r.append(getFullName());
                return r.toString();
        }
index 82cd0747a493c4cfaaced9f7b8824e4022784f36..3490a5bc991e619203ce8dffe022453231d9d360 100644 (file)
@@ -162,20 +162,20 @@ public class TagBuilder {
                ByteArrayOutputStream os = new ByteArrayOutputStream();
                OutputStreamWriter w = new OutputStreamWriter(os, Constants.CHARSET);
                try {
-                       w.write("object ");
+                       w.write("object "); //$NON-NLS-1$
                        getObjectId().copyTo(w);
                        w.write('\n');
 
-                       w.write("type ");
+                       w.write("type "); //$NON-NLS-1$
                        w.write(Constants.typeString(getObjectType()));
-                       w.write("\n");
+                       w.write("\n"); //$NON-NLS-1$
 
-                       w.write("tag ");
+                       w.write("tag "); //$NON-NLS-1$
                        w.write(getTag());
-                       w.write("\n");
+                       w.write("\n"); //$NON-NLS-1$
 
                        if (getTagger() != null) {
-                               w.write("tagger ");
+                               w.write("tagger "); //$NON-NLS-1$
                                w.write(getTagger().toExternalString());
                                w.write('\n');
                        }
@@ -203,6 +203,7 @@ public class TagBuilder {
                return build();
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                StringBuilder r = new StringBuilder();
index 7e48609070f3fc1bb8718974229ef80bf36c295e..7675fccb69a32edadef492c3f0d760b09d17c3f7 100644 (file)
@@ -81,14 +81,14 @@ public class TextProgressMonitor extends BatchingProgressMonitor {
        protected void onEndTask(String taskName, int workCurr) {
                StringBuilder s = new StringBuilder();
                format(s, taskName, workCurr);
-               s.append("\n");
+               s.append("\n"); //$NON-NLS-1$
                send(s);
        }
 
        private void format(StringBuilder s, String taskName, int workCurr) {
-               s.append("\r");
+               s.append("\r"); //$NON-NLS-1$
                s.append(taskName);
-               s.append(": ");
+               s.append(": "); //$NON-NLS-1$
                while (s.length() < 25)
                        s.append(' ');
                s.append(workCurr);
@@ -105,32 +105,32 @@ public class TextProgressMonitor extends BatchingProgressMonitor {
        protected void onEndTask(String taskName, int cmp, int totalWork, int pcnt) {
                StringBuilder s = new StringBuilder();
                format(s, taskName, cmp, totalWork, pcnt);
-               s.append("\n");
+               s.append("\n"); //$NON-NLS-1$
                send(s);
        }
 
        private void format(StringBuilder s, String taskName, int cmp,
                        int totalWork, int pcnt) {
-               s.append("\r");
+               s.append("\r"); //$NON-NLS-1$
                s.append(taskName);
-               s.append(": ");
+               s.append(": "); //$NON-NLS-1$
                while (s.length() < 25)
                        s.append(' ');
 
                String endStr = String.valueOf(totalWork);
                String curStr = String.valueOf(cmp);
                while (curStr.length() < endStr.length())
-                       curStr = " " + curStr;
+                       curStr = " " + curStr; //$NON-NLS-1$
                if (pcnt < 100)
                        s.append(' ');
                if (pcnt < 10)
                        s.append(' ');
                s.append(pcnt);
-               s.append("% (");
+               s.append("% ("); //$NON-NLS-1$
                s.append(curStr);
-               s.append("/");
+               s.append("/"); //$NON-NLS-1$
                s.append(endStr);
-               s.append(")");
+               s.append(")"); //$NON-NLS-1$
        }
 
        private void send(StringBuilder s) {
index 802b966ae7263f48113ef82b23d4a69718bfaf37..d257ba93e82ab8e566be2b8747c9c2497d58fc62 100644 (file)
@@ -593,7 +593,7 @@ public class Tree extends TreeEntry {
        public String toString() {
                final StringBuilder r = new StringBuilder();
                r.append(ObjectId.toString(getId()));
-               r.append(" T ");
+               r.append(" T "); //$NON-NLS-1$
                r.append(getFullName());
                return r.toString();
        }
index 86c3fc042a9ec4c78c5c4c958b8daaab9ecae628..db0694b969a40f0f3454b1af70900bf3e21bf0cb 100644 (file)
@@ -333,6 +333,7 @@ public class TreeFormatter {
                }
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                byte[] raw = toByteArray();
index da44a2ef31280aa5305ad08c62940b5d1688302d..60b4819edac5e6da52f2a98dd8cf7205c1811df7 100644 (file)
@@ -173,7 +173,7 @@ public class UserConfig {
 
        private static String getNameInternal(Config rc, String envKey) {
                // try to get the user name from the local and global configurations.
-               String username = rc.getString("user", null, "name");
+               String username = rc.getString("user", null, "name"); //$NON-NLS-1$ //$NON-NLS-2$
 
                if (username == null) {
                        // try to get the user name for the system property GIT_XXX_NAME
@@ -197,7 +197,7 @@ public class UserConfig {
 
        private static String getEmailInternal(Config rc, String envKey) {
                // try to get the email from the local and global configurations.
-               String email = rc.getString("user", null, "email");
+               String email = rc.getString("user", null, "email"); //$NON-NLS-1$ //$NON-NLS-2$
 
                if (email == null) {
                        // try to get the email for the system property GIT_XXX_EMAIL
@@ -214,7 +214,7 @@ public class UserConfig {
        private static String getDefaultEmail() {
                // try to construct an email
                String username = getDefaultUserName();
-               return username + "@" + system().getHostname();
+               return username + "@" + system().getHostname(); //$NON-NLS-1$
        }
 
        private static SystemReader system() {
index 5feb3a859b3f1dc8e36f7f0c7e6633d0b07d025f..1ba80869c204818fc3fba92504df8e5c3ee1ddd3 100644 (file)
@@ -86,13 +86,13 @@ public class MergeFormatter {
                        if (lastConflictingName != null
                                        && chunk.getConflictState() != ConflictState.NEXT_CONFLICTING_RANGE) {
                                // found the end of an conflict
-                               out.write((">>>>>>> " + lastConflictingName + "\n").getBytes(charsetName));
+                               out.write((">>>>>>> " + lastConflictingName + "\n").getBytes(charsetName)); //$NON-NLS-1$ //$NON-NLS-2$
                                lastConflictingName = null;
                        }
                        if (chunk.getConflictState() == ConflictState.FIRST_CONFLICTING_RANGE) {
                                // found the start of an conflict
-                               out.write(("<<<<<<< " + seqName.get(chunk.getSequenceIndex()) +
-                                               "\n").getBytes(charsetName));
+                               out.write(("<<<<<<< " + seqName.get(chunk.getSequenceIndex()) + //$NON-NLS-1$
+                                               "\n").getBytes(charsetName)); //$NON-NLS-1$
                                lastConflictingName = seqName.get(chunk.getSequenceIndex());
                        } else if (chunk.getConflictState() == ConflictState.NEXT_CONFLICTING_RANGE) {
                                // found another conflicting chunk
@@ -105,8 +105,8 @@ public class MergeFormatter {
                                 * present non-three-way merges - feel free to correct here.
                                 */
                                lastConflictingName = seqName.get(chunk.getSequenceIndex());
-                               out.write((threeWayMerge ? "=======\n" : "======= "
-                                               + lastConflictingName + "\n").getBytes(charsetName));
+                               out.write((threeWayMerge ? "=======\n" : "======= " //$NON-NLS-1$ //$NON-NLS-2$
+                                               + lastConflictingName + "\n").getBytes(charsetName)); //$NON-NLS-1$
                        }
                        // the lines with conflict-metadata are written. Now write the chunk
                        for (int i = chunk.getBegin(); i < chunk.getEnd(); i++) {
@@ -117,7 +117,7 @@ public class MergeFormatter {
                // one possible leftover: if the merge result ended with a conflict we
                // have to close the last conflict here
                if (lastConflictingName != null) {
-                       out.write((">>>>>>> " + lastConflictingName + "\n").getBytes(charsetName));
+                       out.write((">>>>>>> " + lastConflictingName + "\n").getBytes(charsetName)); //$NON-NLS-1$ //$NON-NLS-2$
                }
        }
 
index cacaff4c5d24c4c520cdbece7c251d27cbccb2bf..29fa8d65ad62a6aab5ebf67d7e5ffbfed86246e2 100644 (file)
@@ -67,7 +67,7 @@ public class MergeMessageFormatter {
         */
        public String format(List<Ref> refsToMerge, Ref target) {
                StringBuilder sb = new StringBuilder();
-               sb.append("Merge ");
+               sb.append("Merge "); //$NON-NLS-1$
 
                List<String> branches = new ArrayList<String>();
                List<String> remoteBranches = new ArrayList<String>();
@@ -76,18 +76,18 @@ public class MergeMessageFormatter {
                List<String> others = new ArrayList<String>();
                for (Ref ref : refsToMerge) {
                        if (ref.getName().startsWith(Constants.R_HEADS))
-                               branches.add("'" + Repository.shortenRefName(ref.getName())
-                                               + "'");
+                               branches.add("'" + Repository.shortenRefName(ref.getName()) //$NON-NLS-1$
+                                               + "'"); //$NON-NLS-1$
 
                        else if (ref.getName().startsWith(Constants.R_REMOTES))
-                               remoteBranches.add("'"
-                                               + Repository.shortenRefName(ref.getName()) + "'");
+                               remoteBranches.add("'" //$NON-NLS-1$
+                                               + Repository.shortenRefName(ref.getName()) + "'"); //$NON-NLS-1$
 
                        else if (ref.getName().startsWith(Constants.R_TAGS))
-                               tags.add("'" + Repository.shortenRefName(ref.getName()) + "'");
+                               tags.add("'" + Repository.shortenRefName(ref.getName()) + "'"); //$NON-NLS-1$ //$NON-NLS-2$
 
                        else if (ref.getName().equals(ref.getObjectId().getName()))
-                               commits.add("'" + ref.getName() + "'");
+                               commits.add("'" + ref.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
 
                        else
                                others.add(ref.getName());
@@ -109,9 +109,9 @@ public class MergeMessageFormatter {
                        listings.add(joinNames(commits, "commit", "commits"));
 
                if (!others.isEmpty())
-                       listings.add(StringUtils.join(others, ", ", " and "));
+                       listings.add(StringUtils.join(others, ", ", " and ")); //$NON-NLS-1$
 
-               sb.append(StringUtils.join(listings, ", "));
+               sb.append(StringUtils.join(listings, ", ")); //$NON-NLS-1$
 
                String targetName = target.getLeaf().getName();
                if (!targetName.equals(Constants.R_HEADS + Constants.MASTER)) {
@@ -134,9 +134,9 @@ public class MergeMessageFormatter {
        public String formatWithConflicts(String message,
                        List<String> conflictingPaths) {
                StringBuilder sb = new StringBuilder(message);
-               if (!message.endsWith("\n") && message.length() != 0)
-                       sb.append("\n");
-               sb.append("\n");
+               if (!message.endsWith("\n") && message.length() != 0) //$NON-NLS-1$
+                       sb.append("\n"); //$NON-NLS-1$
+               sb.append("\n"); //$NON-NLS-1$
                sb.append("Conflicts:\n");
                for (String conflictingPath : conflictingPaths)
                        sb.append('\t').append(conflictingPath).append('\n');
@@ -146,8 +146,8 @@ public class MergeMessageFormatter {
        private static String joinNames(List<String> names, String singular,
                        String plural) {
                if (names.size() == 1)
-                       return singular + " " + names.get(0);
+                       return singular + " " + names.get(0); //$NON-NLS-1$
                else
-                       return plural + " " + StringUtils.join(names, ", ", " and ");
+                       return plural + " " + StringUtils.join(names, ", ", " and "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }
 }
index 1301a4b10df9f8a9d37d66e0251fe788ed73c786..2e6fc41378aa16a88007759fe16d45abbe067d74 100644 (file)
@@ -58,10 +58,10 @@ import org.eclipse.jgit.lib.Repository;
  */
 public abstract class MergeStrategy {
        /** Simple strategy that sets the output tree to the first input tree. */
-       public static final MergeStrategy OURS = new StrategyOneSided("ours", 0);
+       public static final MergeStrategy OURS = new StrategyOneSided("ours", 0); //$NON-NLS-1$
 
        /** Simple strategy that sets the output tree to the second input tree. */
-       public static final MergeStrategy THEIRS = new StrategyOneSided("theirs", 1);
+       public static final MergeStrategy THEIRS = new StrategyOneSided("theirs", 1); //$NON-NLS-1$
 
        /** Simple strategy to merge paths, without simultaneous edits. */
        public static final ThreeWayMergeStrategy SIMPLE_TWO_WAY_IN_CORE = new StrategySimpleTwoWayInCore();
index 1782bb2ad3585f8ce15c9801fc8ef993adf5b16c..433458a273fe133394ddf9479dbc1cead22d3a7c 100644 (file)
@@ -728,7 +728,7 @@ public class ResolveMerger extends ThreeWayMerger {
                } else if (!result.containsConflicts()) {
                        // When working inCore, only trivial merges can be handled,
                        // so we generate objects only in conflict free cases
-                       of = File.createTempFile("merge_", "_temp", null);
+                       of = File.createTempFile("merge_", "_temp", null); //$NON-NLS-1$ //$NON-NLS-2$
                        fos = new FileOutputStream(of);
                        try {
                                fmt.formatMerge(fos, result, Arrays.asList(commitNames),
index 6d0ff9ba9c1bdcce3e385cbbab5f2934a4af4119..8931fd65acd1976803355b267c085729c943973d 100644 (file)
@@ -80,11 +80,11 @@ public class SquashMessageFormatter {
                for (RevCommit c : squashedCommits) {
                        sb.append("\ncommit ");
                        sb.append(c.getName());
-                       sb.append("\n");
+                       sb.append("\n"); //$NON-NLS-1$
                        sb.append(toString(c.getAuthorIdent()));
-                       sb.append("\n\t");
+                       sb.append("\n\t"); //$NON-NLS-1$
                        sb.append(c.getShortMessage());
-                       sb.append("\n");
+                       sb.append("\n"); //$NON-NLS-1$
                }
                return sb.toString();
        }
@@ -94,12 +94,12 @@ public class SquashMessageFormatter {
 
                a.append("Author: ");
                a.append(author.getName());
-               a.append(" <");
+               a.append(" <"); //$NON-NLS-1$
                a.append(author.getEmailAddress());
-               a.append(">\n");
+               a.append(">\n"); //$NON-NLS-1$
                a.append("Date:   ");
                a.append(dateFormatter.formatDate(author));
-               a.append("\n");
+               a.append("\n"); //$NON-NLS-1$
 
                return a.toString();
        }
index e37635eb536d17c82f8b2524bfc30002264ae702..07368e57463fb9e2f19cf62755c3f83da62167b4 100644 (file)
@@ -62,6 +62,6 @@ public class StrategyResolve extends ThreeWayMergeStrategy {
 
        @Override
        public String getName() {
-               return "resolve";
+               return "resolve"; //$NON-NLS-1$
        }
 }
\ No newline at end of file
index d8a9423e8e15735b9764826c4b9bf6915373659f..f18a522131c1f51e47959bae25499e0d0ccbca19 100644 (file)
@@ -75,7 +75,7 @@ public class StrategySimpleTwoWayInCore extends ThreeWayMergeStrategy {
 
        @Override
        public String getName() {
-               return "simple-two-way-in-core";
+               return "simple-two-way-in-core"; //$NON-NLS-1$
        }
 
        @Override
index 219b0a163121000270349d48279ddfdda94d5d60..a768c25a2064ed1fd6fbbd5b892120a3aea64615 100644 (file)
@@ -69,7 +69,7 @@ import org.eclipse.jgit.errors.TranslationStringMissingException;
  */
 public class NLS {
        /** The root locale constant. It is defined here because the Locale.ROOT is not defined in Java 5 */
-       public static final Locale ROOT_LOCALE = new Locale("", "", "");
+       public static final Locale ROOT_LOCALE = new Locale("", "", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
        private static final InheritableThreadLocal<NLS> local = new InheritableThreadLocal<NLS>() {
                protected NLS initialValue() {
index ddff52e74efdf0fde1a9a025ae7e08f2f2d5058d..41e9bbeef816eb92a86cfafb4099a329f51ef606 100644 (file)
@@ -72,6 +72,7 @@ public class Note extends ObjectId {
                data = newData;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return "Note[" + name() + " -> " + data.name() + "]";
index 3c4347823b5d9f2eae3f3c760a02318e2069140a..25b2ae89e914da973ee3f79eb0751730a28d4ab4 100644 (file)
@@ -389,7 +389,7 @@ public class NoteMap implements Iterable<Note> {
 
        private void load(ObjectId rootTree) throws MissingObjectException,
                        IncorrectObjectTypeException, CorruptObjectException, IOException {
-               AbbreviatedObjectId none = AbbreviatedObjectId.fromString("");
+               AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); //$NON-NLS-1$
                root = NoteParser.parse(none, rootTree, reader);
        }
 }
index b335fbe87b164d5f6412563eae681731c4dbc41b..061447666c75bf370ab1e10dcc9c9a682f993cf2 100644 (file)
@@ -329,7 +329,7 @@ public class NoteMapMerger {
                        throw new NotesMergeConflictException(baseList, oursList,
                                        theirsList);
                ObjectId resultTreeId = m.getResultTreeId();
-               AbbreviatedObjectId none = AbbreviatedObjectId.fromString("");
+               AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); //$NON-NLS-1$
                return NoteParser.parse(none, resultTreeId, reader).nonNotes;
        }
 
index 802f1930e62c404f8630144b82d6d48c2f14e50f..94fba0fc61671c05bc58404f2eb1263b082335ef 100644 (file)
@@ -101,10 +101,10 @@ public class NotesMergeConflictException extends IOException {
        private static String noteData(Note n) {
                if (n != null)
                        return n.getData().name();
-               return "";
+               return ""; //$NON-NLS-1$
        }
 
        private static String name(NonNoteEntry e) {
-               return e != null ? e.name() : "";
+               return e != null ? e.name() : ""; //$NON-NLS-1$
        }
 }
index 340b67456e12abd04b01375822cb4166748e3ac2..d0a6b1f3185c7049cd10602a944e200174290954 100644 (file)
@@ -51,9 +51,9 @@ import static org.eclipse.jgit.util.RawParseUtils.parseBase10;
 
 /** Part of a "GIT binary patch" to describe the pre-image or post-image */
 public class BinaryHunk {
-       private static final byte[] LITERAL = encodeASCII("literal ");
+       private static final byte[] LITERAL = encodeASCII("literal "); //$NON-NLS-1$
 
-       private static final byte[] DELTA = encodeASCII("delta ");
+       private static final byte[] DELTA = encodeASCII("delta "); //$NON-NLS-1$
 
        /** Type of information stored in a binary hunk. */
        public static enum Type {
index e95c026ddc956636568fb62d94b4e9a679967034..b104a4984285dbf8e03d19fe60b08b25702eaf81 100644 (file)
@@ -63,7 +63,7 @@ import org.eclipse.jgit.lib.FileMode;
  * merge which introduces changes not in any ancestor.
  */
 public class CombinedFileHeader extends FileHeader {
-       private static final byte[] MODE = encodeASCII("mode ");
+       private static final byte[] MODE = encodeASCII("mode "); //$NON-NLS-1$
 
        private AbbreviatedObjectId[] oldIds;
 
index ff30a8cbcb5b03545706cdb7b00071c3b437f9f3..8171669bc8c07c3af7fb88554d2d5f4424eb510b 100644 (file)
@@ -71,35 +71,35 @@ import org.eclipse.jgit.util.TemporaryBuffer;
 
 /** Patch header describing an action for a single file path. */
 public class FileHeader extends DiffEntry {
-       private static final byte[] OLD_MODE = encodeASCII("old mode ");
+       private static final byte[] OLD_MODE = encodeASCII("old mode "); //$NON-NLS-1$
 
-       private static final byte[] NEW_MODE = encodeASCII("new mode ");
+       private static final byte[] NEW_MODE = encodeASCII("new mode "); //$NON-NLS-1$
 
-       static final byte[] DELETED_FILE_MODE = encodeASCII("deleted file mode ");
+       static final byte[] DELETED_FILE_MODE = encodeASCII("deleted file mode "); //$NON-NLS-1$
 
-       static final byte[] NEW_FILE_MODE = encodeASCII("new file mode ");
+       static final byte[] NEW_FILE_MODE = encodeASCII("new file mode "); //$NON-NLS-1$
 
-       private static final byte[] COPY_FROM = encodeASCII("copy from ");
+       private static final byte[] COPY_FROM = encodeASCII("copy from "); //$NON-NLS-1$
 
-       private static final byte[] COPY_TO = encodeASCII("copy to ");
+       private static final byte[] COPY_TO = encodeASCII("copy to "); //$NON-NLS-1$
 
-       private static final byte[] RENAME_OLD = encodeASCII("rename old ");
+       private static final byte[] RENAME_OLD = encodeASCII("rename old "); //$NON-NLS-1$
 
-       private static final byte[] RENAME_NEW = encodeASCII("rename new ");
+       private static final byte[] RENAME_NEW = encodeASCII("rename new "); //$NON-NLS-1$
 
-       private static final byte[] RENAME_FROM = encodeASCII("rename from ");
+       private static final byte[] RENAME_FROM = encodeASCII("rename from "); //$NON-NLS-1$
 
-       private static final byte[] RENAME_TO = encodeASCII("rename to ");
+       private static final byte[] RENAME_TO = encodeASCII("rename to "); //$NON-NLS-1$
 
-       private static final byte[] SIMILARITY_INDEX = encodeASCII("similarity index ");
+       private static final byte[] SIMILARITY_INDEX = encodeASCII("similarity index "); //$NON-NLS-1$
 
-       private static final byte[] DISSIMILARITY_INDEX = encodeASCII("dissimilarity index ");
+       private static final byte[] DISSIMILARITY_INDEX = encodeASCII("dissimilarity index "); //$NON-NLS-1$
 
-       static final byte[] INDEX = encodeASCII("index ");
+       static final byte[] INDEX = encodeASCII("index "); //$NON-NLS-1$
 
-       static final byte[] OLD_NAME = encodeASCII("--- ");
+       static final byte[] OLD_NAME = encodeASCII("--- "); //$NON-NLS-1$
 
-       static final byte[] NEW_NAME = encodeASCII("+++ ");
+       static final byte[] NEW_NAME = encodeASCII("+++ "); //$NON-NLS-1$
 
        /** Type of patch used by this file. */
        public static enum PatchType {
index 13046137dc38088d48776ebc051bd6d8db4f1ae8..245b3ee599caa691bfcdf39531b74adc0719d078 100644 (file)
@@ -103,12 +103,12 @@ public class FormatError {
        public String toString() {
                final StringBuilder r = new StringBuilder();
                r.append(getSeverity().name().toLowerCase());
-               r.append(": at offset ");
+               r.append(": at offset "); //$NON-NLS-1$
                r.append(getOffset());
-               r.append(": ");
+               r.append(": "); //$NON-NLS-1$
                r.append(getMessage());
-               r.append("\n");
-               r.append("  in ");
+               r.append("\n"); //$NON-NLS-1$
+               r.append("  in "); //$NON-NLS-1$
                r.append(getLineText());
                return r.toString();
        }
index b7a93933f2a0db616a2943379dafe838dcb468bd..d72b9bb83a4573252a16e44609d9ad2d039de717 100644 (file)
@@ -311,8 +311,8 @@ public class HunkHeader {
 
                } else if (nContext + old.nDeleted > old.lineCount
                                || nContext + old.nAdded > newLineCount) {
-                       final String oldcnt = old.lineCount + ":" + newLineCount;
-                       final String newcnt = (nContext + old.nDeleted) + ":"
+                       final String oldcnt = old.lineCount + ":" + newLineCount; //$NON-NLS-1$
+                       final String newcnt = (nContext + old.nDeleted) + ":" //$NON-NLS-1$
                                        + (nContext + old.nAdded);
                        script.warn(buf, startOffset, MessageFormat.format(
                                        JGitText.get().hunkHeaderDoesNotMatchBodyLineCountOf, oldcnt, newcnt));
@@ -404,6 +404,7 @@ public class HunkHeader {
                offsets[fileIdx] = end < 0 ? s.length() : end + 1;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                StringBuilder buf = new StringBuilder();
index 8a09de7122fcceeeb21c1f374991feef225c844b..7b48473523094291c75f77872db0f3794bc17385 100644 (file)
@@ -60,20 +60,20 @@ import org.eclipse.jgit.util.TemporaryBuffer;
 
 /** A parsed collection of {@link FileHeader}s from a unified diff patch file */
 public class Patch {
-       static final byte[] DIFF_GIT = encodeASCII("diff --git ");
+       static final byte[] DIFF_GIT = encodeASCII("diff --git "); //$NON-NLS-1$
 
-       private static final byte[] DIFF_CC = encodeASCII("diff --cc ");
+       private static final byte[] DIFF_CC = encodeASCII("diff --cc "); //$NON-NLS-1$
 
-       private static final byte[] DIFF_COMBINED = encodeASCII("diff --combined ");
+       private static final byte[] DIFF_COMBINED = encodeASCII("diff --combined "); //$NON-NLS-1$
 
        private static final byte[][] BIN_HEADERS = new byte[][] {
-                       encodeASCII("Binary files "), encodeASCII("Files "), };
+                       encodeASCII("Binary files "), encodeASCII("Files "), }; //$NON-NLS-1$ //$NON-NLS-2$
 
-       private static final byte[] BIN_TRAILER = encodeASCII(" differ\n");
+       private static final byte[] BIN_TRAILER = encodeASCII(" differ\n"); //$NON-NLS-1$
 
-       private static final byte[] GIT_BINARY = encodeASCII("GIT binary patch\n");
+       private static final byte[] GIT_BINARY = encodeASCII("GIT binary patch\n"); //$NON-NLS-1$
 
-       static final byte[] SIG_FOOTER = encodeASCII("-- \n");
+       static final byte[] SIG_FOOTER = encodeASCII("-- \n"); //$NON-NLS-1$
 
        /** The files, in the order they were parsed out of the input. */
        private final List<FileHeader> files;
index 9c5eaffd7dc025c451dd30d10b1417b66ab0cad0..89d05dba59fd19ec7c2323b68c9a2c93eed3fcda 100644 (file)
@@ -101,8 +101,8 @@ public interface DepthWalk {
                        super(repo);
 
                        this.depth = depth;
-                       this.UNSHALLOW = newFlag("UNSHALLOW");
-                       this.REINTERESTING = newFlag("REINTERESTING");
+                       this.UNSHALLOW = newFlag("UNSHALLOW"); //$NON-NLS-1$
+                       this.REINTERESTING = newFlag("REINTERESTING"); //$NON-NLS-1$
                }
 
                /**
@@ -113,8 +113,8 @@ public interface DepthWalk {
                        super(or);
 
                        this.depth = depth;
-                       this.UNSHALLOW = newFlag("UNSHALLOW");
-                       this.REINTERESTING = newFlag("REINTERESTING");
+                       this.UNSHALLOW = newFlag("UNSHALLOW"); //$NON-NLS-1$
+                       this.REINTERESTING = newFlag("REINTERESTING"); //$NON-NLS-1$
                }
 
                /**
@@ -167,8 +167,8 @@ public interface DepthWalk {
                        super(repo);
 
                        this.depth = depth;
-                       this.UNSHALLOW = newFlag("UNSHALLOW");
-                       this.REINTERESTING = newFlag("REINTERESTING");
+                       this.UNSHALLOW = newFlag("UNSHALLOW"); //$NON-NLS-1$
+                       this.REINTERESTING = newFlag("REINTERESTING"); //$NON-NLS-1$
                }
 
                /**
@@ -179,8 +179,8 @@ public interface DepthWalk {
                        super(or);
 
                        this.depth = depth;
-                       this.UNSHALLOW = newFlag("UNSHALLOW");
-                       this.REINTERESTING = newFlag("REINTERESTING");
+                       this.UNSHALLOW = newFlag("UNSHALLOW"); //$NON-NLS-1$
+                       this.REINTERESTING = newFlag("REINTERESTING"); //$NON-NLS-1$
                }
 
                /**
index d3c8d5b706333a0cca5747a614c3487f53045953..ab2cf2bccbe743ddcd3322d876ab16ef469cef6f 100644 (file)
@@ -115,6 +115,7 @@ public class FollowFilter extends TreeFilter {
                return new FollowFilter(path.clone());
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return "(FOLLOW(" + path.toString() + ")" //
index 97a8ab2ad2901965b988ea4b69b5870bfd070302..319b819a79595306a6cc25a86fb7638a261b667c 100644 (file)
@@ -48,13 +48,13 @@ import org.eclipse.jgit.lib.Constants;
 /** Case insensitive key for a {@link FooterLine}. */
 public final class FooterKey {
        /** Standard {@code Signed-off-by} */
-       public static final FooterKey SIGNED_OFF_BY = new FooterKey("Signed-off-by");
+       public static final FooterKey SIGNED_OFF_BY = new FooterKey("Signed-off-by"); //$NON-NLS-1$
 
        /** Standard {@code Acked-by} */
-       public static final FooterKey ACKED_BY = new FooterKey("Acked-by");
+       public static final FooterKey ACKED_BY = new FooterKey("Acked-by"); //$NON-NLS-1$
 
        /** Standard {@code CC} */
-       public static final FooterKey CC = new FooterKey("CC");
+       public static final FooterKey CC = new FooterKey("CC"); //$NON-NLS-1$
 
        private final String name;
 
@@ -76,6 +76,7 @@ public final class FooterKey {
                return name;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return "FooterKey[" + name + "]";
index 530200b0caca69d0a56451eb64c4327bacc56d56..f233923d7dbace06b47b921ccf897b0510102fe8 100644 (file)
@@ -146,6 +146,6 @@ public final class FooterLine {
 
        @Override
        public String toString() {
-               return getKey() + ": " + getValue();
+               return getKey() + ": " + getValue(); //$NON-NLS-1$
        }
 }
index 18e26da66a78a9d2280152daa65c7c70ae587f87..730fde95742b82c3e2898770b1d2d4e8d59bfd83 100644 (file)
@@ -351,7 +351,7 @@ public class ObjectWalk extends RevWalk {
                                default:
                                        throw new CorruptObjectException(MessageFormat.format(
                                                        JGitText.get().corruptObjectInvalidMode3,
-                                                       String.format("%o", Integer.valueOf(mode)),
+                                                       String.format("%o", Integer.valueOf(mode)), //$NON-NLS-1$
                                                        idBuffer.name(),
                                                        RawParseUtils.decode(buf, tv.namePtr, tv.nameEnd),
                                                        tv.obj));
@@ -705,8 +705,8 @@ public class ObjectWalk extends RevWalk {
                                idBuffer.fromRaw(raw, ptr);
                                throw new CorruptObjectException(MessageFormat.format(
                                                JGitText.get().corruptObjectInvalidMode3,
-                                               String.format("%o", Integer.valueOf(mode)),
-                                               idBuffer.name(), "", tree));
+                                               String.format("%o", Integer.valueOf(mode)), //$NON-NLS-1$
+                                               idBuffer.name(), "", tree)); //$NON-NLS-1$
                        }
                        ptr += ID_SZ;
                }
index 6363014415721029ea6a8fdf78169bc1765b5357..9f2ccfd97e0afdf764a87dbadc1c54d6eb673d74 100644 (file)
@@ -391,7 +391,7 @@ public class RevCommit extends RevObject {
                final byte[] raw = buffer;
                final int msgB = RawParseUtils.commitMessage(raw, 0);
                if (msgB < 0)
-                       return "";
+                       return ""; //$NON-NLS-1$
                final Charset enc = RawParseUtils.parseEncoding(raw);
                return RawParseUtils.decode(enc, raw, msgB, raw.length);
        }
@@ -415,7 +415,7 @@ public class RevCommit extends RevObject {
                final byte[] raw = buffer;
                final int msgB = RawParseUtils.commitMessage(raw, 0);
                if (msgB < 0)
-                       return "";
+                       return ""; //$NON-NLS-1$
 
                final Charset enc = RawParseUtils.parseEncoding(raw);
                final int msgE = RawParseUtils.endOfParagraph(raw, msgB);
index 8cc5227e93e2492fdc59017f58f5f2ad9e086cad..85982c7a0ae246cdd40a36e399ecf00859631ed6 100644 (file)
@@ -64,7 +64,7 @@ public class RevFlag {
         * This is a static flag. Its RevWalk is not available.
         */
        public static final RevFlag UNINTERESTING = new StaticRevFlag(
-                       "UNINTERESTING", RevWalk.UNINTERESTING);
+                       "UNINTERESTING", RevWalk.UNINTERESTING); //$NON-NLS-1$
 
        final RevWalk walker;
 
index bc53c28cc96d3c134ec31bef844e50ba86f91379..269b6c104fe9810422710dd65bdd39370b296336 100644 (file)
@@ -204,7 +204,7 @@ public class RevTag extends RevObject {
                final byte[] raw = buffer;
                final int msgB = RawParseUtils.tagMessage(raw, 0);
                if (msgB < 0)
-                       return "";
+                       return ""; //$NON-NLS-1$
                final Charset enc = RawParseUtils.parseEncoding(raw);
                return RawParseUtils.decode(enc, raw, msgB, raw.length);
        }
@@ -228,7 +228,7 @@ public class RevTag extends RevObject {
                final byte[] raw = buffer;
                final int msgB = RawParseUtils.tagMessage(raw, 0);
                if (msgB < 0)
-                       return "";
+                       return ""; //$NON-NLS-1$
 
                final Charset enc = RawParseUtils.parseEncoding(raw);
                final int msgE = RawParseUtils.endOfParagraph(raw, msgB);
index da3e619dc6226a56d6c2a3a40209c910466cfb98..4a91493dc0221e35128d7b5fb41a85c0d546295d 100644 (file)
@@ -146,9 +146,10 @@ public abstract class AndRevFilter extends RevFilter {
                        return new Binary(a.clone(), b.clone());
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
-                       return "(" + a.toString() + " AND " + b.toString() + ")";
+                       return "(" + a.toString() + " AND " + b.toString() + ")"; //$NON-NLS-1$
                }
        }
 
@@ -190,6 +191,7 @@ public abstract class AndRevFilter extends RevFilter {
                        return new List(s);
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
                        final StringBuilder r = new StringBuilder();
index 14c03a4bcd89a19c074504bdbf3a2806ef9af4b4..5bf9366ded594fef5231ad6faf698b5c1159b80a 100644 (file)
@@ -151,6 +151,7 @@ public abstract class CommitTimeRevFilter extends RevFilter {
                        return cmit.getCommitTime() <= when;
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
                        return super.toString() + "(" + new Date(when * 1000L) + ")";
@@ -175,6 +176,7 @@ public abstract class CommitTimeRevFilter extends RevFilter {
                        return true;
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
                        return super.toString() + "(" + new Date(when * 1000L) + ")";
@@ -196,9 +198,11 @@ public abstract class CommitTimeRevFilter extends RevFilter {
                        return cmit.getCommitTime() <= until && cmit.getCommitTime() >= when;
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
-                       return super.toString() + "(" + new Date(when * 1000L) + " - " + new Date(until * 1000L) + ")";
+                       return super.toString() + "(" + new Date(when * 1000L) + " - "
+                                       + new Date(until * 1000L) + ")";
                }
 
        }
index 6d1a49cb58a1a197b66385fb0b0df80548d89860..d3388021ba519a3c8864afe8bd54cee7a63fdbea 100644 (file)
@@ -93,6 +93,6 @@ public class NotRevFilter extends RevFilter {
 
        @Override
        public String toString() {
-               return "NOT " + a.toString();
+               return "NOT " + a.toString(); //$NON-NLS-1$
        }
 }
index e9050f31ed28741194024d0c9ff3e42949cd712a..4c7b3bf47e19cfeda7b5b56adb27da6b56ea502f 100644 (file)
@@ -144,6 +144,7 @@ public abstract class OrRevFilter extends RevFilter {
                        return new Binary(a.clone(), b.clone());
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
                        return "(" + a.toString() + " OR " + b.toString() + ")";
@@ -191,13 +192,13 @@ public abstract class OrRevFilter extends RevFilter {
                @Override
                public String toString() {
                        final StringBuilder r = new StringBuilder();
-                       r.append("(");
+                       r.append("("); //$NON-NLS-1$
                        for (int i = 0; i < subfilters.length; i++) {
                                if (i > 0)
-                                       r.append(" OR ");
+                                       r.append(" OR "); //$NON-NLS-1$
                                r.append(subfilters[i].toString());
                        }
-                       r.append(")");
+                       r.append(")"); //$NON-NLS-1$
                        return r.toString();
                }
        }
index 51de1d577d64ac2e92fa340a9798b4d29c53c8fc..1dd4555e5ab35457b5caee1e917d643b26ef4c69 100644 (file)
@@ -106,13 +106,13 @@ public abstract class PatternMatchRevFilter extends RevFilter {
                patternText = pattern;
 
                if (innerString) {
-                       if (!pattern.startsWith("^") && !pattern.startsWith(".*"))
-                               pattern = ".*" + pattern;
-                       if (!pattern.endsWith("$") && !pattern.endsWith(".*"))
-                               pattern = pattern + ".*";
+                       if (!pattern.startsWith("^") && !pattern.startsWith(".*")) //$NON-NLS-1$ //$NON-NLS-2$
+                               pattern = ".*" + pattern; //$NON-NLS-1$
+                       if (!pattern.endsWith("$") && !pattern.endsWith(".*")) //$NON-NLS-1$ //$NON-NLS-2$
+                               pattern = pattern + ".*"; //$NON-NLS-1$
                }
                final String p = rawEncoding ? forceToRaw(pattern) : pattern;
-               compiledPattern = Pattern.compile(p, flags).matcher("");
+               compiledPattern = Pattern.compile(p, flags).matcher(""); //$NON-NLS-1$
        }
 
        /**
@@ -145,6 +145,7 @@ public abstract class PatternMatchRevFilter extends RevFilter {
         */
        protected abstract CharSequence text(RevCommit cmit);
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return super.toString() + "(\"" + patternText + "\")";
index 1f9226f06bb9a904ece316b9a425589c9abadfd0..2a5cb2b2ac7ee81c5b7b6b00dc38dc9f9f955c8a 100644 (file)
@@ -114,7 +114,7 @@ public abstract class RevFilter {
 
                @Override
                public String toString() {
-                       return "ALL";
+                       return "ALL"; //$NON-NLS-1$
                }
        }
 
@@ -139,7 +139,7 @@ public abstract class RevFilter {
 
                @Override
                public String toString() {
-                       return "NONE";
+                       return "NONE"; //$NON-NLS-1$
                }
        }
 
@@ -164,7 +164,7 @@ public abstract class RevFilter {
 
                @Override
                public String toString() {
-                       return "NO_MERGES";
+                       return "NO_MERGES"; //$NON-NLS-1$
                }
        }
 
@@ -196,7 +196,7 @@ public abstract class RevFilter {
 
                @Override
                public String toString() {
-                       return "MERGE_BASE";
+                       return "MERGE_BASE"; //$NON-NLS-1$
                }
        }
 
index 20d867fd58e40e4cb9c012a968eaf0321dc8f1af..ce3a0222939b26c9185154d83906a18f2a413029 100644 (file)
@@ -123,6 +123,7 @@ public abstract class SubStringRevFilter extends RevFilter {
                return this; // Typically we are actually thread-safe.
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return super.toString() + "(\"" + pattern.pattern() + "\")";
index 14c96987c18ad0554fbdc96ea2c52c1d6b039642..45994aaf742c4fb561b3c4001ea9fea907cabe9f 100644 (file)
@@ -194,13 +194,13 @@ public class DfsBlockCacheConfig {
                                        60, TimeUnit.SECONDS, // Idle threads wait this long before ending.
                                        new ArrayBlockingQueue<Runnable>(1), // Do not queue deeply.
                                        new ThreadFactory() {
-                                               private final String name = "JGit-DFS-ReadAhead";
+                                               private final String name = "JGit-DFS-ReadAhead"; //$NON-NLS-1$
                                                private final AtomicInteger cnt = new AtomicInteger();
                                                private final ThreadGroup group = new ThreadGroup(name);
 
                                                public Thread newThread(Runnable body) {
                                                        int id = cnt.incrementAndGet();
-                                                       Thread thread = new Thread(group, body, name + "-" + id);
+                                                       Thread thread = new Thread(group, body, name + "-" + id); //$NON-NLS-1$
                                                        thread.setDaemon(true);
                                                        thread.setContextClassLoader(getClass().getClassLoader());
                                                        return thread;
index cbe9bfa6d07866757819f67f6102de3438574611..773366722c11211dfe12023f2e6a546cafcb1047 100644 (file)
@@ -238,7 +238,7 @@ public class DfsPackCompactor {
                });
 
                RevWalk rw = new RevWalk(ctx);
-               RevFlag added = rw.newFlag("ADDED");
+               RevFlag added = rw.newFlag("ADDED"); //$NON-NLS-1$
 
                pm.beginTask(JGitText.get().countingObjects, ProgressMonitor.UNKNOWN);
                for (DfsPackFile src : srcPacks) {
index 6b90454b971a76c9c8c988a2c8473e11c9916144..79cd04f308ea858f4d7f1609e0f74645bd3bef0a 100644 (file)
@@ -114,7 +114,7 @@ public class DfsPackDescription implements Comparable<DfsPackDescription> {
                int dot = name.lastIndexOf('.');
                if (dot < 0)
                        dot = name.length();
-               return name.substring(0, dot) + ".idx";
+               return name.substring(0, dot) + ".idx"; //$NON-NLS-1$
        }
 
        /** @return the source of the pack. */
index 71262bbe25fb10b7959a8df35ce2b1b312ee4685..ce33f6c8fd0a52d118a54d6c04bc71be0e64d55a 100644 (file)
@@ -97,7 +97,7 @@ public abstract class DfsRepository extends Repository {
        public void create(boolean bare) throws IOException {
                if (exists())
                        throw new IOException(MessageFormat.format(
-                                       JGitText.get().repositoryAlreadyExists, ""));
+                                       JGitText.get().repositoryAlreadyExists, "")); //$NON-NLS-1$
 
                String master = Constants.R_HEADS + Constants.MASTER;
                RefUpdate.Result result = updateRef(Constants.HEAD, true).link(master);
index f51a03a07cf6a2fb117b240b0820dbc32e16cf4c..d0816ff60627acd421a0de399fa1ecedcd8e2ba8 100644 (file)
@@ -84,6 +84,7 @@ public class DfsRepositoryDescription {
                return false;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return "DfsRepositoryDescription[" + getRepositoryName() + "]";
index d1ceae00c9587b94d7946183b427aad439c779ef..1783a60327ff477ed69476f21f3a885bea641870 100644 (file)
@@ -77,7 +77,7 @@ public class InMemoryRepository extends DfsRepository {
                protected DfsPackDescription newPack(PackSource source) {
                        int id = packId.incrementAndGet();
                        DfsPackDescription desc = new MemPack(
-                                       "pack-" + id + "-" + source.name(),
+                                       "pack-" + id + "-" + source.name(), //$NON-NLS-1$ //$NON-NLS-2$
                                        getRepository().getDescription());
                        return desc.setPackSource(source);
                }
index 401794bc522c2e1928b6793461aeae4f1d0f66cf..6bd9f805c5489873ee25ac5c97e5ec75ab5dac50 100644 (file)
@@ -47,7 +47,7 @@ package org.eclipse.jgit.storage.file;
  * Parsed information about a checkout.
  */
 public class CheckoutEntry {
-       static final String CHECKOUT_MOVING_FROM = "checkout: moving from ";
+       static final String CHECKOUT_MOVING_FROM = "checkout: moving from "; //$NON-NLS-1$
 
        private String from;
 
@@ -56,10 +56,10 @@ public class CheckoutEntry {
        CheckoutEntry(ReflogEntry reflogEntry) {
                String comment = reflogEntry.getComment();
                int p1 = CHECKOUT_MOVING_FROM.length();
-               int p2 = comment.indexOf(" to ", p1);
+               int p2 = comment.indexOf(" to ", p1); //$NON-NLS-1$
                int p3 = comment.length();
                from = comment.substring(p1,p2);
-               to = comment.substring(p2 + " to ".length(), p3);
+               to = comment.substring(p2 + " to ".length(), p3); //$NON-NLS-1$
        }
 
        /**
index 15637e7ac30acc76a2971be4075ff2c98f2de375..a9a86dc823fc84dc4e1f31ef15204e7611ace7e0 100644 (file)
@@ -225,6 +225,7 @@ public class FileBasedConfig extends StoredConfig {
                return ObjectId.fromRaw(Constants.newMessageDigest().digest(rawText));
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return getClass().getSimpleName() + "[" + getFile().getPath() + "]";
index 2393e607e299a12328a247ac98e1d4c866089eff..6ab1b3fd37bcf4962cec3afa6dba40110e708dd2 100644 (file)
@@ -249,8 +249,8 @@ public class FileRepository extends Repository {
                refs.create();
                objectDatabase.create();
 
-               FileUtils.mkdir(new File(getDirectory(), "branches"));
-               FileUtils.mkdir(new File(getDirectory(), "hooks"));
+               FileUtils.mkdir(new File(getDirectory(), "branches")); //$NON-NLS-1$
+               FileUtils.mkdir(new File(getDirectory(), "hooks")); //$NON-NLS-1$
 
                RefUpdate head = updateRef(Constants.HEAD);
                head.disableRefLog();
@@ -258,7 +258,7 @@ public class FileRepository extends Repository {
 
                final boolean fileMode;
                if (getFS().supportsExecute()) {
-                       File tmp = File.createTempFile("try", "execute", getDirectory());
+                       File tmp = File.createTempFile("try", "execute", getDirectory()); //$NON-NLS-1$ //$NON-NLS-2$
 
                        getFS().setExecute(tmp, true);
                        final boolean on = getFS().canExecute(tmp);
index b0fab6f4b8189d3e14b27e06cd31ae39b2f2766e..72b150961c6f8a08406196f013e1e298f9509158 100644 (file)
@@ -96,7 +96,7 @@ import org.eclipse.jgit.util.GitDateParser;
  * adapted to FileRepositories.
  */
 public class GC {
-       private static final String PRUNE_EXPIRE_DEFAULT = "2.weeks.ago";
+       private static final String PRUNE_EXPIRE_DEFAULT = "2.weeks.ago"; //$NON-NLS-1$
 
        private final FileRepository repo;
 
@@ -190,8 +190,8 @@ public class GC {
 
                        if (!oldPack.shouldBeKept()) {
                                oldPack.close();
-                               FileUtils.delete(nameFor(oldName, ".pack"), deleteOptions);
-                               FileUtils.delete(nameFor(oldName, ".idx"), deleteOptions);
+                               FileUtils.delete(nameFor(oldName, ".pack"), deleteOptions); //$NON-NLS-1$
+                               FileUtils.delete(nameFor(oldName, ".idx"), deleteOptions); //$NON-NLS-1$
                        }
                }
                // close the complete object database. Thats my only chance to force
@@ -614,9 +614,9 @@ public class GC {
                              default:
                                        throw new IOException(MessageFormat.format(
                                                        JGitText.get().corruptObjectInvalidMode3, String
-                                                                       .format("%o", Integer.valueOf(treeWalk
+                                                                       .format("%o", Integer.valueOf(treeWalk //$NON-NLS-1$
                                                                                        .getRawMode(0)),
-                                                                                       (objectId == null) ? "null"
+                                                                                       (objectId == null) ? "null" //$NON-NLS-1$
                                                                                                        : objectId.name(), treeWalk
                                                                                        .getPathString(), repo
                                                                                        .getIndexFile())));
@@ -651,11 +651,11 @@ public class GC {
 
                        // create temporary files
                        String id = pw.computeName().getName();
-                       File packdir = new File(repo.getObjectsDirectory(), "pack");
-                       tmpPack = File.createTempFile("gc_", ".pack_tmp", packdir);
+                       File packdir = new File(repo.getObjectsDirectory(), "pack"); //$NON-NLS-1$
+                       tmpPack = File.createTempFile("gc_", ".pack_tmp", packdir); //$NON-NLS-1$ //$NON-NLS-2$
                        tmpIdx = new File(packdir, tmpPack.getName().substring(0,
                                        tmpPack.getName().lastIndexOf('.'))
-                                       + ".idx_tmp");
+                                       + ".idx_tmp"); //$NON-NLS-1$
 
                        if (!tmpIdx.createNewFile())
                                throw new IOException(MessageFormat.format(
@@ -686,9 +686,9 @@ public class GC {
                        }
 
                        // rename the temporary files to real files
-                       File realPack = nameFor(id, ".pack");
+                       File realPack = nameFor(id, ".pack"); //$NON-NLS-1$
                        tmpPack.setReadOnly();
-                       File realIdx = nameFor(id, ".idx");
+                       File realIdx = nameFor(id, ".idx"); //$NON-NLS-1$
                        realIdx.setReadOnly();
                        boolean delete = true;
                        try {
@@ -697,7 +697,7 @@ public class GC {
                                delete = false;
                                if (!tmpIdx.renameTo(realIdx)) {
                                        File newIdx = new File(realIdx.getParentFile(),
-                                                       realIdx.getName() + ".new");
+                                                       realIdx.getName() + ".new"); //$NON-NLS-1$
                                        if (!tmpIdx.renameTo(newIdx))
                                                newIdx = tmpIdx;
                                        throw new IOException(MessageFormat.format(
@@ -721,8 +721,8 @@ public class GC {
        }
 
        private File nameFor(String name, String ext) {
-               File packdir = new File(repo.getObjectsDirectory(), "pack");
-               return new File(packdir, "pack-" + name + ext);
+               File packdir = new File(repo.getObjectsDirectory(), "pack"); //$NON-NLS-1$
+               return new File(packdir, "pack-" + name + ext); //$NON-NLS-1$
        }
 
        /**
index ee2ebc1b238f044d15c68a664c6e3e6fe0789563..82503b6d1e283ba407d4b5fca2c2e18f4abf4174 100644 (file)
@@ -129,7 +129,7 @@ class LocalCachedPack extends CachedPack {
        }
 
        private String getPackFilePath(String packName) {
-               final File packDir = new File(odb.getDirectory(), "pack");
-               return new File(packDir, "pack-" + packName + ".pack").getPath();
+               final File packDir = new File(odb.getDirectory(), "pack"); //$NON-NLS-1$
+               return new File(packDir, "pack-" + packName + ".pack").getPath(); //$NON-NLS-1$ //$NON-NLS-2$
        }
 }
index 921812191767aab1591c9e652128afeb719d7242..4877f02b9485d486c63a91c55e6191b128e862e2 100644 (file)
@@ -538,6 +538,7 @@ public class LockFile {
                }
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return "LockFile[" + lck + ", haveLck=" + haveLck + "]";
index 7b5d3a63c7be89be7afd3a87a793f1190c06e876..a20f10af4783ad2a48162479755d156f06cd17f2 100644 (file)
@@ -155,10 +155,10 @@ public class ObjectDirectory extends FileObjectDatabase {
                        File[] alternatePaths, FS fs, File shallowFile) throws IOException {
                config = cfg;
                objects = dir;
-               infoDirectory = new File(objects, "info");
-               packDirectory = new File(objects, "pack");
-               alternatesFile = new File(infoDirectory, "alternates");
-               cachedPacksFile = new File(infoDirectory, "cached-packs");
+               infoDirectory = new File(objects, "info"); //$NON-NLS-1$
+               packDirectory = new File(objects, "pack"); //$NON-NLS-1$
+               alternatesFile = new File(infoDirectory, "alternates"); //$NON-NLS-1$
+               cachedPacksFile = new File(infoDirectory, "cached-packs"); //$NON-NLS-1$
                packList = new AtomicReference<PackList>(NO_PACKS);
                cachedPacks = new AtomicReference<CachedPackList>();
                unpackedObjectCache = new UnpackedObjectCache();
@@ -339,10 +339,10 @@ public class ObjectDirectory extends FileObjectDatabase {
                final String p = pack.getName();
                final String i = idx.getName();
 
-               if (p.length() != 50 || !p.startsWith("pack-") || !p.endsWith(".pack"))
+               if (p.length() != 50 || !p.startsWith("pack-") || !p.endsWith(".pack")) //$NON-NLS-1$
                        throw new IOException(MessageFormat.format(JGitText.get().notAValidPack, pack));
 
-               if (i.length() != 49 || !i.startsWith("pack-") || !i.endsWith(".idx"))
+               if (i.length() != 49 || !i.startsWith("pack-") || !i.endsWith(".idx")) //$NON-NLS-1$
                        throw new IOException(MessageFormat.format(JGitText.get().notAValidPack, idx));
 
                if (!p.substring(0, 45).equals(i.substring(0, 45)))
@@ -355,7 +355,7 @@ public class ObjectDirectory extends FileObjectDatabase {
 
        @Override
        public String toString() {
-               return "ObjectDirectory[" + getDirectory() + "]";
+               return "ObjectDirectory[" + getDirectory() + "]"; //$NON-NLS-1$
        }
 
        boolean hasObject1(final AnyObjectId objectId) {
@@ -727,11 +727,11 @@ public class ObjectDirectory extends FileObjectDatabase {
                for (final String indexName : names) {
                        // Must match "pack-[0-9a-f]{40}.idx" to be an index.
                        //
-                       if (indexName.length() != 49 || !indexName.endsWith(".idx"))
+                       if (indexName.length() != 49 || !indexName.endsWith(".idx")) //$NON-NLS-1$
                                continue;
 
                        final String base = indexName.substring(0, indexName.length() - 4);
-                       final String packName = base + ".pack";
+                       final String packName = base + ".pack"; //$NON-NLS-1$
                        if (!names.contains(packName)) {
                                // Sometimes C Git's HTTP fetch transport leaves a
                                // .idx file behind and does not download the .pack.
@@ -806,7 +806,7 @@ public class ObjectDirectory extends FileObjectDatabase {
                        return Collections.emptySet();
                final Set<String> nameSet = new HashSet<String>(nameList.length << 1);
                for (final String name : nameList) {
-                       if (name.startsWith("pack-"))
+                       if (name.startsWith("pack-")) //$NON-NLS-1$
                                nameSet.add(name);
                }
                return nameSet;
index a9e403a16852e21382966e5d4eec696473b22433..75a1a2c1b7a690ccd990abd551047a26321cdec0 100644 (file)
@@ -224,7 +224,7 @@ class ObjectDirectoryInserter extends ObjectInserter {
        }
 
        File newTempFile() throws IOException {
-               return File.createTempFile("noz", null, db.getDirectory());
+               return File.createTempFile("noz", null, db.getDirectory()); //$NON-NLS-1$
        }
 
        DeflaterOutputStream compress(final OutputStream out) {
index ce4c54342b9aca920a0c07a94b01c8a04ec36706..518bccf71b908938b946ec623ab762e90a2c307c 100644 (file)
@@ -171,10 +171,10 @@ public class ObjectDirectoryPackParser extends PackParser {
        @Override
        public PackLock parse(ProgressMonitor receiving, ProgressMonitor resolving)
                        throws IOException {
-               tmpPack = File.createTempFile("incoming_", ".pack", db.getDirectory());
-               tmpIdx = new File(db.getDirectory(), baseName(tmpPack) + ".idx");
+               tmpPack = File.createTempFile("incoming_", ".pack", db.getDirectory()); //$NON-NLS-1$ //$NON-NLS-2$
+               tmpIdx = new File(db.getDirectory(), baseName(tmpPack) + ".idx"); //$NON-NLS-1$
                try {
-                       out = new RandomAccessFile(tmpPack, "rw");
+                       out = new RandomAccessFile(tmpPack, "rw"); //$NON-NLS-1$
 
                        super.parse(receiving, resolving);
 
@@ -425,9 +425,9 @@ public class ObjectDirectoryPackParser extends PackParser {
                }
 
                final String name = ObjectId.fromRaw(d.digest()).name();
-               final File packDir = new File(db.getDirectory(), "pack");
-               final File finalPack = new File(packDir, "pack-" + name + ".pack");
-               final File finalIdx = new File(packDir, "pack-" + name + ".idx");
+               final File packDir = new File(db.getDirectory(), "pack"); //$NON-NLS-1$
+               final File finalPack = new File(packDir, "pack-" + name + ".pack"); //$NON-NLS-1$ //$NON-NLS-2$
+               final File finalIdx = new File(packDir, "pack-" + name + ".idx"); //$NON-NLS-1$ //$NON-NLS-2$
                final PackLock keep = new PackLock(finalPack, db.getFS());
 
                if (!packDir.exists() && !packDir.mkdir() && !packDir.exists()) {
index 1fe4c059682fc8bcc8805319b1f83a6f3082fa9f..a32acfc451c934497a111fdd26defc6f11b7d9f0 100644 (file)
@@ -192,10 +192,10 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                String name = packName;
                if (name == null) {
                        name = getPackFile().getName();
-                       if (name.startsWith("pack-"))
-                               name = name.substring("pack-".length());
-                       if (name.endsWith(".pack"))
-                               name = name.substring(0, name.length() - ".pack".length());
+                       if (name.startsWith("pack-")) //$NON-NLS-1$
+                               name = name.substring("pack-".length()); //$NON-NLS-1$
+                       if (name.endsWith(".pack")) //$NON-NLS-1$
+                               name = name.substring(0, name.length() - ".pack".length()); //$NON-NLS-1$
                        packName = name;
                }
                return name;
@@ -226,7 +226,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
         */
        public boolean shouldBeKept() {
                if (keepFile == null)
-                       keepFile = new File(packFile.getPath() + ".keep");
+                       keepFile = new File(packFile.getPath() + ".keep"); //$NON-NLS-1$
                return keepFile.exists();
        }
 
@@ -589,7 +589,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                        if (invalid)
                                throw new PackInvalidException(packFile);
                        synchronized (readLock) {
-                               fd = new RandomAccessFile(packFile, "r");
+                               fd = new RandomAccessFile(packFile, "r"); //$NON-NLS-1$
                                length = fd.length();
                                onOpenPack();
                        }
index a6e0a5a0537b98c6c294bb92d0eb48263ba00954..f98618aa5baa59cbe65fa2f2ae481f0a42190242 100644 (file)
@@ -66,7 +66,7 @@ public class PackLock {
        public PackLock(final File packFile, final FS fs) {
                final File p = packFile.getParentFile();
                final String n = packFile.getName();
-               keepFile = new File(p, n.substring(0, n.length() - 5) + ".keep");
+               keepFile = new File(p, n.substring(0, n.length() - 5) + ".keep"); //$NON-NLS-1$
                this.fs = fs;
        }
 
@@ -82,8 +82,8 @@ public class PackLock {
        public boolean lock(String msg) throws IOException {
                if (msg == null)
                        return false;
-               if (!msg.endsWith("\n"))
-                       msg += "\n";
+               if (!msg.endsWith("\n")) //$NON-NLS-1$
+                       msg += "\n"; //$NON-NLS-1$
                final LockFile lf = new LockFile(keepFile, fs);
                if (!lf.lock())
                        return false;
index 6ae3f8cc8b89115dfc56d0e699fca253a652e8ca..e0ce909d92fb130a51b21c895717cf21469bd555 100644 (file)
@@ -268,7 +268,7 @@ public class RefDirectory extends RefDatabase {
                                        break;
                                }
                        } catch (IOException e) {
-                               if (!(!needle.contains("/") && "".equals(prefix) && e
+                               if (!(!needle.contains("/") && "".equals(prefix) && e //$NON-NLS-1$ //$NON-NLS-2$
                                                .getCause() instanceof InvalidObjectIdException)) {
                                        throw e;
                                }
@@ -356,7 +356,7 @@ public class RefDirectory extends RefDatabase {
                                if (newLoose == null && curIdx < curLoose.size())
                                        newLoose = curLoose.copy(curIdx);
 
-                       } else if (prefix.startsWith(R_REFS) && prefix.endsWith("/")) {
+                       } else if (prefix.startsWith(R_REFS) && prefix.endsWith("/")) { //$NON-NLS-1$
                                curIdx = -(curLoose.find(prefix) + 1);
                                File dir = new File(refsDir, prefix.substring(R_REFS.length()));
                                scanTree(prefix, dir);
@@ -980,7 +980,7 @@ public class RefDirectory extends RefDatabase {
         *             a temporary name cannot be allocated.
         */
        RefDirectoryUpdate newTemporaryUpdate() throws IOException {
-               File tmp = File.createTempFile("renamed_", "_ref", refsDir);
+               File tmp = File.createTempFile("renamed_", "_ref", refsDir); //$NON-NLS-1$ //$NON-NLS-2$
                String name = Constants.R_REFS + tmp.getName();
                Ref ref = new ObjectIdRef.Unpeeled(NEW, name, null);
                return new RefDirectoryUpdate(this, ref);
index b9f0e14efc116a41255ea76f1dc0193842c765e6..f336ea00890969fbd68e6be75b62f3a6547283ae 100644 (file)
@@ -112,7 +112,7 @@ class RefDirectoryUpdate extends RefUpdate {
                                String strResult = toResultString(status);
                                if (strResult != null) {
                                        if (msg.length() > 0)
-                                               msg = msg + ": " + strResult;
+                                               msg = msg + ": " + strResult; //$NON-NLS-1$
                                        else
                                                msg = strResult;
                                }
index 4b158077299a313aaebb02d1649791b7be7e04fc..e995dcd21798dba0b283ca41f93167651847c2c1 100644 (file)
@@ -81,10 +81,10 @@ public class ReflogEntry implements Serializable {
                who = RawParseUtils.parsePersonIdentOnly(raw, pos);
                int p0 = RawParseUtils.next(raw, pos, '\t');
                if (p0 >= raw.length)
-                       comment = ""; // personident has no \t, no comment present
+                       comment = ""; // personident has no \t, no comment present //$NON-NLS-1$
                else {
                        int p1 = RawParseUtils.nextLF(raw, p0);
-                       comment = p1 > p0 ? RawParseUtils.decode(raw, p0, p1 - 1) : "";
+                       comment = p1 > p0 ? RawParseUtils.decode(raw, p0, p1 - 1) : ""; //$NON-NLS-1$
                }
        }
 
@@ -116,10 +116,11 @@ public class ReflogEntry implements Serializable {
                return comment;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
-               return "Entry[" + oldId.name() + ", " + newId.name() + ", " + getWho() + ", "
-                               + getComment() + "]";
+               return "Entry[" + oldId.name() + ", " + newId.name() + ", " + getWho()
+                               + ", " + getComment() + "]";
        }
 
        /**
index c8e0d5584eea63b3f3d43c3e24ad88b469ec21ab..8060af791acac3b1d404646df1d77dfabc01f91f 100644 (file)
@@ -189,14 +189,20 @@ public class WindowCacheConfig {
         * @param rc configuration to read properties from.
         */
        public void fromConfig(final Config rc) {
-               setPackedGitOpenFiles(rc.getInt("core", null, "packedgitopenfiles", getPackedGitOpenFiles()));
-               setPackedGitLimit(rc.getLong("core", null, "packedgitlimit", getPackedGitLimit()));
-               setPackedGitWindowSize(rc.getInt("core", null, "packedgitwindowsize", getPackedGitWindowSize()));
-               setPackedGitMMAP(rc.getBoolean("core", null, "packedgitmmap", isPackedGitMMAP()));
-               setDeltaBaseCacheLimit(rc.getInt("core", null, "deltabasecachelimit", getDeltaBaseCacheLimit()));
+               setPackedGitOpenFiles(rc.getInt(
+                               "core", null, "packedgitopenfiles", getPackedGitOpenFiles())); //$NON-NLS-1$ //$NON-NLS-2$
+               setPackedGitLimit(rc.getLong(
+                               "core", null, "packedgitlimit", getPackedGitLimit())); //$NON-NLS-1$ //$NON-NLS-2$
+               setPackedGitWindowSize(rc.getInt(
+                               "core", null, "packedgitwindowsize", getPackedGitWindowSize())); //$NON-NLS-1$ //$NON-NLS-2$
+               setPackedGitMMAP(rc.getBoolean(
+                               "core", null, "packedgitmmap", isPackedGitMMAP())); //$NON-NLS-1$ //$NON-NLS-2$
+               setDeltaBaseCacheLimit(rc.getInt(
+                               "core", null, "deltabasecachelimit", getDeltaBaseCacheLimit())); //$NON-NLS-1$ //$NON-NLS-2$
 
                long maxMem = Runtime.getRuntime().maxMemory();
-               long sft = rc.getLong("core", null, "streamfilethreshold", getStreamFileThreshold());
+               long sft = rc.getLong(
+                               "core", null, "streamfilethreshold", getStreamFileThreshold()); //$NON-NLS-1$ //$NON-NLS-2$
                sft = Math.min(sft, maxMem / 4); // don't use more than 1/4 of the heap
                sft = Math.min(sft, Integer.MAX_VALUE); // cannot exceed array length
                setStreamFileThreshold((int) sft);
index fd467a5554526791ff32907427d93309e81f2335..82a2a528b6c19e9dcde8f8b006ccba9caae19f23 100644 (file)
@@ -63,8 +63,8 @@ class WriteConfig {
 
        private WriteConfig(final Config rc) {
                compression = rc.get(CoreConfig.KEY).getCompression();
-               fsyncObjectFiles = rc.getBoolean("core", "fsyncobjectfiles", false);
-               fsyncRefFiles = rc.getBoolean("core", "fsyncreffiles", false);
+               fsyncObjectFiles = rc.getBoolean("core", "fsyncobjectfiles", false); //$NON-NLS-1$ //$NON-NLS-2$
+               fsyncRefFiles = rc.getBoolean("core", "fsyncreffiles", false); //$NON-NLS-1$ //$NON-NLS-2$
        }
 
        int getCompression() {
index 9e1cbd0e1660ce88a33d2488eced156b3bfd6520..9971b794403eb85f8612071bdd571dd4aeaa4c92 100644 (file)
@@ -256,7 +256,7 @@ public class BinaryDelta {
                } while ((c & 0x80) != 0);
 
                if (includeHeader)
-                       r.append("DELTA( BASE=" + baseLen + " RESULT=" + resLen + " )\n");
+                       r.append("DELTA( BASE=" + baseLen + " RESULT=" + resLen + " )\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
                while (deltaPtr < delta.length) {
                        final int cmd = delta[deltaPtr++] & 0xff;
@@ -285,16 +285,16 @@ public class BinaryDelta {
                                if (copySize == 0)
                                        copySize = 0x10000;
 
-                               r.append("  COPY  (" + copyOffset + ", " + copySize + ")\n");
+                               r.append("  COPY  (" + copyOffset + ", " + copySize + ")\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
                        } else if (cmd != 0) {
                                // Anything else the data is literal within the delta
                                // itself.
                                //
-                               r.append("  INSERT(");
+                               r.append("  INSERT("); //$NON-NLS-1$
                                r.append(QuotedString.GIT_PATH.quote(RawParseUtils.decode(
                                                delta, deltaPtr, deltaPtr + cmd)));
-                               r.append(")\n");
+                               r.append(")\n"); //$NON-NLS-1$
                                deltaPtr += cmd;
                        } else {
                                // cmd == 0 has been reserved for future encoding but
index e548cc936591ce8964da6ba5aaeaa1231cd72f4c..4f2d5c7411dd143ea16f8b5b69c8395bc5561e4b 100644 (file)
@@ -421,6 +421,7 @@ public class DeltaIndex {
                return start - resPtr;
        }
 
+       @SuppressWarnings("nls")
        public String toString() {
                String[] units = { "bytes", "KiB", "MiB", "GiB" };
                long sz = getIndexSize();
index 9c50f8d0150a29da1305ca529a65a56e11ea23c2..1b8a9bf600994058f9364ce5819f1dfa95e23833 100644 (file)
@@ -393,6 +393,7 @@ public class ObjectToPack extends PackedObjectInfo {
                // Empty by default.
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                StringBuilder buf = new StringBuilder();
index 91275dc09868fbf88d26c243bf82b42e473dcd3d..58ee985ff51c52a80c288e90a9262bed98733d31 100644 (file)
@@ -624,21 +624,27 @@ public class PackConfig {
         *            configuration to read properties from.
         */
        public void fromConfig(final Config rc) {
-               setMaxDeltaDepth(rc.getInt("pack", "depth", getMaxDeltaDepth()));
-               setDeltaSearchWindowSize(rc.getInt("pack", "window", getDeltaSearchWindowSize()));
-               setDeltaSearchMemoryLimit(rc.getLong("pack", "windowmemory", getDeltaSearchMemoryLimit()));
-               setDeltaCacheSize(rc.getLong("pack", "deltacachesize", getDeltaCacheSize()));
-               setDeltaCacheLimit(rc.getInt("pack", "deltacachelimit", getDeltaCacheLimit()));
-               setCompressionLevel(rc.getInt("pack", "compression",
-                               rc.getInt("core", "compression", getCompressionLevel())));
-               setIndexVersion(rc.getInt("pack", "indexversion", getIndexVersion()));
-               setBigFileThreshold(rc.getInt("core", "bigfilethreshold", getBigFileThreshold()));
-               setThreads(rc.getInt("pack", "threads", getThreads()));
+               setMaxDeltaDepth(rc.getInt("pack", "depth", getMaxDeltaDepth())); //$NON-NLS-1$ //$NON-NLS-2$
+               setDeltaSearchWindowSize(rc.getInt(
+                               "pack", "window", getDeltaSearchWindowSize())); //$NON-NLS-1$ //$NON-NLS-2$
+               setDeltaSearchMemoryLimit(rc.getLong(
+                               "pack", "windowmemory", getDeltaSearchMemoryLimit())); //$NON-NLS-1$ //$NON-NLS-2$
+               setDeltaCacheSize(rc.getLong(
+                               "pack", "deltacachesize", getDeltaCacheSize())); //$NON-NLS-1$ //$NON-NLS-2$
+               setDeltaCacheLimit(rc.getInt(
+                               "pack", "deltacachelimit", getDeltaCacheLimit())); //$NON-NLS-1$ //$NON-NLS-2$
+               setCompressionLevel(rc.getInt("pack", "compression", //$NON-NLS-1$ //$NON-NLS-2$
+                               rc.getInt("core", "compression", getCompressionLevel()))); //$NON-NLS-1$ //$NON-NLS-2$
+               setIndexVersion(rc.getInt("pack", "indexversion", getIndexVersion())); //$NON-NLS-1$ //$NON-NLS-2$
+               setBigFileThreshold(rc.getInt(
+                               "core", "bigfilethreshold", getBigFileThreshold())); //$NON-NLS-1$ //$NON-NLS-2$
+               setThreads(rc.getInt("pack", "threads", getThreads())); //$NON-NLS-1$ //$NON-NLS-2$
 
                // These variables aren't standardized
                //
-               setReuseDeltas(rc.getBoolean("pack", "reusedeltas", isReuseDeltas()));
-               setReuseObjects(rc.getBoolean("pack", "reuseobjects", isReuseObjects()));
-               setDeltaCompress(rc.getBoolean("pack", "deltacompression", isDeltaCompress()));
+               setReuseDeltas(rc.getBoolean("pack", "reusedeltas", isReuseDeltas())); //$NON-NLS-1$ //$NON-NLS-2$
+               setReuseObjects(rc.getBoolean("pack", "reuseobjects", isReuseObjects())); //$NON-NLS-1$ //$NON-NLS-2$
+               setDeltaCompress(rc.getBoolean(
+                               "pack", "deltacompression", isDeltaCompress())); //$NON-NLS-1$ //$NON-NLS-2$
        }
 }
index 99ec75cf9223e94eed2da062ba3dc01a673aebd5..bfb6c652d9fd8a6c5fbeaa92135ead0ba634f928 100644 (file)
@@ -1379,7 +1379,7 @@ public class PackWriter {
                                        // Object writing already started, we cannot recover.
                                        //
                                        CorruptObjectException coe;
-                                       coe = new CorruptObjectException(otp, "");
+                                       coe = new CorruptObjectException(otp, ""); //$NON-NLS-1$
                                        coe.initCause(gone);
                                        throw coe;
                                }
@@ -1504,9 +1504,9 @@ public class PackWriter {
                all.addAll(have);
 
                final Map<ObjectId, CachedPack> tipToPack = new HashMap<ObjectId, CachedPack>();
-               final RevFlag inCachedPack = walker.newFlag("inCachedPack");
-               final RevFlag include = walker.newFlag("include");
-               final RevFlag added = walker.newFlag("added");
+               final RevFlag inCachedPack = walker.newFlag("inCachedPack"); //$NON-NLS-1$
+               final RevFlag include = walker.newFlag("include"); //$NON-NLS-1$
+               final RevFlag added = walker.newFlag("added"); //$NON-NLS-1$
 
                final RevFlagSet keepOnRestart = new RevFlagSet();
                keepOnRestart.add(inCachedPack);
@@ -2279,6 +2279,7 @@ public class PackWriter {
                        return bytesUsed;
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
                        return "PackWriter.State[" + phase + ", memory=" + bytesUsed + "]";
index e8022b69de6ed600395470199516ce3b7d4b99bf..c31ffd1f7d179fb095e5cdfce46c6935d068cdc7 100644 (file)
@@ -232,7 +232,7 @@ public class SubmoduleWalk {
         */
        public static String getSubmoduleRemoteUrl(final Repository parent,
                        final String url) throws IOException {
-               if (!url.startsWith("./") && !url.startsWith("../"))
+               if (!url.startsWith("./") && !url.startsWith("../")) //$NON-NLS-1$ //$NON-NLS-2$
                        return url;
 
                String remoteName = null;
@@ -270,9 +270,9 @@ public class SubmoduleWalk {
                char separator = '/';
                String submoduleUrl = url;
                while (submoduleUrl.length() > 0) {
-                       if (submoduleUrl.startsWith("./"))
+                       if (submoduleUrl.startsWith("./")) //$NON-NLS-1$
                                submoduleUrl = submoduleUrl.substring(2);
-                       else if (submoduleUrl.startsWith("../")) {
+                       else if (submoduleUrl.startsWith("../")) { //$NON-NLS-1$
                                int lastSeparator = remoteUrl.lastIndexOf('/');
                                if (lastSeparator < 1) {
                                        lastSeparator = remoteUrl.lastIndexOf(':');
index 8a595db336fc1282149f8a426c9e42338b082970..99d8b09d87d30653f3b68398dec578c48b29b57a 100644 (file)
@@ -113,24 +113,24 @@ import org.xml.sax.helpers.XMLReaderFactory;
 public class AmazonS3 {
        private static final Set<String> SIGNED_HEADERS;
 
-       private static final String HMAC = "HmacSHA1";
+       private static final String HMAC = "HmacSHA1"; //$NON-NLS-1$
 
-       private static final String DOMAIN = "s3.amazonaws.com";
+       private static final String DOMAIN = "s3.amazonaws.com"; //$NON-NLS-1$
 
-       private static final String X_AMZ_ACL = "x-amz-acl";
+       private static final String X_AMZ_ACL = "x-amz-acl"; //$NON-NLS-1$
 
-       private static final String X_AMZ_META = "x-amz-meta-";
+       private static final String X_AMZ_META = "x-amz-meta-"; //$NON-NLS-1$
 
        static {
                SIGNED_HEADERS = new HashSet<String>();
-               SIGNED_HEADERS.add("content-type");
-               SIGNED_HEADERS.add("content-md5");
-               SIGNED_HEADERS.add("date");
+               SIGNED_HEADERS.add("content-type"); //$NON-NLS-1$
+               SIGNED_HEADERS.add("content-md5"); //$NON-NLS-1$
+               SIGNED_HEADERS.add("date"); //$NON-NLS-1$
        }
 
        private static boolean isSignedHeader(final String name) {
                final String nameLC = StringUtils.toLowerCase(name);
-               return SIGNED_HEADERS.contains(nameLC) || nameLC.startsWith("x-amz-");
+               return SIGNED_HEADERS.contains(nameLC) || nameLC.startsWith("x-amz-"); //$NON-NLS-1$
        }
 
        private static String toCleanString(final List<String> list) {
@@ -138,27 +138,27 @@ public class AmazonS3 {
                for (final String v : list) {
                        if (s.length() > 0)
                                s.append(',');
-                       s.append(v.replaceAll("\n", "").trim());
+                       s.append(v.replaceAll("\n", "").trim()); //$NON-NLS-1$ //$NON-NLS-2$
                }
                return s.toString();
        }
 
        private static String remove(final Map<String, String> m, final String k) {
                final String r = m.remove(k);
-               return r != null ? r : "";
+               return r != null ? r : ""; //$NON-NLS-1$
        }
 
        private static String httpNow() {
-               final String tz = "GMT";
+               final String tz = "GMT"; //$NON-NLS-1$
                final SimpleDateFormat fmt;
-               fmt = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.US);
+               fmt = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.US); //$NON-NLS-1$
                fmt.setTimeZone(TimeZone.getTimeZone(tz));
-               return fmt.format(new Date()) + " " + tz;
+               return fmt.format(new Date()) + " " + tz; //$NON-NLS-1$
        }
 
        private static MessageDigest newMD5() {
                try {
-                       return MessageDigest.getInstance("MD5");
+                       return MessageDigest.getInstance("MD5"); //$NON-NLS-1$
                } catch (NoSuchAlgorithmException e) {
                        throw new RuntimeException(JGitText.get().JRELacksMD5Implementation, e);
                }
@@ -211,33 +211,33 @@ public class AmazonS3 {
         *
         */
        public AmazonS3(final Properties props) {
-               publicKey = props.getProperty("accesskey");
+               publicKey = props.getProperty("accesskey"); //$NON-NLS-1$
                if (publicKey == null)
                        throw new IllegalArgumentException(JGitText.get().missingAccesskey);
 
-               final String secret = props.getProperty("secretkey");
+               final String secret = props.getProperty("secretkey"); //$NON-NLS-1$
                if (secret == null)
                        throw new IllegalArgumentException(JGitText.get().missingSecretkey);
                privateKey = new SecretKeySpec(Constants.encodeASCII(secret), HMAC);
 
-               final String pacl = props.getProperty("acl", "PRIVATE");
-               if (StringUtils.equalsIgnoreCase("PRIVATE", pacl))
-                       acl = "private";
-               else if (StringUtils.equalsIgnoreCase("PUBLIC", pacl))
-                       acl = "public-read";
-               else if (StringUtils.equalsIgnoreCase("PUBLIC-READ", pacl))
-                       acl = "public-read";
-               else if (StringUtils.equalsIgnoreCase("PUBLIC_READ", pacl))
-                       acl = "public-read";
+               final String pacl = props.getProperty("acl", "PRIVATE"); //$NON-NLS-1$ //$NON-NLS-2$
+               if (StringUtils.equalsIgnoreCase("PRIVATE", pacl)) //$NON-NLS-1$
+                       acl = "private"; //$NON-NLS-1$
+               else if (StringUtils.equalsIgnoreCase("PUBLIC", pacl)) //$NON-NLS-1$
+                       acl = "public-read"; //$NON-NLS-1$
+               else if (StringUtils.equalsIgnoreCase("PUBLIC-READ", pacl)) //$NON-NLS-1$
+                       acl = "public-read"; //$NON-NLS-1$
+               else if (StringUtils.equalsIgnoreCase("PUBLIC_READ", pacl)) //$NON-NLS-1$
+                       acl = "public-read"; //$NON-NLS-1$
                else
-                       throw new IllegalArgumentException("Invalid acl: " + pacl);
+                       throw new IllegalArgumentException("Invalid acl: " + pacl); //$NON-NLS-1$
 
                try {
-                       final String cPas = props.getProperty("password");
+                       final String cPas = props.getProperty("password"); //$NON-NLS-1$
                        if (cPas != null) {
-                               String cAlg = props.getProperty("crypto.algorithm");
+                               String cAlg = props.getProperty("crypto.algorithm"); //$NON-NLS-1$
                                if (cAlg == null)
-                                       cAlg = "PBEWithMD5AndDES";
+                                       cAlg = "PBEWithMD5AndDES"; //$NON-NLS-1$
                                encryption = new WalkEncryption.ObjectEncryptionV2(cAlg, cPas);
                        } else {
                                encryption = WalkEncryption.NONE;
@@ -249,7 +249,7 @@ public class AmazonS3 {
                }
 
                maxAttempts = Integer.parseInt(props.getProperty(
-                               "httpclient.retry-max", "3"));
+                               "httpclient.retry-max", "3")); //$NON-NLS-1$ //$NON-NLS-2$
                proxySelector = ProxySelector.getDefault();
        }
 
@@ -269,7 +269,7 @@ public class AmazonS3 {
        public URLConnection get(final String bucket, final String key)
                        throws IOException {
                for (int curAttempt = 0; curAttempt < maxAttempts; curAttempt++) {
-                       final HttpURLConnection c = open("GET", bucket, key);
+                       final HttpURLConnection c = open("GET", bucket, key); //$NON-NLS-1$
                        authorize(c);
                        switch (HttpSupport.response(c)) {
                        case HttpURLConnection.HTTP_OK:
@@ -321,8 +321,8 @@ public class AmazonS3 {
         */
        public List<String> list(final String bucket, String prefix)
                        throws IOException {
-               if (prefix.length() > 0 && !prefix.endsWith("/"))
-                       prefix += "/";
+               if (prefix.length() > 0 && !prefix.endsWith("/")) //$NON-NLS-1$
+                       prefix += "/"; //$NON-NLS-1$
                final ListParser lp = new ListParser(bucket, prefix);
                do {
                        lp.list();
@@ -345,7 +345,7 @@ public class AmazonS3 {
        public void delete(final String bucket, final String key)
                        throws IOException {
                for (int curAttempt = 0; curAttempt < maxAttempts; curAttempt++) {
-                       final HttpURLConnection c = open("DELETE", bucket, key);
+                       final HttpURLConnection c = open("DELETE", bucket, key); //$NON-NLS-1$
                        authorize(c);
                        switch (HttpSupport.response(c)) {
                        case HttpURLConnection.HTTP_NO_CONTENT:
@@ -394,9 +394,9 @@ public class AmazonS3 {
                final String md5str = Base64.encodeBytes(newMD5().digest(data));
                final String lenstr = String.valueOf(data.length);
                for (int curAttempt = 0; curAttempt < maxAttempts; curAttempt++) {
-                       final HttpURLConnection c = open("PUT", bucket, key);
-                       c.setRequestProperty("Content-Length", lenstr);
-                       c.setRequestProperty("Content-MD5", md5str);
+                       final HttpURLConnection c = open("PUT", bucket, key); //$NON-NLS-1$
+                       c.setRequestProperty("Content-Length", lenstr); //$NON-NLS-1$
+                       c.setRequestProperty("Content-MD5", md5str); //$NON-NLS-1$
                        c.setRequestProperty(X_AMZ_ACL, acl);
                        authorize(c);
                        c.setDoOutput(true);
@@ -479,9 +479,9 @@ public class AmazonS3 {
                final long len = buf.length();
                final String lenstr = String.valueOf(len);
                for (int curAttempt = 0; curAttempt < maxAttempts; curAttempt++) {
-                       final HttpURLConnection c = open("PUT", bucket, key);
-                       c.setRequestProperty("Content-Length", lenstr);
-                       c.setRequestProperty("Content-MD5", md5str);
+                       final HttpURLConnection c = open("PUT", bucket, key); //$NON-NLS-1$
+                       c.setRequestProperty("Content-Length", lenstr); //$NON-NLS-1$
+                       c.setRequestProperty("Content-MD5", md5str); //$NON-NLS-1$
                        c.setRequestProperty(X_AMZ_ACL, acl);
                        encryption.request(c, X_AMZ_META);
                        authorize(c);
@@ -529,7 +529,7 @@ public class AmazonS3 {
                }
                buf = b.toByteArray();
                if (buf.length > 0)
-                       err.initCause(new IOException("\n" + new String(buf)));
+                       err.initCause(new IOException("\n" + new String(buf))); //$NON-NLS-1$
                return err;
        }
 
@@ -549,7 +549,7 @@ public class AmazonS3 {
                        final String key, final Map<String, String> args)
                        throws IOException {
                final StringBuilder urlstr = new StringBuilder();
-               urlstr.append("http://");
+               urlstr.append("http://"); //$NON-NLS-1$
                urlstr.append(bucket);
                urlstr.append('.');
                urlstr.append(DOMAIN);
@@ -577,8 +577,8 @@ public class AmazonS3 {
 
                c = (HttpURLConnection) url.openConnection(proxy);
                c.setRequestMethod(method);
-               c.setRequestProperty("User-Agent", "jgit/1.0");
-               c.setRequestProperty("Date", httpNow());
+               c.setRequestProperty("User-Agent", "jgit/1.0"); //$NON-NLS-1$ //$NON-NLS-2$
+               c.setRequestProperty("Date", httpNow()); //$NON-NLS-1$
                return c;
        }
 
@@ -595,13 +595,13 @@ public class AmazonS3 {
                s.append(c.getRequestMethod());
                s.append('\n');
 
-               s.append(remove(sigHdr, "content-md5"));
+               s.append(remove(sigHdr, "content-md5")); //$NON-NLS-1$
                s.append('\n');
 
-               s.append(remove(sigHdr, "content-type"));
+               s.append(remove(sigHdr, "content-type")); //$NON-NLS-1$
                s.append('\n');
 
-               s.append(remove(sigHdr, "date"));
+               s.append(remove(sigHdr, "date")); //$NON-NLS-1$
                s.append('\n');
 
                for (final Map.Entry<String, String> e : sigHdr.entrySet()) {
@@ -620,13 +620,13 @@ public class AmazonS3 {
                try {
                        final Mac m = Mac.getInstance(HMAC);
                        m.init(privateKey);
-                       sec = Base64.encodeBytes(m.doFinal(s.toString().getBytes("UTF-8")));
+                       sec = Base64.encodeBytes(m.doFinal(s.toString().getBytes("UTF-8"))); //$NON-NLS-1$
                } catch (NoSuchAlgorithmException e) {
                        throw new IOException(MessageFormat.format(JGitText.get().noHMACsupport, HMAC, e.getMessage()));
                } catch (InvalidKeyException e) {
                        throw new IOException(MessageFormat.format(JGitText.get().invalidKey, e.getMessage()));
                }
-               c.setRequestProperty("Authorization", "AWS " + publicKey + ":" + sec);
+               c.setRequestProperty("Authorization", "AWS " + publicKey + ":" + sec); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }
 
        static Properties properties(final File authFile)
@@ -660,12 +660,12 @@ public class AmazonS3 {
                void list() throws IOException {
                        final Map<String, String> args = new TreeMap<String, String>();
                        if (prefix.length() > 0)
-                               args.put("prefix", prefix);
+                               args.put("prefix", prefix); //$NON-NLS-1$
                        if (!entries.isEmpty())
-                               args.put("marker", prefix + entries.get(entries.size() - 1));
+                               args.put("marker", prefix + entries.get(entries.size() - 1)); //$NON-NLS-1$
 
                        for (int curAttempt = 0; curAttempt < maxAttempts; curAttempt++) {
-                               final HttpURLConnection c = open("GET", bucket, "", args);
+                               final HttpURLConnection c = open("GET", bucket, "", args); //$NON-NLS-1$ //$NON-NLS-2$
                                authorize(c);
                                switch (HttpSupport.response(c)) {
                                case HttpURLConnection.HTTP_OK:
@@ -696,17 +696,17 @@ public class AmazonS3 {
                                        continue;
 
                                default:
-                                       throw AmazonS3.this.error("Listing", prefix, c);
+                                       throw AmazonS3.this.error("Listing", prefix, c); //$NON-NLS-1$
                                }
                        }
-                       throw maxAttempts("Listing", prefix);
+                       throw maxAttempts("Listing", prefix); //$NON-NLS-1$
                }
 
                @Override
                public void startElement(final String uri, final String name,
                                final String qName, final Attributes attributes)
                                throws SAXException {
-                       if ("Key".equals(name) || "IsTruncated".equals(name))
+                       if ("Key".equals(name) || "IsTruncated".equals(name)) //$NON-NLS-1$ //$NON-NLS-2$
                                data = new StringBuilder();
                }
 
@@ -727,10 +727,10 @@ public class AmazonS3 {
                @Override
                public void endElement(final String uri, final String name,
                                final String qName) throws SAXException {
-                       if ("Key".equals(name))
+                       if ("Key".equals(name)) //$NON-NLS-1$
                                entries.add(data.toString().substring(prefix.length()));
-                       else if ("IsTruncated".equals(name))
-                               truncated = StringUtils.equalsIgnoreCase("true", data.toString());
+                       else if ("IsTruncated".equals(name)) //$NON-NLS-1$
+                               truncated = StringUtils.equalsIgnoreCase("true", data.toString()); //$NON-NLS-1$
                        data = null;
                }
        }
index 37b347bbc1e502eef1248ca32fe621c2d8431fc0..1072d58ada9f8f1035d8f7905d711a71db2c52ed 100644 (file)
@@ -82,7 +82,7 @@ public abstract class BaseConnection implements Connection {
        }
 
        public String getMessages() {
-               return messageWriter != null ? messageWriter.toString() : "";
+               return messageWriter != null ? messageWriter.toString() : ""; //$NON-NLS-1$
        }
 
        public abstract void close();
index c7cee1ee61985272deb47a2ffaf22c7b17425a9a..8f825ea14fd7b3e55955db467e8d2621b3093dc0 100644 (file)
@@ -141,7 +141,7 @@ abstract class BasePackConnection extends BaseConnection {
                final int timeout = transport.getTimeout();
                if (timeout > 0) {
                        final Thread caller = Thread.currentThread();
-                       myTimer = new InterruptTimer(caller.getName() + "-Timer");
+                       myTimer = new InterruptTimer(caller.getName() + "-Timer"); //$NON-NLS-1$
                        timeoutIn = new TimeoutInputStream(myIn, myTimer);
                        timeoutOut = new TimeoutOutputStream(myOut, myTimer);
                        timeoutIn.setTimeout(timeout * 1000);
@@ -201,7 +201,7 @@ abstract class BasePackConnection extends BaseConnection {
                        if (line == PacketLineIn.END)
                                break;
 
-                       if (line.startsWith("ERR ")) {
+                       if (line.startsWith("ERR ")) { //$NON-NLS-1$
                                // This is a customized remote service error.
                                // Users should be informed about it.
                                throw new RemoteRepositoryException(uri, line.substring(4));
@@ -212,23 +212,23 @@ abstract class BasePackConnection extends BaseConnection {
                                if (nul >= 0) {
                                        // The first line (if any) may contain "hidden"
                                        // capability values after a NUL byte.
-                                       for (String c : line.substring(nul + 1).split(" "))
+                                       for (String c : line.substring(nul + 1).split(" ")) //$NON-NLS-1$
                                                remoteCapablities.add(c);
                                        line = line.substring(0, nul);
                                }
                        }
 
                        String name = line.substring(41, line.length());
-                       if (avail.isEmpty() && name.equals("capabilities^{}")) {
+                       if (avail.isEmpty() && name.equals("capabilities^{}")) { //$NON-NLS-1$
                                // special line from git-receive-pack to show
                                // capabilities when there are no refs to advertise
                                continue;
                        }
 
                        final ObjectId id = ObjectId.fromString(line.substring(0, 40));
-                       if (name.equals(".have")) {
+                       if (name.equals(".have")) { //$NON-NLS-1$
                                additionalHaves.add(id);
-                       } else if (name.endsWith("^{}")) {
+                       } else if (name.endsWith("^{}")) { //$NON-NLS-1$
                                name = name.substring(0, name.length() - 3);
                                final Ref prior = avail.get(name);
                                if (prior == null)
@@ -236,7 +236,7 @@ abstract class BasePackConnection extends BaseConnection {
                                                        JGitText.get().advertisementCameBefore, name, name));
 
                                if (prior.getPeeledObjectId() != null)
-                                       throw duplicateAdvertisement(name + "^{}");
+                                       throw duplicateAdvertisement(name + "^{}"); //$NON-NLS-1$
 
                                avail.put(name, new ObjectIdRef.PeeledTag(
                                                Ref.Storage.NETWORK, name, prior.getObjectId(), id));
index 582b75a252ca25f65c79b64b5664833e150e5ac7..8a6140513fdbde96f1339770dfffaa9584aa5301 100644 (file)
@@ -124,61 +124,61 @@ public abstract class BasePackFetchConnection extends BasePackConnection
         * Include tags if we are also including the referenced objects.
         * @since 2.0
         */
-       public static final String OPTION_INCLUDE_TAG = "include-tag";
+       public static final String OPTION_INCLUDE_TAG = "include-tag"; //$NON-NLS-1$
 
        /**
         * Mutli-ACK support for improved negotiation.
         * @since 2.0
         */
-       public static final String OPTION_MULTI_ACK = "multi_ack";
+       public static final String OPTION_MULTI_ACK = "multi_ack"; //$NON-NLS-1$
 
        /**
         * Mutli-ACK detailed support for improved negotiation.
         * @since 2.0
         */
-       public static final String OPTION_MULTI_ACK_DETAILED = "multi_ack_detailed";
+       public static final String OPTION_MULTI_ACK_DETAILED = "multi_ack_detailed"; //$NON-NLS-1$
 
        /**
         * The client supports packs with deltas but not their bases.
         * @since 2.0
         */
-       public static final String OPTION_THIN_PACK = "thin-pack";
+       public static final String OPTION_THIN_PACK = "thin-pack"; //$NON-NLS-1$
 
        /**
         * The client supports using the side-band for progress messages.
         * @since 2.0
         */
-       public static final String OPTION_SIDE_BAND = "side-band";
+       public static final String OPTION_SIDE_BAND = "side-band"; //$NON-NLS-1$
 
        /**
         * The client supports using the 64K side-band for progress messages.
         * @since 2.0
         */
-       public static final String OPTION_SIDE_BAND_64K = "side-band-64k";
+       public static final String OPTION_SIDE_BAND_64K = "side-band-64k"; //$NON-NLS-1$
 
        /**
         * The client supports packs with OFS deltas.
         * @since 2.0
         */
-       public static final String OPTION_OFS_DELTA = "ofs-delta";
+       public static final String OPTION_OFS_DELTA = "ofs-delta"; //$NON-NLS-1$
 
        /**
         * The client supports shallow fetches.
         * @since 2.0
         */
-       public static final String OPTION_SHALLOW = "shallow";
+       public static final String OPTION_SHALLOW = "shallow"; //$NON-NLS-1$
 
        /**
         * The client does not want progress messages and will ignore them.
         * @since 2.0
         */
-       public static final String OPTION_NO_PROGRESS = "no-progress";
+       public static final String OPTION_NO_PROGRESS = "no-progress"; //$NON-NLS-1$
 
        /**
         * The client supports receiving a pack before it has sent "done".
         * @since 2.0
         */
-       public static final String OPTION_NO_DONE = "no-done";
+       public static final String OPTION_NO_DONE = "no-done"; //$NON-NLS-1$
 
        static enum MultiAck {
                OFF, CONTINUE, DETAILED;
@@ -238,10 +238,10 @@ public abstract class BasePackFetchConnection extends BasePackConnection
 
                walk = new RevWalk(local);
                reachableCommits = new RevCommitList<RevCommit>();
-               REACHABLE = walk.newFlag("REACHABLE");
-               COMMON = walk.newFlag("COMMON");
-               STATE = walk.newFlag("STATE");
-               ADVERTISED = walk.newFlag("ADVERTISED");
+               REACHABLE = walk.newFlag("REACHABLE"); //$NON-NLS-1$
+               COMMON = walk.newFlag("COMMON"); //$NON-NLS-1$
+               STATE = walk.newFlag("STATE"); //$NON-NLS-1$
+               ADVERTISED = walk.newFlag("ADVERTISED"); //$NON-NLS-1$
 
                walk.carry(COMMON);
                walk.carry(REACHABLE);
@@ -258,7 +258,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection
                final boolean allowOfsDelta;
 
                FetchConfig(final Config c) {
-                       allowOfsDelta = c.getBoolean("repack", "usedeltabaseoffset", true);
+                       allowOfsDelta = c.getBoolean("repack", "usedeltabaseoffset", true); //$NON-NLS-1$ //$NON-NLS-2$
                }
        }
 
@@ -429,7 +429,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection
                        }
 
                        final StringBuilder line = new StringBuilder(46);
-                       line.append("want ");
+                       line.append("want "); //$NON-NLS-1$
                        line.append(r.getObjectId().name());
                        if (first) {
                                line.append(enableCapabilities());
@@ -500,7 +500,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection
                        if (c == null)
                                break SEND_HAVES;
 
-                       pckOut.writeString("have " + c.getId().name() + "\n");
+                       pckOut.writeString("have " + c.getId().name() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
                        havesSent++;
                        havesSinceLastContinue++;
 
@@ -595,7 +595,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection
                        // loop above while in the middle of a request. This allows us
                        // to just write done immediately.
                        //
-                       pckOut.writeString("done\n");
+                       pckOut.writeString("done\n"); //$NON-NLS-1$
                        pckOut.flush();
                }
 
index 119b266161352effadffc186daf88bd61d9b896e..e97f03c3f188e9074e85a8cf7b56de65b9659c4a 100644 (file)
@@ -87,25 +87,25 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen
         * The client expects a status report after the server processes the pack.
         * @since 2.0
         */
-       public static final String CAPABILITY_REPORT_STATUS = "report-status";
+       public static final String CAPABILITY_REPORT_STATUS = "report-status"; //$NON-NLS-1$
 
        /**
         * The server supports deleting refs.
         * @since 2.0
         */
-       public static final String CAPABILITY_DELETE_REFS = "delete-refs";
+       public static final String CAPABILITY_DELETE_REFS = "delete-refs"; //$NON-NLS-1$
 
        /**
         * The server supports packs with OFS deltas.
         * @since 2.0
         */
-       public static final String CAPABILITY_OFS_DELTA = "ofs-delta";
+       public static final String CAPABILITY_OFS_DELTA = "ofs-delta"; //$NON-NLS-1$
 
        /**
         * The client supports using the 64K side-band for progress messages.
         * @since 2.0
         */
-       public static final String CAPABILITY_SIDE_BAND_64K = "side-band-64k";
+       public static final String CAPABILITY_SIDE_BAND_64K = "side-band-64k"; //$NON-NLS-1$
 
        private final boolean thinPack;
 
@@ -291,10 +291,10 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen
        private void readStatusReport(final Map<String, RemoteRefUpdate> refUpdates)
                        throws IOException {
                final String unpackLine = readStringLongTimeout();
-               if (!unpackLine.startsWith("unpack "))
+               if (!unpackLine.startsWith("unpack ")) //$NON-NLS-1$
                        throw new PackProtocolException(uri, MessageFormat.format(JGitText.get().unexpectedReportLine, unpackLine));
-               final String unpackStatus = unpackLine.substring("unpack ".length());
-               if (!unpackStatus.equals("ok"))
+               final String unpackStatus = unpackLine.substring("unpack ".length()); //$NON-NLS-1$
+               if (!unpackStatus.equals("ok")) //$NON-NLS-1$
                        throw new TransportException(uri, MessageFormat.format(
                                        JGitText.get().errorOccurredDuringUnpackingOnTheRemoteEnd, unpackStatus));
 
@@ -302,12 +302,12 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen
                while ((refLine = pckIn.readString()) != PacketLineIn.END) {
                        boolean ok = false;
                        int refNameEnd = -1;
-                       if (refLine.startsWith("ok ")) {
+                       if (refLine.startsWith("ok ")) { //$NON-NLS-1$
                                ok = true;
                                refNameEnd = refLine.length();
-                       } else if (refLine.startsWith("ng ")) {
+                       } else if (refLine.startsWith("ng ")) { //$NON-NLS-1$
                                ok = false;
-                               refNameEnd = refLine.indexOf(" ", 3);
+                               refNameEnd = refLine.indexOf(" ", 3); //$NON-NLS-1$
                        }
                        if (refNameEnd == -1)
                                throw new PackProtocolException(MessageFormat.format(JGitText.get().unexpectedReportLine2
index 57ccdccfda5d67c7012ffdcf270b6ebf8efe83a2..26cf9034342075519d1d51f0386816048a2f745c 100644 (file)
@@ -115,7 +115,7 @@ public abstract class BaseReceivePack {
                        final HashSet<String> caps = new HashSet<String>();
                        final int nul = line.indexOf('\0');
                        if (nul >= 0) {
-                               for (String c : line.substring(nul + 1).split(" "))
+                               for (String c : line.substring(nul + 1).split(" ")) //$NON-NLS-1$
                                        caps.add(c);
                                this.line = line.substring(0, nul);
                        } else
@@ -274,13 +274,13 @@ public abstract class BaseReceivePack {
                final boolean allowOfsDelta;
 
                ReceiveConfig(final Config config) {
-                       checkReceivedObjects = config.getBoolean("receive", "fsckobjects",
+                       checkReceivedObjects = config.getBoolean("receive", "fsckobjects", //$NON-NLS-1$ //$NON-NLS-2$
                                        false);
                        allowCreates = true;
-                       allowDeletes = !config.getBoolean("receive", "denydeletes", false);
-                       allowNonFastForwards = !config.getBoolean("receive",
-                                       "denynonfastforwards", false);
-                       allowOfsDelta = config.getBoolean("repack", "usedeltabaseoffset",
+                       allowDeletes = !config.getBoolean("receive", "denydeletes", false); //$NON-NLS-1$ //$NON-NLS-2$
+                       allowNonFastForwards = !config.getBoolean("receive", //$NON-NLS-1$
+                                       "denynonfastforwards", false); //$NON-NLS-1$
+                       allowOfsDelta = config.getBoolean("repack", "usedeltabaseoffset", //$NON-NLS-1$ //$NON-NLS-2$
                                        true);
                }
        }
@@ -673,7 +673,7 @@ public abstract class BaseReceivePack {
                                advertiseError = new StringBuilder();
                        advertiseError.append(what).append('\n');
                } else {
-                       msgOutWrapper.write(Constants.encode("error: " + what + "\n"));
+                       msgOutWrapper.write(Constants.encode("error: " + what + "\n")); //$NON-NLS-1$ //$NON-NLS-2$
                }
        }
 
@@ -688,7 +688,7 @@ public abstract class BaseReceivePack {
         *            string must not end with an LF, and must not contain an LF.
         */
        public void sendMessage(final String what) {
-               msgOutWrapper.write(Constants.encode(what + "\n"));
+               msgOutWrapper.write(Constants.encode(what + "\n")); //$NON-NLS-1$
        }
 
        /** @return an underlying stream for sending messages to the client. */
@@ -732,7 +732,7 @@ public abstract class BaseReceivePack {
 
                if (timeout > 0) {
                        final Thread caller = Thread.currentThread();
-                       timer = new InterruptTimer(caller.getName() + "-Timer");
+                       timer = new InterruptTimer(caller.getName() + "-Timer"); //$NON-NLS-1$
                        timeoutIn = new TimeoutInputStream(rawIn, timer);
                        TimeoutOutputStream o = new TimeoutOutputStream(rawOut, timer);
                        timeoutIn.setTimeout(timeout * 1000);
@@ -795,7 +795,7 @@ public abstract class BaseReceivePack {
        public void sendAdvertisedRefs(final RefAdvertiser adv)
                        throws IOException, ServiceMayNotContinueException {
                if (advertiseError != null) {
-                       adv.writeOne("ERR " + advertiseError);
+                       adv.writeOne("ERR " + advertiseError); //$NON-NLS-1$
                        return;
                }
 
@@ -803,7 +803,7 @@ public abstract class BaseReceivePack {
                        advertiseRefsHook.advertiseRefs(this);
                } catch (ServiceMayNotContinueException fail) {
                        if (fail.getMessage() != null) {
-                               adv.writeOne("ERR " + fail.getMessage());
+                               adv.writeOne("ERR " + fail.getMessage()); //$NON-NLS-1$
                                fail.setOutput();
                        }
                        throw fail;
@@ -819,7 +819,7 @@ public abstract class BaseReceivePack {
                for (ObjectId obj : advertisedHaves)
                        adv.advertiseHave(obj);
                if (adv.isEmpty())
-                       adv.advertiseId(ObjectId.zeroId(), "capabilities^{}");
+                       adv.advertiseId(ObjectId.zeroId(), "capabilities^{}"); //$NON-NLS-1$
                adv.end();
        }
 
@@ -921,9 +921,9 @@ public abstract class BaseReceivePack {
 
                ObjectInserter ins = db.newObjectInserter();
                try {
-                       String lockMsg = "jgit receive-pack";
+                       String lockMsg = "jgit receive-pack"; //$NON-NLS-1$
                        if (getRefLogIdent() != null)
-                               lockMsg += " from " + getRefLogIdent().toExternalString();
+                               lockMsg += " from " + getRefLogIdent().toExternalString(); //$NON-NLS-1$
 
                        parser = ins.newPackParser(rawIn);
                        parser.setAllowThin(true);
@@ -1167,7 +1167,7 @@ public abstract class BaseReceivePack {
                BatchRefUpdate batch = db.getRefDatabase().newBatchUpdate();
                batch.setAllowNonFastForwards(isAllowNonFastForwards());
                batch.setRefLogIdent(getRefLogIdent());
-               batch.setRefLogMessage("push", true);
+               batch.setRefLogMessage("push", true); //$NON-NLS-1$
                batch.addCommand(toApply);
                try {
                        batch.execute(walk, updating);
@@ -1195,70 +1195,70 @@ public abstract class BaseReceivePack {
        protected void sendStatusReport(final boolean forClient,
                        final Throwable unpackError, final Reporter out) throws IOException {
                if (unpackError != null) {
-                       out.sendString("unpack error " + unpackError.getMessage());
+                       out.sendString("unpack error " + unpackError.getMessage()); //$NON-NLS-1$
                        if (forClient) {
                                for (final ReceiveCommand cmd : commands) {
-                                       out.sendString("ng " + cmd.getRefName()
-                                                       + " n/a (unpacker error)");
+                                       out.sendString("ng " + cmd.getRefName() //$NON-NLS-1$
+                                                       + " n/a (unpacker error)"); //$NON-NLS-1$
                                }
                        }
                        return;
                }
 
                if (forClient)
-                       out.sendString("unpack ok");
+                       out.sendString("unpack ok"); //$NON-NLS-1$
                for (final ReceiveCommand cmd : commands) {
                        if (cmd.getResult() == Result.OK) {
                                if (forClient)
-                                       out.sendString("ok " + cmd.getRefName());
+                                       out.sendString("ok " + cmd.getRefName()); //$NON-NLS-1$
                                continue;
                        }
 
                        final StringBuilder r = new StringBuilder();
                        if (forClient)
-                               r.append("ng ").append(cmd.getRefName()).append(" ");
+                               r.append("ng ").append(cmd.getRefName()).append(" "); //$NON-NLS-1$ //$NON-NLS-2$
                        else
-                               r.append(" ! [rejected] ").append(cmd.getRefName()).append(" (");
+                               r.append(" ! [rejected] ").append(cmd.getRefName()).append(" ("); //$NON-NLS-1$ //$NON-NLS-2$
 
                        switch (cmd.getResult()) {
                        case NOT_ATTEMPTED:
-                               r.append("server bug; ref not processed");
+                               r.append("server bug; ref not processed"); //$NON-NLS-1$
                                break;
 
                        case REJECTED_NOCREATE:
-                               r.append("creation prohibited");
+                               r.append("creation prohibited"); //$NON-NLS-1$
                                break;
 
                        case REJECTED_NODELETE:
-                               r.append("deletion prohibited");
+                               r.append("deletion prohibited"); //$NON-NLS-1$
                                break;
 
                        case REJECTED_NONFASTFORWARD:
-                               r.append("non-fast forward");
+                               r.append("non-fast forward"); //$NON-NLS-1$
                                break;
 
                        case REJECTED_CURRENT_BRANCH:
-                               r.append("branch is currently checked out");
+                               r.append("branch is currently checked out"); //$NON-NLS-1$
                                break;
 
                        case REJECTED_MISSING_OBJECT:
                                if (cmd.getMessage() == null)
-                                       r.append("missing object(s)");
+                                       r.append("missing object(s)"); //$NON-NLS-1$
                                else if (cmd.getMessage().length() == Constants.OBJECT_ID_STRING_LENGTH)
-                                       r.append("object " + cmd.getMessage() + " missing");
+                                       r.append("object " + cmd.getMessage() + " missing"); //$NON-NLS-1$ //$NON-NLS-2$
                                else
                                        r.append(cmd.getMessage());
                                break;
 
                        case REJECTED_OTHER_REASON:
                                if (cmd.getMessage() == null)
-                                       r.append("unspecified reason");
+                                       r.append("unspecified reason"); //$NON-NLS-1$
                                else
                                        r.append(cmd.getMessage());
                                break;
 
                        case LOCK_FAILURE:
-                               r.append("failed to lock");
+                               r.append("failed to lock"); //$NON-NLS-1$
                                break;
 
                        case OK:
@@ -1266,7 +1266,7 @@ public abstract class BaseReceivePack {
                                continue;
                        }
                        if (!forClient)
-                               r.append(")");
+                               r.append(")"); //$NON-NLS-1$
                        out.sendString(r.toString());
                }
        }
index 5f3fc404cce6c1231abba1b3c76ce8c88dfc5ffb..10af0554e8e76e813defff154fba0a050a55ae85 100644 (file)
@@ -217,8 +217,8 @@ class BundleFetchConnection extends BaseFetchConnection {
 
                final RevWalk rw = new RevWalk(transport.local);
                try {
-                       final RevFlag PREREQ = rw.newFlag("PREREQ");
-                       final RevFlag SEEN = rw.newFlag("SEEN");
+                       final RevFlag PREREQ = rw.newFlag("PREREQ"); //$NON-NLS-1$
+                       final RevFlag SEEN = rw.newFlag("SEEN"); //$NON-NLS-1$
 
                        final Map<ObjectId, String> missing = new HashMap<ObjectId, String>();
                        final List<RevObject> commits = new ArrayList<RevObject>();
index 927822bd8bde997fdbde3ecde8aeab21eadb8d5b..6757aaf1088b08b3700af520b710d89d59ac4529 100644 (file)
@@ -78,7 +78,7 @@ public class CredentialsProviderUserInfo implements UserInfo,
 
        private static URIish createURI(Session session) {
                URIish uri = new URIish();
-               uri = uri.setScheme("ssh");
+               uri = uri.setScheme("ssh"); //$NON-NLS-1$
                uri = uri.setUser(session.getUserName());
                uri = uri.setHost(session.getHost());
                uri = uri.setPort(session.getPort());
index 78306766d80ac2d03c921c725821062dcb3e54d2..89f0764a5e25738c5c687e393c067cf4834be07c 100644 (file)
@@ -105,7 +105,7 @@ public class Daemon {
         */
        public Daemon(final InetSocketAddress addr) {
                myAddress = addr;
-               processors = new ThreadGroup("Git-Daemon");
+               processors = new ThreadGroup("Git-Daemon"); //$NON-NLS-1$
 
                repositoryResolver = (RepositoryResolver<DaemonClient>) RepositoryResolver.NONE;
 
@@ -130,8 +130,8 @@ public class Daemon {
                                String host = peer.getCanonicalHostName();
                                if (host == null)
                                        host = peer.getHostAddress();
-                               String name = "anonymous";
-                               String email = name + "@" + host;
+                               String name = "anonymous"; //$NON-NLS-1$
+                               String email = name + "@" + host; //$NON-NLS-1$
                                rp.setRefLogIdent(new PersonIdent(name, email));
                                rp.setTimeout(getTimeout());
 
@@ -140,7 +140,7 @@ public class Daemon {
                };
 
                services = new DaemonService[] {
-                               new DaemonService("upload-pack", "uploadpack") {
+                               new DaemonService("upload-pack", "uploadpack") { //$NON-NLS-1$ //$NON-NLS-2$
                                        {
                                                setEnabled(true);
                                        }
@@ -155,7 +155,7 @@ public class Daemon {
                                                OutputStream out = dc.getOutputStream();
                                                up.upload(in, out, null);
                                        }
-                               }, new DaemonService("receive-pack", "receivepack") {
+                               }, new DaemonService("receive-pack", "receivepack") { //$NON-NLS-1$ //$NON-NLS-2$
                                        {
                                                setEnabled(false);
                                        }
@@ -188,8 +188,8 @@ public class Daemon {
         *         the requested service type.
         */
        public synchronized DaemonService getService(String name) {
-               if (!name.startsWith("git-"))
-                       name = "git-" + name;
+               if (!name.startsWith("git-")) //$NON-NLS-1$
+                       name = "git-" + name; //$NON-NLS-1$
                for (final DaemonService s : services) {
                        if (s.getCommandName().equals(name))
                                return s;
@@ -286,7 +286,7 @@ public class Daemon {
                myAddress = (InetSocketAddress) listenSock.getLocalSocketAddress();
 
                run = true;
-               acceptThread = new Thread(processors, "Git-Daemon-Accept") {
+               acceptThread = new Thread(processors, "Git-Daemon-Accept") { //$NON-NLS-1$
                        public void run() {
                                while (isRunning()) {
                                        try {
@@ -332,7 +332,7 @@ public class Daemon {
                if (peer instanceof InetSocketAddress)
                        dc.setRemoteAddress(((InetSocketAddress) peer).getAddress());
 
-               new Thread(processors, "Git-Daemon-Client " + peer.toString()) {
+               new Thread(processors, "Git-Daemon-Client " + peer.toString()) { //$NON-NLS-1$
                        public void run() {
                                try {
                                        dc.execute(s);
@@ -375,7 +375,7 @@ public class Daemon {
 
                // git://thishost/path should always be name="/path" here
                //
-               if (!name.startsWith("/"))
+               if (!name.startsWith("/")) //$NON-NLS-1$
                        return null;
 
                try {
index a9481c4d2237e769ab8f0cb71afc91e8d726624f..4e7e12399c7c3fc497695205cfd98e7ea526e577 100644 (file)
@@ -63,7 +63,7 @@ public abstract class DaemonService {
        private boolean overridable;
 
        DaemonService(final String cmdName, final String cfgName) {
-               command = cmdName.startsWith("git-") ? cmdName : "git-" + cmdName;
+               command = cmdName.startsWith("git-") ? cmdName : "git-" + cmdName; //$NON-NLS-1$ //$NON-NLS-2$
                configKey = new SectionParser<ServiceConfig>() {
                        public ServiceConfig parse(final Config cfg) {
                                return new ServiceConfig(DaemonService.this, cfg, cfgName);
@@ -77,7 +77,7 @@ public abstract class DaemonService {
 
                ServiceConfig(final DaemonService service, final Config cfg,
                                final String name) {
-                       enabled = cfg.getBoolean("daemon", name, service.isEnabled());
+                       enabled = cfg.getBoolean("daemon", name, service.isEnabled()); //$NON-NLS-1$
                }
        }
 
@@ -137,7 +137,7 @@ public abstract class DaemonService {
                        // An error when opening the repo means the client is expecting a ref
                        // advertisement, so use that style of error.
                        PacketLineOut pktOut = new PacketLineOut(client.getOutputStream());
-                       pktOut.writeString("ERR " + e.getMessage() + "\n");
+                       pktOut.writeString("ERR " + e.getMessage() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
                        db = null;
                }
                if (db == null)
index e2ec71030caabb04bf9cc29e3ecce4226c04205b..421ef21073903ae64c817136828d7d9ad0037b75 100644 (file)
@@ -67,29 +67,29 @@ class FetchHeadRecord {
                final String type;
                final String name;
                if (sourceName.startsWith(R_HEADS)) {
-                       type = "branch";
+                       type = "branch"; //$NON-NLS-1$
                        name = sourceName.substring(R_HEADS.length());
                } else if (sourceName.startsWith(R_TAGS)) {
-                       type = "tag";
+                       type = "tag"; //$NON-NLS-1$
                        name = sourceName.substring(R_TAGS.length());
                } else if (sourceName.startsWith(R_REMOTES)) {
-                       type = "remote branch";
+                       type = "remote branch"; //$NON-NLS-1$
                        name = sourceName.substring(R_REMOTES.length());
                } else {
-                       type = "";
+                       type = ""; //$NON-NLS-1$
                        name = sourceName;
                }
 
                pw.write(newValue.name());
                pw.write('\t');
                if (notForMerge)
-                       pw.write("not-for-merge");
+                       pw.write("not-for-merge"); //$NON-NLS-1$
                pw.write('\t');
                pw.write(type);
-               pw.write(" '");
+               pw.write(" '"); //$NON-NLS-1$
                pw.write(name);
-               pw.write("' of ");
+               pw.write("' of "); //$NON-NLS-1$
                pw.write(sourceURI.toString());
-               pw.write("\n");
+               pw.write("\n"); //$NON-NLS-1$
        }
 }
index 66d0c62dd9b8957ab68a5f95b6d07aa6034fdf40..a50b0b98dbfb1b18d9137e880be431cc93a98c6a 100644 (file)
@@ -195,7 +195,7 @@ class FetchProcess {
                BatchRefUpdate batch = transport.local.getRefDatabase()
                                .newBatchUpdate()
                                .setAllowNonFastForwards(true)
-                               .setRefLogMessage("fetch", true);
+                               .setRefLogMessage("fetch", true); //$NON-NLS-1$
                final RevWalk walk = new RevWalk(transport.local);
                try {
                        if (monitor instanceof BatchingProgressMonitor) {
@@ -243,7 +243,7 @@ class FetchProcess {
        private void fetchObjects(final ProgressMonitor monitor)
                        throws TransportException {
                try {
-                       conn.setPackLockMessage("jgit fetch " + transport.uri);
+                       conn.setPackLockMessage("jgit fetch " + transport.uri); //$NON-NLS-1$
                        conn.fetch(monitor, askFor.values(), have);
                } finally {
                        packLocks.addAll(conn.getPackLocks());
@@ -316,7 +316,7 @@ class FetchProcess {
                File meta = transport.local.getDirectory();
                if (meta == null)
                        return;
-               final LockFile lock = new LockFile(new File(meta, "FETCH_HEAD"),
+               final LockFile lock = new LockFile(new File(meta, "FETCH_HEAD"), //$NON-NLS-1$
                                transport.local.getFS());
                try {
                        if (lock.lock()) {
@@ -510,6 +510,6 @@ class FetchProcess {
                        if (cmd.getResult() != ReceiveCommand.Result.OK)
                                return cmd.getRefName();
                }
-               return "";
+               return ""; //$NON-NLS-1$
        }
 }
index bcf0a8ba2142e702936abe484c5f7cf58d3351c0..4ab7998f5c295c078fb648ef7c214acdf42c2b3a 100644 (file)
@@ -164,7 +164,7 @@ abstract class HttpAuthMethod {
 
        /** Performs HTTP basic authentication (plaintext username/password). */
        private static class Basic extends HttpAuthMethod {
-               static final String NAME = "Basic";
+               static final String NAME = "Basic"; //$NON-NLS-1$
 
                private String user;
 
@@ -178,15 +178,15 @@ abstract class HttpAuthMethod {
 
                @Override
                void configureRequest(final HttpURLConnection conn) throws IOException {
-                       String ident = user + ":" + pass;
-                       String enc = Base64.encodeBytes(ident.getBytes("UTF-8"));
-                       conn.setRequestProperty(HDR_AUTHORIZATION, NAME + " " + enc);
+                       String ident = user + ":" + pass; //$NON-NLS-1$
+                       String enc = Base64.encodeBytes(ident.getBytes("UTF-8")); //$NON-NLS-1$
+                       conn.setRequestProperty(HDR_AUTHORIZATION, NAME + " " + enc); //$NON-NLS-1$
                }
        }
 
        /** Performs HTTP digest authentication. */
        private static class Digest extends HttpAuthMethod {
-               static final String NAME = "Digest";
+               static final String NAME = "Digest"; //$NON-NLS-1$
 
                private static final Random PRNG = new Random();
 
@@ -201,11 +201,11 @@ abstract class HttpAuthMethod {
                Digest(String hdr) {
                        params = parse(hdr);
 
-                       final String qop = params.get("qop");
-                       if ("auth".equals(qop)) {
+                       final String qop = params.get("qop"); //$NON-NLS-1$
+                       if ("auth".equals(qop)) { //$NON-NLS-1$
                                final byte[] bin = new byte[8];
                                PRNG.nextBytes(bin);
-                               params.put("cnonce", Base64.encodeBytes(bin));
+                               params.put("cnonce", Base64.encodeBytes(bin)); //$NON-NLS-1$
                        }
                }
 
@@ -220,67 +220,66 @@ abstract class HttpAuthMethod {
                void configureRequest(final HttpURLConnection conn) throws IOException {
                        final Map<String, String> r = new LinkedHashMap<String, String>();
 
-                       final String realm = params.get("realm");
-                       final String nonce = params.get("nonce");
-                       final String cnonce = params.get("cnonce");
+                       final String realm = params.get("realm"); //$NON-NLS-1$
+                       final String nonce = params.get("nonce"); //$NON-NLS-1$
+                       final String cnonce = params.get("cnonce"); //$NON-NLS-1$
                        final String uri = uri(conn.getURL());
-                       final String qop = params.get("qop");
+                       final String qop = params.get("qop"); //$NON-NLS-1$
                        final String method = conn.getRequestMethod();
 
-                       final String A1 = user + ":" + realm + ":" + pass;
-                       final String A2 = method + ":" + uri;
+                       final String A1 = user + ":" + realm + ":" + pass; //$NON-NLS-1$ //$NON-NLS-2$
+                       final String A2 = method + ":" + uri; //$NON-NLS-1$
 
-                       r.put("username", user);
-                       r.put("realm", realm);
-                       r.put("nonce", nonce);
-                       r.put("uri", uri);
+                       r.put("username", user); //$NON-NLS-1$
+                       r.put("realm", realm); //$NON-NLS-1$
+                       r.put("nonce", nonce); //$NON-NLS-1$
+                       r.put("uri", uri); //$NON-NLS-1$
 
                        final String response, nc;
-                       if ("auth".equals(qop)) {
-                               nc = String.format("%08x", ++requestCount);
-                               response = KD(H(A1), nonce + ":" + nc + ":" + cnonce + ":"
-                                               + qop
-                                               + ":"
+                       if ("auth".equals(qop)) { //$NON-NLS-1$
+                               nc = String.format("%08x", ++requestCount); //$NON-NLS-1$
+                               response = KD(H(A1), nonce + ":" + nc + ":" + cnonce + ":" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                                               + qop + ":" //$NON-NLS-1$
                                                + H(A2));
                        } else {
                                nc = null;
-                               response = KD(H(A1), nonce + ":" + H(A2));
+                               response = KD(H(A1), nonce + ":" + H(A2)); //$NON-NLS-1$
                        }
-                       r.put("response", response);
-                       if (params.containsKey("algorithm"))
-                               r.put("algorithm", "MD5");
+                       r.put("response", response); //$NON-NLS-1$
+                       if (params.containsKey("algorithm")) //$NON-NLS-1$
+                               r.put("algorithm", "MD5"); //$NON-NLS-1$ //$NON-NLS-2$
                        if (cnonce != null && qop != null)
-                               r.put("cnonce", cnonce);
-                       if (params.containsKey("opaque"))
-                               r.put("opaque", params.get("opaque"));
+                               r.put("cnonce", cnonce); //$NON-NLS-1$
+                       if (params.containsKey("opaque")) //$NON-NLS-1$
+                               r.put("opaque", params.get("opaque")); //$NON-NLS-1$ //$NON-NLS-2$
                        if (qop != null)
-                               r.put("qop", qop);
+                               r.put("qop", qop); //$NON-NLS-1$
                        if (nc != null)
-                               r.put("nc", nc);
+                               r.put("nc", nc); //$NON-NLS-1$
 
                        StringBuilder v = new StringBuilder();
                        for (Map.Entry<String, String> e : r.entrySet()) {
                                if (v.length() > 0)
-                                       v.append(", ");
+                                       v.append(", "); //$NON-NLS-1$
                                v.append(e.getKey());
                                v.append('=');
                                v.append('"');
                                v.append(e.getValue());
                                v.append('"');
                        }
-                       conn.setRequestProperty(HDR_AUTHORIZATION, NAME + " " + v);
+                       conn.setRequestProperty(HDR_AUTHORIZATION, NAME + " " + v); //$NON-NLS-1$
                }
 
                private static String uri(URL u) {
                        StringBuilder r = new StringBuilder();
                        r.append(u.getProtocol());
-                       r.append("://");
+                       r.append("://"); //$NON-NLS-1$
                        r.append(u.getHost());
                        if (0 < u.getPort()) {
-                               if (u.getPort() == 80 && "http".equals(u.getProtocol())) {
+                               if (u.getPort() == 80 && "http".equals(u.getProtocol())) { //$NON-NLS-1$
                                        /* nothing */
                                } else if (u.getPort() == 443
-                                               && "https".equals(u.getProtocol())) {
+                                               && "https".equals(u.getProtocol())) { //$NON-NLS-1$
                                        /* nothing */
                                } else {
                                        r.append(':').append(u.getPort());
@@ -295,30 +294,30 @@ abstract class HttpAuthMethod {
                private static String H(String data) {
                        try {
                                MessageDigest md = newMD5();
-                               md.update(data.getBytes("UTF-8"));
+                               md.update(data.getBytes("UTF-8")); //$NON-NLS-1$
                                return LHEX(md.digest());
                        } catch (UnsupportedEncodingException e) {
-                               throw new RuntimeException("UTF-8 encoding not available", e);
+                               throw new RuntimeException("UTF-8 encoding not available", e); //$NON-NLS-1$
                        }
                }
 
                private static String KD(String secret, String data) {
                        try {
                                MessageDigest md = newMD5();
-                               md.update(secret.getBytes("UTF-8"));
+                               md.update(secret.getBytes("UTF-8")); //$NON-NLS-1$
                                md.update((byte) ':');
-                               md.update(data.getBytes("UTF-8"));
+                               md.update(data.getBytes("UTF-8")); //$NON-NLS-1$
                                return LHEX(md.digest());
                        } catch (UnsupportedEncodingException e) {
-                               throw new RuntimeException("UTF-8 encoding not available", e);
+                               throw new RuntimeException("UTF-8 encoding not available", e); //$NON-NLS-1$
                        }
                }
 
                private static MessageDigest newMD5() {
                        try {
-                               return MessageDigest.getInstance("MD5");
+                               return MessageDigest.getInstance("MD5"); //$NON-NLS-1$
                        } catch (NoSuchAlgorithmException e) {
-                               throw new RuntimeException("No MD5 available", e);
+                               throw new RuntimeException("No MD5 available", e); //$NON-NLS-1$
                        }
                }
 
index 917ad531b5047dd473c36b1f5f645f390186bf19..d70148861e7ee825f974ab67854cec1121345a3c 100644 (file)
@@ -120,7 +120,7 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory {
                                        // if authentication failed maybe credentials changed at the
                                        // remote end therefore reset credentials and retry
                                        if (credentialsProvider != null && e.getCause() == null
-                                                       && e.getMessage().equals("Auth fail")
+                                                       && e.getMessage().equals("Auth fail") //$NON-NLS-1$
                                                        && retries < 3) {
                                                credentialsProvider.reset(uri);
                                                session = createSession(credentialsProvider, fs, user,
@@ -153,11 +153,11 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory {
                final String strictHostKeyCheckingPolicy = hc
                                .getStrictHostKeyChecking();
                if (strictHostKeyCheckingPolicy != null)
-                       session.setConfig("StrictHostKeyChecking",
+                       session.setConfig("StrictHostKeyChecking", //$NON-NLS-1$
                                        strictHostKeyCheckingPolicy);
                final String pauth = hc.getPreferredAuthentications();
                if (pauth != null)
-                       session.setConfig("PreferredAuthentications", pauth);
+                       session.setConfig("PreferredAuthentications", pauth); //$NON-NLS-1$
                if (credentialsProvider != null
                                && (!hc.isBatchMode() || !credentialsProvider.isInteractive())) {
                        session.setUserInfo(new CredentialsProviderUserInfo(session,
@@ -255,7 +255,7 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory {
                final File home = fs.userHome();
                if (home == null)
                        return;
-               final File known_hosts = new File(new File(home, ".ssh"), "known_hosts");
+               final File known_hosts = new File(new File(home, ".ssh"), "known_hosts"); //$NON-NLS-1$ //$NON-NLS-2$
                try {
                        final FileInputStream in = new FileInputStream(known_hosts);
                        try {
@@ -274,11 +274,11 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory {
                final File home = fs.userHome();
                if (home == null)
                        return;
-               final File sshdir = new File(home, ".ssh");
+               final File sshdir = new File(home, ".ssh"); //$NON-NLS-1$
                if (sshdir.isDirectory()) {
-                       loadIdentity(sch, new File(sshdir, "identity"));
-                       loadIdentity(sch, new File(sshdir, "id_rsa"));
-                       loadIdentity(sch, new File(sshdir, "id_dsa"));
+                       loadIdentity(sch, new File(sshdir, "identity")); //$NON-NLS-1$
+                       loadIdentity(sch, new File(sshdir, "id_rsa")); //$NON-NLS-1$
+                       loadIdentity(sch, new File(sshdir, "id_dsa")); //$NON-NLS-1$
                }
        }
 
index 9dc0da614651592ea88819bcee2417f3afbb8fec..e5d59b579b9e05b63eeb844db2633e7f6addb0b7 100644 (file)
@@ -106,7 +106,7 @@ public class JschSession implements RemoteSession {
         *             on problems getting the channel.
         */
        public Channel getSftpChannel() throws JSchException {
-               return sock.openChannel("sftp");
+               return sock.openChannel("sftp"); //$NON-NLS-1$
        }
 
        /**
@@ -144,7 +144,7 @@ public class JschSession implements RemoteSession {
                                throws TransportException, IOException {
                        timeout = tms;
                        try {
-                               channel = (ChannelExec) sock.openChannel("exec");
+                               channel = (ChannelExec) sock.openChannel("exec"); //$NON-NLS-1$
                                channel.setCommand(commandName);
                                setupStreams();
                                channel.connect(timeout > 0 ? timeout * 1000 : 0);
index a97c09bfe9abf803e0e71b065838d9d2a90be7d1..01716da70ae98eab6bd0383f0fce692c47ae598a 100644 (file)
@@ -91,9 +91,9 @@ public class OpenSshConfig {
        public static OpenSshConfig get(FS fs) {
                File home = fs.userHome();
                if (home == null)
-                       home = new File(".").getAbsoluteFile();
+                       home = new File(".").getAbsoluteFile(); //$NON-NLS-1$
 
-               final File config = new File(new File(home, ".ssh"), Constants.CONFIG);
+               final File config = new File(new File(home, ".ssh"), Constants.CONFIG); //$NON-NLS-1$
                final OpenSshConfig osc = new OpenSshConfig(home, config);
                osc.refresh();
                return osc;
@@ -180,16 +180,16 @@ public class OpenSshConfig {
 
                while ((line = br.readLine()) != null) {
                        line = line.trim();
-                       if (line.length() == 0 || line.startsWith("#"))
+                       if (line.length() == 0 || line.startsWith("#")) //$NON-NLS-1$
                                continue;
 
-                       final String[] parts = line.split("[ \t]*[= \t]", 2);
+                       final String[] parts = line.split("[ \t]*[= \t]", 2); //$NON-NLS-1$
                        final String keyword = parts[0].trim();
                        final String argValue = parts[1].trim();
 
-                       if (StringUtils.equalsIgnoreCase("Host", keyword)) {
+                       if (StringUtils.equalsIgnoreCase("Host", keyword)) { //$NON-NLS-1$
                                current.clear();
-                               for (final String pattern : argValue.split("[ \t]")) {
+                               for (final String pattern : argValue.split("[ \t]")) { //$NON-NLS-1$
                                        final String name = dequote(pattern);
                                        Host c = m.get(name);
                                        if (c == null) {
@@ -208,15 +208,15 @@ public class OpenSshConfig {
                                continue;
                        }
 
-                       if (StringUtils.equalsIgnoreCase("HostName", keyword)) {
+                       if (StringUtils.equalsIgnoreCase("HostName", keyword)) { //$NON-NLS-1$
                                for (final Host c : current)
                                        if (c.hostName == null)
                                                c.hostName = dequote(argValue);
-                       } else if (StringUtils.equalsIgnoreCase("User", keyword)) {
+                       } else if (StringUtils.equalsIgnoreCase("User", keyword)) { //$NON-NLS-1$
                                for (final Host c : current)
                                        if (c.user == null)
                                                c.user = dequote(argValue);
-                       } else if (StringUtils.equalsIgnoreCase("Port", keyword)) {
+                       } else if (StringUtils.equalsIgnoreCase("Port", keyword)) { //$NON-NLS-1$
                                try {
                                        final int port = Integer.parseInt(dequote(argValue));
                                        for (final Host c : current)
@@ -225,19 +225,21 @@ public class OpenSshConfig {
                                } catch (NumberFormatException nfe) {
                                        // Bad port number. Don't set it.
                                }
-                       } else if (StringUtils.equalsIgnoreCase("IdentityFile", keyword)) {
+                       } else if (StringUtils.equalsIgnoreCase("IdentityFile", keyword)) { //$NON-NLS-1$
                                for (final Host c : current)
                                        if (c.identityFile == null)
                                                c.identityFile = toFile(dequote(argValue));
-                       } else if (StringUtils.equalsIgnoreCase("PreferredAuthentications", keyword)) {
+                       } else if (StringUtils.equalsIgnoreCase(
+                                       "PreferredAuthentications", keyword)) { //$NON-NLS-1$
                                for (final Host c : current)
                                        if (c.preferredAuthentications == null)
                                                c.preferredAuthentications = nows(dequote(argValue));
-                       } else if (StringUtils.equalsIgnoreCase("BatchMode", keyword)) {
+                       } else if (StringUtils.equalsIgnoreCase("BatchMode", keyword)) { //$NON-NLS-1$
                                for (final Host c : current)
                                        if (c.batchMode == null)
                                                c.batchMode = yesno(dequote(argValue));
-                       } else if (StringUtils.equalsIgnoreCase("StrictHostKeyChecking", keyword)) {
+                       } else if (StringUtils.equalsIgnoreCase(
+                                       "StrictHostKeyChecking", keyword)) { //$NON-NLS-1$
                                String value = dequote(argValue);
                                for (final Host c : current)
                                        if (c.strictHostKeyChecking == null)
@@ -264,7 +266,7 @@ public class OpenSshConfig {
        }
 
        private static String dequote(final String value) {
-               if (value.startsWith("\"") && value.endsWith("\""))
+               if (value.startsWith("\"") && value.endsWith("\"")) //$NON-NLS-1$ //$NON-NLS-2$
                        return value.substring(1, value.length() - 1);
                return value;
        }
@@ -279,13 +281,13 @@ public class OpenSshConfig {
        }
 
        private static Boolean yesno(final String value) {
-               if (StringUtils.equalsIgnoreCase("yes", value))
+               if (StringUtils.equalsIgnoreCase("yes", value)) //$NON-NLS-1$
                        return Boolean.TRUE;
                return Boolean.FALSE;
        }
 
        private File toFile(final String path) {
-               if (path.startsWith("~/"))
+               if (path.startsWith("~/")) //$NON-NLS-1$
                        return new File(home, path.substring(2));
                File ret = new File(path);
                if (ret.isAbsolute())
@@ -296,7 +298,7 @@ public class OpenSshConfig {
        static String userName() {
                return AccessController.doPrivileged(new PrivilegedAction<String>() {
                        public String run() {
-                               return System.getProperty("user.name");
+                               return System.getProperty("user.name"); //$NON-NLS-1$
                        }
                });
        }
index 115cfbcc81d52abce6632d83b27e10c3b7c00866..b4a48b01652654008a7989e3855bcd1274ec85ff 100644 (file)
@@ -153,7 +153,7 @@ public abstract class OperationResult {
         *         remote produced no additional messages.
         */
        public String getMessages() {
-               return messageBuffer != null ? messageBuffer.toString() : "";
+               return messageBuffer != null ? messageBuffer.toString() : ""; //$NON-NLS-1$
        }
 
        void addMessages(final String msg) {
@@ -161,7 +161,7 @@ public abstract class OperationResult {
                        if (messageBuffer == null)
                                messageBuffer = new StringBuilder();
                        messageBuffer.append(msg);
-                       if (!msg.endsWith("\n"))
+                       if (!msg.endsWith("\n")) //$NON-NLS-1$
                                messageBuffer.append('\n');
                }
        }
index 0c035e547d1c30a2fdd8659e7c51179a6e9f5bf7..7b55768e6fdb9cf2d152f1272247c104ca3b8900 100644 (file)
@@ -846,13 +846,13 @@ public abstract class PackParser {
                if (bAvail != 0 && !expectDataAfterPackFooter)
                        throw new CorruptObjectException(MessageFormat.format(
                                        JGitText.get().expectedEOFReceived,
-                                       "\\x" + Integer.toHexString(buf[bOffset] & 0xff)));
+                                       "\\x" + Integer.toHexString(buf[bOffset] & 0xff))); //$NON-NLS-1$
                if (isCheckEofAfterPackFooter()) {
                        int eof = in.read();
                        if (0 <= eof)
                                throw new CorruptObjectException(MessageFormat.format(
                                                JGitText.get().expectedEOFReceived,
-                                               "\\x" + Integer.toHexString(eof)));
+                                               "\\x" + Integer.toHexString(eof))); //$NON-NLS-1$
                } else if (bAvail > 0 && expectDataAfterPackFooter) {
                        in.reset();
                        IO.skipFully(in, bOffset);
index 5030ed142cc4ce1201afdea48170d7f52ce0df07..e1769f84ed42e757c9280a2ab8ebe5490e7327e9 100644 (file)
@@ -102,22 +102,22 @@ public class PacketLineIn {
                final String line = readString();
                if (line.length() == 0)
                        throw new PackProtocolException(JGitText.get().expectedACKNAKFoundEOF);
-               if ("NAK".equals(line))
+               if ("NAK".equals(line)) //$NON-NLS-1$
                        return AckNackResult.NAK;
-               if (line.startsWith("ACK ")) {
+               if (line.startsWith("ACK ")) { //$NON-NLS-1$
                        returnedId.fromString(line.substring(4, 44));
                        if (line.length() == 44)
                                return AckNackResult.ACK;
 
                        final String arg = line.substring(44);
-                       if (arg.equals(" continue"))
+                       if (arg.equals(" continue")) //$NON-NLS-1$
                                return AckNackResult.ACK_CONTINUE;
-                       else if (arg.equals(" common"))
+                       else if (arg.equals(" common")) //$NON-NLS-1$
                                return AckNackResult.ACK_COMMON;
-                       else if (arg.equals(" ready"))
+                       else if (arg.equals(" ready")) //$NON-NLS-1$
                                return AckNackResult.ACK_READY;
                }
-               if (line.startsWith("ERR "))
+               if (line.startsWith("ERR ")) //$NON-NLS-1$
                        throw new PackProtocolException(line.substring(4));
                throw new PackProtocolException(MessageFormat.format(JGitText.get().expectedACKNAKGot, line));
        }
@@ -141,7 +141,7 @@ public class PacketLineIn {
 
                len -= 4; // length header (4 bytes)
                if (len == 0)
-                       return "";
+                       return ""; //$NON-NLS-1$
 
                byte[] raw;
                if (len <= lineBuffer.length)
@@ -191,7 +191,7 @@ public class PacketLineIn {
                        return len;
                } catch (ArrayIndexOutOfBoundsException err) {
                        throw new IOException(MessageFormat.format(JGitText.get().invalidPacketLineHeader,
-                                       "" + (char) lineBuffer[0] + (char) lineBuffer[1]
+                                       "" + (char) lineBuffer[0] + (char) lineBuffer[1] //$NON-NLS-1$
                                        + (char) lineBuffer[2] + (char) lineBuffer[3]));
                }
        }
index 4c7ffecceea010406d11180da986ea2286021932..37da6c646254418d68b11ca8cb8a245d11c6ae05 100644 (file)
@@ -332,7 +332,7 @@ public class ReceiveCommand {
                                ru.setForceUpdate(rp.isAllowNonFastForwards());
                                ru.setExpectedOldObjectId(getOldId());
                                ru.setNewObjectId(getNewId());
-                               ru.setRefLogMessage("push", true);
+                               ru.setRefLogMessage("push", true); //$NON-NLS-1$
                                setResult(ru.update(rp.getRevWalk()));
                                break;
                        }
@@ -397,6 +397,7 @@ public class ReceiveCommand {
                                JGitText.get().lockError, err.getMessage()));
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return getType().name() + ": " + getOldId().name() + " "
index fb30d99fc58069326d3320b9f8aebf559aec5a7f..d17abf78c4379c92f3e9e495a7ad696f92a37351 100644 (file)
@@ -209,7 +209,7 @@ public class ReceivePack extends BaseReceivePack {
                                if (echoCommandFailures && msgOut != null) {
                                        sendStatusReport(false, unpackError, new Reporter() {
                                                void sendString(final String s) throws IOException {
-                                                       msgOut.write(Constants.encode(s + "\n"));
+                                                       msgOut.write(Constants.encode(s + "\n")); //$NON-NLS-1$
                                                }
                                        });
                                        msgOut.flush();
@@ -221,14 +221,14 @@ public class ReceivePack extends BaseReceivePack {
                                }
                                sendStatusReport(true, unpackError, new Reporter() {
                                        void sendString(final String s) throws IOException {
-                                               pckOut.writeString(s + "\n");
+                                               pckOut.writeString(s + "\n"); //$NON-NLS-1$
                                        }
                                });
                                pckOut.end();
                        } else if (msgOut != null) {
                                sendStatusReport(false, unpackError, new Reporter() {
                                        void sendString(final String s) throws IOException {
-                                               msgOut.write(Constants.encode(s + "\n"));
+                                               msgOut.write(Constants.encode(s + "\n")); //$NON-NLS-1$
                                        }
                                });
                        }
@@ -242,6 +242,6 @@ public class ReceivePack extends BaseReceivePack {
 
        @Override
        protected String getLockMessageProcessName() {
-               return "jgit receive-pack";
+               return "jgit receive-pack"; //$NON-NLS-1$
        }
 }
index b04311659f1e19135adf6d428699f6ad51547387..581a44b1dc8db93985a669fe7f67bc6f560512ec 100644 (file)
@@ -174,7 +174,7 @@ public abstract class RefAdvertiser {
                        }
 
                        if (ref.getPeeledObjectId() != null)
-                               advertiseAny(ref.getPeeledObjectId(), ref.getName() + "^{}");
+                               advertiseAny(ref.getPeeledObjectId(), ref.getName() + "^{}"); //$NON-NLS-1$
                }
                return sent;
        }
@@ -201,7 +201,7 @@ public abstract class RefAdvertiser {
         *             advertisement record.
         */
        public void advertiseHave(AnyObjectId id) throws IOException {
-               advertiseAnyOnce(id, ".have");
+               advertiseAnyOnce(id, ".have"); //$NON-NLS-1$
        }
 
        /** @return true if no advertisements have been sent yet. */
index 98574b0fa17ddbf995d4a68e2e57d47bfe1aa43a..53a7b02be36b356c386932a1ab8bf48f3b072b3f 100644 (file)
@@ -63,7 +63,7 @@ public class RefSpec implements Serializable {
         * Suffix for wildcard ref spec component, that indicate matching all refs
         * with specified prefix.
         */
-       public static final String WILDCARD_SUFFIX = "/*";
+       public static final String WILDCARD_SUFFIX = "/*"; //$NON-NLS-1$
 
        /**
         * Check whether provided string is a wildcard ref spec component.
@@ -122,7 +122,7 @@ public class RefSpec implements Serializable {
         */
        public RefSpec(final String spec) {
                String s = spec;
-               if (s.startsWith("+")) {
+               if (s.startsWith("+")) { //$NON-NLS-1$
                        force = true;
                        s = s.substring(1);
                }
index f75ac703a3c3fdc6989d5ab9092600d8429e8b45..ba0931b9ba7ef3f58bbe9ddd5d43591b0d6e3d37 100644 (file)
@@ -67,37 +67,37 @@ import org.eclipse.jgit.lib.Config;
 public class RemoteConfig implements Serializable {
        private static final long serialVersionUID = 1L;
 
-       private static final String SECTION = "remote";
+       private static final String SECTION = "remote"; //$NON-NLS-1$
 
-       private static final String KEY_URL = "url";
+       private static final String KEY_URL = "url"; //$NON-NLS-1$
 
-       private static final String KEY_PUSHURL = "pushurl";
+       private static final String KEY_PUSHURL = "pushurl"; //$NON-NLS-1$
 
-       private static final String KEY_FETCH = "fetch";
+       private static final String KEY_FETCH = "fetch"; //$NON-NLS-1$
 
-       private static final String KEY_PUSH = "push";
+       private static final String KEY_PUSH = "push"; //$NON-NLS-1$
 
-       private static final String KEY_UPLOADPACK = "uploadpack";
+       private static final String KEY_UPLOADPACK = "uploadpack"; //$NON-NLS-1$
 
-       private static final String KEY_RECEIVEPACK = "receivepack";
+       private static final String KEY_RECEIVEPACK = "receivepack"; //$NON-NLS-1$
 
-       private static final String KEY_TAGOPT = "tagopt";
+       private static final String KEY_TAGOPT = "tagopt"; //$NON-NLS-1$
 
-       private static final String KEY_MIRROR = "mirror";
+       private static final String KEY_MIRROR = "mirror"; //$NON-NLS-1$
 
-       private static final String KEY_TIMEOUT = "timeout";
+       private static final String KEY_TIMEOUT = "timeout"; //$NON-NLS-1$
 
-       private static final String KEY_INSTEADOF = "insteadof";
+       private static final String KEY_INSTEADOF = "insteadof"; //$NON-NLS-1$
 
-       private static final String KEY_PUSHINSTEADOF = "pushinsteadof";
+       private static final String KEY_PUSHINSTEADOF = "pushinsteadof"; //$NON-NLS-1$
 
        private static final boolean DEFAULT_MIRROR = false;
 
        /** Default value for {@link #getUploadPack()} if not specified. */
-       public static final String DEFAULT_UPLOAD_PACK = "git-upload-pack";
+       public static final String DEFAULT_UPLOAD_PACK = "git-upload-pack"; //$NON-NLS-1$
 
        /** Default value for {@link #getReceivePack()} if not specified. */
-       public static final String DEFAULT_RECEIVE_PACK = "git-receive-pack";
+       public static final String DEFAULT_RECEIVE_PACK = "git-receive-pack"; //$NON-NLS-1$
 
        /**
         * Parse all remote blocks in an existing configuration file, looking for
index 421830202e22af88681f886bf986026f2419affc..1b82a3610578b4040f8289dc478e931efe12b71d 100644 (file)
@@ -305,7 +305,7 @@ public class RemoteRefUpdate {
                if (localName != null && localDb != null) {
                        localUpdate = localDb.updateRef(localName);
                        localUpdate.setForceUpdate(true);
-                       localUpdate.setRefLogMessage("push", true);
+                       localUpdate.setRefLogMessage("push", true); //$NON-NLS-1$
                        localUpdate.setNewObjectId(newObjectId);
                        trackingRefUpdate = new TrackingRefUpdate(
                                        true,
@@ -467,13 +467,20 @@ public class RemoteRefUpdate {
                        trackingRefUpdate.setResult(localUpdate.update(walk));
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
-               return "RemoteRefUpdate[remoteName=" + remoteName + ", " + status
-                               + ", " + (expectedOldObjectId!=null ? expectedOldObjectId.name() : "(null)")
-                               + "..." + (newObjectId != null ? newObjectId.name() : "(null)")
+               return "RemoteRefUpdate[remoteName="
+                               + remoteName
+                               + ", "
+                               + status
+                               + ", "
+                               + (expectedOldObjectId != null ? expectedOldObjectId.name()
+                                               : "(null)") + "..."
+                               + (newObjectId != null ? newObjectId.name() : "(null)")
                                + (fastForward ? ", fastForward" : "")
-                               + ", srcRef=" + srcRef + (forceUpdate ? ", forceUpdate" : "") + ", message=" + (message != null ? "\""
-                               + message + "\"" : "null") + "]";
+ + ", srcRef=" + srcRef
+                               + (forceUpdate ? ", forceUpdate" : "") + ", message="
+                               + (message != null ? "\"" + message + "\"" : "null") + "]";
        }
 }
index bc9f649959733728fd74595799a01b1bbc09aef8..b48a8a5f096d7cd07dbda3a1fd74c70154319bc9 100644 (file)
@@ -86,10 +86,10 @@ class SideBandInputStream extends InputStream {
        static final int CH_ERROR = 3;
 
        private static Pattern P_UNBOUNDED = Pattern
-                       .compile("^([\\w ]+): +(\\d+)(?:, done\\.)? *[\r\n]$");
+                       .compile("^([\\w ]+): +(\\d+)(?:, done\\.)? *[\r\n]$"); //$NON-NLS-1$
 
        private static Pattern P_BOUNDED = Pattern
-                       .compile("^([\\w ]+): +\\d+% +\\( *(\\d+)/ *(\\d+)\\)(?:, done\\.)? *[\r\n]$");
+                       .compile("^([\\w ]+): +\\d+% +\\( *(\\d+)/ *(\\d+)\\)(?:, done\\.)? *[\r\n]$"); //$NON-NLS-1$
 
        private final InputStream rawIn;
 
@@ -99,7 +99,7 @@ class SideBandInputStream extends InputStream {
 
        private final Writer messages;
 
-       private String progressBuffer = "";
+       private String progressBuffer = ""; //$NON-NLS-1$
 
        private String currentTask;
 
@@ -117,7 +117,7 @@ class SideBandInputStream extends InputStream {
                pckIn = new PacketLineIn(rawIn);
                monitor = progress;
                messages = messageStream;
-               currentTask = "";
+               currentTask = ""; //$NON-NLS-1$
        }
 
        @Override
index c7b22bdabfb7f72c0f2fda540954729864989f88..aa800657e17943863ac69a02e399151df6009047 100644 (file)
@@ -64,7 +64,7 @@ class SideBandProgressMonitor extends BatchingProgressMonitor {
        protected void onUpdate(String taskName, int workCurr) {
                StringBuilder s = new StringBuilder();
                format(s, taskName, workCurr);
-               s.append("   \r");
+               s.append("   \r"); //$NON-NLS-1$
                send(s);
        }
 
@@ -72,13 +72,13 @@ class SideBandProgressMonitor extends BatchingProgressMonitor {
        protected void onEndTask(String taskName, int workCurr) {
                StringBuilder s = new StringBuilder();
                format(s, taskName, workCurr);
-               s.append(", done\n");
+               s.append(", done\n"); //$NON-NLS-1$
                send(s);
        }
 
        private void format(StringBuilder s, String taskName, int workCurr) {
                s.append(taskName);
-               s.append(": ");
+               s.append(": "); //$NON-NLS-1$
                s.append(workCurr);
        }
 
@@ -86,7 +86,7 @@ class SideBandProgressMonitor extends BatchingProgressMonitor {
        protected void onUpdate(String taskName, int cmp, int totalWork, int pcnt) {
                StringBuilder s = new StringBuilder();
                format(s, taskName, cmp, totalWork, pcnt);
-               s.append("   \r");
+               s.append("   \r"); //$NON-NLS-1$
                send(s);
        }
 
@@ -94,24 +94,24 @@ class SideBandProgressMonitor extends BatchingProgressMonitor {
        protected void onEndTask(String taskName, int cmp, int totalWork, int pcnt) {
                StringBuilder s = new StringBuilder();
                format(s, taskName, cmp, totalWork, pcnt);
-               s.append("\n");
+               s.append("\n"); //$NON-NLS-1$
                send(s);
        }
 
        private void format(StringBuilder s, String taskName, int cmp,
                        int totalWork, int pcnt) {
                s.append(taskName);
-               s.append(": ");
+               s.append(": "); //$NON-NLS-1$
                if (pcnt < 100)
                        s.append(' ');
                if (pcnt < 10)
                        s.append(' ');
                s.append(pcnt);
-               s.append("% (");
+               s.append("% ("); //$NON-NLS-1$
                s.append(cmp);
-               s.append("/");
+               s.append("/"); //$NON-NLS-1$
                s.append(totalWork);
-               s.append(")");
+               s.append(")"); //$NON-NLS-1$
        }
 
        private void send(StringBuilder s) {
index 3b25870d9396ed251baf4ffca225d30edbc2cfe7..384e9fc4b288ed3e06f1dfa407a2792c2eddc616 100644 (file)
@@ -59,7 +59,7 @@ public enum TagOpt {
         * prove that we already have (or will have when the fetch completes) the
         * object the annotated tag peels (dereferences) to.
         */
-       AUTO_FOLLOW(""),
+       AUTO_FOLLOW(""), //$NON-NLS-1$
 
        /**
         * Never fetch tags, even if we have the thing it points at.
@@ -69,7 +69,7 @@ public enum TagOpt {
         * publishes annotated tags, but you are not interested in the tags and only
         * want their branches.
         */
-       NO_TAGS("--no-tags"),
+       NO_TAGS("--no-tags"), //$NON-NLS-1$
 
        /**
         * Always fetch tags, even if we do not have the thing it points at.
@@ -78,7 +78,7 @@ public enum TagOpt {
         * hundreds of megabytes of objects to be fetched if the receiving
         * repository does not yet have the necessary dependencies.
         */
-       FETCH_TAGS("--tags");
+       FETCH_TAGS("--tags"); //$NON-NLS-1$
 
        private final String option;
 
index d6dcb3208f33d5fbdb95692134c1618d2ae385bd..54b3066d8810faf7a82ab2b65ee553909f100112 100644 (file)
@@ -194,6 +194,7 @@ public class TrackingRefUpdate {
                }
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                StringBuilder sb = new StringBuilder();
index 492365ad3fa73d69eb9aca2767f3825f17f65791..c3e39868dd7704418f5541ee7f7cee4d0055f33c 100644 (file)
@@ -60,7 +60,7 @@ public class TransferConfig {
        private final boolean fsckObjects;
 
        private TransferConfig(final Config rc) {
-               fsckObjects = rc.getBoolean("receive", "fsckobjects", false);
+               fsckObjects = rc.getBoolean("receive", "fsckobjects", false); //$NON-NLS-1$ //$NON-NLS-2$
        }
 
        /**
index affccf947abf20892c6f72615bcd60fc42aa5407..5a7c0a194ee002ca2725a31d2f2e984c685aff55 100644 (file)
@@ -127,7 +127,7 @@ public abstract class Transport {
 
        private static Enumeration<URL> catalogs(ClassLoader ldr) {
                try {
-                       String prefix = "META-INF/services/";
+                       String prefix = "META-INF/services/"; //$NON-NLS-1$
                        String name = prefix + Transport.class.getName();
                        return ldr.getResources(name);
                } catch (IOException err) {
@@ -139,7 +139,7 @@ public abstract class Transport {
                BufferedReader br;
                try {
                        InputStream urlIn = url.openStream();
-                       br = new BufferedReader(new InputStreamReader(urlIn, "UTF-8"));
+                       br = new BufferedReader(new InputStreamReader(urlIn, "UTF-8")); //$NON-NLS-1$
                } catch (IOException err) {
                        // If we cannot read from the service list, go to the next.
                        //
@@ -687,14 +687,14 @@ public abstract class Transport {
         * Acts as --tags.
         */
        public static final RefSpec REFSPEC_TAGS = new RefSpec(
-                       "refs/tags/*:refs/tags/*");
+                       "refs/tags/*:refs/tags/*"); //$NON-NLS-1$
 
        /**
         * Specification for push operation, to push all refs under refs/heads. Acts
         * as --all.
         */
        public static final RefSpec REFSPEC_PUSH_ALL = new RefSpec(
-                       "refs/heads/*:refs/heads/*");
+                       "refs/heads/*:refs/heads/*"); //$NON-NLS-1$
 
        /** The repository this transport fetches into, or pushes out of. */
        protected final Repository local;
index 01b845b15171f9195dd55020d8feb2828b91db3f..0a50fe2d290211b70ac4ed8a4955c5ac38e87b60 100644 (file)
@@ -98,11 +98,11 @@ import org.eclipse.jgit.lib.SymbolicRef;
  * @see WalkPushConnection
  */
 public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
-       static final String S3_SCHEME = "amazon-s3";
+       static final String S3_SCHEME = "amazon-s3"; //$NON-NLS-1$
 
        static final TransportProtocol PROTO_S3 = new TransportProtocol() {
                public String getName() {
-                       return "Amazon S3";
+                       return "Amazon S3"; //$NON-NLS-1$
                }
 
                public Set<String> getSchemes() {
@@ -151,9 +151,9 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
                bucket = uri.getHost();
 
                String p = uri.getPath();
-               if (p.startsWith("/"))
+               if (p.startsWith("/")) //$NON-NLS-1$
                        p = p.substring(1);
-               if (p.endsWith("/"))
+               if (p.endsWith("/")) //$NON-NLS-1$
                        p = p.substring(0, p.length() - 1);
                keyPrefix = p;
        }
@@ -170,8 +170,8 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
                        return loadPropertiesFile(propsFile);
 
                Properties props = new Properties();
-               props.setProperty("accesskey", uri.getUser());
-               props.setProperty("secretkey", uri.getPass());
+               props.setProperty("accesskey", uri.getUser()); //$NON-NLS-1$
+               props.setProperty("secretkey", uri.getPass()); //$NON-NLS-1$
                return props;
        }
 
@@ -187,7 +187,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
 
        @Override
        public FetchConnection openFetch() throws TransportException {
-               final DatabaseS3 c = new DatabaseS3(bucket, keyPrefix + "/objects");
+               final DatabaseS3 c = new DatabaseS3(bucket, keyPrefix + "/objects"); //$NON-NLS-1$
                final WalkFetchConnection r = new WalkFetchConnection(this, c);
                r.available(c.readAdvertisedRefs());
                return r;
@@ -195,7 +195,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
 
        @Override
        public PushConnection openPush() throws TransportException {
-               final DatabaseS3 c = new DatabaseS3(bucket, keyPrefix + "/objects");
+               final DatabaseS3 c = new DatabaseS3(bucket, keyPrefix + "/objects"); //$NON-NLS-1$
                final WalkPushConnection r = new WalkPushConnection(this, c);
                r.available(c.readAdvertisedRefs());
                return r;
@@ -217,14 +217,14 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
                }
 
                private String resolveKey(String subpath) {
-                       if (subpath.endsWith("/"))
+                       if (subpath.endsWith("/")) //$NON-NLS-1$
                                subpath = subpath.substring(0, subpath.length() - 1);
                        String k = objectsKey;
                        while (subpath.startsWith(ROOT_DIR)) {
                                k = k.substring(0, k.lastIndexOf('/'));
                                subpath = subpath.substring(3);
                        }
-                       return k + "/" + subpath;
+                       return k + "/" + subpath; //$NON-NLS-1$
                }
 
                @Override
@@ -232,7 +232,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
                        URIish u = new URIish();
                        u = u.setScheme(S3_SCHEME);
                        u = u.setHost(bucketName);
-                       u = u.setPath("/" + objectsKey);
+                       u = u.setPath("/" + objectsKey); //$NON-NLS-1$
                        return u;
                }
 
@@ -255,14 +255,14 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
                @Override
                Collection<String> getPackNames() throws IOException {
                        final HashSet<String> have = new HashSet<String>();
-                       have.addAll(s3.list(bucket, resolveKey("pack")));
+                       have.addAll(s3.list(bucket, resolveKey("pack"))); //$NON-NLS-1$
 
                        final Collection<String> packs = new ArrayList<String>();
                        for (final String n : have) {
-                               if (!n.startsWith("pack-") || !n.endsWith(".pack"))
+                               if (!n.startsWith("pack-") || !n.endsWith(".pack")) //$NON-NLS-1$ //$NON-NLS-2$
                                        continue;
 
-                               final String in = n.substring(0, n.length() - 5) + ".idx";
+                               final String in = n.substring(0, n.length() - 5) + ".idx"; //$NON-NLS-1$
                                if (have.contains(in))
                                        packs.add(n);
                        }
@@ -307,8 +307,8 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
                                throws TransportException {
                        try {
                                for (final String n : s3.list(bucket, resolveKey(ROOT_DIR
-                                               + "refs")))
-                                       readRef(avail, "refs/" + n);
+                                               + "refs"))) //$NON-NLS-1$
+                                       readRef(avail, "refs/" + n); //$NON-NLS-1$
                        } catch (IOException e) {
                                throw new TransportException(getURI(), JGitText.get().cannotListRefs, e);
                        }
@@ -335,8 +335,8 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
                        if (s == null)
                                throw new TransportException(getURI(), MessageFormat.format(JGitText.get().transportExceptionEmptyRef, rn));
 
-                       if (s.startsWith("ref: ")) {
-                               final String target = s.substring("ref: ".length());
+                       if (s.startsWith("ref: ")) { //$NON-NLS-1$
+                               final String target = s.substring("ref: ".length()); //$NON-NLS-1$
                                Ref r = avail.get(target);
                                if (r == null)
                                        r = readRef(avail, target);
index 05be0bbdf7a6e7130f24e7ee90f05716bc92de4b..6a285e59f57c4da741cfd2f0b8e81ecd67a3e610 100644 (file)
@@ -58,5 +58,5 @@ public interface TransportBundle extends PackTransport {
        /**
         * Bundle signature
         */
-       public static final String V2_BUNDLE_SIGNATURE = "# v2 git bundle";
+       public static final String V2_BUNDLE_SIGNATURE = "# v2 git bundle"; //$NON-NLS-1$
 }
index 05313dc7c8411c61ddfff5c9fb06844d5155ae2c..32de7dedd7eb782460bef478ecb7cb41f9c4ecd5 100644 (file)
@@ -92,8 +92,8 @@ class TransportBundleFile extends Transport implements TransportBundle {
                @Override
                public Transport open(URIish uri, Repository local, String remoteName)
                                throws NotSupportedException, TransportException {
-                       if ("bundle".equals(uri.getScheme())) {
-                               File path = local.getFS().resolve(new File("."), uri.getPath());
+                       if ("bundle".equals(uri.getScheme())) { //$NON-NLS-1$
+                               File path = local.getFS().resolve(new File("."), uri.getPath()); //$NON-NLS-1$
                                return new TransportBundleFile(local, uri, path);
                        }
 
index 2bc895c56bc395f9b8782c406cbb903a8a08ad12..4fca19ce8099316b49a19ebc06d8d9c7becf04f6 100644 (file)
@@ -151,10 +151,10 @@ class TransportGitAnon extends TcpTransport implements PackTransport {
                cmd.append(' ');
                cmd.append(uri.getPath());
                cmd.append('\0');
-               cmd.append("host=");
+               cmd.append("host="); //$NON-NLS-1$
                cmd.append(uri.getHost());
                if (uri.getPort() > 0 && uri.getPort() != GIT_PORT) {
-                       cmd.append(":");
+                       cmd.append(":"); //$NON-NLS-1$
                        cmd.append(uri.getPort());
                }
                cmd.append('\0');
@@ -176,7 +176,7 @@ class TransportGitAnon extends TcpTransport implements PackTransport {
                                sOut = new SafeBufferedOutputStream(sOut);
 
                                init(sIn, sOut);
-                               service("git-upload-pack", pckOut);
+                               service("git-upload-pack", pckOut); //$NON-NLS-1$
                        } catch (IOException err) {
                                close();
                                throw new TransportException(uri,
@@ -215,7 +215,7 @@ class TransportGitAnon extends TcpTransport implements PackTransport {
                                sOut = new SafeBufferedOutputStream(sOut);
 
                                init(sIn, sOut);
-                               service("git-receive-pack", pckOut);
+                               service("git-receive-pack", pckOut); //$NON-NLS-1$
                        } catch (IOException err) {
                                close();
                                throw new TransportException(uri,
index 16e778da0df301b1228f32c64d8fb3364f0a416d..dde4d20585a15e3aad9a1a2b9f8581c662793e0d 100644 (file)
@@ -154,7 +154,7 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
 
        String commandFor(final String exe) {
                String path = uri.getPath();
-               if (uri.getScheme() != null && uri.getPath().startsWith("/~"))
+               if (uri.getScheme() != null && uri.getPath().startsWith("/~")) //$NON-NLS-1$
                        path = (uri.getPath().substring(1));
 
                final StringBuilder cmd = new StringBuilder();
@@ -181,13 +181,13 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
                        return nf;
 
                String path = uri.getPath();
-               if (uri.getScheme() != null && uri.getPath().startsWith("/~"))
+               if (uri.getScheme() != null && uri.getPath().startsWith("/~")) //$NON-NLS-1$
                        path = uri.getPath().substring(1);
 
                final StringBuilder pfx = new StringBuilder();
-               pfx.append("fatal: ");
+               pfx.append("fatal: "); //$NON-NLS-1$
                pfx.append(QuotedString.BOURNE.quote(path));
-               pfx.append(": ");
+               pfx.append(": "); //$NON-NLS-1$
                if (why.startsWith(pfx.toString()))
                        why = why.substring(pfx.length());
 
@@ -195,25 +195,25 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
        }
 
        private static boolean useExtSession() {
-               return SystemReader.getInstance().getenv("GIT_SSH") != null;
+               return SystemReader.getInstance().getenv("GIT_SSH") != null; //$NON-NLS-1$
        }
 
        private class ExtSession implements RemoteSession {
                public Process exec(String command, int timeout)
                                throws TransportException {
-                       String ssh = SystemReader.getInstance().getenv("GIT_SSH");
-                       boolean putty = ssh.toLowerCase().contains("plink");
+                       String ssh = SystemReader.getInstance().getenv("GIT_SSH"); //$NON-NLS-1$
+                       boolean putty = ssh.toLowerCase().contains("plink"); //$NON-NLS-1$
 
                        List<String> args = new ArrayList<String>();
                        args.add(ssh);
-                       if (putty && !ssh.toLowerCase().contains("tortoiseplink"))
-                               args.add("-batch");
+                       if (putty && !ssh.toLowerCase().contains("tortoiseplink")) //$NON-NLS-1$
+                               args.add("-batch"); //$NON-NLS-1$
                        if (0 < getURI().getPort()) {
-                               args.add(putty ? "-P" : "-p");
+                               args.add(putty ? "-P" : "-p"); //$NON-NLS-1$ //$NON-NLS-2$
                                args.add(String.valueOf(getURI().getPort()));
                        }
                        if (getURI().getUser() != null)
-                               args.add(getURI().getUser() + "@" + getURI().getHost());
+                               args.add(getURI().getUser() + "@" + getURI().getHost()); //$NON-NLS-1$
                        else
                                args.add(getURI().getHost());
                        args.add(command);
index 5796ab3c73aed3a8550c7fc5bd39c0eb21a58160..3f1cebaaf8daa1a77c391574326515462f9d5a9f 100644 (file)
@@ -226,7 +226,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
 
                HttpConfig(final Config rc) {
                        postBuffer = rc.getInt("http", "postbuffer", 1 * 1024 * 1024); //$NON-NLS-1$  //$NON-NLS-2$
-                       sslVerify = rc.getBoolean("http", "sslVerify", true);
+                       sslVerify = rc.getBoolean("http", "sslVerify", true); //$NON-NLS-1$ //$NON-NLS-2$
                }
 
                private HttpConfig() {
@@ -505,7 +505,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
                final Proxy proxy = HttpSupport.proxyFor(proxySelector, u);
                HttpURLConnection conn = (HttpURLConnection) u.openConnection(proxy);
 
-               if (!http.sslVerify && "https".equals(u.getProtocol())) {
+               if (!http.sslVerify && "https".equals(u.getProtocol())) { //$NON-NLS-1$
                        disableSslVerify(conn);
                }
 
@@ -528,7 +528,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
                        throws IOException {
                final TrustManager[] trustAllCerts = new TrustManager[] { new DummyX509TrustManager() };
                try {
-                       SSLContext ctx = SSLContext.getInstance("SSL");
+                       SSLContext ctx = SSLContext.getInstance("SSL"); //$NON-NLS-1$
                        ctx.init(null, trustAllCerts, null);
                        final HttpsURLConnection sslConn = (HttpsURLConnection) conn;
                        sslConn.setSSLSocketFactory(ctx.getSocketFactory());
index 5a23ae18d8258ae7a93f38b7c6321b243e834321..c783898c00560c3ca20980b46ac761203c9ec4e9 100644 (file)
@@ -150,7 +150,7 @@ class TransportLocal extends Transport implements PackTransport {
        @Override
        public FetchConnection openFetch() throws TransportException {
                final String up = getOptionUploadPack();
-               if ("git-upload-pack".equals(up) || "git upload-pack".equals(up))
+               if ("git-upload-pack".equals(up) || "git upload-pack".equals(up)) //$NON-NLS-1$ //$NON-NLS-2$
                        return new InternalLocalFetchConnection();
                return new ForkLocalFetchConnection();
        }
@@ -159,7 +159,7 @@ class TransportLocal extends Transport implements PackTransport {
        public PushConnection openPush() throws NotSupportedException,
                        TransportException {
                final String rp = getOptionReceivePack();
-               if ("git-receive-pack".equals(rp) || "git receive-pack".equals(rp))
+               if ("git-receive-pack".equals(rp) || "git receive-pack".equals(rp)) //$NON-NLS-1$ //$NON-NLS-2$
                        return new InternalLocalPushConnection();
                return new ForkLocalPushConnection();
        }
@@ -172,20 +172,20 @@ class TransportLocal extends Transport implements PackTransport {
        protected Process spawn(final String cmd)
                        throws TransportException {
                try {
-                       String[] args = { "." };
+                       String[] args = { "." }; //$NON-NLS-1$
                        ProcessBuilder proc = local.getFS().runInShell(cmd, args);
                        proc.directory(remoteGitDir);
 
                        // Remove the same variables CGit does.
                        Map<String, String> env = proc.environment();
-                       env.remove("GIT_ALTERNATE_OBJECT_DIRECTORIES");
-                       env.remove("GIT_CONFIG");
-                       env.remove("GIT_CONFIG_PARAMETERS");
-                       env.remove("GIT_DIR");
-                       env.remove("GIT_WORK_TREE");
-                       env.remove("GIT_GRAFT_FILE");
-                       env.remove("GIT_INDEX_FILE");
-                       env.remove("GIT_NO_REPLACE_OBJECTS");
+                       env.remove("GIT_ALTERNATE_OBJECT_DIRECTORIES"); //$NON-NLS-1$
+                       env.remove("GIT_CONFIG"); //$NON-NLS-1$
+                       env.remove("GIT_CONFIG_PARAMETERS"); //$NON-NLS-1$
+                       env.remove("GIT_DIR"); //$NON-NLS-1$
+                       env.remove("GIT_WORK_TREE"); //$NON-NLS-1$
+                       env.remove("GIT_GRAFT_FILE"); //$NON-NLS-1$
+                       env.remove("GIT_INDEX_FILE"); //$NON-NLS-1$
+                       env.remove("GIT_NO_REPLACE_OBJECTS"); //$NON-NLS-1$
 
                        return proc.start();
                } catch (IOException err) {
@@ -230,7 +230,7 @@ class TransportLocal extends Transport implements PackTransport {
                                throw new TransportException(uri, JGitText.get().cannotConnectPipes, err);
                        }
 
-                       worker = new Thread("JGit-Upload-Pack") {
+                       worker = new Thread("JGit-Upload-Pack") { //$NON-NLS-1$
                                public void run() {
                                        try {
                                                final UploadPack rp = createUploadPack(dst);
@@ -362,7 +362,7 @@ class TransportLocal extends Transport implements PackTransport {
                                throw new TransportException(uri, JGitText.get().cannotConnectPipes, err);
                        }
 
-                       worker = new Thread("JGit-Receive-Pack") {
+                       worker = new Thread("JGit-Receive-Pack") { //$NON-NLS-1$
                                public void run() {
                                        try {
                                                final ReceivePack rp = createReceivePack(dst);
index dbb6c7ce0bb93244f4b840a4785ccc8988f33014..e99ba1c4aded74a0cdcea6e8a520ce8e83bb42d4 100644 (file)
@@ -166,14 +166,14 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                private ChannelSftp ftp;
 
                SftpObjectDB(String path) throws TransportException {
-                       if (path.startsWith("/~"))
+                       if (path.startsWith("/~")) //$NON-NLS-1$
                                path = path.substring(1);
-                       if (path.startsWith("~/"))
+                       if (path.startsWith("~/")) //$NON-NLS-1$
                                path = path.substring(2);
                        try {
                                ftp = newSftp();
                                ftp.cd(path);
-                               ftp.cd("objects");
+                               ftp.cd("objects"); //$NON-NLS-1$
                                objectsPath = ftp.pwd();
                        } catch (TransportException err) {
                                close();
@@ -224,7 +224,7 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                Collection<String> getPackNames() throws IOException {
                        final List<String> packs = new ArrayList<String>();
                        try {
-                               final Collection<ChannelSftp.LsEntry> list = ftp.ls("pack");
+                               final Collection<ChannelSftp.LsEntry> list = ftp.ls("pack"); //$NON-NLS-1$
                                final HashMap<String, ChannelSftp.LsEntry> files;
                                final HashMap<String, Integer> mtimes;
 
@@ -235,10 +235,10 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                                        files.put(ent.getFilename(), ent);
                                for (final ChannelSftp.LsEntry ent : list) {
                                        final String n = ent.getFilename();
-                                       if (!n.startsWith("pack-") || !n.endsWith(".pack"))
+                                       if (!n.startsWith("pack-") || !n.endsWith(".pack")) //$NON-NLS-1$
                                                continue;
 
-                                       final String in = n.substring(0, n.length() - 5) + ".idx";
+                                       final String in = n.substring(0, n.length() - 5) + ".idx"; //$NON-NLS-1$
                                        if (!files.containsKey(in))
                                                continue;
 
@@ -325,7 +325,7 @@ public class TransportSftp extends SshTransport implements WalkTransport {
 
                @Override
                void writeFile(final String path, final byte[] data) throws IOException {
-                       final String lock = path + ".lock";
+                       final String lock = path + ".lock"; //$NON-NLS-1$
                        try {
                                super.writeFile(lock, data);
                                try {
@@ -373,7 +373,7 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                        final TreeMap<String, Ref> avail = new TreeMap<String, Ref>();
                        readPackedRefs(avail);
                        readRef(avail, ROOT_DIR + Constants.HEAD, Constants.HEAD);
-                       readLooseRefs(avail, ROOT_DIR + "refs", "refs/");
+                       readLooseRefs(avail, ROOT_DIR + "refs", "refs/"); //$NON-NLS-1$ //$NON-NLS-2$
                        return avail;
                }
 
@@ -390,12 +390,12 @@ public class TransportSftp extends SshTransport implements WalkTransport {
 
                        for (final ChannelSftp.LsEntry ent : list) {
                                final String n = ent.getFilename();
-                               if (".".equals(n) || "..".equals(n))
+                               if (".".equals(n) || "..".equals(n)) //$NON-NLS-1$ //$NON-NLS-2$
                                        continue;
 
-                               final String nPath = dir + "/" + n;
+                               final String nPath = dir + "/" + n; //$NON-NLS-1$
                                if (ent.getAttrs().isDir())
-                                       readLooseRefs(avail, nPath, prefix + n + "/");
+                                       readLooseRefs(avail, nPath, prefix + n + "/"); //$NON-NLS-1$
                                else
                                        readRef(avail, nPath, prefix + n);
                        }
@@ -421,8 +421,8 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                        if (line == null)
                                throw new TransportException("Empty ref: " + name);
 
-                       if (line.startsWith("ref: ")) {
-                               final String target = line.substring("ref: ".length());
+                       if (line.startsWith("ref: ")) { //$NON-NLS-1$
+                               final String target = line.substring("ref: ".length()); //$NON-NLS-1$
                                Ref r = avail.get(target);
                                if (r == null)
                                        r = readRef(avail, ROOT_DIR + target, target);
index f2d3c8c235672e36c45eadb2b77ae0b15b77dada..cdd7fcde831ae99d4d0cc3271729ee4ebf9f73db 100644 (file)
@@ -73,7 +73,7 @@ public class URIish implements Serializable {
         * URI. Defines one capturing group containing the scheme without the
         * trailing colon and slashes
         */
-       private static final String SCHEME_P = "([a-z][a-z0-9+-]+)://";
+       private static final String SCHEME_P = "([a-z][a-z0-9+-]+)://"; //$NON-NLS-1$
 
        /**
         * Part of a pattern which matches the optional user/password part (e.g.
@@ -81,44 +81,44 @@ public class URIish implements Serializable {
         * capturing groups: the first containing the user and the second containing
         * the password
         */
-       private static final String OPT_USER_PWD_P = "(?:([^/:@]+)(?::([^\\\\/]+))?@)?";
+       private static final String OPT_USER_PWD_P = "(?:([^/:@]+)(?::([^\\\\/]+))?@)?"; //$NON-NLS-1$
 
        /**
         * Part of a pattern which matches the host part of URIs. Defines one
         * capturing group containing the host name.
         */
-       private static final String HOST_P = "([^\\\\/:]+)";
+       private static final String HOST_P = "([^\\\\/:]+)"; //$NON-NLS-1$
 
        /**
         * Part of a pattern which matches the optional port part of URIs. Defines
         * one capturing group containing the port without the preceding colon.
         */
-       private static final String OPT_PORT_P = "(?::(\\d+))?";
+       private static final String OPT_PORT_P = "(?::(\\d+))?"; //$NON-NLS-1$
 
        /**
         * Part of a pattern which matches the ~username part (e.g. /~root in
         * git://host.xyz/~root/a.git) of URIs. Defines no capturing group.
         */
-       private static final String USER_HOME_P = "(?:/~(?:[^\\\\/]+))";
+       private static final String USER_HOME_P = "(?:/~(?:[^\\\\/]+))"; //$NON-NLS-1$
 
        /**
         * Part of a pattern which matches the optional drive letter in paths (e.g.
         * D: in file:///D:/a.txt). Defines no capturing group.
         */
-       private static final String OPT_DRIVE_LETTER_P = "(?:[A-Za-z]:)?";
+       private static final String OPT_DRIVE_LETTER_P = "(?:[A-Za-z]:)?"; //$NON-NLS-1$
 
        /**
         * Part of a pattern which matches a relative path. Relative paths don't
         * start with slash or drive letters. Defines no capturing group.
         */
-       private static final String RELATIVE_PATH_P = "(?:(?:[^\\\\/]+[\\\\/])*[^\\\\/]+[\\\\/]?)";
+       private static final String RELATIVE_PATH_P = "(?:(?:[^\\\\/]+[\\\\/])*[^\\\\/]+[\\\\/]?)"; //$NON-NLS-1$
 
        /**
         * Part of a pattern which matches a relative or absolute path. Defines no
         * capturing group.
         */
-       private static final String PATH_P = "(" + OPT_DRIVE_LETTER_P + "[\\\\/]?"
-                       + RELATIVE_PATH_P + ")";
+       private static final String PATH_P = "(" + OPT_DRIVE_LETTER_P + "[\\\\/]?" //$NON-NLS-1$ //$NON-NLS-2$
+                       + RELATIVE_PATH_P + ")"; //$NON-NLS-1$
 
        private static final long serialVersionUID = 1L;
 
@@ -126,58 +126,58 @@ public class URIish implements Serializable {
         * A pattern matching standard URI: </br>
         * <code>scheme "://" user_password? hostname? portnumber? path</code>
         */
-       private static final Pattern FULL_URI = Pattern.compile("^" //
+       private static final Pattern FULL_URI = Pattern.compile("^" // //$NON-NLS-1$
                        + SCHEME_P //
-                       + "(?:" // start a group containing hostname and all options only
+                       + "(?:" // start a group containing hostname and all options only //$NON-NLS-1$
                                        // availabe when a hostname is there
                        + OPT_USER_PWD_P //
                        + HOST_P //
                        + OPT_PORT_P //
-                       + "(" // open a catpuring group the the user-home-dir part
-                       + (USER_HOME_P + "?") //
-                       + "[\\\\/])" //
-                       + ")?" // close the optional group containing hostname
-                       + "(.+)?" //
-                       + "$");
+                       + "(" // open a catpuring group the the user-home-dir part //$NON-NLS-1$
+                       + (USER_HOME_P + "?") // //$NON-NLS-1$
+                       + "[\\\\/])" // //$NON-NLS-1$
+                       + ")?" // close the optional group containing hostname //$NON-NLS-1$
+                       + "(.+)?" // //$NON-NLS-1$
+                       + "$"); //$NON-NLS-1$
 
        /**
         * A pattern matching the reference to a local file. This may be an absolute
         * path (maybe even containing windows drive-letters) or a relative path.
         */
-       private static final Pattern LOCAL_FILE = Pattern.compile("^" //
-                       + "([\\\\/]?" + PATH_P + ")" //
-                       + "$");
+       private static final Pattern LOCAL_FILE = Pattern.compile("^" // //$NON-NLS-1$
+                       + "([\\\\/]?" + PATH_P + ")" // //$NON-NLS-1$ //$NON-NLS-2$
+                       + "$"); //$NON-NLS-1$
 
        /**
         * A pattern matching a URI for the scheme 'file' which has only ':/' as
         * separator between scheme and path. Standard file URIs have '://' as
         * separator, but java.io.File.toURI() constructs those URIs.
         */
-       private static final Pattern SINGLE_SLASH_FILE_URI = Pattern.compile("^" //
-                       + "(file):([\\\\/](?![\\\\/])" //
+       private static final Pattern SINGLE_SLASH_FILE_URI = Pattern.compile("^" // //$NON-NLS-1$
+                       + "(file):([\\\\/](?![\\\\/])" // //$NON-NLS-1$
                        + PATH_P //
-                       + ")$");
+                       + ")$"); //$NON-NLS-1$
 
        /**
         * A pattern matching a SCP URI's of the form user@host:path/to/repo.git
         */
-       private static final Pattern RELATIVE_SCP_URI = Pattern.compile("^" //
+       private static final Pattern RELATIVE_SCP_URI = Pattern.compile("^" // //$NON-NLS-1$
                        + OPT_USER_PWD_P //
                        + HOST_P //
-                       + ":(" //
-                       + ("(?:" + USER_HOME_P + "[\\\\/])?") //
+                       + ":(" // //$NON-NLS-1$
+                       + ("(?:" + USER_HOME_P + "[\\\\/])?") // //$NON-NLS-1$ //$NON-NLS-2$
                        + RELATIVE_PATH_P //
-                       + ")$");
+                       + ")$"); //$NON-NLS-1$
 
        /**
         * A pattern matching a SCP URI's of the form user@host:/path/to/repo.git
         */
-       private static final Pattern ABSOLUTE_SCP_URI = Pattern.compile("^" //
+       private static final Pattern ABSOLUTE_SCP_URI = Pattern.compile("^" // //$NON-NLS-1$
                        + OPT_USER_PWD_P //
-                       + "([^\\\\/:]{2,})" //
-                       + ":(" //
-                       + "[\\\\/]" + RELATIVE_PATH_P //
-                       + ")$");
+                       + "([^\\\\/:]{2,})" // //$NON-NLS-1$
+                       + ":(" // //$NON-NLS-1$
+                       + "[\\\\/]" + RELATIVE_PATH_P // //$NON-NLS-1$
+                       + ")$"); //$NON-NLS-1$
 
        private String scheme;
 
@@ -201,7 +201,7 @@ public class URIish implements Serializable {
         */
        public URIish(String s) throws URISyntaxException {
                if (StringUtils.isEmptyOrNull(s)) {
-                       throw new URISyntaxException("The uri was empty or null",
+                       throw new URISyntaxException("The uri was empty or null", //$NON-NLS-1$
                                        JGitText.get().cannotParseGitURIish);
                }
                Matcher matcher = SINGLE_SLASH_FILE_URI.matcher(s);
@@ -284,7 +284,7 @@ public class URIish implements Serializable {
        private static final BitSet reservedChars = new BitSet(127);
 
        static {
-               for (byte b : Constants.encodeASCII("!*'();:@&=+$,/?#[]"))
+               for (byte b : Constants.encodeASCII("!*'();:@&=+$,/?#[]")) //$NON-NLS-1$
                        reservedChars.set(b);
        }
 
@@ -315,7 +315,7 @@ public class URIish implements Serializable {
                        if (b <= 32 || (encodeNonAscii && b > 127) || b == '%'
                                        || (escapeReservedChars && reservedChars.get(b))) {
                                os.write('%');
-                               byte[] tmp = Constants.encodeASCII(String.format("%02x",
+                               byte[] tmp = Constants.encodeASCII(String.format("%02x", //$NON-NLS-1$
                                                Integer.valueOf(b)));
                                os.write(tmp[0]);
                                os.write(tmp[1]);
@@ -329,7 +329,7 @@ public class URIish implements Serializable {
 
        private String n2e(String s) {
                if (s == null)
-                       return "";
+                       return ""; //$NON-NLS-1$
                else
                        return s;
        }
@@ -602,7 +602,7 @@ public class URIish implements Serializable {
                final StringBuilder r = new StringBuilder();
                if (getScheme() != null) {
                        r.append(getScheme());
-                       r.append("://");
+                       r.append("://"); //$NON-NLS-1$
                }
 
                if (getUser() != null) {
@@ -625,7 +625,7 @@ public class URIish implements Serializable {
 
                if (getPath() != null) {
                        if (getScheme() != null) {
-                               if (!getPath().startsWith("/"))
+                               if (!getPath().startsWith("/")) //$NON-NLS-1$
                                        r.append('/');
                        } else if (getHost() != null)
                                r.append(':');
@@ -691,14 +691,14 @@ public class URIish implements Serializable {
         * @see #getPath
         */
        public String getHumanishName() throws IllegalArgumentException {
-               if ("".equals(getPath()) || getPath() == null)
+               if ("".equals(getPath()) || getPath() == null) //$NON-NLS-1$
                        throw new IllegalArgumentException();
                String s = getPath();
                String[] elements;
-               if ("file".equals(scheme) || LOCAL_FILE.matcher(s).matches())
-                       elements = s.split("[\\" + File.separatorChar + "/]");
+               if ("file".equals(scheme) || LOCAL_FILE.matcher(s).matches()) //$NON-NLS-1$
+                       elements = s.split("[\\" + File.separatorChar + "/]"); //$NON-NLS-1$ //$NON-NLS-2$
                else
-                       elements = s.split("/");
+                       elements = s.split("/"); //$NON-NLS-1$
                if (elements.length == 0)
                        throw new IllegalArgumentException();
                String result = elements[elements.length - 1];
index c2cda5498131d32e219e5e7510d9825495f9efa1..74801fe41a167d5fdaf418fb5cd1831a79f8f03b 100644 (file)
@@ -133,9 +133,9 @@ public class UploadPack {
                        if (line.length() > 45) {
                                final HashSet<String> opts = new HashSet<String>();
                                String opt = line.substring(45);
-                               if (opt.startsWith(" "))
+                               if (opt.startsWith(" ")) //$NON-NLS-1$
                                        opt = opt.substring(1);
-                               for (String c : opt.split(" "))
+                               for (String c : opt.split(" ")) //$NON-NLS-1$
                                        opts.add(c);
                                this.line = line.substring(0, 45);
                                this.options = Collections.unmodifiableSet(opts);
@@ -271,10 +271,10 @@ public class UploadPack {
                walk = new RevWalk(db);
                walk.setRetainBody(false);
 
-               WANT = walk.newFlag("WANT");
-               PEER_HAS = walk.newFlag("PEER_HAS");
-               COMMON = walk.newFlag("COMMON");
-               SATISFIED = walk.newFlag("SATISFIED");
+               WANT = walk.newFlag("WANT"); //$NON-NLS-1$
+               PEER_HAS = walk.newFlag("PEER_HAS"); //$NON-NLS-1$
+               COMMON = walk.newFlag("COMMON"); //$NON-NLS-1$
+               SATISFIED = walk.newFlag("SATISFIED"); //$NON-NLS-1$
                walk.carry(PEER_HAS);
 
                SAVE = new RevFlagSet();
@@ -507,7 +507,7 @@ public class UploadPack {
 
                        if (timeout > 0) {
                                final Thread caller = Thread.currentThread();
-                               timer = new InterruptTimer(caller.getName() + "-Timer");
+                               timer = new InterruptTimer(caller.getName() + "-Timer"); //$NON-NLS-1$
                                TimeoutInputStream i = new TimeoutInputStream(rawIn, timer);
                                TimeoutOutputStream o = new TimeoutOutputStream(rawOut, timer);
                                i.setTimeout(timeout * 1000);
@@ -588,7 +588,7 @@ public class UploadPack {
                } catch (ServiceMayNotContinueException err) {
                        if (!err.isOutput() && err.getMessage() != null) {
                                try {
-                                       pckOut.writeString("ERR " + err.getMessage() + "\n");
+                                       pckOut.writeString("ERR " + err.getMessage() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
                                        err.setOutput();
                                } catch (Throwable err2) {
                                        // Ignore this secondary failure (and not mark output).
@@ -613,7 +613,7 @@ public class UploadPack {
 
        private void reportErrorDuringNegotiate(String msg) {
                try {
-                       pckOut.writeString("ERR " + msg + "\n");
+                       pckOut.writeString("ERR " + msg + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
                } catch (Throwable err) {
                        // Ignore this secondary failure.
                }
@@ -639,13 +639,13 @@ public class UploadPack {
                        // Commits at the boundary which aren't already shallow in
                        // the client need to be marked as such
                        if (c.getDepth() == depth && !clientShallowCommits.contains(c))
-                               pckOut.writeString("shallow " + o.name());
+                               pckOut.writeString("shallow " + o.name()); //$NON-NLS-1$
 
                        // Commits not on the boundary which are shallow in the client
                        // need to become unshallowed
                        if (c.getDepth() < depth && clientShallowCommits.contains(c)) {
                                unshallowCommits.add(c.copy());
-                               pckOut.writeString("unshallow " + c.name());
+                               pckOut.writeString("unshallow " + c.name()); //$NON-NLS-1$
                        }
                }
 
@@ -668,7 +668,7 @@ public class UploadPack {
                        advertiseRefsHook.advertiseRefs(this);
                } catch (ServiceMayNotContinueException fail) {
                        if (fail.getMessage() != null) {
-                               adv.writeOne("ERR " + fail.getMessage());
+                               adv.writeOne("ERR " + fail.getMessage()); //$NON-NLS-1$
                                fail.setOutput();
                        }
                        throw fail;
@@ -706,18 +706,18 @@ public class UploadPack {
                        if (line == PacketLineIn.END)
                                break;
 
-                       if (line.startsWith("deepen ")) {
+                       if (line.startsWith("deepen ")) { //$NON-NLS-1$
                                depth = Integer.parseInt(line.substring(7));
                                continue;
                        }
 
-                       if (line.startsWith("shallow ")) {
+                       if (line.startsWith("shallow ")) { //$NON-NLS-1$
                                clientShallowCommits.add(ObjectId.fromString(line.substring(8)));
                                continue;
                        }
 
-                       if (!line.startsWith("want ") || line.length() < 45)
-                               throw new PackProtocolException(MessageFormat.format(JGitText.get().expectedGot, "want", line));
+                       if (!line.startsWith("want ") || line.length() < 45) //$NON-NLS-1$
+                               throw new PackProtocolException(MessageFormat.format(JGitText.get().expectedGot, "want", line)); //$NON-NLS-1$
 
                        if (isFirst && line.length() > 45) {
                                final FirstLine firstLine = new FirstLine(line);
@@ -753,31 +753,31 @@ public class UploadPack {
                        if (line == PacketLineIn.END) {
                                last = processHaveLines(peerHas, last);
                                if (commonBase.isEmpty() || multiAck != MultiAck.OFF)
-                                       pckOut.writeString("NAK\n");
+                                       pckOut.writeString("NAK\n"); //$NON-NLS-1$
                                if (noDone && sentReady) {
-                                       pckOut.writeString("ACK " + last.name() + "\n");
+                                       pckOut.writeString("ACK " + last.name() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
                                        return true;
                                }
                                if (!biDirectionalPipe)
                                        return false;
                                pckOut.flush();
 
-                       } else if (line.startsWith("have ") && line.length() == 45) {
+                       } else if (line.startsWith("have ") && line.length() == 45) { //$NON-NLS-1$
                                peerHas.add(ObjectId.fromString(line.substring(5)));
 
-                       } else if (line.equals("done")) {
+                       } else if (line.equals("done")) { //$NON-NLS-1$
                                last = processHaveLines(peerHas, last);
 
                                if (commonBase.isEmpty())
-                                       pckOut.writeString("NAK\n");
+                                       pckOut.writeString("NAK\n"); //$NON-NLS-1$
 
                                else if (multiAck != MultiAck.OFF)
-                                       pckOut.writeString("ACK " + last.name() + "\n");
+                                       pckOut.writeString("ACK " + last.name() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 
                                return true;
 
                        } else {
-                               throw new PackProtocolException(MessageFormat.format(JGitText.get().expectedGot, "have", line));
+                               throw new PackProtocolException(MessageFormat.format(JGitText.get().expectedGot, "have", line)); //$NON-NLS-1$
                        }
                }
        }
@@ -877,13 +877,13 @@ public class UploadPack {
                                switch (multiAck) {
                                case OFF:
                                        if (commonBase.size() == 1)
-                                               pckOut.writeString("ACK " + obj.name() + "\n");
+                                               pckOut.writeString("ACK " + obj.name() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
                                        break;
                                case CONTINUE:
-                                       pckOut.writeString("ACK " + obj.name() + " continue\n");
+                                       pckOut.writeString("ACK " + obj.name() + " continue\n"); //$NON-NLS-1$ //$NON-NLS-2$
                                        break;
                                case DETAILED:
-                                       pckOut.writeString("ACK " + obj.name() + " common\n");
+                                       pckOut.writeString("ACK " + obj.name() + " common\n"); //$NON-NLS-1$ //$NON-NLS-2$
                                        break;
                                }
                        }
@@ -927,10 +927,10 @@ public class UploadPack {
                                                case OFF:
                                                        break;
                                                case CONTINUE:
-                                                       pckOut.writeString("ACK " + id.name() + " continue\n");
+                                                       pckOut.writeString("ACK " + id.name() + " continue\n"); //$NON-NLS-1$ //$NON-NLS-2$
                                                        break;
                                                case DETAILED:
-                                                       pckOut.writeString("ACK " + id.name() + " ready\n");
+                                                       pckOut.writeString("ACK " + id.name() + " ready\n"); //$NON-NLS-1$ //$NON-NLS-2$
                                                        sentReady = true;
                                                        break;
                                                }
@@ -943,7 +943,7 @@ public class UploadPack {
                if (multiAck == MultiAck.DETAILED && !didOkToGiveUp && okToGiveUp()) {
                        ObjectId id = peerHas.get(peerHas.size() - 1);
                        sentReady = true;
-                       pckOut.writeString("ACK " + id.name() + " ready\n");
+                       pckOut.writeString("ACK " + id.name() + " ready\n"); //$NON-NLS-1$ //$NON-NLS-2$
                        sentReady = true;
                }
 
@@ -1047,7 +1047,7 @@ public class UploadPack {
                        if (0 <= eof)
                                throw new CorruptObjectException(MessageFormat.format(
                                                JGitText.get().expectedEOFReceived,
-                                               "\\x" + Integer.toHexString(eof)));
+                                               "\\x" + Integer.toHexString(eof))); //$NON-NLS-1$
                }
 
                if (sideband) {
index db4ac63851120dd0ab2ff99ee2b3ea72432ed831..6caa5aa146f4bac472931030c1ec945516712690 100644 (file)
@@ -109,14 +109,14 @@ public class UsernamePasswordCredentialsProvider extends CredentialsProvider {
                                continue;
                        }
                        if (i instanceof CredentialItem.StringType) {
-                               if (i.getPromptText().equals("Password: ")) {
+                               if (i.getPromptText().equals("Password: ")) { //$NON-NLS-1$
                                        ((CredentialItem.StringType) i).setValue(new String(
                                                        password));
                                        continue;
                                }
                        }
                        throw new UnsupportedCredentialItem(uri, i.getClass().getName()
-                                       + ":" + i.getPromptText());
+                                       + ":" + i.getPromptText()); //$NON-NLS-1$
                }
                return true;
        }
index 080dc35e6a9116a37d51f512fb1e19afded9d097..e55b984380e4840be7e91ada68bfc9507865bfb1 100644 (file)
@@ -67,9 +67,9 @@ import org.eclipse.jgit.internal.JGitText;
 abstract class WalkEncryption {
        static final WalkEncryption NONE = new NoEncryption();
 
-       static final String JETS3T_CRYPTO_VER = "jets3t-crypto-ver";
+       static final String JETS3T_CRYPTO_VER = "jets3t-crypto-ver"; //$NON-NLS-1$
 
-       static final String JETS3T_CRYPTO_ALG = "jets3t-crypto-alg";
+       static final String JETS3T_CRYPTO_ALG = "jets3t-crypto-alg"; //$NON-NLS-1$
 
        abstract OutputStream encrypt(OutputStream os) throws IOException;
 
@@ -85,13 +85,13 @@ abstract class WalkEncryption {
 
                v = u.getHeaderField(p + JETS3T_CRYPTO_VER);
                if (v == null)
-                       v = "";
+                       v = ""; //$NON-NLS-1$
                if (!version.equals(v))
                        throw new IOException(MessageFormat.format(JGitText.get().unsupportedEncryptionVersion, v));
 
                v = u.getHeaderField(p + JETS3T_CRYPTO_ALG);
                if (v == null)
-                       v = "";
+                       v = ""; //$NON-NLS-1$
                if (!name.equals(v))
                        throw new IOException(JGitText.get().unsupportedEncryptionAlgorithm + v);
        }
@@ -112,7 +112,7 @@ abstract class WalkEncryption {
                @Override
                void validate(final HttpURLConnection u, final String p)
                                throws IOException {
-                       validateImpl(u, p, "", "");
+                       validateImpl(u, p, "", ""); //$NON-NLS-1$ //$NON-NLS-2$
                }
 
                @Override
@@ -150,14 +150,14 @@ abstract class WalkEncryption {
 
                @Override
                void request(final HttpURLConnection u, final String prefix) {
-                       u.setRequestProperty(prefix + JETS3T_CRYPTO_VER, "2");
+                       u.setRequestProperty(prefix + JETS3T_CRYPTO_VER, "2"); //$NON-NLS-1$
                        u.setRequestProperty(prefix + JETS3T_CRYPTO_ALG, algorithmName);
                }
 
                @Override
                void validate(final HttpURLConnection u, final String p)
                                throws IOException {
-                       validateImpl(u, p, "2", algorithmName);
+                       validateImpl(u, p, "2", algorithmName); //$NON-NLS-1$
                }
 
                @Override
index f1710bd5c0c26ae0a53d70b71c1bf9adcd7be072..e1ce5d6523b407b64cd94bf853e020e16ed91378 100644 (file)
@@ -212,9 +212,9 @@ class WalkFetchConnection extends BaseFetchConnection {
                revWalk = new RevWalk(reader);
                revWalk.setRetainBody(false);
                treeWalk = new TreeWalk(reader);
-               COMPLETE = revWalk.newFlag("COMPLETE");
-               IN_WORK_QUEUE = revWalk.newFlag("IN_WORK_QUEUE");
-               LOCALLY_SEEN = revWalk.newFlag("LOCALLY_SEEN");
+               COMPLETE = revWalk.newFlag("COMPLETE"); //$NON-NLS-1$
+               IN_WORK_QUEUE = revWalk.newFlag("IN_WORK_QUEUE"); //$NON-NLS-1$
+               LOCALLY_SEEN = revWalk.newFlag("LOCALLY_SEEN"); //$NON-NLS-1$
 
                localCommitQueue = new DateRevQueue();
                workQueue = new LinkedList<ObjectId>();
@@ -406,7 +406,7 @@ class WalkFetchConnection extends BaseFetchConnection {
                        final String idStr = id.name();
                        final String subdir = idStr.substring(0, 2);
                        final String file = idStr.substring(2);
-                       final String looseName = subdir + "/" + file;
+                       final String looseName = subdir + "/" + file; //$NON-NLS-1$
 
                        for (int i = lastRemoteIdx; i < remotes.size(); i++) {
                                if (downloadLooseObject(id, looseName, remotes.get(i))) {
@@ -791,17 +791,18 @@ class WalkFetchConnection extends BaseFetchConnection {
                RemotePack(final WalkRemoteObjectDatabase c, final String pn) {
                        connection = c;
                        packName = pn;
-                       idxName = packName.substring(0, packName.length() - 5) + ".idx";
+                       idxName = packName.substring(0, packName.length() - 5) + ".idx"; //$NON-NLS-1$
 
                        String tn = idxName;
-                       if (tn.startsWith("pack-"))
+                       if (tn.startsWith("pack-")) //$NON-NLS-1$
                                tn = tn.substring(5);
-                       if (tn.endsWith(".idx"))
+                       if (tn.endsWith(".idx")) //$NON-NLS-1$
                                tn = tn.substring(0, tn.length() - 4);
 
                        if (local.getObjectDatabase() instanceof ObjectDirectory) {
                                tmpIdx = new File(((ObjectDirectory) local.getObjectDatabase())
-                                               .getDirectory(), "walk-" + tn + ".walkidx");
+                                                               .getDirectory(),
+                                               "walk-" + tn + ".walkidx"); //$NON-NLS-1$ //$NON-NLS-2$
                        }
                }
 
@@ -809,7 +810,7 @@ class WalkFetchConnection extends BaseFetchConnection {
                        if (index != null)
                                return;
                        if (tmpIdx == null)
-                               tmpIdx = File.createTempFile("jgit-walk-", ".idx");
+                               tmpIdx = File.createTempFile("jgit-walk-", ".idx"); //$NON-NLS-1$ //$NON-NLS-2$
                        else if (tmpIdx.isFile()) {
                                try {
                                        index = PackIndex.open(tmpIdx);
@@ -820,8 +821,8 @@ class WalkFetchConnection extends BaseFetchConnection {
                        }
 
                        final WalkRemoteObjectDatabase.FileStream s;
-                       s = connection.open("pack/" + idxName);
-                       pm.beginTask("Get " + idxName.substring(0, 12) + "..idx",
+                       s = connection.open("pack/" + idxName); //$NON-NLS-1$
+                       pm.beginTask("Get " + idxName.substring(0, 12) + "..idx", //$NON-NLS-1$ //$NON-NLS-2$
                                        s.length < 0 ? ProgressMonitor.UNKNOWN
                                                        : (int) (s.length / 1024));
                        try {
@@ -858,7 +859,7 @@ class WalkFetchConnection extends BaseFetchConnection {
                }
 
                void downloadPack(final ProgressMonitor monitor) throws IOException {
-                       String name = "pack/" + packName;
+                       String name = "pack/" + packName; //$NON-NLS-1$
                        WalkRemoteObjectDatabase.FileStream s = connection.open(name);
                        PackParser parser = inserter.newPackParser(s.in);
                        parser.setAllowThin(false);
index 9b22aefebe3a988e16dd4b964c53d60e1f15a907..78fe30a0bb6e0f1df89c72192ad605e7b11bf966 100644 (file)
@@ -149,7 +149,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
                final List<RemoteRefUpdate> updates = new ArrayList<RemoteRefUpdate>();
                for (final RemoteRefUpdate u : refUpdates.values()) {
                        final String n = u.getRemoteName();
-                       if (!n.startsWith("refs/") || !Repository.isValidRefName(n)) {
+                       if (!n.startsWith("refs/") || !Repository.isValidRefName(n)) { //$NON-NLS-1$
                                u.setStatus(Status.REJECTED_OTHER_REASON);
                                u.setMessage(JGitText.get().funnyRefname);
                                continue;
@@ -239,10 +239,10 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
                        for (final String n : dest.getPackNames())
                                packNames.put(n, n);
 
-                       final String base = "pack-" + writer.computeName().name();
-                       final String packName = base + ".pack";
-                       pathPack = "pack/" + packName;
-                       pathIdx = "pack/" + base + ".idx";
+                       final String base = "pack-" + writer.computeName().name(); //$NON-NLS-1$
+                       final String packName = base + ".pack"; //$NON-NLS-1$
+                       pathPack = "pack/" + packName; //$NON-NLS-1$
+                       pathIdx = "pack/" + base + ".idx"; //$NON-NLS-1$ //$NON-NLS-2$
 
                        if (packNames.remove(packName) != null) {
                                // The remote already contains this pack. We should
@@ -256,8 +256,8 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
                        // Write the pack file, then the index, as readers look the
                        // other direction (index, then pack file).
                        //
-                       final String wt = "Put " + base.substring(0, 12);
-                       OutputStream os = dest.writeFile(pathPack, monitor, wt + "..pack");
+                       final String wt = "Put " + base.substring(0, 12); //$NON-NLS-1$
+                       OutputStream os = dest.writeFile(pathPack, monitor, wt + "..pack"); //$NON-NLS-1$
                        try {
                                os = new SafeBufferedOutputStream(os);
                                writer.writePack(monitor, monitor, os);
@@ -265,7 +265,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
                                os.close();
                        }
 
-                       os = dest.writeFile(pathIdx, monitor, wt + "..idx");
+                       os = dest.writeFile(pathIdx, monitor, wt + "..idx"); //$NON-NLS-1$
                        try {
                                os = new SafeBufferedOutputStream(os);
                                writer.writeIndex(os);
@@ -354,7 +354,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
        private void createNewRepository(final List<RemoteRefUpdate> updates)
                        throws TransportException {
                try {
-                       final String ref = "ref: " + pickHEAD(updates) + "\n";
+                       final String ref = "ref: " + pickHEAD(updates) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
                        final byte[] bytes = Constants.encode(ref);
                        dest.writeFile(ROOT_DIR + Constants.HEAD, bytes);
                } catch (IOException e) {
@@ -362,8 +362,8 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
                }
 
                try {
-                       final String config = "[core]\n"
-                                       + "\trepositoryformatversion = 0\n";
+                       final String config = "[core]\n" //$NON-NLS-1$
+                                       + "\trepositoryformatversion = 0\n"; //$NON-NLS-1$
                        final byte[] bytes = Constants.encode(config);
                        dest.writeFile(ROOT_DIR + Constants.CONFIG, bytes);
                } catch (IOException e) {
index 8d6937df4ae0aacbc0a80147c1065b6b01c3c149..59a9f56825b5c2cb6a19bfeb23acb93695a9353c 100644 (file)
@@ -76,13 +76,13 @@ import org.eclipse.jgit.util.IO;
  * independent {@link WalkFetchConnection}.
  */
 abstract class WalkRemoteObjectDatabase {
-       static final String ROOT_DIR = "../";
+       static final String ROOT_DIR = "../"; //$NON-NLS-1$
 
-       static final String INFO_PACKS = "info/packs";
+       static final String INFO_PACKS = "info/packs"; //$NON-NLS-1$
 
-       static final String INFO_ALTERNATES = "info/alternates";
+       static final String INFO_ALTERNATES = "info/alternates"; //$NON-NLS-1$
 
-       static final String INFO_HTTP_ALTERNATES = "info/http-alternates";
+       static final String INFO_HTTP_ALTERNATES = "info/http-alternates"; //$NON-NLS-1$
 
        static final String INFO_REFS = ROOT_DIR + Constants.INFO_REFS;
 
@@ -292,7 +292,7 @@ abstract class WalkRemoteObjectDatabase {
         *             deletion is not supported, or deletion failed.
         */
        void deleteRefLog(final String name) throws IOException {
-               deleteFile(ROOT_DIR + Constants.LOGS + "/" + name);
+               deleteFile(ROOT_DIR + Constants.LOGS + "/" + name); //$NON-NLS-1$
        }
 
        /**
@@ -336,7 +336,7 @@ abstract class WalkRemoteObjectDatabase {
        void writeInfoPacks(final Collection<String> packNames) throws IOException {
                final StringBuilder w = new StringBuilder();
                for (final String n : packNames) {
-                       w.append("P ");
+                       w.append("P "); //$NON-NLS-1$
                        w.append(n);
                        w.append('\n');
                }
@@ -398,8 +398,8 @@ abstract class WalkRemoteObjectDatabase {
                                String line = br.readLine();
                                if (line == null)
                                        break;
-                               if (!line.endsWith("/"))
-                                       line += "/";
+                               if (!line.endsWith("/")) //$NON-NLS-1$
+                                       line += "/"; //$NON-NLS-1$
                                alts.add(openAlternate(line));
                        }
                        return alts;
index 1d4f2beb1810559dc14a1ae1906b42f2f7d101a4..6964e7fa2800e1213094684051bde1801342cc86 100644 (file)
@@ -222,7 +222,7 @@ public class FileResolver<C> implements RepositoryResolver<C> {
                if (isExportAll())
                        return true;
                else if (db.getDirectory() != null)
-                       return new File(db.getDirectory(), "git-daemon-export-ok").exists();
+                       return new File(db.getDirectory(), "git-daemon-export-ok").exists(); //$NON-NLS-1$
                else
                        return false;
        }
@@ -242,13 +242,13 @@ public class FileResolver<C> implements RepositoryResolver<C> {
                if (new File(name).isAbsolute())
                        return true; // no absolute paths
 
-               if (name.startsWith("../"))
-                       return true; // no "l../etc/passwd"
-               if (name.contains("/../"))
-                       return true; // no "foo/../etc/passwd"
-               if (name.contains("/./"))
-                       return true; // "foo/./foo" is insane to ask
-               if (name.contains("//"))
+               if (name.startsWith("../")) //$NON-NLS-1$
+                       return true; // no "l../etc/passwd" 
+               if (name.contains("/../")) //$NON-NLS-1$
+                       return true; // no "foo/../etc/passwd" 
+               if (name.contains("/./")) //$NON-NLS-1$
+                       return true; // "foo/./foo" is insane to ask 
+               if (name.contains("//")) //$NON-NLS-1$
                        return true; // double slashes is sloppy, don't use it
 
                return false; // is a reasonable name
index 0b8df130f8b6a17347dea04d8889dda9deca8885..4cf79c0a27e9413bf31c6f09257cbc841150c33a 100644 (file)
@@ -672,8 +672,9 @@ public abstract class AbstractTreeIterator {
                System.arraycopy(path, pathOffset, buffer, offset, pathLen - pathOffset);
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
-               return getClass().getSimpleName() + "[" + getEntryPathString() + "]";
+               return getClass().getSimpleName() + "[" + getEntryPathString() + "]"; //$NON-NLS-1$
        }
 }
index 9ee5f8b11d4555fcbb2e6c6d6dee41201ba5b0a3..e16bf7ffa9d2578d320db9e1c645b8592cd5b2a8 100644 (file)
@@ -646,7 +646,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
                        if (e == null)
                                continue;
                        final String name = e.getName();
-                       if (".".equals(name) || "..".equals(name))
+                       if (".".equals(name) || "..".equals(name)) //$NON-NLS-1$ //$NON-NLS-2$
                                continue;
                        if (Constants.DOT_GIT.equals(name))
                                continue;
@@ -937,7 +937,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
                }
 
                public String toString() {
-                       return getMode().toString() + " " + getName();
+                       return getMode().toString() + " " + getName(); //$NON-NLS-1$
                }
 
                /**
@@ -1054,7 +1054,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
                                        .getExcludesFile();
                        if (path != null) {
                                File excludesfile;
-                               if (path.startsWith("~/"))
+                               if (path.startsWith("~/")) //$NON-NLS-1$
                                        excludesfile = fs.resolve(fs.userHome(), path.substring(2));
                                else
                                        excludesfile = fs.resolve(null, path);
@@ -1062,7 +1062,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
                        }
 
                        File exclude = fs
-                                       .resolve(repository.getDirectory(), "info/exclude");
+                                       .resolve(repository.getDirectory(), "info/exclude"); //$NON-NLS-1$
                        loadRulesFromFile(r, exclude);
 
                        return r.getRules().isEmpty() ? null : r;
index 01d2bd0421a1a803fc988cc1f6688fbb847e1433..d5e7464d4fbfd8ae658a55c65a4d35d24a66c070 100644 (file)
@@ -141,6 +141,7 @@ public abstract class AndTreeFilter extends TreeFilter {
                        return new Binary(a.clone(), b.clone());
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
                        return "(" + a.toString() + " AND " + b.toString() + ")";
@@ -181,6 +182,7 @@ public abstract class AndTreeFilter extends TreeFilter {
                        return new List(s);
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
                        final StringBuilder r = new StringBuilder();
index 34e92b6b1b28f2b202ce5de36740637f624d13fc..4e44a76c995335a2678f7c13a95e37f9adc4b293 100644 (file)
@@ -226,7 +226,7 @@ public class IndexDiffFilter extends TreeFilter {
                String pathToBeSaved = null;
                while (!untrackedParentFolders.isEmpty()
                                && !currentPath.startsWith(untrackedParentFolders.getFirst()
-                                               + "/"))
+                                               + "/")) //$NON-NLS-1$
                        pathToBeSaved = untrackedParentFolders.removeFirst();
                if (pathToBeSaved != null) {
                        while (!untrackedFolders.isEmpty()
@@ -254,7 +254,7 @@ public class IndexDiffFilter extends TreeFilter {
 
        @Override
        public String toString() {
-               return "INDEX_DIFF_FILTER";
+               return "INDEX_DIFF_FILTER"; //$NON-NLS-1$
        }
 
        /**
index 2e96d2ffa460f5a32c873d1630515cbe180e7f1a..7f30cc7d08173f7ad8772f37b1b4108c559ca246 100644 (file)
@@ -83,6 +83,7 @@ public class NotIgnoredFilter extends TreeFilter {
                return this;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return "NotIgnored(" + index + ")";
index 717e8e1d0cb83dda5931a634fe4f0f05489b049e..8ec04bb32db6b69cd52359aefa8a4cd07cde4f61 100644 (file)
@@ -94,6 +94,6 @@ public class NotTreeFilter extends TreeFilter {
 
        @Override
        public String toString() {
-               return "NOT " + a.toString();
+               return "NOT " + a.toString(); //$NON-NLS-1$
        }
 }
index 8e934f01de72f5854b3c0da7c56a047e4804bbd5..270633ce63d7c2e1b849429f9c32610a06e2d2ff 100644 (file)
@@ -139,6 +139,7 @@ public abstract class OrTreeFilter extends TreeFilter {
                        return new Binary(a.clone(), b.clone());
                }
 
+               @SuppressWarnings("nls")
                @Override
                public String toString() {
                        return "(" + a.toString() + " OR " + b.toString() + ")";
@@ -182,13 +183,13 @@ public abstract class OrTreeFilter extends TreeFilter {
                @Override
                public String toString() {
                        final StringBuilder r = new StringBuilder();
-                       r.append("(");
+                       r.append("("); //$NON-NLS-1$
                        for (int i = 0; i < subfilters.length; i++) {
                                if (i > 0)
-                                       r.append(" OR ");
+                                       r.append(" OR "); //$NON-NLS-1$
                                r.append(subfilters[i].toString());
                        }
-                       r.append(")");
+                       r.append(")"); //$NON-NLS-1$
                        return r.toString();
                }
        }
index b3494bf6ee3e09874bb7e3dc3f638857656e8355..d85ea8cc5dee83a85e570527a73bd910677cd83c 100644 (file)
@@ -74,7 +74,7 @@ public class PathFilter extends TreeFilter {
         *             the path supplied was the empty string.
         */
        public static PathFilter create(String path) {
-               while (path.endsWith("/"))
+               while (path.endsWith("/")) //$NON-NLS-1$
                        path = path.substring(0, path.length() - 1);
                if (path.length() == 0)
                        throw new IllegalArgumentException(JGitText.get().emptyPathNotPermitted);
@@ -113,6 +113,7 @@ public class PathFilter extends TreeFilter {
                return this;
        }
 
+       @SuppressWarnings("nls")
        public String toString() {
                return "PATH(\"" + pathStr + "\")";
        }
index 8f6e5446926f2ddfdc0364bddd7a7f29614d04d0..51761a8126576dc939fc6c90a536d645d57a5c80 100644 (file)
@@ -172,7 +172,7 @@ public class PathFilterGroup {
                }
 
                public String toString() {
-                       return "FAST_" + path.toString();
+                       return "FAST_" + path.toString(); //$NON-NLS-1$
                }
        }
 
@@ -221,13 +221,13 @@ public class PathFilterGroup {
 
                public String toString() {
                        final StringBuilder r = new StringBuilder();
-                       r.append("FAST(");
+                       r.append("FAST("); //$NON-NLS-1$
                        for (int i = 0; i < paths.length; i++) {
                                if (i > 0)
-                                       r.append(" OR ");
+                                       r.append(" OR "); //$NON-NLS-1$
                                r.append(paths[i].toString());
                        }
-                       r.append(")");
+                       r.append(")"); //$NON-NLS-1$
                        return r.toString();
                }
        }
index d06a13ed89c10583a0d128ecbd353dcfa3d00c84..e6bedfd43eda31bcbf4ca9f11b8c79a7f12fc044 100644 (file)
@@ -89,6 +89,7 @@ public class SkipWorkTreeFilter extends TreeFilter {
                return this;
        }
 
+       @SuppressWarnings("nls")
        @Override
        public String toString() {
                return "SkipWorkTree(" + treeIdx + ")";
index acc1ae608a5b01b726143ef13791fc47ba9102f9..7d99e58f3804c8ebcbc0ce9d1a9c2f32689125c5 100644 (file)
@@ -106,7 +106,7 @@ public abstract class TreeFilter {
 
                @Override
                public String toString() {
-                       return "ALL";
+                       return "ALL"; //$NON-NLS-1$
                }
        }
 
@@ -156,7 +156,7 @@ public abstract class TreeFilter {
 
                @Override
                public String toString() {
-                       return "ANY_DIFF";
+                       return "ANY_DIFF"; //$NON-NLS-1$
                }
        }
 
index b59148fc303aec72e47e2721c6b2d9d8bd8b811f..ed5838a20e036d0f59cc7215db12bdc4e7ac0957 100644 (file)
@@ -40,7 +40,7 @@ public class Base64 {
        private final static byte INVALID_DEC = -3;
 
        /** Preferred encoding. */
-       private final static String UTF_8 = "UTF-8";
+       private final static String UTF_8 = "UTF-8"; //$NON-NLS-1$
 
        /** The 64 valid Base64 values. */
        private final static byte[] ENC;
@@ -54,10 +54,10 @@ public class Base64 {
 
        static {
                try {
-                       ENC = ("ABCDEFGHIJKLMNOPQRSTUVWXYZ" //
-                                       + "abcdefghijklmnopqrstuvwxyz" //
-                                       + "0123456789" //
-                                       + "+/" //
+                       ENC = ("ABCDEFGHIJKLMNOPQRSTUVWXYZ" // //$NON-NLS-1$
+                                       + "abcdefghijklmnopqrstuvwxyz" // //$NON-NLS-1$
+                                       + "0123456789" // //$NON-NLS-1$
+                                       + "+/" // //$NON-NLS-1$
                        ).getBytes(UTF_8);
                } catch (UnsupportedEncodingException uee) {
                        throw new RuntimeException(uee.getMessage(), uee);
index a8e505d6e5fe2523901eec19f04a5648a4282a9c..a869b2beaca9c3164f7079a1bef3635d4dce2e1e 100644 (file)
@@ -61,16 +61,17 @@ import org.eclipse.jgit.lib.PersonIdent;
  */
 public class ChangeIdUtil {
 
-       static final String CHANGE_ID = "Change-Id:";
+       static final String CHANGE_ID = "Change-Id:"; //$NON-NLS-1$
 
        // package-private so the unit test can test this part only
+       @SuppressWarnings("nls")
        static String clean(String msg) {
                return msg.//
-                               replaceAll("(?i)(?m)^Signed-off-by:.*$\n?", "").//
-                               replaceAll("(?m)^#.*$\n?", "").//
-                               replaceAll("(?m)\n\n\n+", "\\\n").//
-                               replaceAll("\\n*$", "").//
-                               replaceAll("(?s)\ndiff --git.*", "").//
+                               replaceAll("(?i)(?m)^Signed-off-by:.*$\n?", "").// //$NON-NLS-1$
+                               replaceAll("(?m)^#.*$\n?", "").// //$NON-NLS-1$
+                               replaceAll("(?m)\n\n\n+", "\\\n").// //$NON-NLS-1$
+                               replaceAll("\\n*$", "").// //$NON-NLS-1$
+                               replaceAll("(?s)\ndiff --git.*", "").// //$NON-NLS-1$
                                trim();
        }
 
@@ -99,33 +100,33 @@ public class ChangeIdUtil {
                if (cleanMessage.length() == 0)
                        return null;
                StringBuilder b = new StringBuilder();
-               b.append("tree ");
+               b.append("tree "); //$NON-NLS-1$
                b.append(ObjectId.toString(treeId));
-               b.append("\n");
+               b.append("\n"); //$NON-NLS-1$
                if (firstParentId != null) {
-                       b.append("parent ");
+                       b.append("parent "); //$NON-NLS-1$
                        b.append(ObjectId.toString(firstParentId));
-                       b.append("\n");
+                       b.append("\n"); //$NON-NLS-1$
                }
-               b.append("author ");
+               b.append("author "); //$NON-NLS-1$
                b.append(author.toExternalString());
-               b.append("\n");
-               b.append("committer ");
+               b.append("\n"); //$NON-NLS-1$
+               b.append("committer "); //$NON-NLS-1$
                b.append(committer.toExternalString());
-               b.append("\n\n");
+               b.append("\n\n"); //$NON-NLS-1$
                b.append(cleanMessage);
                return new ObjectInserter.Formatter().idFor(Constants.OBJ_COMMIT, //
                                b.toString().getBytes(Constants.CHARACTER_ENCODING));
        }
 
        private static final Pattern issuePattern = Pattern
-                       .compile("^(Bug|Issue)[a-zA-Z0-9-]*:.*$");
+                       .compile("^(Bug|Issue)[a-zA-Z0-9-]*:.*$"); //$NON-NLS-1$
 
        private static final Pattern footerPattern = Pattern
-                       .compile("(^[a-zA-Z0-9-]+:(?!//).*$)");
+                       .compile("(^[a-zA-Z0-9-]+:(?!//).*$)"); //$NON-NLS-1$
 
        private static final Pattern includeInFooterPattern = Pattern
-                       .compile("^[ \\[].*$");
+                       .compile("^[ \\[].*$"); //$NON-NLS-1$
 
        /**
         * Find the right place to insert a Change-Id and return it.
@@ -167,12 +168,12 @@ public class ChangeIdUtil {
                                        i++;
                                String oldId = message.length() == (i + 40) ?
                                                message.substring(i) : message.substring(i, i + 41);
-                               message = message.replace(oldId, "I" + changeId.getName());
+                               message = message.replace(oldId, "I" + changeId.getName()); //$NON-NLS-1$
                        }
                        return message;
                }
 
-               String[] lines = message.split("\n");
+               String[] lines = message.split("\n"); //$NON-NLS-1$
                int footerFirstLine = lines.length;
                for (int i = lines.length - 1; i > 1; --i) {
                        if (footerPattern.matcher(lines[i]).matches()) {
@@ -202,17 +203,17 @@ public class ChangeIdUtil {
                int i = 0;
                for (; i < insertAfter; ++i) {
                        ret.append(lines[i]);
-                       ret.append("\n");
+                       ret.append("\n"); //$NON-NLS-1$
                }
                if (insertAfter == lines.length && insertAfter == footerFirstLine)
-                       ret.append("\n");
+                       ret.append("\n"); //$NON-NLS-1$
                ret.append(CHANGE_ID);
-               ret.append(" I");
+               ret.append(" I"); //$NON-NLS-1$
                ret.append(ObjectId.toString(changeId));
-               ret.append("\n");
+               ret.append("\n"); //$NON-NLS-1$
                for (; i < lines.length; ++i) {
                        ret.append(lines[i]);
-                       ret.append("\n");
+                       ret.append("\n"); //$NON-NLS-1$
                }
                return ret.toString();
        }
index 6eb020e52b11f06ae546b4e77e119682a2f6ac71..ae6197838ce5a935c00ce187a770c394a6a85f7a 100644 (file)
@@ -243,7 +243,7 @@ public abstract class FS {
                final String home = AccessController
                                .doPrivileged(new PrivilegedAction<String>() {
                                        public String run() {
-                                               return System.getProperty("user.home");
+                                               return System.getProperty("user.home"); //$NON-NLS-1$
                                        }
                                });
                if (home == null || home.length() == 0)
@@ -287,10 +287,10 @@ public abstract class FS {
         */
        protected static String readPipe(File dir, String[] command, String encoding) {
                final boolean debug = Boolean.parseBoolean(SystemReader.getInstance()
-                               .getProperty("jgit.fs.debug"));
+                               .getProperty("jgit.fs.debug")); //$NON-NLS-1$
                try {
                        if (debug)
-                               System.err.println("readpipe " + Arrays.asList(command) + ","
+                               System.err.println("readpipe " + Arrays.asList(command) + "," //$NON-NLS-1$ //$NON-NLS-2$
                                                + dir);
                        final Process p = Runtime.getRuntime().exec(command, null, dir);
                        final BufferedReader lineRead = new BufferedReader(
@@ -330,8 +330,8 @@ public abstract class FS {
                        try {
                                r = lineRead.readLine();
                                if (debug) {
-                                       System.err.println("readpipe may return '" + r + "'");
-                                       System.err.println("(ignoring remaing output:");
+                                       System.err.println("readpipe may return '" + r + "'"); //$NON-NLS-1$ //$NON-NLS-2$
+                                       System.err.println("(ignoring remaing output:"); //$NON-NLS-1$
                                }
                                String l;
                                while ((l = lineRead.readLine()) != null) {
@@ -351,7 +351,7 @@ public abstract class FS {
                                                        && !gooblerFail.get())
                                                return r;
                                        if (debug)
-                                               System.err.println("readpipe rc=" + rc);
+                                               System.err.println("readpipe rc=" + rc); //$NON-NLS-1$
                                        break;
                                } catch (InterruptedException ie) {
                                        // Stop bothering me, I have a zombie to reap.
@@ -363,7 +363,7 @@ public abstract class FS {
                        // Ignore error (but report)
                }
                if (debug)
-                       System.err.println("readpipe returns null");
+                       System.err.println("readpipe returns null"); //$NON-NLS-1$
                return null;
        }
 
@@ -372,7 +372,7 @@ public abstract class FS {
                Holder<File> p = gitPrefix;
                if (p == null) {
                        String overrideGitPrefix = SystemReader.getInstance().getProperty(
-                                       "jgit.gitprefix");
+                                       "jgit.gitprefix"); //$NON-NLS-1$
                        if (overrideGitPrefix != null)
                                p = new Holder<File>(new File(overrideGitPrefix));
                        else
index 742afe1354cba151f0df6a329e9ed15d49874f87..b6b55959028018759eec900fc5d85777f970c834 100644 (file)
@@ -51,8 +51,8 @@ import java.util.List;
 abstract class FS_POSIX extends FS {
        @Override
        protected File discoverGitPrefix() {
-               String path = SystemReader.getInstance().getenv("PATH");
-               File gitExe = searchPath(path, "git");
+               String path = SystemReader.getInstance().getenv("PATH"); //$NON-NLS-1$
+               File gitExe = searchPath(path, "git"); //$NON-NLS-1$
                if (gitExe != null)
                        return gitExe.getParentFile().getParentFile();
 
@@ -62,7 +62,7 @@ abstract class FS_POSIX extends FS {
                        // login shell and search using that.
                        //
                        String w = readPipe(userHome(), //
-                                       new String[] { "bash", "--login", "-c", "which git" }, //
+                                       new String[] { "bash", "--login", "-c", "which git" }, // //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                                        Charset.defaultCharset().name());
                        if (w == null || w.length() == 0)
                                return null;
@@ -91,9 +91,9 @@ abstract class FS_POSIX extends FS {
        @Override
        public ProcessBuilder runInShell(String cmd, String[] args) {
                List<String> argv = new ArrayList<String>(4 + args.length);
-               argv.add("sh");
-               argv.add("-c");
-               argv.add(cmd + " \"$@\"");
+               argv.add("sh"); //$NON-NLS-1$
+               argv.add("-c"); //$NON-NLS-1$
+               argv.add(cmd + " \"$@\""); //$NON-NLS-1$
                argv.add(cmd);
                argv.addAll(Arrays.asList(args));
                ProcessBuilder proc = new ProcessBuilder();
index 09a4db7a2372a2d4d9aa8c3f02f0d75220379c67..05025479b5516e6628f2ef08133c6bf34fdeb02c 100644 (file)
@@ -55,8 +55,8 @@ class FS_POSIX_Java6 extends FS_POSIX {
        private static final Method setExecute;
 
        static {
-               canExecute = needMethod(File.class, "canExecute");
-               setExecute = needMethod(File.class, "setExecutable", Boolean.TYPE);
+               canExecute = needMethod(File.class, "canExecute"); //$NON-NLS-1$
+               setExecute = needMethod(File.class, "setExecutable", Boolean.TYPE); //$NON-NLS-1$
        }
 
        static boolean hasExecute() {
index eebaa65d08c39ccf067065b30f2eed82b6a3e215..ce62628e8556d862a9f4e8e08f370e5803233d58 100644 (file)
@@ -87,8 +87,8 @@ class FS_Win32 extends FS {
 
        @Override
        protected File discoverGitPrefix() {
-               String path = SystemReader.getInstance().getenv("PATH");
-               File gitExe = searchPath(path, "git.exe", "git.cmd");
+               String path = SystemReader.getInstance().getenv("PATH"); //$NON-NLS-1$
+               File gitExe = searchPath(path, "git.exe", "git.cmd"); //$NON-NLS-1$ //$NON-NLS-2$
                if (gitExe != null)
                        return gitExe.getParentFile().getParentFile();
 
@@ -96,7 +96,7 @@ class FS_Win32 extends FS {
                // also be in $PATH. But its worth trying.
                //
                String w = readPipe(userHome(), //
-                               new String[] { "bash", "--login", "-c", "which git" }, //
+                               new String[] { "bash", "--login", "-c", "which git" }, // //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                                Charset.defaultCharset().name());
                if (w != null) {
                        // The path may be in cygwin/msys notation so resolve it right away
@@ -109,16 +109,16 @@ class FS_Win32 extends FS {
 
        @Override
        protected File userHomeImpl() {
-               String home = SystemReader.getInstance().getenv("HOME");
+               String home = SystemReader.getInstance().getenv("HOME"); //$NON-NLS-1$
                if (home != null)
                        return resolve(null, home);
-               String homeDrive = SystemReader.getInstance().getenv("HOMEDRIVE");
+               String homeDrive = SystemReader.getInstance().getenv("HOMEDRIVE"); //$NON-NLS-1$
                if (homeDrive != null) {
-                       String homePath = SystemReader.getInstance().getenv("HOMEPATH");
+                       String homePath = SystemReader.getInstance().getenv("HOMEPATH"); //$NON-NLS-1$
                        return new File(homeDrive, homePath);
                }
 
-               String homeShare = SystemReader.getInstance().getenv("HOMESHARE");
+               String homeShare = SystemReader.getInstance().getenv("HOMESHARE"); //$NON-NLS-1$
                if (homeShare != null)
                        return new File(homeShare);
 
@@ -128,8 +128,8 @@ class FS_Win32 extends FS {
        @Override
        public ProcessBuilder runInShell(String cmd, String[] args) {
                List<String> argv = new ArrayList<String>(3 + args.length);
-               argv.add("cmd.exe");
-               argv.add("/c");
+               argv.add("cmd.exe"); //$NON-NLS-1$
+               argv.add("/c"); //$NON-NLS-1$
                argv.add(cmd);
                argv.addAll(Arrays.asList(args));
                ProcessBuilder proc = new ProcessBuilder();
index ee83c65f8b29e7e400d7f77462c211ae5f54178f..af2d5a9a722f70346862fe5af1151306f69b513b 100644 (file)
@@ -57,12 +57,12 @@ class FS_Win32_Cygwin extends FS_Win32 {
                final String path = AccessController
                                .doPrivileged(new PrivilegedAction<String>() {
                                        public String run() {
-                                               return System.getProperty("java.library.path");
+                                               return System.getProperty("java.library.path"); //$NON-NLS-1$
                                        }
                                });
                if (path == null)
                        return false;
-               File found = FS.searchPath(path, "cygpath.exe");
+               File found = FS.searchPath(path, "cygpath.exe"); //$NON-NLS-1$
                if (found != null)
                        cygpath = found.getPath();
                return cygpath != null;
@@ -81,11 +81,11 @@ class FS_Win32_Cygwin extends FS_Win32 {
        }
 
        public File resolve(final File dir, final String pn) {
-               String useCygPath = System.getProperty("jgit.usecygpath");
-               if (useCygPath != null && useCygPath.equals("true")) {
+               String useCygPath = System.getProperty("jgit.usecygpath"); //$NON-NLS-1$
+               if (useCygPath != null && useCygPath.equals("true")) { //$NON-NLS-1$
                        String w = readPipe(dir, //
-                                       new String[] { cygpath, "--windows", "--absolute", pn }, //
-                                       "UTF-8");
+                                       new String[] { cygpath, "--windows", "--absolute", pn }, // //$NON-NLS-1$ //$NON-NLS-2$
+                                       "UTF-8"); //$NON-NLS-1$
                        if (w != null)
                                return new File(w);
                }
@@ -97,20 +97,20 @@ class FS_Win32_Cygwin extends FS_Win32 {
                final String home = AccessController
                                .doPrivileged(new PrivilegedAction<String>() {
                                        public String run() {
-                                               return System.getenv("HOME");
+                                               return System.getenv("HOME"); //$NON-NLS-1$
                                        }
                                });
                if (home == null || home.length() == 0)
                        return super.userHomeImpl();
-               return resolve(new File("."), home);
+               return resolve(new File("."), home); //$NON-NLS-1$
        }
 
        @Override
        public ProcessBuilder runInShell(String cmd, String[] args) {
                List<String> argv = new ArrayList<String>(4 + args.length);
-               argv.add("sh.exe");
-               argv.add("-c");
-               argv.add(cmd + " \"$@\"");
+               argv.add("sh.exe"); //$NON-NLS-1$
+               argv.add("-c"); //$NON-NLS-1$
+               argv.add(cmd + " \"$@\""); //$NON-NLS-1$
                argv.add(cmd);
                argv.addAll(Arrays.asList(args));
                ProcessBuilder proc = new ProcessBuilder();
index 9648449da140463b2f01c96c71106c87a1d9dda2..384cbb0f54d55429998fd3d8f05b0eb8fea55de3 100644 (file)
@@ -127,10 +127,10 @@ public class GitDateFormatter {
                        break;
                case DEFAULT: // Not default:
                        dateTimeInstance = new SimpleDateFormat(
-                                       "EEE MMM dd HH:mm:ss yyyy Z", Locale.US);
+                                       "EEE MMM dd HH:mm:ss yyyy Z", Locale.US); //$NON-NLS-1$
                        break;
                case ISO:
-                       dateTimeInstance = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z",
+                       dateTimeInstance = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z", //$NON-NLS-1$
                                        Locale.US);
                        break;
                case LOCAL:
@@ -139,17 +139,17 @@ public class GitDateFormatter {
                        break;
                case RFC:
                        dateTimeInstance = new SimpleDateFormat(
-                                       "EEE, dd MMM yyyy HH:mm:ss Z", Locale.US);
+                                       "EEE, dd MMM yyyy HH:mm:ss Z", Locale.US); //$NON-NLS-1$
                        break;
                case SHORT:
-                       dateTimeInstance = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
+                       dateTimeInstance = new SimpleDateFormat("yyyy-MM-dd", Locale.US); //$NON-NLS-1$
                        break;
                case LOCALE:
                case LOCALELOCAL:
                        SystemReader systemReader = SystemReader.getInstance();
                        dateTimeInstance = systemReader.getDateTimeInstance(
                                        DateFormat.DEFAULT, DateFormat.DEFAULT);
-                       dateTimeInstance2 = systemReader.getSimpleDateFormat("Z");
+                       dateTimeInstance2 = systemReader.getSimpleDateFormat("Z"); //$NON-NLS-1$
                        break;
                }
        }
@@ -166,7 +166,7 @@ public class GitDateFormatter {
                switch (format) {
                case RAW:
                        int offset = ident.getTimeZoneOffset();
-                       String sign = offset < 0 ? "-" : "+";
+                       String sign = offset < 0 ? "-" : "+"; //$NON-NLS-1$ //$NON-NLS-2$
                        int offset2;
                        if (offset < 0)
                                offset2 = -offset;
@@ -174,7 +174,7 @@ public class GitDateFormatter {
                                offset2 = offset;
                        int hours = offset2 / 60;
                        int minutes = offset2 % 60;
-                       return String.format("%d %s%02d%02d",
+                       return String.format("%d %s%02d%02d", //$NON-NLS-1$
                                        ident.getWhen().getTime() / 1000, sign, hours, minutes);
                case RELATIVE:
                        return RelativeDateFormatter.format(ident.getWhen());
@@ -189,7 +189,7 @@ public class GitDateFormatter {
                                tz = SystemReader.getInstance().getTimeZone();
                        dateTimeInstance.setTimeZone(tz);
                        dateTimeInstance2.setTimeZone(tz);
-                       return dateTimeInstance.format(ident.getWhen()) + " "
+                       return dateTimeInstance.format(ident.getWhen()) + " " //$NON-NLS-1$
                                        + dateTimeInstance2.format(ident.getWhen());
                default:
                        tz = ident.getTimeZone();
index f1743d4f165b3477a05ee0e8d95173dad119cf86..8f4e491de6c484c947c64f4f1757a760ce3b349e 100644 (file)
@@ -98,13 +98,13 @@ public class GitDateParser {
        // are not listed here because they are parsed without the help of a
        // SimpleDateFormat.
        enum ParseableSimpleDateFormat {
-               ISO("yyyy-MM-dd HH:mm:ss Z"), //
-               RFC("EEE, dd MMM yyyy HH:mm:ss Z"), //
-               SHORT("yyyy-MM-dd"), //
-               SHORT_WITH_DOTS_REVERSE("dd.MM.yyyy"), //
-               SHORT_WITH_DOTS("yyyy.MM.dd"), //
-               SHORT_WITH_SLASH("MM/dd/yyyy"), //
-               DEFAULT("EEE MMM dd HH:mm:ss yyyy Z"), //
+               ISO("yyyy-MM-dd HH:mm:ss Z"), // //$NON-NLS-1$
+               RFC("EEE, dd MMM yyyy HH:mm:ss Z"), // //$NON-NLS-1$
+               SHORT("yyyy-MM-dd"), // //$NON-NLS-1$
+               SHORT_WITH_DOTS_REVERSE("dd.MM.yyyy"), // //$NON-NLS-1$
+               SHORT_WITH_DOTS("yyyy.MM.dd"), // //$NON-NLS-1$
+               SHORT_WITH_SLASH("MM/dd/yyyy"), // //$NON-NLS-1$
+               DEFAULT("EEE MMM dd HH:mm:ss yyyy Z"), // //$NON-NLS-1$
                LOCAL("EEE MMM dd HH:mm:ss yyyy");
 
                String formatStr;
@@ -154,7 +154,7 @@ public class GitDateParser {
                dateStr = dateStr.trim();
                Date ret;
 
-               if ("never".equalsIgnoreCase(dateStr))
+               if ("never".equalsIgnoreCase(dateStr)) //$NON-NLS-1$
                        return NEVER;
                ret = parse_relative(dateStr, now);
                if (ret != null)
@@ -167,11 +167,11 @@ public class GitDateParser {
                        }
                }
                ParseableSimpleDateFormat[] values = ParseableSimpleDateFormat.values();
-               StringBuilder allFormats = new StringBuilder("\"")
+               StringBuilder allFormats = new StringBuilder("\"") //$NON-NLS-1$
                                .append(values[0].formatStr);
                for (int i = 1; i < values.length; i++)
-                       allFormats.append("\", \"").append(values[i].formatStr);
-               allFormats.append("\"");
+                       allFormats.append("\", \"").append(values[i].formatStr); //$NON-NLS-1$
+               allFormats.append("\""); //$NON-NLS-1$
                throw new ParseException(MessageFormat.format(
                                JGitText.get().cannotParseDate, dateStr, allFormats.toString()), 0);
        }
@@ -190,7 +190,7 @@ public class GitDateParser {
                SystemReader sysRead = SystemReader.getInstance();
 
                // check for the static words "yesterday" or "now"
-               if ("now".equals(dateStr)) {
+               if ("now".equals(dateStr)) { //$NON-NLS-1$
                        return ((now == null) ? new Date(sysRead.getCurrentTime()) : now
                                        .getTime());
                }
@@ -202,7 +202,7 @@ public class GitDateParser {
                } else
                        cal = (Calendar) now.clone();
 
-               if ("yesterday".equals(dateStr)) {
+               if ("yesterday".equals(dateStr)) { //$NON-NLS-1$
                        cal.add(Calendar.DATE, -1);
                        cal.set(Calendar.HOUR_OF_DAY, 0);
                        cal.set(Calendar.MINUTE, 0);
@@ -213,12 +213,12 @@ public class GitDateParser {
                }
 
                // parse constructs like "3 days ago", "5.week.2.day.ago"
-               String[] parts = dateStr.split("\\.| ");
+               String[] parts = dateStr.split("\\.| "); //$NON-NLS-1$
                int partsLength = parts.length;
                // check we have an odd number of parts (at least 3) and that the last
                // part is "ago"
                if (partsLength < 3 || (partsLength & 1) == 0
-                               || !"ago".equals(parts[parts.length - 1]))
+                               || !"ago".equals(parts[parts.length - 1])) //$NON-NLS-1$
                        return null;
                int number;
                for (int i = 0; i < parts.length - 2; i += 2) {
@@ -227,24 +227,24 @@ public class GitDateParser {
                        } catch (NumberFormatException e) {
                                return null;
                        }
-                       if ("year".equals(parts[i + 1]) || "years".equals(parts[i + 1]))
+                       if ("year".equals(parts[i + 1]) || "years".equals(parts[i + 1])) //$NON-NLS-1$ //$NON-NLS-2$
                                cal.add(Calendar.YEAR, -number);
-                       else if ("month".equals(parts[i + 1])
-                                       || "months".equals(parts[i + 1]))
+                       else if ("month".equals(parts[i + 1]) //$NON-NLS-1$
+                                       || "months".equals(parts[i + 1])) //$NON-NLS-1$
                                cal.add(Calendar.MONTH, -number);
-                       else if ("week".equals(parts[i + 1])
-                                       || "weeks".equals(parts[i + 1]))
+                       else if ("week".equals(parts[i + 1]) //$NON-NLS-1$
+                                       || "weeks".equals(parts[i + 1])) //$NON-NLS-1$
                                cal.add(Calendar.WEEK_OF_YEAR, -number);
-                       else if ("day".equals(parts[i + 1]) || "days".equals(parts[i + 1]))
+                       else if ("day".equals(parts[i + 1]) || "days".equals(parts[i + 1])) //$NON-NLS-1$ //$NON-NLS-2$
                                cal.add(Calendar.DATE, -number);
-                       else if ("hour".equals(parts[i + 1])
-                                       || "hours".equals(parts[i + 1]))
+                       else if ("hour".equals(parts[i + 1]) //$NON-NLS-1$
+                                       || "hours".equals(parts[i + 1])) //$NON-NLS-1$
                                cal.add(Calendar.HOUR_OF_DAY, -number);
-                       else if ("minute".equals(parts[i + 1])
-                                       || "minutes".equals(parts[i + 1]))
+                       else if ("minute".equals(parts[i + 1]) //$NON-NLS-1$
+                                       || "minutes".equals(parts[i + 1])) //$NON-NLS-1$
                                cal.add(Calendar.MINUTE, -number);
-                       else if ("second".equals(parts[i + 1])
-                                       || "seconds".equals(parts[i + 1]))
+                       else if ("second".equals(parts[i + 1]) //$NON-NLS-1$
+                                       || "seconds".equals(parts[i + 1])) //$NON-NLS-1$
                                cal.add(Calendar.SECOND, -number);
                        else
                                return null;
index 3cddc0d0d5383df6cd66396e063a7ccdbc3bf2e9..0c41e945dab764fcd9c89e3f30963726710b3bc4 100644 (file)
@@ -60,76 +60,76 @@ import org.eclipse.jgit.internal.JGitText;
 /** Extra utilities to support usage of HTTP. */
 public class HttpSupport {
        /** The {@code GET} HTTP method. */
-       public static final String METHOD_GET = "GET";
+       public static final String METHOD_GET = "GET"; //$NON-NLS-1$
 
        /** The {@code POST} HTTP method. */
-       public static final String METHOD_POST = "POST";
+       public static final String METHOD_POST = "POST"; //$NON-NLS-1$
 
        /** The {@code Cache-Control} header. */
-       public static final String HDR_CACHE_CONTROL = "Cache-Control";
+       public static final String HDR_CACHE_CONTROL = "Cache-Control"; //$NON-NLS-1$
 
        /** The {@code Pragma} header. */
-       public static final String HDR_PRAGMA = "Pragma";
+       public static final String HDR_PRAGMA = "Pragma"; //$NON-NLS-1$
 
        /** The {@code User-Agent} header. */
-       public static final String HDR_USER_AGENT = "User-Agent";
+       public static final String HDR_USER_AGENT = "User-Agent"; //$NON-NLS-1$
 
        /** The {@code Date} header. */
-       public static final String HDR_DATE = "Date";
+       public static final String HDR_DATE = "Date"; //$NON-NLS-1$
 
        /** The {@code Expires} header. */
-       public static final String HDR_EXPIRES = "Expires";
+       public static final String HDR_EXPIRES = "Expires"; //$NON-NLS-1$
 
        /** The {@code ETag} header. */
-       public static final String HDR_ETAG = "ETag";
+       public static final String HDR_ETAG = "ETag"; //$NON-NLS-1$
 
        /** The {@code If-None-Match} header. */
-       public static final String HDR_IF_NONE_MATCH = "If-None-Match";
+       public static final String HDR_IF_NONE_MATCH = "If-None-Match"; //$NON-NLS-1$
 
        /** The {@code Last-Modified} header. */
-       public static final String HDR_LAST_MODIFIED = "Last-Modified";
+       public static final String HDR_LAST_MODIFIED = "Last-Modified"; //$NON-NLS-1$
 
        /** The {@code If-Modified-Since} header. */
-       public static final String HDR_IF_MODIFIED_SINCE = "If-Modified-Since";
+       public static final String HDR_IF_MODIFIED_SINCE = "If-Modified-Since"; //$NON-NLS-1$
 
        /** The {@code Accept} header. */
-       public static final String HDR_ACCEPT = "Accept";
+       public static final String HDR_ACCEPT = "Accept"; //$NON-NLS-1$
 
        /** The {@code Content-Type} header. */
-       public static final String HDR_CONTENT_TYPE = "Content-Type";
+       public static final String HDR_CONTENT_TYPE = "Content-Type"; //$NON-NLS-1$
 
        /** The {@code Content-Length} header. */
-       public static final String HDR_CONTENT_LENGTH = "Content-Length";
+       public static final String HDR_CONTENT_LENGTH = "Content-Length"; //$NON-NLS-1$
 
        /** The {@code Content-Encoding} header. */
-       public static final String HDR_CONTENT_ENCODING = "Content-Encoding";
+       public static final String HDR_CONTENT_ENCODING = "Content-Encoding"; //$NON-NLS-1$
 
        /** The {@code Content-Range} header. */
-       public static final String HDR_CONTENT_RANGE = "Content-Range";
+       public static final String HDR_CONTENT_RANGE = "Content-Range"; //$NON-NLS-1$
 
        /** The {@code Accept-Ranges} header. */
-       public static final String HDR_ACCEPT_RANGES = "Accept-Ranges";
+       public static final String HDR_ACCEPT_RANGES = "Accept-Ranges"; //$NON-NLS-1$
 
        /** The {@code If-Range} header. */
-       public static final String HDR_IF_RANGE = "If-Range";
+       public static final String HDR_IF_RANGE = "If-Range"; //$NON-NLS-1$
 
        /** The {@code Range} header. */
-       public static final String HDR_RANGE = "Range";
+       public static final String HDR_RANGE = "Range"; //$NON-NLS-1$
 
        /** The {@code Accept-Encoding} header. */
-       public static final String HDR_ACCEPT_ENCODING = "Accept-Encoding";
+       public static final String HDR_ACCEPT_ENCODING = "Accept-Encoding"; //$NON-NLS-1$
 
        /** The {@code gzip} encoding value for {@link #HDR_ACCEPT_ENCODING}. */
-       public static final String ENCODING_GZIP = "gzip";
+       public static final String ENCODING_GZIP = "gzip"; //$NON-NLS-1$
 
        /** The standard {@code text/plain} MIME type. */
-       public static final String TEXT_PLAIN = "text/plain";
+       public static final String TEXT_PLAIN = "text/plain"; //$NON-NLS-1$
 
        /** The {@code Authorization} header. */
-       public static final String HDR_AUTHORIZATION = "Authorization";
+       public static final String HDR_AUTHORIZATION = "Authorization"; //$NON-NLS-1$
 
        /** The {@code WWW-Authenticate} header. */
-       public static final String HDR_WWW_AUTHENTICATE = "WWW-Authenticate";
+       public static final String HDR_WWW_AUTHENTICATE = "WWW-Authenticate"; //$NON-NLS-1$
 
        /**
         * URL encode a value string into an output buffer.
@@ -143,7 +143,7 @@ public class HttpSupport {
                if (key == null || key.length() == 0)
                        return;
                try {
-                       urlstr.append(URLEncoder.encode(key, "UTF-8"));
+                       urlstr.append(URLEncoder.encode(key, "UTF-8")); //$NON-NLS-1$
                } catch (UnsupportedEncodingException e) {
                        throw new RuntimeException(JGitText.get().couldNotURLEncodeToUTF8, e);
                }
@@ -171,7 +171,7 @@ public class HttpSupport {
                        //
                        if ("Connection timed out: connect".equals(ce.getMessage()))
                                throw new ConnectException(MessageFormat.format(JGitText.get().connectionTimeOut, host));
-                       throw new ConnectException(ce.getMessage() + " " + host);
+                       throw new ConnectException(ce.getMessage() + " " + host); //$NON-NLS-1$
                }
        }
 
index 510032eeb0bfb68a5e25e1a2d25b782adc721055..3161b51ae08292abb04420ac881119154ace2fc0 100644 (file)
@@ -143,7 +143,7 @@ public class IntList {
                r.append('[');
                for (int i = 0; i < count; i++) {
                        if (i > 0)
-                               r.append(", ");
+                               r.append(", "); //$NON-NLS-1$
                        r.append(entries[i]);
                }
                r.append(']');
index e3aeb83a7e862bf042cc77a6bbaf49aac49ff4af..d62203c4478d2ac1278f1bc7e7ee67b61322b4cc 100644 (file)
@@ -164,7 +164,7 @@ public class LongList {
                r.append('[');
                for (int i = 0; i < count; i++) {
                        if (i > 0)
-                               r.append(", ");
+                               r.append(", "); //$NON-NLS-1$
                        r.append(entries[i]);
                }
                r.append(']');
index f920af6116e49465d6b8d6f4c96c94ffe7a6887f..57dfb859030b3f91b35db5bd231e7f75a5ec8759 100644 (file)
@@ -187,14 +187,14 @@ public abstract class QuotedString {
        public static class BourneUserPathStyle extends BourneStyle {
                @Override
                public String quote(final String in) {
-                       if (in.matches("^~[A-Za-z0-9_-]+$")) {
+                       if (in.matches("^~[A-Za-z0-9_-]+$")) { //$NON-NLS-1$
                                // If the string is just "~user" we can assume they
                                // mean "~user/".
                                //
-                               return in + "/";
+                               return in + "/"; //$NON-NLS-1$
                        }
 
-                       if (in.matches("^~[A-Za-z0-9_-]*/.*$")) {
+                       if (in.matches("^~[A-Za-z0-9_-]*/.*$")) { //$NON-NLS-1$
                                // If the string is of "~/path" or "~user/path"
                                // we must not escape ~/ or ~user/ from the shell.
                                //
@@ -255,7 +255,7 @@ public abstract class QuotedString {
                @Override
                public String quote(final String instr) {
                        if (instr.length() == 0)
-                               return "\"\"";
+                               return "\"\""; //$NON-NLS-1$
                        boolean reuse = true;
                        final byte[] in = Constants.encode(instr);
                        final StringBuilder r = new StringBuilder(2 + in.length);
index c20474d11ca3fa42dfa06c31aed450eebff617fc..9114d500ee316ac743fd727ae6ecdadad05c40a8 100644 (file)
@@ -70,7 +70,7 @@ public final class RawParseUtils {
         *
         * @since 2.2
         */
-       public static final Charset UTF8_CHARSET = Charset.forName("UTF-8");
+       public static final Charset UTF8_CHARSET = Charset.forName("UTF-8"); //$NON-NLS-1$
 
        private static final byte[] digits10;
 
@@ -82,7 +82,7 @@ public final class RawParseUtils {
 
        static {
                encodingAliases = new HashMap<String, Charset>();
-               encodingAliases.put("latin-1", Charset.forName("ISO-8859-1"));
+               encodingAliases.put("latin-1", Charset.forName("ISO-8859-1")); //$NON-NLS-1$ //$NON-NLS-2$
 
                digits10 = new byte['9' + 1];
                Arrays.fill(digits10, (byte) -1);
@@ -779,7 +779,7 @@ public final class RawParseUtils {
                if (emailE < stop) {
                        email = decode(raw, emailB, emailE - 1);
                } else {
-                       email = "invalid";
+                       email = "invalid"; //$NON-NLS-1$
                }
                if (emailB < stop)
                        name = decode(raw, nameB, emailB - 2);
index 45b065999c7025ce2ec3224574925ec5c1df0137..4695111de9679c420f9abd3e7dcd17814d4f0a75 100644 (file)
@@ -306,7 +306,7 @@ public class RefList<T extends Ref> implements Iterable<Ref> {
                if (cnt > 0) {
                        r.append(list[0]);
                        for (int i = 1; i < cnt; i++) {
-                               r.append(", ");
+                               r.append(", "); //$NON-NLS-1$
                                r.append(list[i]);
                        }
                }
index 763a9f3a47498ed7c34f5981f8504d9f5d5b8ce8..5cc7e92c52a043681cb7d48b687b20fb316ea258 100644 (file)
@@ -111,7 +111,7 @@ public class RefMap extends AbstractMap<String, Ref> {
 
        /** Construct an empty map with a small initial capacity. */
        public RefMap() {
-               prefix = "";
+               prefix = ""; //$NON-NLS-1$
                packed = RefList.emptyList();
                loose = RefList.emptyList();
                resolved = RefList.emptyList();
@@ -267,7 +267,7 @@ public class RefMap extends AbstractMap<String, Ref> {
                        if (first)
                                first = false;
                        else
-                               r.append(", ");
+                               r.append(", "); //$NON-NLS-1$
                        r.append(ref);
                }
                r.append(']');
index efb9abd8785fa7cfc0a49213aa97e69e07170a37..cb4895025d2a212edb6dc880a2b923a154a50f4f 100644 (file)
@@ -208,15 +208,15 @@ public final class StringUtils {
                if (stringValue == null)
                        return null;
 
-               if (equalsIgnoreCase("yes", stringValue)
-                               || equalsIgnoreCase("true", stringValue)
-                               || equalsIgnoreCase("1", stringValue)
-                               || equalsIgnoreCase("on", stringValue))
+               if (equalsIgnoreCase("yes", stringValue) //$NON-NLS-1$
+                               || equalsIgnoreCase("true", stringValue) //$NON-NLS-1$
+                               || equalsIgnoreCase("1", stringValue) //$NON-NLS-1$
+                               || equalsIgnoreCase("on", stringValue)) //$NON-NLS-1$
                        return Boolean.TRUE;
-               else if (equalsIgnoreCase("no", stringValue)
-                               || equalsIgnoreCase("false", stringValue)
-                               || equalsIgnoreCase("0", stringValue)
-                               || equalsIgnoreCase("off", stringValue))
+               else if (equalsIgnoreCase("no", stringValue) //$NON-NLS-1$
+                               || equalsIgnoreCase("false", stringValue) //$NON-NLS-1$
+                               || equalsIgnoreCase("0", stringValue) //$NON-NLS-1$
+                               || equalsIgnoreCase("off", stringValue)) //$NON-NLS-1$
                        return Boolean.FALSE;
                else
                        return null;
index e9d9953f4d34280eeafb145e3b2085a96145ba56..f0db580afe237dbe799b36c9d0b08f2a42892ffb 100644 (file)
@@ -93,14 +93,14 @@ public abstract class SystemReader {
                                        }
                                };
                        }
-                       File etc = fs.resolve(prefix, "etc");
-                       File config = fs.resolve(etc, "gitconfig");
+                       File etc = fs.resolve(prefix, "etc"); //$NON-NLS-1$
+                       File config = fs.resolve(etc, "gitconfig"); //$NON-NLS-1$
                        return new FileBasedConfig(parent, config, fs);
                }
 
                public FileBasedConfig openUserConfig(Config parent, FS fs) {
                        final File home = fs.userHome();
-                       return new FileBasedConfig(parent, new File(home, ".gitconfig"), fs);
+                       return new FileBasedConfig(parent, new File(home, ".gitconfig"), fs); //$NON-NLS-1$
                }
 
                public String getHostname() {
@@ -110,7 +110,7 @@ public abstract class SystemReader {
                                        hostname = localMachine.getCanonicalHostName();
                                } catch (UnknownHostException e) {
                                        // we do nothing
-                                       hostname = "localhost";
+                                       hostname = "localhost"; //$NON-NLS-1$
                                }
                                assert hostname != null;
                        }
@@ -251,10 +251,10 @@ public abstract class SystemReader {
                String osDotName = AccessController
                                .doPrivileged(new PrivilegedAction<String>() {
                                        public String run() {
-                                               return getProperty("os.name");
+                                               return getProperty("os.name"); //$NON-NLS-1$
                                        }
                                });
-               return osDotName.startsWith("Windows");
+               return osDotName.startsWith("Windows"); //$NON-NLS-1$
        }
 
        /**
@@ -264,10 +264,10 @@ public abstract class SystemReader {
                String osDotName = AccessController
                                .doPrivileged(new PrivilegedAction<String>() {
                                        public String run() {
-                                               return getProperty("os.name");
+                                               return getProperty("os.name"); //$NON-NLS-1$
                                        }
                                });
-               return "Mac OS X".equals(osDotName) || "Darwin".equals(osDotName);
+               return "Mac OS X".equals(osDotName) || "Darwin".equals(osDotName); //$NON-NLS-1$ //$NON-NLS-2$
        }
 
 }
index 5c56a166a99c394470b430128110f8bc098f3774..88c32d2f5389d1d0ce2149cc23ea112443c96fea 100644 (file)
@@ -408,7 +408,7 @@ public abstract class TemporaryBuffer extends OutputStream {
                }
 
                protected OutputStream overflow() throws IOException {
-                       onDiskFile = File.createTempFile("jgit_", ".buf", directory);
+                       onDiskFile = File.createTempFile("jgit_", ".buf", directory); //$NON-NLS-1$ //$NON-NLS-2$
                        return new FileOutputStream(onDiskFile);
                }
 
index 352e23724726b591c74264660a921b77bc41f9f4..0e58c4b60f0195723d71759504fe78ab1a6851a5 100644 (file)
@@ -90,7 +90,7 @@ public final class InterruptTimer {
 
        /** Create a new timer with a default thread name. */
        public InterruptTimer() {
-               this("JGit-InterruptTimer");
+               this("JGit-InterruptTimer"); //$NON-NLS-1$
        }
 
        /**
index 9129ece09770a388a95dd57754869eda8a2ed9e1..24b8b533308680bbaaeb68e4e7e9bd5c9de93e8a 100644 (file)
@@ -69,7 +69,7 @@ public class StreamCopyThread extends Thread {
         *            closed when the thread terminates.
         */
        public StreamCopyThread(final InputStream i, final OutputStream o) {
-               setName(Thread.currentThread().getName() + "-StreamCopy");
+               setName(Thread.currentThread().getName() + "-StreamCopy"); //$NON-NLS-1$
                src = i;
                dst = o;
        }
index e4a8fc080e40dd089b868b4bb5b25940ef389bc4..c34c1fb681d6100d35167bae22342f3628a37f44 100644 (file)
@@ -70,7 +70,7 @@ public class ThrowingPrintWriter extends Writer {
                this.out = out;
                LF = AccessController.doPrivileged(new PrivilegedAction<String>() {
                        public String run() {
-                               return SystemReader.getInstance().getProperty("line.separator");
+                               return SystemReader.getInstance().getProperty("line.separator"); //$NON-NLS-1$
                        }
                });
        }