Browse Source

Fix warnings in ArchiveCommand

- remove unnecessary imports
- fix NLS warnings
- add missing Javadoc tag

Bug: 410354
Change-Id: I2b78a2c0e92c740bed80558b17a2100c1c884416
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v3.1.0.201309270735-rc1
Matthias Sohn 11 years ago
parent
commit
06ba0f6df1
1 changed files with 7 additions and 11 deletions
  1. 7
    11
      org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java

+ 7
- 11
org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java View File

import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;


import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.GitCommand;
import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.JGitInternalException; import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.internal.JGitText;
for (String sfx : fmt.suffixes()) for (String sfx : fmt.suffixes())
if (filenameSuffix.endsWith(sfx)) if (filenameSuffix.endsWith(sfx))
return fmt; return fmt;
return lookupFormat("tar");
return lookupFormat("tar"); //$NON-NLS-1$
} }


private static Format<?> lookupFormat(String formatName) throws UnsupportedFormatException { private static Format<?> lookupFormat(String formatName) throws UnsupportedFormatException {
} }


/** /**
* Set the intended filename for the produced archive.
* Currently the only effect is to determine the default
* archive format when none is specified with
* {@link #setFormat(String)}.
* Set the intended filename for the produced archive. Currently the only
* effect is to determine the default archive format when none is specified
* with {@link #setFormat(String)}.
* *
* @param filename * @param filename
* intended filename for the archive
* intended filename for the archive
* @return this
*/ */
public ArchiveCommand setFilename(String filename) { public ArchiveCommand setFilename(String filename) {
int slash = filename.lastIndexOf('/'); int slash = filename.lastIndexOf('/');
int dot = filename.indexOf('.', slash + 1); int dot = filename.indexOf('.', slash + 1);


if (dot == -1) if (dot == -1)
this.suffix = "";
this.suffix = ""; //$NON-NLS-1$
else else
this.suffix = filename.substring(dot); this.suffix = filename.substring(dot);
return this; return this;

Loading…
Cancel
Save