Examples of VerificationResult


Examples of org.apache.bcel.verifier.VerificationResult

          ConstantClass cc = (ConstantClass) (cp.getConstant(exc_index));
          checkIndex(cc, cc.getNameIndex(), CONST_Utf8); // cannot be sure this ConstantClass has already been visited (checked)!
          String cname = ((ConstantUtf8) cp.getConstant(cc.getNameIndex())).getBytes().replace('/','.');

          Verifier v = VerifierFactory.getVerifier(cname);
          VerificationResult vr = v.doPass1();

          if (vr != VerificationResult.VR_OK){
            throw new ClassConstraintException("Code attribute '"+tostring(obj)+"' (method '"+m+"') has an exception_table entry '"+tostring(exc_table[i])+"' that references '"+cname+"' as an Exception but it does not pass verification pass 1: "+vr);
          }
          else{
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

        ConstantClass cc = (ConstantClass) (cp.getConstant(exc_indices[i]));
        checkIndex(cc, cc.getNameIndex(), CONST_Utf8); // cannot be sure this ConstantClass has already been visited (checked)!
        String cname = ((ConstantUtf8) cp.getConstant(cc.getNameIndex())).getBytes().replace('/','.'); //convert internal notation on-the-fly to external notation

        Verifier v = VerifierFactory.getVerifier(cname);
        VerificationResult vr = v.doPass1();

        if (vr != VerificationResult.VR_OK){
          throw new ClassConstraintException("Exceptions attribute '"+tostring(obj)+"' references '"+cname+"' as an Exception but it does not pass verification pass 1: "+vr);
        }
        else{
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

        }
      }
     
    }
    catch(LoadingException e){
      return new VerificationResult(VerificationResult.VERIFIED_REJECTED, e.getMessage());
    }
    catch(ClassFormatException e){
      return new VerificationResult(VerificationResult.VERIFIED_REJECTED, e.getMessage());
    }
    catch(RuntimeException e){
      // BCEL does not catch every possible RuntimeException; e.g. if
      // a constant pool index is referenced that does not exist.
      return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Parsing via BCEL did not succeed. "+e.getClass().getName()+" occured:\n"+Utility.getStackTrace(e));
    }

    if (jc != null){
      return VerificationResult.VR_OK;
    }
    else{
      //TODO: Maybe change Repository's behaviour to throw a LoadingException instead of just returning "null"
      //      if a class file cannot be found or in another way be looked up.
      return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Repository.lookup() failed. FILE NOT FOUND?");
    }
  }
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

        circulationPump(cfg, cfg.contextOf(mg.getInstructionList().getStart()), f, icv, ev);
      }
    }
    catch (VerifierConstraintViolatedException ce){
      ce.extendMessage("Constraint violated in method '"+methods[method_no]+"':\n","");
      return new VerificationResult(VerificationResult.VERIFIED_REJECTED, ce.getMessage());
    }
    catch (RuntimeException re){
      // These are internal errors

      StringWriter sw = new StringWriter();
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

   */
  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.doPass2();
      if (vr.getStatus() != VerificationResult.VERIFIED_OK){
        constraintViolated((Instruction) o, "Class '"+o.getLoadClassType(cpg).getClassName()+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
      }
    }
  }
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

      // 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((Instruction) o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
        }
      }
   }
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

    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((Instruction) o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
      }
    }

View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

    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((Instruction) o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
      }
    }

View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

   
    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((Instruction) o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
      }
    }

    Type[] argtypes = o.getArgumentTypes(cpg);
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

    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((Instruction) o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
      }
    }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.