Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2012-03-12 09:53:30 +0000
committerRobin Rosenberg2012-09-23 08:49:50 +0000
commit07f99362575f324e466d7f5ae49d5f8f69cf7a8a (patch)
tree1404aa53312b8ebddfca3eec8d30f461d35c2aba
parentc3f1fac03fdf3ed5165adfd22aa14a21e5876892 (diff)
downloadjgit-07f99362575f324e466d7f5ae49d5f8f69cf7a8a.tar.gz
jgit-07f99362575f324e466d7f5ae49d5f8f69cf7a8a.tar.xz
jgit-07f99362575f324e466d7f5ae49d5f8f69cf7a8a.zip
The constructor CmdLineException(String) is deprecated
Use CmdLineException(CmdLineParser, String) instead. The new constructor has been added in args4j 2.0.12, so in pom.xml that would be the minimum version. Set the upper boundary in pom.xml to 2.1.0 (exclusive), just like in the MANIFEST.MF. Change-Id: If45d809e4ffa11a3572d958ce121422fb03cf8f3 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
-rw-r--r--org.eclipse.jgit.pgm/pom.xml1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java17
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java5
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java17
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java14
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java2
6 files changed, 36 insertions, 20 deletions
diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml
index 02d346365a..a889a54533 100644
--- a/org.eclipse.jgit.pgm/pom.xml
+++ b/org.eclipse.jgit.pgm/pom.xml
@@ -69,6 +69,7 @@
<dependency>
<groupId>args4j</groupId>
<artifactId>args4j</artifactId>
+ <version>[2.0.12,2.1.0)</version>
</dependency>
<dependency>
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java
index ca9710491c..6e028ec065 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java
@@ -109,7 +109,8 @@ public class AbstractTreeIteratorHandler extends
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 class AbstractTreeIteratorHandler extends
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();
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java
index f6550a5d88..fada8fc072 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java
@@ -86,14 +86,15 @@ public class ObjectIdHandler extends OptionHandler<ObjectId> {
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
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java
index bf1753634c..b7a2314dbf 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java
@@ -96,7 +96,8 @@ public class RevCommitHandler extends OptionHandler<RevCommit> {
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 @@ public class RevCommitHandler extends OptionHandler<RevCommit> {
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)
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java
index 0b607ee06f..2798c5b9d6 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java
@@ -89,20 +89,24 @@ public class RevTreeHandler extends OptionHandler<RevTree> {
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;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java
index 35ed22bd30..08d01f4f0e 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java
@@ -82,7 +82,7 @@ public class SubcommandHandler extends OptionHandler<TextBuiltin> {
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

Back to the top