Package javassist

Examples of javassist.CannotCompileException


        int c = iterator.byteAt(pos);
        if (c == NEW) {
            index = iterator.u16bitAt(pos + 1);
            if (cp.getClassInfo(index).equals(classname)) {
                if (iterator.byteAt(pos + 3) != DUP)
                    throw new CannotCompileException(
                                "NEW followed by no DUP was found");

                iterator.writeByte(NOP, pos);
                iterator.writeByte(NOP, pos + 1);
                iterator.writeByte(NOP, pos + 2);
View Full Code Here


                MethodInfo minfo = (MethodInfo)list.get(i);
                minfo.setSuperclass(superclass);
            }
        }
        catch (BadBytecode e) {
            throw new CannotCompileException(e);
        }
        cachedSuperclass = superclass;
    }
View Full Code Here

            throws CannotCompileException {
        ListIterator it = fields.listIterator(0);
        while (it.hasNext()) {
            FieldInfo minfo = (FieldInfo)it.next();
            if (minfo.getName().equals(name))
                throw new CannotCompileException("duplicate field: " + name);
        }
    }
View Full Code Here

            MethodInfo minfo = (MethodInfo)it.next();
            if (minfo.getName().equals(name)
                    && notBridgeMethod(minfo) && notBridgeMethod(newMinfo)
                    && Descriptor.eqParamTypes(minfo.getDescriptor(),
                                               descriptor))
                throw new CannotCompileException("duplicate method: " + name);
        }
    }
View Full Code Here

            diag = "END";
        }
        catch (ClassNotFoundException ex)
        {
            throw new CannotCompileException(ex);
        }
        finally
        {
            _logger.debug(String.format("%5s onLoad %s", diag, classname));
        }
View Full Code Here

            superName = superClass.getName();
            classname = superName;
        }

        if (Modifier.isFinal(superClass.getModifiers()))
            throw new CannotCompileException(superName + " is final");

        classname = makeProxyName(classname);
        if (classname.startsWith("java."))
            classname = "org.javassist.tmp." + classname;
View Full Code Here

        int c = iterator.byteAt(pos);
        if (c == NEW) {
            index = iterator.u16bitAt(pos + 1);
            if (cp.getClassInfo(index).equals(classname)) {
                if (iterator.byteAt(pos + 3) != DUP)
                    throw new CannotCompileException(
                                "NEW followed by no DUP was found");

                if (newClassIndex == 0)
                    newClassIndex = cp.addClassInfo(newClassName);
View Full Code Here

                MethodInfo minfo = (MethodInfo)list.get(i);
                minfo.setSuperclass(superclass);
            }
        }
        catch (BadBytecode e) {
            throw new CannotCompileException(e);
        }
        cachedSuperclass = superclass;
    }
View Full Code Here

            diag = "END";
        }
        catch (ClassNotFoundException ex)
        {
            throw new CannotCompileException(ex);
        }
        finally
        {
            _log.debug(String.format("%5s onLoad %s", diag, classname));
        }
View Full Code Here

      case EDITNEWEXPR:
        parameters = new CtClass[] { pool.get("javassist.expr.NewExpr") };
        break;

      default:
        throw new CannotCompileException("");
      }
     
      CtMethod m = CtNewMethod.make(modifiers, returnType, mname, parameters, exceptions, body, declaring);
      declaring.addMethod(m);

    } catch (Exception e) {
      throw new CannotCompileException(e);
    }
   
  }
View Full Code Here

TOP

Related Classes of javassist.CannotCompileException

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.