Package org.apache.bcel.verifier.exc

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


    /**
     * 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. Only JustIce must not use it, but foreign users of the ControlFlowGraph
//      will want it. Thanks Johannes Wust.
//throw new AssertionViolatedException("DID YOU REALLY WANT TO ASK FOR RET'S SUCCS?");
View Full Code Here

  /**
   * Ensures the specific preconditions of the said instruction.
   */
  public void visitIMPDEP1(IMPDEP1 o){
    throw new AssertionViolatedException("In this JustIce verification pass there should not occur an illegal instruction such as IMPDEP1.");
  }
View Full Code Here

  /**
   * Ensures the specific preconditions of the said instruction.
   */
  public void visitIMPDEP2(IMPDEP2 o){
    throw new AssertionViolatedException("In this JustIce verification pass there should not occur an illegal instruction such as IMPDEP2.");
  }
View Full Code Here

      constraintViolated(o, "The 'objref' item '"+objref+"' does not implement '"+theClass+"' as expected.");
   
   
      } catch (ClassNotFoundException e) {
    // FIXME: maybe not the best way to handle this
    throw new AssertionViolatedException("Missing class: " + e.toString());
      }
  }
View Full Code Here

        }
      }
    }
      } catch (ClassNotFoundException e) {
    // FIXME: maybe not the best way to handle this
    throw new AssertionViolatedException("Missing class: " + e.toString());
      }
  }
View Full Code Here

    if ( ! Repository.instanceOf(objref_classname, theClass) ){
      constraintViolated(o, "The 'objref' item '"+objref+"' does not implement '"+theClass+"' as expected.");
   
      } catch (ClassNotFoundException e) {
    // FIXME: maybe not the best way to handle this
    throw new AssertionViolatedException("Missing class: " + e.toString());
      }
  }
View Full Code Here

    //visitCPInstruction(CPInstruction) has been called before.
    //visitLoadClass(LoadClass) has been called before.
   
    Type t = o.getType(cpg);
    if (! (t instanceof ReferenceType)){
      throw new AssertionViolatedException("NEW.getType() returning a non-reference type?!");
    }
    if (! (t instanceof ObjectType)){
      constraintViolated(o, "Expecting a class type (ObjectType) to work on. Found: '"+t+"'.");
    }
    ObjectType obj = (ObjectType) t;
View Full Code Here

TOP

Related Classes of org.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.