View run.sh
This file contains 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
#!/bin/bash | |
set -x | |
set -e | |
if [[ -z $1 ]]; then | |
echo "Specify location of Graal VM as first argument" | |
exit 1 | |
fi | |
$1/bin/gu install native-image | |
rm -rf META-INF sample sample.build_artifacts.txt Sample.* *.jar | |
echo "public class Sample { |
View XsdSample.java
This file contains 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; |
View Main.java
This file contains 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()); |
View SampleRecord.java
This file contains 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) { |
View MyAutoConfiguration.java
This file contains 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(); |
View Executable_Constructor.patch
This file contains 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; |
View TypeAnnotation.java
This file contains 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 { |
View NativeBinding.java
This file contains 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"); |
View Bar.java
This file contains 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"); | |
} | |
} |
View bridge_generic.sh
This file contains 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 |
NewerOlder