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 HashMap<InstructionContext, Frame>();
      outFrames = new HashMap<InstructionContext, Frame>();
View Full Code Here


      InstructionContext jsr = lastExecutionJSR();

      org = 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

      InstructionContext jsr = lastExecutionJSR();
     
      org = inFrames.get(jsr);

      if (org == null){
          throw new AssertionViolatedException("inFrame not set! This:\n"+this+"\nInFrames: '"+inFrames+"'.");
      }
      return org.getClone();
    }
View Full Code Here

      executionPredecessors = (List<InstructionContext>) 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 = 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

// of "EmptyVisitor" and provide a thousand empty methods.
// However, in terms of performance this would be a better idea.
// If some new "Node" is defined in BCEL (such as some concrete "Attribute"), we
// want to know that this class has also to be adapted.
        if (tostring == null) {
            throw new AssertionViolatedException("Please adapt '" + getClass() + "' to deal with objects of class '" + n.getClass() + "'.");
        }
        return tostring;
    }
View Full Code Here

  public LocalVariablesInfo getLocalVariablesInfo(int method_nr){
    if (this.verify() != VerificationResult.VR_OK) {
            return null; // It's cached, don't worry.
        }
    if (method_nr < 0 || method_nr >= localVariablesInfos.length){
      throw new AssertionViolatedException("Method number out of range.");
    }
    return localVariablesInfos[method_nr];
  }
View Full Code Here

            return VerificationResult.VR_NOTYET;
        }

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

      }
    }

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

      jc = Repository.lookupClass(jc.getSuperclassName())// Well, for OBJECT this returns OBJECT so it works (could return anything but must not throw an Exception).
    }

      } catch (ClassNotFoundException e) {
    // FIXME: this might not be the best way to handle missing classes.
    throw new AssertionViolatedException("Missing class: " + e.toString(), e);
      }

  }
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.