This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.w3c.dom.ls.LSInput; | |
| import javax.xml.XMLConstants; | |
| import javax.xml.bind.util.JAXBSource; | |
| import javax.xml.transform.dom.DOMSource; | |
| import javax.xml.validation.Schema; | |
| import javax.xml.validation.SchemaFactory; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.Reader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Main { | |
| public static void main(String[] args) { | |
| Structure<Alpha, Alpha1, Alpha2> first = new First(new Alpha()); | |
| Structure<Beta, Beta1, Beta2> second = new Second(new Beta()); | |
| Structure<Object, Object, Object> template = new Template(); | |
| first.getValue().setValue(first.getValue().getValue()); | |
| //first.getValue().setValue(second.getValue().getValue()); | |
| //first.getValue().setValue(template.getValue().getValue()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package foo; | |
| import java.lang.annotation.ElementType; | |
| import java.lang.annotation.Retention; | |
| import java.lang.annotation.RetentionPolicy; | |
| import java.lang.annotation.Target; | |
| import java.lang.reflect.*; | |
| import java.util.concurrent.Callable; | |
| public record SampleRecord(@RegularAnnotation @TypeAnnotation Callable<@TypeAnnotation ?>foo) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyAutoConfiguration { | |
| @Bean | |
| public static BeanFactoryPostProcessor behandleserviceRegistrationBeanFactory() { | |
| return factory -> { | |
| if (!(factory instanceof BeanDefinitionRegistry)) { | |
| throw new IllegalStateException("Unsupported bean factory: " + factory.getClass().getTypeName()); | |
| } | |
| BeanDefinitionRegistry registry = (BeanDefinitionRegistry) factory; | |
| String someBean = Arrays.stream(factory.getBeanNamesForType(SomeBeanType.class)).findFirst().orElseThrow(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: src/java.base/share/classes/java/lang/reflect/Executable.java | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| --- src/java.base/share/classes/java/lang/reflect/Executable.java (revision 55752:8ae33203d600a7c9f9b2be9b31a0eb8197270ab1) | |
| +++ src/java.base/share/classes/java/lang/reflect/Executable.java (revision 55752+:8ae33203d600+) | |
| @@ -38,6 +38,7 @@ | |
| import sun.reflect.annotation.AnnotationSupport; | |
| import sun.reflect.annotation.TypeAnnotationParser; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package sample; | |
| import java.lang.annotation.ElementType; | |
| import java.lang.annotation.Retention; | |
| import java.lang.annotation.RetentionPolicy; | |
| import java.lang.annotation.Target; | |
| @Retention(RetentionPolicy.RUNTIME) | |
| @Target(ElementType.TYPE_USE) | |
| public @interface TypeAnnotation { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.shadeproof; | |
| import net.bytebuddy.ByteBuddy; | |
| public abstract class NativeBinding { | |
| public static final NativeBinding INSTANCE; | |
| static { | |
| System.load("mylibrary"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package x; | |
| public class Bar extends Foo { | |
| @Override | |
| public void m() { | |
| System.out.println("bar"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir pkg1 | |
| echo "package pkg1; class SuperClass<X> { public X m() { return null; } }" > pkg1/SuperClass.java | |
| echo "package pkg1; public class SubClass extends SuperClass<Void> { }" > pkg1/SubClass.java | |
| ${JAVA_HOME}/bin/javac pkg1/*.java | |
| mkdir pkg2 | |
| echo "package pkg2; class Main { public static void main(String[] args) throws Exception { pkg1.SubClass.class.getMethod(\"m\").invoke(new pkg1.SubClass()); } }" > pkg2/Main.java | |
| ${JAVA_HOME}/bin/javac pkg2/*.java | |
| ${JAVA_HOME}/bin/java -cp . pkg2.Main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir pkg1 | |
| echo "package pkg1; class SuperClass<X> { public X m() { return null; } }" > pkg1/SuperClass.java | |
| echo "package pkg1; public class SubClass extends SuperClass<Void> { }" > pkg1/SubClass.java | |
| ${JAVA_HOME}/bin/javac pkg1/*.java | |
| mkdir pkg2 | |
| echo "package pkg2; class Main { public static void main(String[] args) throws Exception { pkg1.SubClass.class.getMethod(\"m\").invoke(new pkg1.SubClass()); } }" > pkg2/Main.java | |
| ${JAVA_HOME}/bin/javac pkg2/*.java | |
| ${JAVA_HOME}/bin/java -cp . pkg2.Main |