Package javassist

Examples of javassist.ByteArrayClassPath


          }
          catch (NotFoundException e)
          {
             // todo Bill Burke: this scares the shit out of me, but it must be done
             // I think it will screw up hotdeployment at some time.  Then again, maybe not ;)
             ByteArrayClassPath cp = new ByteArrayClassPath(className, classfileBuffer);
             pool.insertClassPath(cp);
             clazz = pool.getLocally(className);
          }
          if (clazz.isArray())
          {
View Full Code Here


          }
          catch (NotFoundException e)
          {
             // todo Bill Burke: this scares the shit out of me, but it must be done
             // I think it will screw up hotdeployment at some time.  Then again, maybe not ;)
             ByteArrayClassPath cp = new ByteArrayClassPath(className, classfileBuffer);
             pool.insertClassPath(cp);
             clazz = pool.getLocally(className);
          }
          if (clazz.isArray())
          {
View Full Code Here

    }
    catch (NotFoundException e)
    {
      // todo Bill Burke: this scares the shit out of me, but it must be done
      // I think it will screw up hotdeployment at some time.  Then again, maybe not ;)
      ByteArrayClassPath cp = new ByteArrayClassPath(className, classfileBuffer);
      pool.insertClassPath(cp);
      return new CtClassTransformationInfo(pool.getLocally(className), className);
    }
      catch(Error e)
      {
View Full Code Here

     * @return the Javassist class gen
     */
    private static CtClass fromByte(final String name, final byte[] bytecode, final ClassLoader loader) {
        try {
            ClassPool cp = new ClassPool(null);
            cp.insertClassPath(new ByteArrayClassPath(name, bytecode));
            cp.appendClassPath(new LoaderClassPath(loader));
            CtClass klass = cp.get(name);
            klass.stopPruning(true);// to allow dump
            return klass;
        } catch (Exception e) {
View Full Code Here

     * @return the Javassist class gen
     */
    public static CtClass fromByte(final String name, final byte[] bytecode, final ClassLoader loader) {
        try {
            ClassPool cp = new ClassPool(null);
            cp.insertClassPath(new ByteArrayClassPath(name, bytecode));
            cp.appendClassPath(new LoaderClassPath(loader));
            return cp.get(name);
        } catch (Exception e) {
            throw new WrappedRuntimeException(e);
        }
View Full Code Here

    }
   
    // return a javassist handle for the class
    String javaClassFileName = Descriptor.toJavaName( deobfClassName );
    ClassPool classPool = new ClassPool();
    classPool.insertClassPath( new ByteArrayClassPath( javaClassFileName, data ) );
    try
    {
      return classPool.get( javaClassFileName );
    }
    catch( NotFoundException ex )
View Full Code Here

      buf = data.toByteArray();
     
      // load the javassist handle to the raw class
      String javaClassFileName = Descriptor.toJavaName( classFileName );
      ClassPool classPool = new ClassPool();
      classPool.insertClassPath( new ByteArrayClassPath( javaClassFileName, buf ) );
      CtClass c = classPool.get( javaClassFileName );
     
      c = transformClass( c );
     
      // sanity checking
View Full Code Here

   
    // re-get the javassist handle since we changed class names
    ClassEntry obfClassEntry = new ClassEntry( Descriptor.toJvmName( c.getName() ) );
    String javaClassReconstructedName = Descriptor.toJavaName( obfClassEntry.getName() );
    ClassPool classPool = new ClassPool();
    classPool.insertClassPath( new ByteArrayClassPath( javaClassReconstructedName, c.toBytecode() ) );
    c = classPool.get( javaClassReconstructedName );
   
    // check that the file is correct after inner class reconstruction (ie cause Javassist to fail fast if something is wrong)
    assertClassName( c, obfClassEntry );
   
View Full Code Here

    }
   
    // get a javassist handle for the class
    String className = Descriptor.toJavaName( getClassEntry( entry ).getName() );
    ClassPool classPool = new ClassPool();
    classPool.insertClassPath( new ByteArrayClassPath( className, bos.toByteArray() ) );
    return classPool.get( className );
  }
View Full Code Here

TOP

Related Classes of javassist.ByteArrayClassPath

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.