-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create minimal reproducer for Quarkus 32298
- Loading branch information
Showing
9 changed files
with
33 additions
and
171 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,14 @@ | ||
import org.graalvm.home.Version; | ||
public class Main { | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.ObjectInputStream; | ||
import java.io.ObjectOutputStream; | ||
static { | ||
dontCallMe(); | ||
} | ||
|
||
public class Main { | ||
private static void dontCallMe() { | ||
throw new IllegalArgumentException("Don't call me!"); | ||
} | ||
|
||
public static void main(String[] args) { | ||
// we don't test serialization for GraalVM < 21.3 | ||
if (Version.getCurrent().compareTo(21, 3) < 0) { | ||
System.out.println("Please use GraalVM >21.3"); | ||
return; | ||
} | ||
|
||
try { | ||
SomeSerializationObject instance = new SomeSerializationObject(); | ||
instance.setPerson(new Person("Sheldon")); | ||
ExternalizablePerson ep = new ExternalizablePerson(); | ||
ep.setName("Sheldon 2.0"); | ||
instance.setExternalizablePerson(ep); | ||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | ||
ObjectOutputStream os = new ObjectOutputStream(out); | ||
os.writeObject(instance); | ||
ByteArrayInputStream bais = new ByteArrayInputStream(out.toByteArray()); | ||
ObjectInputStream is = new ObjectInputStream(bais); | ||
SomeSerializationObject result = (SomeSerializationObject) is.readObject(); | ||
if (result.getPerson().getName().equals("Sheldon") | ||
&& result.getExternalizablePerson().getName().equals("Sheldon 2.0")) { | ||
System.out.println("OK"); | ||
} else { | ||
System.out.println("Ooops"); | ||
} | ||
} catch (Exception e) { | ||
System.out.println("Ooops2"); | ||
e.printStackTrace(); | ||
} | ||
System.out.println("Hello World!"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import com.oracle.svm.core.annotate.Delete; | ||
import com.oracle.svm.core.annotate.TargetClass; | ||
|
||
@TargetClass(Main.class) | ||
public final class Target_Main { | ||
|
||
@Delete | ||
private static void dontCallMe() { | ||
// Do nothing; | ||
} | ||
|
||
} |