diff options
Diffstat (limited to 'tests/bugs160/pr168063/A.java')
-rw-r--r-- | tests/bugs160/pr168063/A.java | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/tests/bugs160/pr168063/A.java b/tests/bugs160/pr168063/A.java deleted file mode 100644 index c4831ff9d..000000000 --- a/tests/bugs160/pr168063/A.java +++ /dev/null @@ -1,40 +0,0 @@ -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - - -public class A { - public static void main(String[] args) throws Exception { - A obj1 = new A(); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(obj1); - oos.close(); - byte[] data = baos.toByteArray(); - - ByteArrayInputStream bais = new ByteArrayInputStream(data); - ObjectInputStream ois = new ObjectInputStream(bais); - Object o = ois.readObject(); - - int before = ((Persistable)obj1).getPersistableId(); - int after = ((Persistable)o).getPersistableId(); - if (before!=after) - System.out.println("The data was lost! before="+before+" after="+after); - else - System.out.println("It worked, data preserved!"); - } -} - -interface Persistable extends Serializable { - abstract public int getPersistableId(); -} - -aspect PersistableImpl { - declare parents: A extends Persistable; - - final public int Persistable.persistableId = 42; - public int Persistable.getPersistableId() { return persistableId; } -} |