]> source.dussan.org Git - jgit.git/commitdiff
Revert "The constructor CmdLineException(String) is deprecated" 35/7935/2
authorShawn O. Pearce <spearce@spearce.org>
Wed, 26 Sep 2012 17:19:00 +0000 (10:19 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 26 Sep 2012 17:20:42 +0000 (10:20 -0700)
This reverts commit 07f99362575f324e466d7f5ae49d5f8f69cf7a8a.

07f9 seems to require a more recent args4j, but I cannot locate a CQ
that verifies we can use a version more recent then 2.0.12. 2.0.16
has been released, but the Hudson CI instance at Eclipse won't
build it.

Since the commit fixes an issue identified in March but wasn't
actually submitted to the tree until September, we can continue to
ignore whatever the problem is/was until someone can attempt a more
correctly working solution.

Change-Id: I94fa432c219bda21c1126976bb60e5292760092e

org.eclipse.jgit.pgm/pom.xml
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java

index a889a54533635327ab869e71dd742e1087de1135..02d346365aab9bddd41816161050fb09da6d81a5 100644 (file)
@@ -69,7 +69,6 @@
     <dependency>
       <groupId>args4j</groupId>
       <artifactId>args4j</artifactId>
-      <version>[2.0.12,2.1.0)</version>
     </dependency>
 
     <dependency>
index 6e028ec065b3ae9fa5fd61fc764e446353804d6d..ca9710491c016553e766229f5c877dfee8a5109b 100644 (file)
@@ -109,8 +109,7 @@ public class AbstractTreeIteratorHandler extends
                        try {
                                dirc = DirCache.read(new File(name), FS.DETECTED);
                        } catch (IOException e) {
-                               throw new CmdLineException(owner, MessageFormat.format(
-                                               CLIText.get().notAnIndexFile, name), e);
+                               throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e);
                        }
                        setter.addValue(new DirCacheIterator(dirc));
                        return 1;
@@ -120,25 +119,21 @@ public class AbstractTreeIteratorHandler extends
                try {
                        id = clp.getRepository().resolve(name);
                } catch (IOException e) {
-                       throw new CmdLineException(owner, e.getMessage());
+                       throw new CmdLineException(e.getMessage());
                }
                if (id == null)
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().notATree, name));
+                       throw new CmdLineException(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(owner, MessageFormat.format(
-                                       CLIText.get().notATree, name));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
                } catch (IncorrectObjectTypeException e) {
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().notATree, name));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
                } catch (IOException e) {
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().cannotReadBecause, name, e.getMessage()));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage()));
                } finally {
                        curs.release();
                }
index fada8fc07215e457f41ca08e7e5936c9585e74ce..f6550a5d88f18f58cc1fa939f3b7b1dbc4b1e6bb 100644 (file)
@@ -86,15 +86,14 @@ public class ObjectIdHandler extends OptionHandler<ObjectId> {
                try {
                        id = clp.getRepository().resolve(name);
                } catch (IOException e) {
-                       throw new CmdLineException(owner, e.getMessage());
+                       throw new CmdLineException(e.getMessage());
                }
                if (id != null) {
                        setter.addValue(id);
                        return 1;
                }
 
-               throw new CmdLineException(owner, MessageFormat.format(
-                               CLIText.get().notAnObject, name));
+               throw new CmdLineException(MessageFormat.format(CLIText.get().notAnObject, name));
        }
 
        @Override
index b7a2314dbfff91929cd83c1335ce7d14fe5c77e6..bf1753634c33bb91f4b9c7fc5813305d527b0fc3 100644 (file)
@@ -96,8 +96,7 @@ public class RevCommitHandler extends OptionHandler<RevCommit> {
                final int dot2 = name.indexOf("..");
                if (dot2 != -1) {
                        if (!option.isMultiValued())
-                               throw new CmdLineException(owner, MessageFormat.format(
-                                               CLIText.get().onlyOneMetaVarExpectedIn
+                               throw new CmdLineException(MessageFormat.format(CLIText.get().onlyOneMetaVarExpectedIn
                                        , option.metaVar(), name));
 
                        final String left = name.substring(0, dot2);
@@ -117,24 +116,20 @@ public class RevCommitHandler extends OptionHandler<RevCommit> {
                try {
                        id = clp.getRepository().resolve(name);
                } catch (IOException e) {
-                       throw new CmdLineException(owner, e.getMessage());
+                       throw new CmdLineException(e.getMessage());
                }
                if (id == null)
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().notACommit, name));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().notACommit, name));
 
                final RevCommit c;
                try {
                        c = clp.getRevWalk().parseCommit(id);
                } catch (MissingObjectException e) {
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().notACommit, name));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().notACommit, name));
                } catch (IncorrectObjectTypeException e) {
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().notACommit, name));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().notACommit, name));
                } catch (IOException e) {
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().cannotReadBecause, name, e.getMessage()));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage()));
                }
 
                if (interesting)
index 2798c5b9d6424270a1cd9b293f2c283b8028edb3..0b607ee06fec7a788ddb8c08d86f040dd401902b 100644 (file)
@@ -89,24 +89,20 @@ public class RevTreeHandler extends OptionHandler<RevTree> {
                try {
                        id = clp.getRepository().resolve(name);
                } catch (IOException e) {
-                       throw new CmdLineException(owner, e.getMessage());
+                       throw new CmdLineException(e.getMessage());
                }
                if (id == null)
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().notATree, name));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
 
                final RevTree c;
                try {
                        c = clp.getRevWalk().parseTree(id);
                } catch (MissingObjectException e) {
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().notATree, name));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
                } catch (IncorrectObjectTypeException e) {
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().notATree, name));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
                } catch (IOException e) {
-                       throw new CmdLineException(owner, MessageFormat.format(
-                                       CLIText.get().cannotReadBecause, name, e.getMessage()));
+                       throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage()));
                }
                setter.addValue(c);
                return 1;
index 08d01f4f0e5a4fcfd7d097b77eab5d54eeb21da1..35ed22bd30382bce8b3f52d7d48b27015b452058 100644 (file)
@@ -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(owner, MessageFormat.format(
+                       throw new CmdLineException(MessageFormat.format(
                                        CLIText.get().notAJgitCommand, name));
 
                // Force option parsing to stop. Everything after us should