cvs commit: jakarta-bcel/src/java/org/apache/bcel/verifier/statics Pass3aVerifier.java

[email protected]
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
enver       2004/02/17 02:22:12

  Modified:    src/java/org/apache/bcel/verifier/statics
                        Pass3aVerifier.java
  Log:
  * Make CONSTANT_Class pushed possible for LDC / LDC_W, as is said to be possible in JDK1.5.
  * rm typo
  
  Revision  Changes    Path
  1.8       +11 -6     jakarta-bcel/src/java/org/apache/bcel/verifier/statics/Pass3aVerifier.java
  
  Index: Pass3aVerifier.java
  ===================================================================
  RCS file: /home/cvs/jakarta-bcel/src/java/org/apache/bcel/verifier/statics/Pass3aVerifier.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Pass3aVerifier.java	18 Dec 2003 20:55:12 -0000	1.7
  +++ Pass3aVerifier.java	17 Feb 2004 10:22:12 -0000	1.8
  @@ -464,10 +464,15 @@
   		public void visitLDC(LDC o){
   			indexValid(o, o.getIndex());
   			Constant c = cpg.getConstant(o.getIndex());
  -			if (! ( (c instanceof ConstantInteger)	||
  -							(c instanceof ConstantFloat) 		||
  -							(c instanceof ConstantString) ) ){
  -				constraintViolated(o, "Operand of LDC or LDC_W must be one of CONSTANT_Integer, CONSTANT_Float or CONSTANT_String, but is '"+c+"'.");
  +			if (c instanceof ConstantClass){
  +			  addMessage("Operand of LDC or LDC_W is CONSTANT_Class '"+c+"' - this is only supported in JDK 1.5 and higher.");
  +			}
  +			else{
  +			  if (! ( (c instanceof ConstantInteger)	||
  +			          (c instanceof ConstantFloat) 		||
  +                (c instanceof ConstantString) ) ){
  +            constraintViolated(o, "Operand of LDC or LDC_W must be one of CONSTANT_Integer, CONSTANT_Float or CONSTANT_String, but is '"+c+"'.");
  +			  }
   			}
   		}
   
  @@ -527,7 +532,7 @@
   				Type o_type = o.getType(cpg);
   								
   				// Argh. Sun's implementation allows us to have multiple fields of
  -				// the same name but wirth a different signature.
  +				// the same name but with a different signature.
   				//if (! f_type.equals(o_type)){
   				//	constraintViolated(o, "Referenced field '"+field_name+"' has type '"+f_type+"' instead of '"+o_type+"' as expected.");
   				//}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.