Package org.aspectj.apache.bcel.verifier.exc

Examples of org.aspectj.apache.bcel.verifier.exc.AssertionViolatedException


        // Sanity check
        InstructionContext lastJSR = null;
        int skip_jsr = 0;
        for (int ss=oldchain.size()-1; ss >= 0; ss--){
          if (skip_jsr < 0){
            throw new AssertionViolatedException("More RET than JSR in execution chain?!");
          }
//System.err.println("+"+oldchain.get(ss));
          if (((InstructionContext) oldchain.get(ss)).getInstruction().getInstruction() instanceof JsrInstruction){
            if (skip_jsr == 0){
              lastJSR = (InstructionContext) oldchain.get(ss);
              break;
            }
            else{
              skip_jsr--;
            }
          }
          if (((InstructionContext) oldchain.get(ss)).getInstruction().getInstruction() instanceof RET){
            skip_jsr++;
          }
        }
        if (lastJSR == null){
          throw new AssertionViolatedException("RET without a JSR before in ExecutionChain?! EC: '"+oldchain+"'.");
        }
        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())+"'?");
        }
       
        if (theSuccessor.execute(u.getOutFrame(oldchain), newchain, icv, ev)){
          icq.add(theSuccessor, (ArrayList) newchain.clone());
        }
View Full Code Here


      StringWriter sw = new StringWriter();
      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");
    }
    return VerificationResult.VR_OK;
  }
View Full Code Here

   * Returns the InstructionContext of a given instruction.
   */
  public InstructionContext contextOf(InstructionHandle inst){
    InstructionContext ic = (InstructionContext) instructionContexts.get(inst);
    if (ic == null){
      throw new AssertionViolatedException("InstructionContext requested for an InstructionHandle that's not known!");
    }
    return ic;
  }
View Full Code Here

    /**
     * Creates an InstructionHandleImpl object from an InstructionHandle.
     * Creation of one per InstructionHandle suffices. Don't create more.
     */
    public InstructionContextImpl(InstructionHandle inst){
      if (inst == null) throw new AssertionViolatedException("Cannot instantiate InstructionContextImpl from NULL.");
   
      instruction = inst;
      inFrames = new java.util.HashMap();
      outFrames = new java.util.HashMap();
    }
View Full Code Here

      InstructionContext jsr = lastExecutionJSR();

      org = (Frame) outFrames.get(jsr);

      if (org == null){
        throw new AssertionViolatedException("outFrame not set! This:\n"+this+"\nExecutionChain: "+getExecutionChain()+"\nOutFrames: '"+outFrames+"'.");
      }
      return org.getClone();
    }
View Full Code Here

      executionPredecessors = (ArrayList) execPreds.clone();

      //sanity check
      if ( (lastExecutionJSR() == null) && (subroutines.subroutineOf(getInstruction()) != subroutines.getTopLevel() ) ){
        throw new AssertionViolatedException("Huh?! Am I '"+this+"' part of a subroutine or not?");
      }
      if ( (lastExecutionJSR() != null) && (subroutines.subroutineOf(getInstruction()) == subroutines.getTopLevel() ) ){
        throw new AssertionViolatedException("Huh?! Am I '"+this+"' part of a subroutine or not?");
      }

      Frame inF = (Frame) inFrames.get(lastExecutionJSR());
      if (inF == null){// no incoming frame was set, so set it.
        inFrames.put(lastExecutionJSR(), inFrame);
View Full Code Here

      Instruction inst = getInstruction().getInstruction();
   
      if (inst instanceof RET){
        Subroutine s = subroutines.subroutineOf(getInstruction());
        if (s==null){ //return empty; // RET in dead code. "empty" would be the correct answer, but we know something about the surrounding project...
          throw new AssertionViolatedException("Asking for successors of a RET in dead code?!");
        }
//TODO: remove
throw new AssertionViolatedException("DID YOU REALLY WANT TO ASK FOR RET'S SUCCS?");
/*
        InstructionHandle[] jsrs = s.getEnteringJsrInstructions();
        InstructionHandle[] ret = new InstructionHandle[jsrs.length];
        for (int i=0; i<jsrs.length; i++){
          ret[i] = jsrs[i].getNext();
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.verifier.exc.AssertionViolatedException

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.