Examples of AssertionViolatedException


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

        constraintViolated(o, "Referenced class '"+jc.getClassName()+"' is an interface, but not a class 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

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

// 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

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

  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

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

            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());
      }
  }
View Full Code Here

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

      }
    }

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

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

      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());
      }

  }
View Full Code Here

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

    JavaClass jc = Repository.lookupClass(myOwner.getClassName());
    new CPESSC_Visitor(jc); // constructor implicitely traverses jc

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

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

    DescendingVisitor v = new DescendingVisitor(jc, new FAMRAV_Visitor(jc));
    v.visit();

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

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

  /**
   * Pushes a Type object onto the stack.
   */
  public void push(Type type){
    if (type == null) {
            throw new AssertionViolatedException("Cannot push NULL onto OperandStack.");
        }
    if (type == Type.BOOLEAN || type == Type.CHAR || type == Type.BYTE || type == Type.SHORT){
      throw new AssertionViolatedException("The OperandStack does not know about '"+type+"'; use Type.INT instead.");
    }
    if (slotsUsed() >= maxStack){
      throw new AssertionViolatedException("OperandStack too small, should have thrown proper Exception elsewhere. Stack: "+this);
    }
    stack.add(type);
  }
View Full Code Here

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 (oldchain.get(ss).getInstruction()
                            .getInstruction() instanceof JsrInstruction)
                    {
                        if (skip_jsr == 0) {
                            lastJSR = oldchain.get(ss);
                            break;
                        } else {
                            skip_jsr--;
                        }
                    }
                    if (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()) + "'?");
                }
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.