Merge "The constructor CmdLineException(String) is deprecated"
This commit is contained in:
commit
78c8659428
|
@ -69,6 +69,7 @@
|
|||
<dependency>
|
||||
<groupId>args4j</groupId>
|
||||
<artifactId>args4j</artifactId>
|
||||
<version>[2.0.12,2.1.0)</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -109,7 +109,8 @@ public int parseArguments(final Parameters params) throws CmdLineException {
|
|||
try {
|
||||
dirc = DirCache.read(new File(name), FS.DETECTED);
|
||||
} catch (IOException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e);
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notAnIndexFile, name), e);
|
||||
}
|
||||
setter.addValue(new DirCacheIterator(dirc));
|
||||
return 1;
|
||||
|
@ -119,21 +120,25 @@ public int parseArguments(final Parameters params) throws CmdLineException {
|
|||
try {
|
||||
id = clp.getRepository().resolve(name);
|
||||
} catch (IOException e) {
|
||||
throw new CmdLineException(e.getMessage());
|
||||
throw new CmdLineException(owner, e.getMessage());
|
||||
}
|
||||
if (id == null)
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notATree, name));
|
||||
|
||||
final CanonicalTreeParser p = new CanonicalTreeParser();
|
||||
final ObjectReader curs = clp.getRepository().newObjectReader();
|
||||
try {
|
||||
p.reset(curs, clp.getRevWalk().parseTree(id));
|
||||
} catch (MissingObjectException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notATree, name));
|
||||
} catch (IncorrectObjectTypeException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notATree, name));
|
||||
} catch (IOException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage()));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().cannotReadBecause, name, e.getMessage()));
|
||||
} finally {
|
||||
curs.release();
|
||||
}
|
||||
|
|
|
@ -86,14 +86,15 @@ public int parseArguments(final Parameters params) throws CmdLineException {
|
|||
try {
|
||||
id = clp.getRepository().resolve(name);
|
||||
} catch (IOException e) {
|
||||
throw new CmdLineException(e.getMessage());
|
||||
throw new CmdLineException(owner, e.getMessage());
|
||||
}
|
||||
if (id != null) {
|
||||
setter.addValue(id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notAnObject, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notAnObject, name));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -96,7 +96,8 @@ public int parseArguments(final Parameters params) throws CmdLineException {
|
|||
final int dot2 = name.indexOf("..");
|
||||
if (dot2 != -1) {
|
||||
if (!option.isMultiValued())
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().onlyOneMetaVarExpectedIn
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().onlyOneMetaVarExpectedIn
|
||||
, option.metaVar(), name));
|
||||
|
||||
final String left = name.substring(0, dot2);
|
||||
|
@ -116,20 +117,24 @@ private void addOne(final String name, final boolean interesting)
|
|||
try {
|
||||
id = clp.getRepository().resolve(name);
|
||||
} catch (IOException e) {
|
||||
throw new CmdLineException(e.getMessage());
|
||||
throw new CmdLineException(owner, e.getMessage());
|
||||
}
|
||||
if (id == null)
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notACommit, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notACommit, name));
|
||||
|
||||
final RevCommit c;
|
||||
try {
|
||||
c = clp.getRevWalk().parseCommit(id);
|
||||
} catch (MissingObjectException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notACommit, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notACommit, name));
|
||||
} catch (IncorrectObjectTypeException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notACommit, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notACommit, name));
|
||||
} catch (IOException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage()));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().cannotReadBecause, name, e.getMessage()));
|
||||
}
|
||||
|
||||
if (interesting)
|
||||
|
|
|
@ -89,20 +89,24 @@ public int parseArguments(final Parameters params) throws CmdLineException {
|
|||
try {
|
||||
id = clp.getRepository().resolve(name);
|
||||
} catch (IOException e) {
|
||||
throw new CmdLineException(e.getMessage());
|
||||
throw new CmdLineException(owner, e.getMessage());
|
||||
}
|
||||
if (id == null)
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notATree, name));
|
||||
|
||||
final RevTree c;
|
||||
try {
|
||||
c = clp.getRevWalk().parseTree(id);
|
||||
} catch (MissingObjectException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notATree, name));
|
||||
} catch (IncorrectObjectTypeException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notATree, name));
|
||||
} catch (IOException e) {
|
||||
throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage()));
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().cannotReadBecause, name, e.getMessage()));
|
||||
}
|
||||
setter.addValue(c);
|
||||
return 1;
|
||||
|
|
|
@ -82,7 +82,7 @@ public int parseArguments(final Parameters params) throws CmdLineException {
|
|||
final String name = params.getParameter(0);
|
||||
final CommandRef cr = CommandCatalog.get(name);
|
||||
if (cr == null)
|
||||
throw new CmdLineException(MessageFormat.format(
|
||||
throw new CmdLineException(owner, MessageFormat.format(
|
||||
CLIText.get().notAJgitCommand, name));
|
||||
|
||||
// Force option parsing to stop. Everything after us should
|
||||
|
|
Loading…
Reference in New Issue