You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/06/01 22:31:07 UTC
[commons-bcel] branch master updated: No silly strings in exception
messages.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
The following commit(s) were added to refs/heads/master by this push:
new 5d1e875 No silly strings in exception messages.
5d1e875 is described below
commit 5d1e87525ce84a737f6760e0a14073a0ebefe417
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jun 1 18:31:03 2020 -0400
No silly strings in exception messages.
---
src/main/java/org/apache/bcel/generic/ArrayInstruction.java | 2 +-
src/main/java/org/apache/bcel/generic/FieldGen.java | 2 +-
src/main/java/org/apache/bcel/generic/InstructionFactory.java | 6 +++---
src/main/java/org/apache/bcel/generic/LocalVariableInstruction.java | 2 +-
src/main/java/org/apache/bcel/generic/Type.java | 2 +-
src/main/java/org/apache/bcel/util/BCELFactory.java | 2 +-
.../org/apache/bcel/verifier/exc/AssertionViolatedException.java | 3 ++-
7 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/apache/bcel/generic/ArrayInstruction.java b/src/main/java/org/apache/bcel/generic/ArrayInstruction.java
index 05e906e..725787a 100644
--- a/src/main/java/org/apache/bcel/generic/ArrayInstruction.java
+++ b/src/main/java/org/apache/bcel/generic/ArrayInstruction.java
@@ -79,7 +79,7 @@ public abstract class ArrayInstruction extends Instruction implements ExceptionT
case org.apache.bcel.Const.AASTORE:
return Type.OBJECT;
default:
- throw new ClassGenException("Oops: unknown case in switch" + _opcode);
+ throw new ClassGenException("Unknown case in switch" + _opcode);
}
}
}
diff --git a/src/main/java/org/apache/bcel/generic/FieldGen.java b/src/main/java/org/apache/bcel/generic/FieldGen.java
index b0a698d..5884a41 100644
--- a/src/main/java/org/apache/bcel/generic/FieldGen.java
+++ b/src/main/java/org/apache/bcel/generic/FieldGen.java
@@ -252,7 +252,7 @@ public class FieldGen extends FieldGenOrMethodGen {
case Const.T_REFERENCE:
return super.getConstantPool().addString((String) value);
default:
- throw new RuntimeException("Oops: Unhandled : " + super.getType().getType()); // sic
+ throw new RuntimeException("Unhandled : " + super.getType().getType()); // sic
}
}
diff --git a/src/main/java/org/apache/bcel/generic/InstructionFactory.java b/src/main/java/org/apache/bcel/generic/InstructionFactory.java
index 3d9d1d6..3a0c817 100644
--- a/src/main/java/org/apache/bcel/generic/InstructionFactory.java
+++ b/src/main/java/org/apache/bcel/generic/InstructionFactory.java
@@ -101,7 +101,7 @@ public class InstructionFactory implements InstructionConstants {
final Type[] arg_types, final short kind, final boolean use_interface) {
if (kind != Const.INVOKESPECIAL && kind != Const.INVOKEVIRTUAL && kind != Const.INVOKESTATIC
&& kind != Const.INVOKEINTERFACE && kind != Const.INVOKEDYNAMIC) {
- throw new RuntimeException("Oops: Unknown invoke kind: " + kind);
+ throw new RuntimeException("Unknown invoke kind: " + kind);
}
int index;
int nargs = 0;
@@ -276,7 +276,7 @@ public class InstructionFactory implements InstructionConstants {
case Const.T_OBJECT:
return createInvoke(append_mos[1], Const.INVOKEVIRTUAL);
default:
- throw new RuntimeException("Oops: No append for this type? " + type);
+ throw new RuntimeException("No append for this type? " + type);
}
}
@@ -303,7 +303,7 @@ public class InstructionFactory implements InstructionConstants {
case Const.PUTSTATIC:
return new PUTSTATIC(index);
default:
- throw new RuntimeException("Oops: Unknown getfield kind:" + kind);
+ throw new RuntimeException("Unknown getfield kind:" + kind);
}
}
diff --git a/src/main/java/org/apache/bcel/generic/LocalVariableInstruction.java b/src/main/java/org/apache/bcel/generic/LocalVariableInstruction.java
index 527b3b3..ec567b2 100644
--- a/src/main/java/org/apache/bcel/generic/LocalVariableInstruction.java
+++ b/src/main/java/org/apache/bcel/generic/LocalVariableInstruction.java
@@ -216,7 +216,7 @@ public abstract class LocalVariableInstruction extends Instruction implements Ty
case Const.ASTORE:
return Type.OBJECT;
default:
- throw new ClassGenException("Oops: unknown case in switch" + canon_tag);
+ throw new ClassGenException("Unknown case in switch" + canon_tag);
}
}
diff --git a/src/main/java/org/apache/bcel/generic/Type.java b/src/main/java/org/apache/bcel/generic/Type.java
index 3b9e604..93fb632 100644
--- a/src/main/java/org/apache/bcel/generic/Type.java
+++ b/src/main/java/org/apache/bcel/generic/Type.java
@@ -300,7 +300,7 @@ public abstract class Type {
} else if (cl == Character.TYPE) {
return CHAR;
} else {
- throw new IllegalStateException("Ooops, what primitive type is " + cl);
+ throw new IllegalStateException("Unknown primitive type " + cl);
}
} else { // "Real" class
return ObjectType.getInstance(cl.getName());
diff --git a/src/main/java/org/apache/bcel/util/BCELFactory.java b/src/main/java/org/apache/bcel/util/BCELFactory.java
index b9fbaab..2910e5c 100644
--- a/src/main/java/org/apache/bcel/util/BCELFactory.java
+++ b/src/main/java/org/apache/bcel/util/BCELFactory.java
@@ -196,7 +196,7 @@ class BCELFactory extends EmptyVisitor {
+ ", (short) " + dim + "));");
break;
default:
- throw new RuntimeException("Oops: " + opcode);
+ throw new RuntimeException("Unhandled opcode: " + opcode);
}
}
diff --git a/src/main/java/org/apache/bcel/verifier/exc/AssertionViolatedException.java b/src/main/java/org/apache/bcel/verifier/exc/AssertionViolatedException.java
index ae6fbed..e671155 100644
--- a/src/main/java/org/apache/bcel/verifier/exc/AssertionViolatedException.java
+++ b/src/main/java/org/apache/bcel/verifier/exc/AssertionViolatedException.java
@@ -17,6 +17,7 @@
*/
package org.apache.bcel.verifier.exc;
+import java.util.Arrays;
/**
* Instances of this class should never be thrown. When such an instance is thrown,
@@ -77,7 +78,7 @@ public final class AssertionViolatedException extends RuntimeException{
* DO NOT USE. It's for experimental testing during development only.
*/
public static void main(final String[] args) {
- final AssertionViolatedException ave = new AssertionViolatedException("Oops!");
+ final AssertionViolatedException ave = new AssertionViolatedException(Arrays.toString(args));
ave.extendMessage("\nFOUND:\n\t","\nExiting!!\n");
throw ave;
}