javassist icon indicating copy to clipboard operation
javassist copied to clipboard

Java bytecode engineering toolkit

Results 142 javassist issues
Sort by recently updated
recently updated
newest added

I want to make javaagent with javassist, and in sample project, there's dummy dao class. `public class UserDao { public User populateUser(User user) { user.setAddress(UUID.randomUUID().toString()); user.setAge((int) (System.currentTimeMillis() / 100000)); return...

Sometimes the compiler will search for inner classes of classes in the default package instead of using a fully-qualified name. Using Javassist version 3.29.0-GA Test project using gradle attached, with...

When compiling a method that passes an int to a method that takes a long, the compiler will not automatically promote the int to a long automatically. Using Javassist version...

My OS is CentOs 7.2.1511 and JDK version is 1.8.0_102,the next code will throw "javassist.NotFoundException: createCommandLine(..) is not found in java.lang.ProcessImpl" ` CtClass ctClass = ClassPool.getDefault().get("java.lang.ProcessImpl"); CtMethod method = ctClass.getDeclaredMethod("createCommandLine");...

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @3aefe5e5 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) at...

Hi am using Javasnoop tool and in that javassist.jar file is used the logs are displaying as nelow [JSNOOP 1/30/17 12:26 PM DEBUG] Failure establishing hooks com.aspect.snoop.agent.manager.InstrumentationException: javassist.NotFoundException: com.sun.proxy.$Proxy4 Caused...

public static void main(String[] args) throws InstantiationException, IllegalAccessException, NotFoundException, IOException, CannotCompileException { ProxyFactory proxyFactory = new ProxyFactory(); proxyFactory.setSuperclass(UserinfoService.class); Class classRef = proxyFactory.createClass(); UserinfoService service = (UserinfoService) classRef.newInstance(); ((Proxy) service).setHandler(new MyMethodHandler(new...

hi! More compiler placeholder such as $className may be better.

Method modification: ```java CtMethod m = renderEffect.getCtMethod(classPool, compiledClass); System.out.println("Hooked Method: " + m.getName()); m.insertBefore("java.lang.System.out.println(\"wow, its rendering\");"); ``` Classpool: ```java ClassPool classPool = ClassPool.getDefault(); classPool.appendClassPath(jar.toString()); classPool.appendClassPath(new File(InjectedAgent.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getPath().toString()); ``` Error: > [STDERR]:...

like this: klass.declaredMethods.forEach { ctMethod-> val ctMethodName = ctMethod.name ctMethod.instrument(object : ExprEditor() { override fun edit(m: MethodCall?) { m?.let { methodCall -> when (methodCall.className) { "android.telephony.TelephonyManager" -> { when (methodCall.methodName)...