You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/20 23:36:34 UTC
svn commit: r1696858 [3/3] - in /commons/proper/bcel/trunk: ./ src/examples/
src/examples/Mini/ src/main/java/org/apache/commons/bcel6/classfile/
src/main/java/org/apache/commons/bcel6/generic/
src/main/java/org/apache/commons/bcel6/verifier/ src/main/...
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstConstraintVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstConstraintVisitor.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstConstraintVisitor.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstConstraintVisitor.java Thu Aug 20 21:36:33 2015
@@ -109,7 +109,8 @@ public class InstConstraintVisitor exten
*/
private void constraintViolated(Instruction violator, String description){
String fq_classname = violator.getClass().getName();
- throw new StructuralCodeConstraintException("Instruction "+ fq_classname.substring(fq_classname.lastIndexOf('.')+1) +" constraint violated: " + description);
+ throw new StructuralCodeConstraintException(
+ "Instruction "+ fq_classname.substring(fq_classname.lastIndexOf('.')+1) +" constraint violated: " + description);
}
/**
@@ -123,7 +124,8 @@ public class InstConstraintVisitor exten
*/
public void setFrame(Frame f){ // TODO could be package-protected?
this.frame = f;
- //if (singleInstance.mg == null || singleInstance.cpg == null) throw new AssertionViolatedException("Forgot to set important values first.");
+ //if (singleInstance.mg == null || singleInstance.cpg == null)
+ // throw new AssertionViolatedException("Forgot to set important values first.");
}
/**
@@ -204,12 +206,14 @@ public class InstConstraintVisitor exten
private void _visitStackAccessor(Instruction o){
int consume = o.consumeStack(cpg); // Stack values are always consumed first; then produced.
if (consume > stack().slotsUsed()){
- constraintViolated(o, "Cannot consume "+consume+" stack slots: only "+stack().slotsUsed()+" slot(s) left on stack!\nStack:\n"+stack());
+ constraintViolated(o,
+ "Cannot consume "+consume+" stack slots: only "+stack().slotsUsed()+" slot(s) left on stack!\nStack:\n"+stack());
}
int produce = o.produceStack(cpg) - o.consumeStack(cpg); // Stack values are always consumed first; then produced.
if ( produce + stack().slotsUsed() > stack().maxStack() ){
- constraintViolated(o, "Cannot produce "+produce+" stack slots: only "+(stack().maxStack()-stack().slotsUsed())+" free stack slot(s) left.\nStack:\n"+stack());
+ constraintViolated(o, "Cannot produce "+produce+" stack slots: only "+(stack().maxStack()-stack().slotsUsed())+
+ " free stack slot(s) left.\nStack:\n"+stack());
}
}
@@ -230,7 +234,8 @@ public class InstConstraintVisitor exten
Verifier v = VerifierFactory.getVerifier(t.getClassName());
VerificationResult vr = v.doPass2();
if (vr.getStatus() != VerificationResult.VERIFIED_OK){
- constraintViolated((Instruction) o, "Class '"+o.getLoadClassType(cpg).getClassName()+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
+ constraintViolated((Instruction) o, "Class '"+o.getLoadClassType(cpg).getClassName()+
+ "' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
}
}
}
@@ -264,7 +269,8 @@ public class InstConstraintVisitor exten
public void visitCPInstruction(CPInstruction o){
int idx = o.getIndex();
if ((idx < 0) || (idx >= cpg.getSize())){
- throw new AssertionViolatedException("Huh?! Constant pool index of instruction '"+o+"' illegal? Pass 3a should have checked this!");
+ throw new AssertionViolatedException(
+ "Huh?! Constant pool index of instruction '"+o+"' illegal? Pass 3a should have checked this!");
}
}
@@ -279,7 +285,8 @@ public class InstConstraintVisitor exten
// A FieldInstruction may be: GETFIELD, GETSTATIC, PUTFIELD, PUTSTATIC
Constant c = cpg.getConstant(o.getIndex());
if (!(c instanceof ConstantFieldref)){
- constraintViolated(o, "Index '"+o.getIndex()+"' should refer to a CONSTANT_Fieldref_info structure, but refers to '"+c+"'.");
+ constraintViolated(o,
+ "Index '"+o.getIndex()+"' should refer to a CONSTANT_Fieldref_info structure, but refers to '"+c+"'.");
}
// the o.getClassType(cpg) type has passed pass 2; see visitLoadClass(o).
Type t = o.getType(cpg);
@@ -340,19 +347,23 @@ public class InstConstraintVisitor exten
// [suppose some instruction put an int at N+1--- our double at N is defective]
if (o.getType(cpg).getSize() == 2){
if (locals().get(o.getIndex()+1) != Type.UNKNOWN){
- constraintViolated(o, "Reading a two-locals value from local variables "+o.getIndex()+" and "+(o.getIndex()+1)+" where the latter one is destroyed.");
+ constraintViolated(o,
+ "Reading a two-locals value from local variables "+o.getIndex()+
+ " and "+(o.getIndex()+1)+" where the latter one is destroyed.");
}
}
// LOAD instructions must read the correct type.
if (!(o instanceof ALOAD)){
if (locals().get(o.getIndex()) != o.getType(cpg) ){
- constraintViolated(o, "Local Variable type and LOADing Instruction type mismatch: Local Variable: '"+locals().get(o.getIndex())+"'; Instruction type: '"+o.getType(cpg)+"'.");
+ constraintViolated(o,"Local Variable type and LOADing Instruction type mismatch: Local Variable: '"+
+ locals().get(o.getIndex())+"'; Instruction type: '"+o.getType(cpg)+"'.");
}
}
else{ // we deal with an ALOAD
if (!(locals().get(o.getIndex()) instanceof ReferenceType)){
- constraintViolated(o, "Local Variable type and LOADing Instruction type mismatch: Local Variable: '"+locals().get(o.getIndex())+"'; Instruction expects a ReferenceType.");
+ constraintViolated(o, "Local Variable type and LOADing Instruction type mismatch: Local Variable: '"+
+ locals().get(o.getIndex())+"'; Instruction expects a ReferenceType.");
}
// ALOAD __IS ALLOWED__ to put uninitialized objects onto the stack!
//referenceTypeIsInitialized(o, (ReferenceType) (locals().get(o.getIndex())));
@@ -371,19 +382,21 @@ public class InstConstraintVisitor exten
public void visitStoreInstruction(StoreInstruction o){
//visitLocalVariableInstruction(o) is called before, because it is more generic.
- if (stack().isEmpty()){ // Don't bother about 1 or 2 stack slots used. This check is implicitely done below while type checking.
+ if (stack().isEmpty()){ // Don't bother about 1 or 2 stack slots used. This check is implicitly done below while type checking.
constraintViolated(o, "Cannot STORE: Stack to read from is empty.");
}
if ( (!(o instanceof ASTORE)) ){
if (! (stack().peek() == o.getType(cpg)) ){// the other xSTORE types are singletons in BCEL.
- constraintViolated(o, "Stack top type and STOREing Instruction type mismatch: Stack top: '"+stack().peek()+"'; Instruction type: '"+o.getType(cpg)+"'.");
+ constraintViolated(o, "Stack top type and STOREing Instruction type mismatch: Stack top: '"+stack().peek()+
+ "'; Instruction type: '"+o.getType(cpg)+"'.");
}
}
else{ // we deal with ASTORE
Type stacktop = stack().peek();
if ( (!(stacktop instanceof ReferenceType)) && (!(stacktop instanceof ReturnaddressType)) ){
- constraintViolated(o, "Stack top type and STOREing Instruction type mismatch: Stack top: '"+stack().peek()+"'; Instruction expects a ReferenceType or a ReturnadressType.");
+ constraintViolated(o, "Stack top type and STOREing Instruction type mismatch: Stack top: '"+stack().peek()+
+ "'; Instruction expects a ReferenceType or a ReturnadressType.");
}
//if (stacktop instanceof ReferenceType){
// referenceTypeIsInitialized(o, (ReferenceType) stacktop);
@@ -427,12 +440,14 @@ public class InstConstraintVisitor exten
// TODO: This can only be checked if using Staerk-et-al's "set of object types" instead of a
// "wider cast object type" created during verification.
//if (! (objectref.isAssignmentCompatibleWith(mg.getType())) ){
- // constraintViolated(o, "Type on stack top which should be returned is a '"+stack().peek()+"' which is not assignment compatible with the return type of this method, '"+mg.getType()+"'.");
+ // constraintViolated(o, "Type on stack top which should be returned is a '"+stack().peek()+
+ // "' which is not assignment compatible with the return type of this method, '"+mg.getType()+"'.");
//}
}
else{
if (! ( method_type.equals( stack().peek() ))){
- constraintViolated(o, "Current method has return type of '"+mg.getType()+"' expecting a '"+method_type+"' on top of the stack. But stack top is a '"+stack().peek()+"'.");
+ constraintViolated(o, "Current method has return type of '"+mg.getType()+"' expecting a '"+method_type+
+ "' on top of the stack. But stack top is a '"+stack().peek()+"'.");
}
}
}
@@ -452,7 +467,9 @@ public class InstConstraintVisitor exten
indexOfInt(o, index);
if (arrayrefOfArrayType(o, arrayref)){
if (! (((ArrayType) arrayref).getElementType() instanceof ReferenceType)){
- constraintViolated(o, "The 'arrayref' does not refer to an array with elements of a ReferenceType but to an array of "+((ArrayType) arrayref).getElementType()+".");
+ constraintViolated(o,
+ "The 'arrayref' does not refer to an array with elements of a ReferenceType but to an array of "+
+ ((ArrayType) arrayref).getElementType()+".");
}
//referenceTypeIsInitialized(o, (ReferenceType) (((ArrayType) arrayref).getElementType()));
}
@@ -477,7 +494,8 @@ public class InstConstraintVisitor exten
// of an uninitialized object type.
if (arrayrefOfArrayType(o, arrayref)){
if (! (((ArrayType) arrayref).getElementType() instanceof ReferenceType)){
- constraintViolated(o, "The 'arrayref' does not refer to an array with elements of a ReferenceType but to an array of "+((ArrayType) arrayref).getElementType()+".");
+ constraintViolated(o, "The 'arrayref' does not refer to an array with elements of a ReferenceType but to an array of "+
+ ((ArrayType) arrayref).getElementType()+".");
}
// No check for array element assignment compatibility. This is done at runtime.
}
@@ -528,7 +546,8 @@ public class InstConstraintVisitor exten
// It cannot be done using Staerk-et-al's "set of object types" instead of a
// "wider cast object type", anyway.
//if (! objectref.isAssignmentCompatibleWith(mg.getReturnType() )){
- // constraintViolated(o, "The 'objectref' type "+objectref+" at the stack top is not assignment compatible with the return type '"+mg.getReturnType()+"' of the method.");
+ // constraintViolated(o, "The 'objectref' type "+objectref+
+ // " at the stack top is not assignment compatible with the return type '"+mg.getReturnType()+"' of the method.");
//}
}
@@ -574,7 +593,8 @@ public class InstConstraintVisitor exten
ObjectType exc = (ObjectType) (stack().peek());
ObjectType throwable = (ObjectType) (Type.getType("Ljava/lang/Throwable;"));
if ( (! (exc.subclassOf(throwable)) ) && (! (exc.equals(throwable))) ){
- constraintViolated(o, "The 'objectref' is not of class Throwable or of a subclass of Throwable, but of '"+stack().peek()+"'.");
+ constraintViolated(o,
+ "The 'objectref' is not of class Throwable or of a subclass of Throwable, but of '"+stack().peek()+"'.");
}
} catch (ClassNotFoundException e) {
// FIXME: maybe not the best way to handle this
@@ -593,7 +613,9 @@ public class InstConstraintVisitor exten
if (arrayrefOfArrayType(o, arrayref)){
if (! ( (((ArrayType) arrayref).getElementType().equals(Type.BOOLEAN)) ||
(((ArrayType) arrayref).getElementType().equals(Type.BYTE)) ) ){
- constraintViolated(o, "The 'arrayref' does not refer to an array with elements of a Type.BYTE or Type.BOOLEAN but to an array of '"+((ArrayType) arrayref).getElementType()+"'.");
+ constraintViolated(o,
+ "The 'arrayref' does not refer to an array with elements of a Type.BYTE or Type.BOOLEAN but to an array of '"+
+ ((ArrayType) arrayref).getElementType()+"'.");
}
}
}
@@ -612,7 +634,9 @@ public class InstConstraintVisitor exten
if (arrayrefOfArrayType(o, arrayref)){
if (! ( (((ArrayType) arrayref).getElementType().equals(Type.BOOLEAN)) ||
(((ArrayType) arrayref).getElementType().equals(Type.BYTE)) ) ) {
- constraintViolated(o, "The 'arrayref' does not refer to an array with elements of a Type.BYTE or Type.BOOLEAN but to an array of '"+((ArrayType) arrayref).getElementType()+"'.");
+ constraintViolated(o,
+ "The 'arrayref' does not refer to an array with elements of a Type.BYTE or Type.BOOLEAN but to an array of '"+
+ ((ArrayType) arrayref).getElementType()+"'.");
}
}
}
@@ -630,7 +654,8 @@ public class InstConstraintVisitor exten
*/
@Override
public void visitBREAKPOINT(BREAKPOINT o){
- throw new AssertionViolatedException("In this JustIce verification pass there should not occur an illegal instruction such as BREAKPOINT.");
+ throw new AssertionViolatedException(
+ "In this JustIce verification pass there should not occur an illegal instruction such as BREAKPOINT.");
}
/**
@@ -658,7 +683,8 @@ public class InstConstraintVisitor exten
valueOfInt(o, value);
if (arrayrefOfArrayType(o, arrayref)){
if (! ((ArrayType) arrayref).getElementType().equals(Type.CHAR) ){
- constraintViolated(o, "The 'arrayref' does not refer to an array with elements of type char but to an array of type "+((ArrayType) arrayref).getElementType()+".");
+ constraintViolated(o, "The 'arrayref' does not refer to an array with elements of type char but to an array of type "+
+ ((ArrayType) arrayref).getElementType()+".");
}
}
}
@@ -899,7 +925,8 @@ public class InstConstraintVisitor exten
@Override
public void visitDUP(DUP o){
if (stack().peek().getSize() != 1){
- constraintViolated(o, "Won't DUP type on stack top '"+stack().peek()+"' because it must occupy exactly one slot, not '"+stack().peek().getSize()+"'.");
+ constraintViolated(o, "Won't DUP type on stack top '"+stack().peek()+
+ "' because it must occupy exactly one slot, not '"+stack().peek().getSize()+"'.");
}
}
@@ -909,10 +936,13 @@ public class InstConstraintVisitor exten
@Override
public void visitDUP_X1(DUP_X1 o){
if (stack().peek().getSize() != 1){
- constraintViolated(o, "Type on stack top '"+stack().peek()+"' should occupy exactly one slot, not '"+stack().peek().getSize()+"'.");
+ constraintViolated(o,
+ "Type on stack top '"+stack().peek()+"' should occupy exactly one slot, not '"+stack().peek().getSize()+"'.");
}
if (stack().peek(1).getSize() != 1){
- constraintViolated(o, "Type on stack next-to-top '"+stack().peek(1)+"' should occupy exactly one slot, not '"+stack().peek(1).getSize()+"'.");
+ constraintViolated(o,
+ "Type on stack next-to-top '"+stack().peek(1)+
+ "' should occupy exactly one slot, not '"+stack().peek(1).getSize()+"'.");
}
}
@@ -922,14 +952,18 @@ public class InstConstraintVisitor exten
@Override
public void visitDUP_X2(DUP_X2 o){
if (stack().peek().getSize() != 1){
- constraintViolated(o, "Stack top type must be of size 1, but is '"+stack().peek()+"' of size '"+stack().peek().getSize()+"'.");
+ constraintViolated(o,
+ "Stack top type must be of size 1, but is '"+stack().peek()+"' of size '"+stack().peek().getSize()+"'.");
}
if (stack().peek(1).getSize() == 2){
return; // Form 2, okay.
}
//stack().peek(1).getSize == 1.
if (stack().peek(2).getSize() != 1){
- constraintViolated(o, "If stack top's size is 1 and stack next-to-top's size is 1, stack next-to-next-to-top's size must also be 1, but is: '"+stack().peek(2)+"' of size '"+stack().peek(2).getSize()+"'.");
+ constraintViolated(o,
+ "If stack top's size is 1 and stack next-to-top's size is 1,"+
+ " stack next-to-next-to-top's size must also be 1, but is: '"+
+ stack().peek(2)+"' of size '"+stack().peek(2).getSize()+"'.");
}
}
@@ -943,7 +977,9 @@ public class InstConstraintVisitor exten
}
//stack().peek().getSize() == 1.
if (stack().peek(1).getSize() != 1){
- constraintViolated(o, "If stack top's size is 1, then stack next-to-top's size must also be 1. But it is '"+stack().peek(1)+"' of size '"+stack().peek(1).getSize()+"'.");
+ constraintViolated(o,
+ "If stack top's size is 1, then stack next-to-top's size must also be 1. But it is '"+stack().peek(1)+
+ "' of size '"+stack().peek(1).getSize()+"'.");
}
}
@@ -954,7 +990,8 @@ public class InstConstraintVisitor exten
public void visitDUP2_X1(DUP2_X1 o){
if (stack().peek().getSize() == 2){
if (stack().peek(1).getSize() != 1){
- constraintViolated(o, "If stack top's size is 2, then stack next-to-top's size must be 1. But it is '"+stack().peek(1)+"' of size '"+stack().peek(1).getSize()+"'.");
+ constraintViolated(o, "If stack top's size is 2, then stack next-to-top's size must be 1. But it is '"+
+ stack().peek(1)+"' of size '"+stack().peek(1).getSize()+"'.");
}
else{
return; // Form 2
@@ -962,10 +999,12 @@ public class InstConstraintVisitor exten
}
else{ // stack top is of size 1
if ( stack().peek(1).getSize() != 1 ){
- constraintViolated(o, "If stack top's size is 1, then stack next-to-top's size must also be 1. But it is '"+stack().peek(1)+"' of size '"+stack().peek(1).getSize()+"'.");
+ constraintViolated(o, "If stack top's size is 1, then stack next-to-top's size must also be 1. But it is '"+
+ stack().peek(1)+"' of size '"+stack().peek(1).getSize()+"'.");
}
if ( stack().peek(2).getSize() != 1 ){
- constraintViolated(o, "If stack top's size is 1, then stack next-to-next-to-top's size must also be 1. But it is '"+stack().peek(2)+"' of size '"+stack().peek(2).getSize()+"'.");
+ constraintViolated(o, "If stack top's size is 1, then stack next-to-next-to-top's size must also be 1. But it is '"+
+ stack().peek(2)+"' of size '"+stack().peek(2).getSize()+"'.");
}
}
}
@@ -982,7 +1021,9 @@ public class InstConstraintVisitor exten
}
// stack top size is 2, next-to-top's size is 1
if ( stack().peek(2).getSize() != 1 ){
- constraintViolated(o, "If stack top's size is 2 and stack-next-to-top's size is 1, then stack next-to-next-to-top's size must also be 1. But it is '"+stack().peek(2)+"' of size '"+stack().peek(2).getSize()+"'.");
+ constraintViolated(o, "If stack top's size is 2 and stack-next-to-top's size is 1,"+
+ " then stack next-to-next-to-top's size must also be 1. But it is '"+stack().peek(2)+
+ "' of size '"+stack().peek(2).getSize()+"'.");
}
else{
return; // Form 2
@@ -1291,7 +1332,10 @@ public class InstConstraintVisitor exten
//TODO: One day move to Staerk-et-al's "Set of object types" instead of "wider" object types
// created during the verification.
// "Wider" object types don't allow us to check for things like that below.
- //constraintViolated(o, "The referenced field has the ACC_PROTECTED modifier, and it's a member of the current class or a superclass of the current class. However, the referenced object type '"+stack().peek()+"' is not the current class or a subclass of the current class.");
+ //constraintViolated(o, "The referenced field has the ACC_PROTECTED modifier, "+
+ // "and it's a member of the current class or a superclass of the current class."+
+ // " However, the referenced object type '"+stack().peek()+
+ // "' is not the current class or a subclass of the current class.");
}
}
}
@@ -1695,7 +1739,8 @@ public class InstConstraintVisitor exten
*/
@Override
public void visitIMPDEP1(IMPDEP1 o){
- throw new AssertionViolatedException("In this JustIce verification pass there should not occur an illegal instruction such as IMPDEP1.");
+ throw new AssertionViolatedException(
+ "In this JustIce verification pass there should not occur an illegal instruction such as IMPDEP1.");
}
/**
@@ -1703,7 +1748,8 @@ public class InstConstraintVisitor exten
*/
@Override
public void visitIMPDEP2(IMPDEP2 o){
- throw new AssertionViolatedException("In this JustIce verification pass there should not occur an illegal instruction such as IMPDEP2.");
+ throw new AssertionViolatedException(
+ "In this JustIce verification pass there should not occur an illegal instruction such as IMPDEP2.");
}
/**
@@ -1807,7 +1853,8 @@ public class InstConstraintVisitor exten
// TODO: This can only be checked when using Staerk-et-al's "set of object types"
// instead of a "wider cast object type" created during verification.
//if ( ! rFromStack.isAssignmentCompatibleWith(rFromDesc) ){
- // constraintViolated(o, "Expecting a '"+fromDesc+"' but found a '"+fromStack+"' on the stack (which is not assignment compatible).");
+ // constraintViolated(o, "Expecting a '"+fromDesc+"' but found a '"+fromStack+
+ // "' on the stack (which is not assignment compatible).");
//}
referenceTypeIsInitialized(o, rFromStack);
}
@@ -1826,8 +1873,8 @@ public class InstConstraintVisitor exten
}
referenceTypeIsInitialized(o, (ReferenceType) objref);
if (!(objref instanceof ObjectType)){
- if (!(objref instanceof ArrayType)){
- constraintViolated(o, "Expecting an ObjectType as 'objectref' on the stack, not a '"+objref+"'."); // could be a ReturnaddressType
+ if (!(objref instanceof ArrayType)){ // could be a ReturnaddressType
+ constraintViolated(o, "Expecting an ObjectType as 'objectref' on the stack, not a '"+objref+"'.");
}
else{
objref = GENERIC_ARRAY;
@@ -1858,8 +1905,12 @@ public class InstConstraintVisitor exten
public void visitINVOKESPECIAL(INVOKESPECIAL o){
try {
// Don't init an object twice.
- if ( (o.getMethodName(cpg).equals(Constants.CONSTRUCTOR_NAME)) && (!(stack().peek(o.getArgumentTypes(cpg).length) instanceof UninitializedObjectType)) ){
- constraintViolated(o, "Possibly initializing object twice. A valid instruction sequence must not have an uninitialized object on the operand stack or in a local variable during a backwards branch, or in a local variable in code protected by an exception handler. Please see The Java Virtual Machine Specification, Second Edition, 4.9.4 (pages 147 and 148) for details.");
+ if ( (o.getMethodName(cpg).equals(Constants.CONSTRUCTOR_NAME)) &&
+ (!(stack().peek(o.getArgumentTypes(cpg).length) instanceof UninitializedObjectType)) ){
+ constraintViolated(o, "Possibly initializing object twice."+
+ " A valid instruction sequence must not have an uninitialized object on the operand stack or in a local variable"+
+ " during a backwards branch, or in a local variable in code protected by an exception handler."+
+ " Please see The Java Virtual Machine Specification, Second Edition, 4.9.4 (pages 147 and 148) for details.");
}
// the o.getClassType(cpg) type has passed pass 2; see visitLoadClass(o).
@@ -1894,7 +1945,8 @@ public class InstConstraintVisitor exten
// TODO: This can only be checked using Staerk-et-al's "set of object types", not
// using a "wider cast object type".
if ( ! rFromStack.isAssignmentCompatibleWith(rFromDesc) ){
- constraintViolated(o, "Expecting a '"+fromDesc+"' but found a '"+fromStack+"' on the stack (which is not assignment compatible).");
+ constraintViolated(o, "Expecting a '"+fromDesc+"' but found a '"+fromStack+
+ "' on the stack (which is not assignment compatible).");
}
referenceTypeIsInitialized(o, rFromStack);
}
@@ -1915,8 +1967,8 @@ public class InstConstraintVisitor exten
if ( !(o.getMethodName(cpg).equals(Constants.CONSTRUCTOR_NAME))){
referenceTypeIsInitialized(o, (ReferenceType) objref);
if (!(objref instanceof ObjectType)){
- if (!(objref instanceof ArrayType)){
- constraintViolated(o, "Expecting an ObjectType as 'objectref' on the stack, not a '"+objref+"'."); // could be a ReturnaddressType
+ if (!(objref instanceof ArrayType)){ // could be a ReturnaddressType
+ constraintViolated(o, "Expecting an ObjectType as 'objectref' on the stack, not a '"+objref+"'.");
}
else{
objref = GENERIC_ARRAY;
@@ -1927,7 +1979,8 @@ public class InstConstraintVisitor exten
}
else{
if (!(objref instanceof UninitializedObjectType)){
- constraintViolated(o, "Expecting an UninitializedObjectType as 'objectref' on the stack, not a '"+objref+"'. Otherwise, you couldn't invoke a method since an array has no methods (not to speak of a return address).");
+ constraintViolated(o, "Expecting an UninitializedObjectType as 'objectref' on the stack, not a '"+objref+
+ "'. Otherwise, you couldn't invoke a method since an array has no methods (not to speak of a return address).");
}
objref_classname = ((UninitializedObjectType) objref).getInitialized().getClassName();
}
@@ -1981,7 +2034,8 @@ public class InstConstraintVisitor exten
// TODO: This check can possibly only be done using Staerk-et-al's "set of object types"
// instead of a "wider cast object type" created during verification.
if ( ! rFromStack.isAssignmentCompatibleWith(rFromDesc) ){
- constraintViolated(o, "Expecting a '"+fromDesc+"' but found a '"+fromStack+"' on the stack (which is not assignment compatible).");
+ constraintViolated(o, "Expecting a '"+fromDesc+"' but found a '"+fromStack+
+ "' on the stack (which is not assignment compatible).");
}
referenceTypeIsInitialized(o, rFromStack);
}
@@ -2034,7 +2088,8 @@ public class InstConstraintVisitor exten
// TODO: This can possibly only be checked when using Staerk-et-al's "set of object types" instead
// of a single "wider cast object type" created during verification.
if ( ! rFromStack.isAssignmentCompatibleWith(rFromDesc) ){
- constraintViolated(o, "Expecting a '"+fromDesc+"' but found a '"+fromStack+"' on the stack (which is not assignment compatible).");
+ constraintViolated(o, "Expecting a '"+fromDesc+"' but found a '"+fromStack+
+ "' on the stack (which is not assignment compatible).");
}
referenceTypeIsInitialized(o, rFromStack);
}
@@ -2053,8 +2108,8 @@ public class InstConstraintVisitor exten
}
referenceTypeIsInitialized(o, (ReferenceType) objref);
if (!(objref instanceof ObjectType)){
- if (!(objref instanceof ArrayType)){
- constraintViolated(o, "Expecting an ObjectType as 'objectref' on the stack, not a '"+objref+"'."); // could be a ReturnaddressType
+ if (!(objref instanceof ArrayType)){ // could be a ReturnaddressType
+ constraintViolated(o, "Expecting an ObjectType as 'objectref' on the stack, not a '"+objref+"'.");
}
else{
objref = GENERIC_ARRAY;
@@ -2329,7 +2384,9 @@ public class InstConstraintVisitor exten
( c instanceof ConstantFloat ) ||
( c instanceof ConstantString ) ||
( c instanceof ConstantClass ) ) ){
- constraintViolated(o, "Referenced constant should be a CONSTANT_Integer, a CONSTANT_Float, a CONSTANT_String or a CONSTANT_Class, but is '"+c+"'.");
+ constraintViolated(o,
+ "Referenced constant should be a CONSTANT_Integer, a CONSTANT_Float, a CONSTANT_String or a CONSTANT_Class, but is '"+
+ c + "'.");
}
}
@@ -2344,7 +2401,9 @@ public class InstConstraintVisitor exten
( c instanceof ConstantFloat ) ||
( c instanceof ConstantString ) ||
( c instanceof ConstantClass ) ) ){
- constraintViolated(o, "Referenced constant should be a CONSTANT_Integer, a CONSTANT_Float, a CONSTANT_String or a CONSTANT_Class, but is '"+c+"'.");
+ constraintViolated(o,
+ "Referenced constant should be a CONSTANT_Integer, a CONSTANT_Float, a CONSTANT_String or a CONSTANT_Class, but is '"+
+ c + "'.");
}
}
@@ -2358,7 +2417,8 @@ public class InstConstraintVisitor exten
Constant c = cpg.getConstant(o.getIndex());
if (! ( ( c instanceof ConstantLong) ||
( c instanceof ConstantDouble ) ) ){
- constraintViolated(o, "Referenced constant should be a CONSTANT_Integer, a CONSTANT_Float or a CONSTANT_String, but is '"+c+"'.");
+ constraintViolated(o,
+ "Referenced constant should be a CONSTANT_Integer, a CONSTANT_Float or a CONSTANT_String, but is '"+c+"'.");
}
}
@@ -2619,7 +2679,8 @@ public class InstConstraintVisitor exten
@Override
public void visitPOP(POP o){
if (stack().peek().getSize() != 1){
- constraintViolated(o, "Stack top size should be 1 but stack top is '"+stack().peek()+"' of size '"+stack().peek().getSize()+"'.");
+ constraintViolated(o,
+ "Stack top size should be 1 but stack top is '"+stack().peek()+"' of size '"+stack().peek().getSize()+"'.");
}
}
@@ -2629,7 +2690,8 @@ public class InstConstraintVisitor exten
@Override
public void visitPOP2(POP2 o){
if (stack().peek().getSize() != 2){
- constraintViolated(o, "Stack top size should be 2 but stack top is '"+stack().peek()+"' of size '"+stack().peek().getSize()+"'.");
+ constraintViolated(o,
+ "Stack top size should be 2 but stack top is '"+stack().peek()+"' of size '"+stack().peek().getSize()+"'.");
}
}
@@ -2642,7 +2704,8 @@ public class InstConstraintVisitor exten
Type objectref = stack().peek(1);
if (! ( (objectref instanceof ObjectType) || (objectref == Type.NULL) ) ){
- constraintViolated(o, "Stack next-to-top should be an object reference that's not an array reference, but is '"+objectref+"'.");
+ constraintViolated(o,
+ "Stack next-to-top should be an object reference that's not an array reference, but is '"+objectref+"'.");
}
String field_name = o.getFieldName(cpg);
@@ -2714,7 +2777,10 @@ public class InstConstraintVisitor exten
ObjectType objreftype = (ObjectType) tp;
if (! ( objreftype.equals(curr) ||
objreftype.subclassOf(curr) ) ){
- constraintViolated(o, "The referenced field has the ACC_PROTECTED modifier, and it's a member of the current class or a superclass of the current class. However, the referenced object type '"+stack().peek()+"' is not the current class or a subclass of the current class.");
+ constraintViolated(o,
+ "The referenced field has the ACC_PROTECTED modifier, and it's a member of the current class or"+
+ " a superclass of the current class. However, the referenced object type '"+stack().peek()+
+ "' is not the current class or a subclass of the current class.");
}
}
}
@@ -2878,7 +2944,8 @@ public class InstConstraintVisitor exten
constraintViolated(o, "The value at the stack top is not of size '1', but of size '"+stack().peek().getSize()+"'.");
}
if (stack().peek(1).getSize() != 1){
- constraintViolated(o, "The value at the stack next-to-top is not of size '1', but of size '"+stack().peek(1).getSize()+"'.");
+ constraintViolated(o,
+ "The value at the stack next-to-top is not of size '1', but of size '"+stack().peek(1).getSize()+"'.");
}
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstructionContext.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstructionContext.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstructionContext.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/InstructionContext.java Thu Aug 20 21:36:33 2015
@@ -72,7 +72,8 @@ public interface InstructionContext{
* @return true - if and only if the "outgoing" frame situation
* changed from the one before execute()ing.
*/
- boolean execute(Frame inFrame, ArrayList<InstructionContext> executionPredecessors, InstConstraintVisitor icv, ExecutionVisitor ev);
+ boolean execute(Frame inFrame, ArrayList<InstructionContext> executionPredecessors,
+ InstConstraintVisitor icv, ExecutionVisitor ev);
Frame getInFrame();
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/LocalVariables.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/LocalVariables.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/LocalVariables.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/LocalVariables.java Thu Aug 20 21:36:33 2015
@@ -142,11 +142,14 @@ public class LocalVariables{
// We won't accept an unitialized object if we know it was initialized;
// compare vmspec2, 4.9.4, last paragraph.
if ( (!(locals[i] instanceof UninitializedObjectType)) && (lv.locals[i] instanceof UninitializedObjectType) ){
- throw new StructuralCodeConstraintException("Backwards branch with an uninitialized object in the local variables detected.");
+ throw new StructuralCodeConstraintException(
+ "Backwards branch with an uninitialized object in the local variables detected.");
}
// Even harder, what about _different_ uninitialized object types?!
- if ( (!(locals[i].equals(lv.locals[i]))) && (locals[i] instanceof UninitializedObjectType) && (lv.locals[i] instanceof UninitializedObjectType) ){
- throw new StructuralCodeConstraintException("Backwards branch with an uninitialized object in the local variables detected.");
+ if ( (!(locals[i].equals(lv.locals[i]))) && (locals[i] instanceof UninitializedObjectType) &&
+ (lv.locals[i] instanceof UninitializedObjectType) ){
+ throw new StructuralCodeConstraintException(
+ "Backwards branch with an uninitialized object in the local variables detected.");
}
// If we just didn't know that it was initialized, we have now learned.
if (locals[i] instanceof UninitializedObjectType){
@@ -163,14 +166,16 @@ public class LocalVariables{
}
else{
// We should have checked this in Pass2!
- throw new AssertionViolatedException("Could not load all the super classes of '"+locals[i]+"' and '"+lv.locals[i]+"'.");
+ throw new AssertionViolatedException(
+ "Could not load all the super classes of '"+locals[i]+"' and '"+lv.locals[i]+"'.");
}
}
}
else{
if (! (locals[i].equals(lv.locals[i])) ){
/*TODO
- if ((locals[i] instanceof org.apache.commons.bcel6.generic.ReturnaddressType) && (lv.locals[i] instanceof org.apache.commons.bcel6.generic.ReturnaddressType)){
+ if ((locals[i] instanceof org.apache.commons.bcel6.generic.ReturnaddressType) &&
+ (lv.locals[i] instanceof org.apache.commons.bcel6.generic.ReturnaddressType)){
//System.err.println("merging "+locals[i]+" and "+lv.locals[i]);
throw new AssertionViolatedException("Merging different ReturnAddresses: '"+locals[i]+"' and '"+lv.locals[i]+"'.");
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/OperandStack.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/OperandStack.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/OperandStack.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/OperandStack.java Thu Aug 20 21:36:33 2015
@@ -163,7 +163,8 @@ public class OperandStack{
throw new AssertionViolatedException("The OperandStack does not know about '"+type+"'; use Type.INT instead.");
}
if (slotsUsed() >= maxStack){
- throw new AssertionViolatedException("OperandStack too small, should have thrown proper Exception elsewhere. Stack: "+this);
+ throw new AssertionViolatedException(
+ "OperandStack too small, should have thrown proper Exception elsewhere. Stack: "+this);
}
stack.add(type);
}
@@ -219,7 +220,8 @@ public class OperandStack{
public void merge(OperandStack s){
try {
if ( (slotsUsed() != s.slotsUsed()) || (size() != s.size()) ) {
- throw new StructuralCodeConstraintException("Cannot merge stacks of different size:\nOperandStack A:\n"+this+"\nOperandStack B:\n"+s);
+ throw new StructuralCodeConstraintException(
+ "Cannot merge stacks of different size:\nOperandStack A:\n"+this+"\nOperandStack B:\n"+s);
}
for (int i=0; i<size(); i++){
@@ -230,7 +232,8 @@ public class OperandStack{
}
// Even harder, we're not initialized but are supposed to broaden
// the known object type
- if ( (!(stack.get(i).equals(s.stack.get(i)))) && (stack.get(i) instanceof UninitializedObjectType) && (!(s.stack.get(i) instanceof UninitializedObjectType))){
+ if ( (!(stack.get(i).equals(s.stack.get(i)))) &&
+ (stack.get(i) instanceof UninitializedObjectType) && (!(s.stack.get(i) instanceof UninitializedObjectType))){
throw new StructuralCodeConstraintException("Backwards branch with an uninitialized object on the stack detected.");
}
// on the other hand...
@@ -245,7 +248,8 @@ public class OperandStack{
stack.set(i, ((ReferenceType) stack.get(i)).getFirstCommonSuperclass((ReferenceType) (s.stack.get(i))));
}
else{
- throw new StructuralCodeConstraintException("Cannot merge stacks of different types:\nStack A:\n"+this+"\nStack B:\n"+s);
+ throw new StructuralCodeConstraintException(
+ "Cannot merge stacks of different types:\nStack A:\n"+this+"\nStack B:\n"+s);
}
}
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Pass3bVerifier.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Pass3bVerifier.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Pass3bVerifier.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Pass3bVerifier.java Thu Aug 20 21:36:33 2015
@@ -126,12 +126,14 @@ public final class Pass3bVerifier extend
* The proof of termination is about the existence of a
* fix point of frame merging.
*/
- private void circulationPump(MethodGen m,ControlFlowGraph cfg, InstructionContext start, Frame vanillaFrame, InstConstraintVisitor icv, ExecutionVisitor ev){
+ private void circulationPump(MethodGen m,ControlFlowGraph cfg, InstructionContext start,
+ Frame vanillaFrame, InstConstraintVisitor icv, ExecutionVisitor ev){
final Random random = new Random();
InstructionContextQueue icq = new InstructionContextQueue();
- start.execute(vanillaFrame, new ArrayList<InstructionContext>(), icv, ev); // new ArrayList() <=> no Instruction was executed before
- // => Top-Level routine (no jsr call before)
+ start.execute(vanillaFrame, new ArrayList<InstructionContext>(), icv, ev);
+ // new ArrayList() <=> no Instruction was executed before
+ // => Top-Level routine (no jsr call before)
icq.add(start, new ArrayList<InstructionContext>());
// LOOP!
@@ -188,7 +190,8 @@ public final class Pass3bVerifier extend
}
JsrInstruction jsr = (JsrInstruction) (lastJSR.getInstruction().getInstruction());
if ( theSuccessor != (cfg.contextOf(jsr.physicalSuccessor())) ){
- throw new AssertionViolatedException("RET '"+u.getInstruction()+"' info inconsistent: jump back to '"+theSuccessor+"' or '"+cfg.contextOf(jsr.physicalSuccessor())+"'?");
+ throw new AssertionViolatedException("RET '"+u.getInstruction()+"' info inconsistent: jump back to '"+
+ theSuccessor+"' or '"+cfg.contextOf(jsr.physicalSuccessor())+"'?");
}
if (theSuccessor.execute(u.getOutFrame(oldchain), newchain, icv, ev)){
@@ -223,9 +226,14 @@ public final class Pass3bVerifier extend
// mean we're in a subroutine if we go to the exception handler.
// We should address this problem later; by now we simply "cut" the chain
// by using an empty chain for the exception handlers.
- //if (v.execute(new Frame(u.getOutFrame(oldchain).getLocals(), new OperandStack (u.getOutFrame().getStack().maxStack(), (exc_hds[s].getExceptionType()==null? Type.THROWABLE : exc_hds[s].getExceptionType())) ), newchain), icv, ev){
+ //if (v.execute(new Frame(u.getOutFrame(oldchain).getLocals(),
+ // new OperandStack (u.getOutFrame().getStack().maxStack(),
+ // (exc_hds[s].getExceptionType()==null? Type.THROWABLE : exc_hds[s].getExceptionType())) ), newchain), icv, ev){
//icq.add(v, (ArrayList) newchain.clone());
- if (v.execute(new Frame(u.getOutFrame(oldchain).getLocals(), new OperandStack (u.getOutFrame(oldchain).getStack().maxStack(), (exc_hd.getExceptionType()==null? Type.THROWABLE : exc_hd.getExceptionType())) ), new ArrayList<InstructionContext>(), icv, ev)){
+ if (v.execute(new Frame(u.getOutFrame(oldchain).getLocals(),
+ new OperandStack (u.getOutFrame(oldchain).getStack().maxStack(),
+ (exc_hd.getExceptionType()==null? Type.THROWABLE : exc_hd.getExceptionType())) ),
+ new ArrayList<InstructionContext>(), icv, ev)){
icq.add(v, new ArrayList<InstructionContext>());
}
}
@@ -236,17 +244,21 @@ public final class Pass3bVerifier extend
do{
if ((ih.getInstruction() instanceof ReturnInstruction) && (!(cfg.isDead(ih)))) {
InstructionContext ic = cfg.contextOf(ih);
- Frame f = ic.getOutFrame(new ArrayList<InstructionContext>()); // TODO: This is buggy, we check only the top-level return instructions this way. Maybe some maniac returns from a method when in a subroutine?
+ // TODO: This is buggy, we check only the top-level return instructions this way.
+ // Maybe some maniac returns from a method when in a subroutine?
+ Frame f = ic.getOutFrame(new ArrayList<InstructionContext>());
LocalVariables lvs = f.getLocals();
for (int i=0; i<lvs.maxLocals(); i++){
if (lvs.get(i) instanceof UninitializedObjectType){
- this.addMessage("Warning: ReturnInstruction '"+ic+"' may leave method with an uninitialized object in the local variables array '"+lvs+"'.");
+ this.addMessage("Warning: ReturnInstruction '"+ic+
+ "' may leave method with an uninitialized object in the local variables array '"+lvs+"'.");
}
}
OperandStack os = f.getStack();
for (int i=0; i<os.size(); i++){
if (os.peek(i) instanceof UninitializedObjectType){
- this.addMessage("Warning: ReturnInstruction '"+ic+"' may leave method with an uninitialized object on the operand stack '"+os+"'.");
+ this.addMessage("Warning: ReturnInstruction '"+ic+
+ "' may leave method with an uninitialized object on the operand stack '"+os+"'.");
}
}
//see JVM $4.8.2
@@ -283,7 +295,8 @@ public final class Pass3bVerifier extend
* @since 6.0
*/
public void invalidReturnTypeError(Type returnedType, MethodGen m){
- throw new StructuralCodeConstraintException("Returned type "+returnedType+" does not match Method's return type "+m.getReturnType());
+ throw new StructuralCodeConstraintException(
+ "Returned type "+returnedType+" does not match Method's return type "+m.getReturnType());
}
/**
@@ -348,7 +361,8 @@ public final class Pass3bVerifier extend
Type[] argtypes = mg.getArgumentTypes();
int twoslotoffset = 0;
for (int j=0; j<argtypes.length; j++){
- if (argtypes[j] == Type.SHORT || argtypes[j] == Type.BYTE || argtypes[j] == Type.CHAR || argtypes[j] == Type.BOOLEAN){
+ if (argtypes[j] == Type.SHORT || argtypes[j] == Type.BYTE ||
+ argtypes[j] == Type.CHAR || argtypes[j] == Type.BOOLEAN){
argtypes[j] = Type.INT;
}
f.getLocals().set(twoslotoffset + j + (mg.isStatic()?0:1), argtypes[j]);
@@ -371,7 +385,8 @@ public final class Pass3bVerifier extend
PrintWriter pw = new PrintWriter(sw);
re.printStackTrace(pw);
- throw new AssertionViolatedException("Some RuntimeException occured while verify()ing class '"+jc.getClassName()+"', method '"+methods[method_no]+"'. Original RuntimeException's stack trace:\n---\n"+sw+"---\n", re);
+ throw new AssertionViolatedException("Some RuntimeException occured while verify()ing class '"+jc.getClassName()+
+ "', method '"+methods[method_no]+"'. Original RuntimeException's stack trace:\n---\n"+sw+"---\n", re);
}
return VerificationResult.VR_OK;
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Subroutines.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Subroutines.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Subroutines.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/Subroutines.java Thu Aug 20 21:36:33 2015
@@ -115,7 +115,8 @@ public class Subroutines{
*/
@Override
public String toString(){
- String ret = "Subroutine: Local variable is '"+localVariable+"', JSRs are '"+theJSRs+"', RET is '"+theRET+"', Instructions: '"+instructions+"'.";
+ String ret = "Subroutine: Local variable is '"+localVariable+
+ "', JSRs are '"+theJSRs+"', RET is '"+theRET+"', Instructions: '"+instructions+"'.";
ret += " Accessed local variable slots: '";
int[] alv = getAccessedLocalsIndices();
@@ -140,13 +141,15 @@ public class Subroutines{
*/
void setLeavingRET(){
if (localVariable == UNSET){
- throw new AssertionViolatedException("setLeavingRET() called for top-level 'subroutine' or forgot to set local variable first.");
+ throw new AssertionViolatedException(
+ "setLeavingRET() called for top-level 'subroutine' or forgot to set local variable first.");
}
InstructionHandle ret = null;
for (InstructionHandle actual : instructions) {
if (actual.getInstruction() instanceof RET){
if (ret != null){
- throw new StructuralCodeConstraintException("Subroutine with more then one RET detected: '"+ret+"' and '"+actual+"'.");
+ throw new StructuralCodeConstraintException(
+ "Subroutine with more then one RET detected: '"+ret+"' and '"+actual+"'.");
}
ret = actual;
}
@@ -155,7 +158,8 @@ public class Subroutines{
throw new StructuralCodeConstraintException("Subroutine without a RET detected.");
}
if (((RET) ret.getInstruction()).getIndex() != localVariable){
- throw new StructuralCodeConstraintException("Subroutine uses '"+ret+"' which does not match the correct local variable '"+localVariable+"'.");
+ throw new StructuralCodeConstraintException(
+ "Subroutine uses '"+ret+"' which does not match the correct local variable '"+localVariable+"'.");
}
theRET = ret;
}
@@ -265,7 +269,8 @@ public class Subroutines{
//TODO: Implement caching.
Set<Integer> acc = new HashSet<>();
if (theRET == null && this != getTopLevel()){
- throw new AssertionViolatedException("This subroutine object must be built up completely before calculating accessed locals.");
+ throw new AssertionViolatedException(
+ "This subroutine object must be built up completely before calculating accessed locals.");
}
{
for (InstructionHandle ih : instructions) {
@@ -411,7 +416,8 @@ public class Subroutines{
// Now do a BFS from every subroutine leader to find all the
// instructions that belong to a subroutine.
- Set<InstructionHandle> instructions_assigned = new HashSet<>(); // we don't want to assign an instruction to two or more Subroutine objects.
+ // we don't want to assign an instruction to two or more Subroutine objects.
+ Set<InstructionHandle> instructions_assigned = new HashSet<>();
Map<InstructionHandle, Integer> colors = new HashMap<>(); //Graph colouring. Key: InstructionHandle, Value: Integer .
@@ -428,7 +434,12 @@ public class Subroutines{
Q.clear();
Q.add(actual); // add(Obj) adds to the end, remove(0) removes from the start.
- /* BFS ALGORITHM MODIFICATION: Start out with multiple "root" nodes, as exception handlers are starting points of top-level code, too. [why top-level? TODO: Refer to the special JustIce notion of subroutines.]*/
+ /*
+ * BFS ALGORITHM MODIFICATION:
+ * Start out with multiple "root" nodes, as exception handlers are starting points of top-level code, too.
+ * [why top-level?
+ * TODO: Refer to the special JustIce notion of subroutines.]
+ */
if (actual == all[0]){
for (CodeExceptionGen handler : handlers) {
colors.put(handler.getHandlerPC(), GRAY);
@@ -454,7 +465,8 @@ public class Subroutines{
if (colors.get(element) == BLACK){
((SubroutineImpl) (actual==all[0]?getTopLevel():getSubroutine(actual))).addInstruction(element);
if (instructions_assigned.contains(element)){
- throw new StructuralCodeConstraintException("Instruction '"+element+"' is part of more than one subroutine (or of the top level and a subroutine).");
+ throw new StructuralCodeConstraintException("Instruction '"+element+
+ "' is part of more than one subroutine (or of the top level and a subroutine).");
}
instructions_assigned.add(element);
}
@@ -468,11 +480,14 @@ public class Subroutines{
// as is mandated by JustIces notion of subroutines.
for (CodeExceptionGen handler : handlers) {
InstructionHandle _protected = handler.getStartPC();
- while (_protected != handler.getEndPC().getNext()){// Note the inclusive/inclusive notation of "generic API" exception handlers!
+ while (_protected != handler.getEndPC().getNext()){
+ // Note the inclusive/inclusive notation of "generic API" exception handlers!
for (Subroutine sub : subroutines.values()) {
if (sub != subroutines.get(all[0])){ // We don't want to forbid top-level exception handlers.
if (sub.contains(_protected)){
- throw new StructuralCodeConstraintException("Subroutine instruction '"+_protected+"' is protected by an exception handler, '"+handler+"'. This is forbidden by the JustIce verifier due to its clear definition of subroutines.");
+ throw new StructuralCodeConstraintException("Subroutine instruction '"+_protected+
+ "' is protected by an exception handler, '"+handler+
+ "'. This is forbidden by the JustIce verifier due to its clear definition of subroutines.");
}
}
}
@@ -510,7 +525,10 @@ public class Subroutines{
if (!set.add(Integer.valueOf(index))){
// Don't use toString() here because of possibly infinite recursive subSubs() calls then.
SubroutineImpl si = (SubroutineImpl) sub2;
- throw new StructuralCodeConstraintException("Subroutine with local variable '"+si.localVariable+"', JSRs '"+si.theJSRs+"', RET '"+si.theRET+"' is called by a subroutine which uses the same local variable index as itself; maybe even a recursive call? JustIce's clean definition of a subroutine forbids both.");
+ throw new StructuralCodeConstraintException("Subroutine with local variable '"+si.localVariable+"', JSRs '"+
+ si.theJSRs+"', RET '"+si.theRET+
+ "' is called by a subroutine which uses the same local variable index as itself; maybe even a recursive call?"+
+ " JustIce's clean definition of a subroutine forbids both.");
}
noRecursiveCalls(sub2, set);
@@ -531,7 +549,8 @@ public class Subroutines{
Subroutine ret = subroutines.get(leader);
if (ret == null){
- throw new AssertionViolatedException("Subroutine requested for an InstructionHandle that is not a leader of a subroutine.");
+ throw new AssertionViolatedException(
+ "Subroutine requested for an InstructionHandle that is not a leader of a subroutine.");
}
if (ret == TOPLEVEL){
Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/classfile/UtilityTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/classfile/UtilityTestCase.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/classfile/UtilityTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/classfile/UtilityTestCase.java Thu Aug 20 21:36:33 2015
@@ -24,8 +24,14 @@ import junit.framework.TestCase;
public class UtilityTestCase extends TestCase {
public void testSignatureToStringWithGenerics() throws Exception {
- assertEquals("generic signature", "java.util.Map<X, java.util.List<Y>>", Utility.signatureToString("Ljava/util/Map<TX;Ljava/util/List<TY;>;>;"));
- assertEquals("generic signature", "java.util.Set<? extends java.nio.file.OpenOption>", Utility.signatureToString("Ljava/util/Set<+Ljava/nio/file/OpenOption;>;"));
- assertEquals("generic signature", "java.nio.file.attribute.FileAttribute<?>...[]", Utility.signatureToString("[Ljava/nio/file/attribute/FileAttribute<*>;"));
+ assertEquals("generic signature",
+ "java.util.Map<X, java.util.List<Y>>",
+ Utility.signatureToString("Ljava/util/Map<TX;Ljava/util/List<TY;>;>;"));
+ assertEquals("generic signature",
+ "java.util.Set<? extends java.nio.file.OpenOption>"
+ , Utility.signatureToString("Ljava/util/Set<+Ljava/nio/file/OpenOption;>;"));
+ assertEquals("generic signature",
+ "java.nio.file.attribute.FileAttribute<?>...[]",
+ Utility.signatureToString("[Ljava/nio/file/attribute/FileAttribute<*>;"));
}
}
Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/AbstractVerifierTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/AbstractVerifierTestCase.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/AbstractVerifierTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/AbstractVerifierTestCase.java Thu Aug 20 21:36:33 2015
@@ -42,7 +42,8 @@ public abstract class AbstractVerifierTe
}
/**
- * Asserts that the verification of the given class is rejected. If it isn't it throws an AssertionFailedError with the given message.
+ * Asserts that the verification of the given class is rejected.
+ * If it isn't it throws an AssertionFailedError with the given message.
*
* @param classname simple classname of the class to verify
* @param message message displayed if assertion fails
Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/VerifierArrayAccessTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/VerifierArrayAccessTestCase.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/VerifierArrayAccessTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/VerifierArrayAccessTestCase.java Thu Aug 20 21:36:33 2015
@@ -30,13 +30,16 @@ public class VerifierArrayAccessTestCase
new TestArrayAccess03Creator().create();
assertVerifyRejected("TestArrayAccess03", "Verification of an arraystore instruction on an object must fail.");
new TestArrayAccess04Creator().create();
- assertVerifyRejected("TestArrayAccess04", "Verification of an arraystore instruction of an int on an array of references must fail.");
+ assertVerifyRejected("TestArrayAccess04",
+ "Verification of an arraystore instruction of an int on an array of references must fail.");
}
public void testValidArrayAccess() throws IOException {
- assertVerifyOK("TestArrayAccess01", "Verification of an arraystore instruction on an array that is not compatible with the stored element must pass.");
+ assertVerifyOK("TestArrayAccess01",
+ "Verification of an arraystore instruction on an array that is not compatible with the stored element must pass.");
new TestArrayAccess02Creator().create();
- assertVerifyOK("TestArrayAccess02", "Verification of an arraystore instruction on an array that is not compatible with the stored element must pass.");
+ assertVerifyOK("TestArrayAccess02",
+ "Verification of an arraystore instruction on an array that is not compatible with the stored element must pass.");
}
}
Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/VerifierTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/VerifierTestCase.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/VerifierTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/VerifierTestCase.java Thu Aug 20 21:36:33 2015
@@ -34,10 +34,12 @@ public class VerifierTestCase extends Te
Verifier verifier = VerifierFactory.getVerifier(classname);
VerificationResult result = verifier.doPass1();
- assertEquals("Pass 1 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK, result.getStatus());
+ assertEquals("Pass 1 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK,
+ result.getStatus());
result = verifier.doPass2();
- assertEquals("Pass 2 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK, result.getStatus());
+ assertEquals("Pass 2 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK,
+ result.getStatus());
}
}
Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess02Creator.java Thu Aug 20 21:36:33 2015
@@ -39,7 +39,8 @@ public class TestArrayAccess02Creator ex
private final ClassGen _cg;
public TestArrayAccess02Creator() {
- _cg = new ClassGen(TEST_PACKAGE+".TestArrayAccess02", "java.lang.Object", "TestArrayAccess02.java", Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
+ _cg = new ClassGen(TEST_PACKAGE+".TestArrayAccess02", "java.lang.Object", "TestArrayAccess02.java",
+ Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
_cp = _cg.getConstantPool();
_factory = new InstructionFactory(_cg, _cp);
@@ -54,7 +55,8 @@ public void create(OutputStream out) thr
private void createMethod_0() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", TEST_PACKAGE+".TestArrayAccess02", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>",
+ TEST_PACKAGE+".TestArrayAccess02", il, _cp);
InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
Assert.assertNotNull(ih_0); // TODO why is this not used
@@ -69,7 +71,8 @@ public void create(OutputStream out) thr
private void createMethod_1() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.VOID, Type.NO_ARGS, new String[] { }, "test", TEST_PACKAGE+".TestArrayAccess02", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.VOID, Type.NO_ARGS, new String[] { },
+ "test", TEST_PACKAGE+".TestArrayAccess02", il, _cp);
InstructionHandle ih_0 = il.append(new PUSH(_cp, 1));
Assert.assertNotNull(ih_0); // TODO why is this not used
Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess03Creator.java Thu Aug 20 21:36:33 2015
@@ -39,7 +39,8 @@ public class TestArrayAccess03Creator ex
private final ClassGen _cg;
public TestArrayAccess03Creator() {
- _cg = new ClassGen(TEST_PACKAGE+".TestArrayAccess03", "java.lang.Object", "TestArrayAccess03.java", Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
+ _cg = new ClassGen(TEST_PACKAGE+".TestArrayAccess03", "java.lang.Object", "TestArrayAccess03.java",
+ Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
_cp = _cg.getConstantPool();
_factory = new InstructionFactory(_cg, _cp);
@@ -54,7 +55,8 @@ public void create(OutputStream out) thr
private void createMethod_0() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", TEST_PACKAGE+".TestArrayAccess03", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>",
+ TEST_PACKAGE+".TestArrayAccess03", il, _cp);
InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
Assert.assertNotNull(ih_0); // TODO why is this not used
@@ -69,7 +71,8 @@ public void create(OutputStream out) thr
private void createMethod_1() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.VOID, new Type[] { Type.OBJECT }, new String[] { "arg0" }, "test", TEST_PACKAGE+".TestArrayAccess03", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.VOID, new Type[] { Type.OBJECT },
+ new String[] { "arg0" }, "test", TEST_PACKAGE+".TestArrayAccess03", il, _cp);
InstructionHandle ih_0 = il.append(new PUSH(_cp, 1));
Assert.assertNotNull(ih_0); // TODO why is this not used
Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestArrayAccess04Creator.java Thu Aug 20 21:36:33 2015
@@ -39,7 +39,8 @@ public class TestArrayAccess04Creator ex
private final ClassGen _cg;
public TestArrayAccess04Creator() {
- _cg = new ClassGen(TEST_PACKAGE+".TestArrayAccess04", "java.lang.Object", "TestArrayAccess04.java", Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
+ _cg = new ClassGen(TEST_PACKAGE+".TestArrayAccess04", "java.lang.Object", "TestArrayAccess04.java",
+ Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
_cp = _cg.getConstantPool();
_factory = new InstructionFactory(_cg, _cp);
@@ -54,7 +55,8 @@ public void create(OutputStream out) thr
private void createMethod_0() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", TEST_PACKAGE+".TestArrayAccess04", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>",
+ TEST_PACKAGE+".TestArrayAccess04", il, _cp);
InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
Assert.assertNotNull(ih_0); // TODO why is this not used
@@ -69,7 +71,8 @@ public void create(OutputStream out) thr
private void createMethod_1() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.VOID, new Type[] { Type.OBJECT }, new String[] { "arg0" }, "test", TEST_PACKAGE+".TestArrayAccess04", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.VOID, new Type[] { Type.OBJECT },
+ new String[] { "arg0" }, "test", TEST_PACKAGE+".TestArrayAccess04", il, _cp);
InstructionHandle ih_0 = il.append(new PUSH(_cp, 1));
Assert.assertNotNull(ih_0); // TODO why is this not used
Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn01Creator.java Thu Aug 20 21:36:33 2015
@@ -37,7 +37,8 @@ public class TestReturn01Creator extends
private final ClassGen _cg;
public TestReturn01Creator() {
- _cg = new ClassGen(TEST_PACKAGE+".TestReturn01", "java.lang.Object", "TestReturn01.java", Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
+ _cg = new ClassGen(TEST_PACKAGE+".TestReturn01", "java.lang.Object", "TestReturn01.java",
+ Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
_cp = _cg.getConstantPool();
_factory = new InstructionFactory(_cg, _cp);
@@ -52,7 +53,8 @@ public void create(OutputStream out) thr
private void createMethod_0() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", TEST_PACKAGE+".TestReturn01", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { },
+ "<init>", TEST_PACKAGE+".TestReturn01", il, _cp);
InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
Assert.assertNotNull(ih_0); // TODO why is this not used
@@ -67,7 +69,8 @@ public void create(OutputStream out) thr
private void createMethod_1() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.VOID, Type.NO_ARGS, new String[] { }, "foo", TEST_PACKAGE+".TestReturn01", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.VOID, Type.NO_ARGS,
+ new String[] { }, "foo", TEST_PACKAGE+".TestReturn01", il, _cp);
InstructionHandle ih_0 = il.append(_factory.createNew("java.lang.Object"));
Assert.assertNotNull(ih_0); // TODO why is this not used
Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java?rev=1696858&r1=1696857&r2=1696858&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/verifier/tests/TestReturn03Creator.java Thu Aug 20 21:36:33 2015
@@ -37,7 +37,8 @@ public class TestReturn03Creator extends
private final ClassGen _cg;
public TestReturn03Creator() {
- _cg = new ClassGen(TEST_PACKAGE+".TestReturn03", "java.lang.Object", "TestReturn03.java", Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
+ _cg = new ClassGen(TEST_PACKAGE+".TestReturn03", "java.lang.Object", "TestReturn03.java",
+ Constants.ACC_PUBLIC | Constants.ACC_SUPER, new String[] { });
_cp = _cg.getConstantPool();
_factory = new InstructionFactory(_cg, _cp);
@@ -52,7 +53,8 @@ public void create(OutputStream out) thr
private void createMethod_0() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", TEST_PACKAGE+".TestReturn03", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { },
+ "<init>", TEST_PACKAGE+".TestReturn03", il, _cp);
InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
Assert.assertNotNull(ih_0); // TODO why is this not used
@@ -67,7 +69,8 @@ public void create(OutputStream out) thr
private void createMethod_1() {
InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.INT, Type.NO_ARGS, new String[] { }, "test3", TEST_PACKAGE+".TestReturn03", il, _cp);
+ MethodGen method = new MethodGen(Constants.ACC_PUBLIC | Constants.ACC_STATIC, Type.INT, Type.NO_ARGS,
+ new String[] { }, "test3", TEST_PACKAGE+".TestReturn03", il, _cp);
InstructionHandle ih_0 = il.append(InstructionConstants.ACONST_NULL);
Assert.assertNotNull(ih_0); // TODO why is this not used