I hereby claim:
- I am raphw on github.
- I am raphw (https://keybase.io/raphw) on keybase.
- I have a public key ASCRLoOS-VdPyzfuhZ_xgec5Zht5jaGp2ScPVs_qJ-kXEgo
To claim this, I am signing this object:
| public class Foo<T> { | |
| void foo(Foo<@Bar T> this) {} | |
| public static void main(String[] args) { | |
| assert Foo.class.getDeclaredMethod("foo").getAnnotatedReceiverType() instanceof AnnotatedParameterizedType; | |
| } | |
| } |
| public class Foo<T> { | |
| class Bar<S> { | |
| Bar(Foo<T> Foo.this) {} | |
| void bar(Foo<T>.Bar<S> this) {} | |
| } | |
| static class Qux<S> { |
| class Foo { | |
| class Bar { | |
| void qux(@TypeAnnotation Foo.@TypeAnnotation Bar this) { } // Foo is treated as owner type. | |
| } | |
| } | |
| @Target(ElementType.TYPE_USE) | |
| @Retention(RetentionPolicy.RUNTIME) | |
| @interface TypeAnnotation { } |
| class Foo<T> { | |
| abstract class Bar { | |
| // type path is not null but . | |
| abstract void qux(@TypeAnnotation(1) Bar arg); | |
| abstract void baz(Foo<T>.@TypeAnnotation(7) Bar arg); | |
| } | |
| } | |
| @Target(Element.TYPE_USE) | |
| @Retention(RetentionPolicy.RUNTIME) |
| public class Foo { | |
| public static void main(String[] args) throws Exception { | |
| System.out.println(Arrays.asList(Foo.class.getDeclaredField("bar").getAnnotatedType().getAnnotations())); | |
| System.out.println(Arrays.asList(Foo.class.getDeclaredField("qux").getAnnotatedType().getAnnotations())); | |
| } | |
| GenericNested<Void>.@TypeAnnotation Inner bar; | |
| Nested.@TypeAnnotation Inner qux; |
| package net.bytebuddy; | |
| import net.bytebuddy.agent.ByteBuddyAgent; | |
| import net.bytebuddy.agent.builder.AgentBuilder; | |
| import net.bytebuddy.description.type.TypeDescription; | |
| import net.bytebuddy.dynamic.ClassFileLocator; | |
| import net.bytebuddy.dynamic.DynamicType; | |
| import net.bytebuddy.dynamic.loading.ClassInjector; | |
| import net.bytebuddy.implementation.MethodDelegation; | |
| import net.bytebuddy.implementation.bind.annotation.SuperCall; |
| public class Bar { | |
| public static Object baz() { | |
| return new Object(); | |
| } | |
| } |
I hereby claim:
To claim this, I am signing this object:
| public class Foo { | |
| public static void main(String[] args) throws UnmodifiableClassException, InterruptedException { | |
| // jar: https://bintray.com/raphw/maven/download_file?file_path=net%2Fbytebuddy%2Fbyte-buddy-agent%2F1.4.26%2Fbyte-buddy-agent-1.4.26.jar | |
| Instrumentation instrumentation = ByteBuddyAgent.install(); | |
| System.out.println(instrumentation.isRedefineClassesSupported()); | |
| System.out.println(instrumentation.isRetransformClassesSupported()); | |
| import java.lang.instrument.Instrumentation; | |
| import java.lang.reflect.Layer; | |
| import java.lang.reflect.Module; | |
| import java.util.*; | |
| public class WeakeningAgent { | |
| public static void premain(String argument, Instrumentation instrumentation) { | |
| boolean full = argument != null && argument.equals("full"); | |
| Set<Module> importing = new HashSet<>(), exporting = new HashSet<>(); |