Examples of CompileException


Examples of org.jboss.byteman.rule.exception.CompileException

                compileTypeConversion(Type.OBJECT, type, mv, compileContext);
            }
        }
        // check the stack height is ok
        if (compileContext.getStackCount() != currentStack + expected) {
            throw new CompileException("FieldExpression.compile : invalid stack height " + compileContext.getStackCount() + " expecting " + (currentStack + expected));
        }
    }
View Full Code Here

Examples of org.jboss.byteman.rule.exception.CompileException

                compileContext.addStackCount(-4);
            }

            // check the stack height is ok
            if (compileContext.getStackCount() != currentStack) {
                throw new CompileException("FieldExpression.compileAssign : invalid stack height " + compileContext.getStackCount() + " expecting " + (currentStack));
            }
        }
    }
View Full Code Here

Examples of org.jboss.byteman.rule.exception.CompileException

            adapterClass = loadHelperAdapter(loader, externalName, classBytes);
        } catch(CompileException ce) {
            throw ce;
        } catch (Throwable th) {
            if (compileToBytecode) {
                throw new CompileException("Compiler.createHelperAdapter : exception creating compiled helper adapter for " + helperClass.getName(), th);
            } else {
                throw new CompileException("Compiler.createHelperAdapter : exception creating interpreted helper adapter for " + helperClass.getName(), th);
            }
        }

        return adapterClass;
    }
View Full Code Here

Examples of org.jboss.byteman.rule.exception.CompileException

        try {
            superConstructor = helperClass.getDeclaredConstructor(Rule.class);
        } catch (NoSuchMethodException e) {
            // hmm, ok see if there is an empty constructor
        } catch (SecurityException e) {
            throw new CompileException("Compiler.compileBytes : unable to access constructor for helper class " + helperClass.getCanonicalName());
        }
        boolean superWantsRule = (superConstructor != null);
        if (!superWantsRule) {
            try {
                superConstructor = helperClass.getDeclaredConstructor();
            } catch (NoSuchMethodException e) {
                throw new CompileException("Compiler.compileBytes : no valid constructor found for helper class " + helperClass.getCanonicalName());
            } catch (SecurityException e) {
                throw new CompileException("Compiler.compileBytes : unable to access constructor for helper class " + helperClass.getCanonicalName());
            }
        }
        //
        //  public Compiled<helper>_<NNN>()Rule rule)
        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "(Lorg/jboss/byteman/rule/Rule;)V", null, null);
View Full Code Here

Examples of org.jboss.byteman.rule.exception.CompileException

        // modify the stack height to account for the removed exception and params
        compileContext.addStackCount(-(extraParams+1));

        if (compileContext.getStackCount() != currentStack + expected) {
            throw new CompileException("ThrowExpression.compile : invalid stack height " + compileContext.getStackCount() + " expecting " + (currentStack + expected));
        }
        // now create a ThrowException to wrap the user exception
        // create the thrown exception instance -- adds 1 to stack [UE] --> [UE, THE]
        exceptionClassName = "org/jboss/byteman/rule/exception/ThrowException";
        mv.visitTypeInsn(Opcodes.NEW, exceptionClassName);
        compileContext.addStackCount(1);
        // copy the ThrowException so we can init it [UE, THE] --> [THE, UE, THE]
        mv.visitInsn(Opcodes.DUP_X1);
        compileContext.addStackCount(1);
        // reverse the order of the top two words  [THE, UE, THE] --> [THE, THE, UE]
        mv.visitInsn(Opcodes.SWAP);
        // construct the exception [THE, THE, UE] --> [UE]
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, exceptionClassName, "<init>", "(Ljava/lang/Throwable;)V");
        // we should now have just the ThrowException on the stack
        compileContext.addStackCount(-2);
        if (compileContext.getStackCount() != currentStack + expected) {
            throw new CompileException("ThrowExpression.compile : invalid stack height " + compileContext.getStackCount() + " expecting " + (currentStack + expected));
        }

        // now throw the exception and decrement the stack height

        mv.visitInsn(Opcodes.ATHROW);
View Full Code Here

Examples of org.mvel.CompileException

    public VariableResolver createVariable(String name,
                                           Object value,
                                           Class type) {
        VariableResolver vr = getVariableResolver( name );
        if ( vr != null && vr.getType() != null ) {
            throw new CompileException( "variable already defined within scope: " + vr.getType() + " " + name );
        } else {
            if ( this.localVariables == null ) {
                this.localVariables = new HashMap();
            }
            addResolver( name,
View Full Code Here

Examples of org.mvel2.CompileException

      case '\'':
        return '\'';
      case '"':
        return '\"';
      default:
        throw new CompileException("illegal escape sequence: " + c);
    }
  }
View Full Code Here

Examples of org.mvel2.CompileException

        }
    }

    public static void copyErrorLocation(Exception e, BaseDescr descr) {
        if (e instanceof CompileException) {
            CompileException compileException = (CompileException)e;
            compileException.setLineNumber(descr.getLine());
            compileException.setColumn(descr.getColumn());
        }
    }
View Full Code Here

Examples of org.mvel2.CompileException

        catch (UnresolveablePropertyException e) {
            vr = null;
        }
        if (vr != null && vr.getType() != null) {
            throw new CompileException("variable already defined within scope: " + vr.getType() + " " + name);
        }
        else {
            return addResolver(name, new LocalVariableResolver(this, name), value);
        }
    }
View Full Code Here

Examples of org.mvel2.CompileException

        catch (UnresolveablePropertyException e) {
            vr = null;
        }
        if (vr != null && vr.getType() != null) {
            throw new CompileException("variable already defined within scope: " + vr.getType() + " " + name);
        }
        else {
            return addResolver(name, new LocalVariableResolver(this, name, type), value);
        }
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.