Package org.apache.bcel.verifier

Examples of org.apache.bcel.verifier.Verifier


    // Method is not native, otherwise pass 3 would not happen.
   
    Type t = o.getType(cpg);
    if (t instanceof ObjectType){
      String name = ((ObjectType)t).getClassName();
      Verifier v = VerifierFactory.getVerifier( name );
      VerificationResult vr = v.doPass2();
      if (vr.getStatus() != VerificationResult.VERIFIED_OK){
        constraintViolated(o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
      }
    }
View Full Code Here


    // the o.getClassType(cpg) type has passed pass 2; see visitLoadClass(o).

    Type t = o.getType(cpg);
    if (t instanceof ObjectType){
      String name = ((ObjectType)t).getClassName();
      Verifier v = VerifierFactory.getVerifier( name );
      VerificationResult vr = v.doPass2();
      if (vr.getStatus() != VerificationResult.VERIFIED_OK){
        constraintViolated(o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
      }
    }
View Full Code Here

     */
    @Override
        public void visitLoadClass(LoadClass o){
      ObjectType t = o.getLoadClassType(cpg);
      if (t != null){// null means "no class is loaded"
        Verifier v = VerifierFactory.getVerifier(t.getClassName());
        VerificationResult vr = v.doPass1();
        if (vr.getStatus() != VerificationResult.VERIFIED_OK){
          constraintViolated((Instruction) o, "Class '"+o.getLoadClassType(cpg).getClassName()+"' is referenced, but cannot be loaded: '"+vr+"'.");
        }
      }
    }
View Full Code Here

      Type t = o.getReturnType(cpg);
      if (t instanceof ArrayType){
        t = ((ArrayType) t).getBasicType();
      }
      if (t instanceof ObjectType){
        Verifier v = VerifierFactory.getVerifier(((ObjectType) t).getClassName());
        VerificationResult vr = v.doPass2();
        if (vr.getStatus() != VerificationResult.VERIFIED_OK){
          constraintViolated(o, "Return type class/interface could not be verified successfully: '"+vr.getMessage()+"'.");
        }
      }
     
      Type[] ts = o.getArgumentTypes(cpg);
      for (int i=0; i<ts.length; i++){
        t = ts[i];
        if (t instanceof ArrayType){
          t = ((ArrayType) t).getBasicType();
        }
        if (t instanceof ObjectType){
          Verifier v = VerifierFactory.getVerifier(((ObjectType) t).getClassName());
          VerificationResult vr = v.doPass2();
          if (vr.getStatus() != VerificationResult.VERIFIED_OK){
            constraintViolated(o, "Argument type class/interface could not be verified successfully: '"+vr.getMessage()+"'.");
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.apache.bcel.verifier.Verifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.