-
-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document is hard to read #661
Comments
.load(ClassLoader.getSystemClassLoader(), ClassLoadingStrategy.Default.INJECTION); So it works. By passing ClassLoadingStrategy.Default.INJECTION. the default |
A feature was added to Byte Buddy that throws an exception if a class that is injected is already loaded. In Byte Buddy 1.9.*, any use unsafe (unofficial) API is opt-in, therefore, INJECTION is no longer the default. But you are right, there should be more documentation, I simply lack the time to write it. |
Thanks for answering questions and considering Suggestions |
The examples from Section "Accessing fields" of this tutorial (http://bytebuddy.net/#/tutorial) will not work in version 1.9.13. When running to InstanceCreator factory = new ByteBuddy()
.subclass(InstanceCreator.class)
.method(not(isDeclaredBy(Object.class)))
.intercept(MethodDelegation.toConstructor(dynamicUserType))
.make()
.load(I.class.getClassLoader())
.getLoaded()
.newInstance(); An exception is thrown here, beause: MethodDelegationBinder$Processor#bind(Implementation.Target implementationTarget,
MethodDescription source,
TerminationHandler terminationHandler,
MethodInvoker methodInvoker,
Assigner assigne) How to solve this problem? |
in @Argumen$Binder#bind(...) : Argument argument = annotation.loadSilent();
if (argument.value() < 0) {
throw new IllegalArgumentException("@Argument annotation on " + target + " specifies negative index");
} else if (source.getParameters().size() <= argument.value()) {
return MethodDelegationBinder.ParameterBinding.Illegal.INSTANCE;
}
|
TypePool
,DynamicType
,ClassLoadingStrategy
etc.)It was not compiled in 1.9.13, but the 1.9.13 version of the document could not be found. Try to change it to:
But in the end:
Much more complex than using javassist
The text was updated successfully, but these errors were encountered: