diff options
author | aclement <aclement> | 2010-01-21 18:39:53 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-01-21 18:39:53 +0000 |
commit | f91ffb032fae7c7d9f59f4aedf27f067ba60919e (patch) | |
tree | df21f06a213e08536473f9b1e21542909c28d0a3 /tests/features169 | |
parent | f7591e67250f1e6717bbebb23b5bb9c47fb05204 (diff) | |
download | aspectj-f91ffb032fae7c7d9f59f4aedf27f067ba60919e.tar.gz aspectj-f91ffb032fae7c7d9f59f4aedf27f067ba60919e.zip |
299552: private ITD fields stay private in target (with unmangled name)
Diffstat (limited to 'tests/features169')
-rw-r--r-- | tests/features169/transparent/DeclareAtTwo.java | 17 | ||||
-rw-r--r-- | tests/features169/transparent/Generics.java | 37 | ||||
-rw-r--r-- | tests/features169/transparent/InteractingOldAndNew.java | 38 | ||||
-rw-r--r-- | tests/features169/transparent/OneDeclareAt.java | 13 | ||||
-rw-r--r-- | tests/features169/transparent/OneDefault.java | 6 | ||||
-rw-r--r-- | tests/features169/transparent/OneDefaultAnnotated.java | 12 | ||||
-rw-r--r-- | tests/features169/transparent/OnePrivate.java | 6 | ||||
-rw-r--r-- | tests/features169/transparent/OnePrivateAccessors.java | 21 | ||||
-rw-r--r-- | tests/features169/transparent/OnePrivateAnnotated.java | 12 | ||||
-rw-r--r-- | tests/features169/transparent/OnePrivateInitializer.java | 16 | ||||
-rw-r--r-- | tests/features169/transparent/Three.java | 7 | ||||
-rw-r--r-- | tests/features169/transparent/Two.java | 7 | ||||
-rw-r--r-- | tests/features169/transparent/TwoItdsOnTarget.java | 10 | ||||
-rw-r--r-- | tests/features169/transparent/TwoItdsOnTargetHasAlready.java | 11 |
14 files changed, 213 insertions, 0 deletions
diff --git a/tests/features169/transparent/DeclareAtTwo.java b/tests/features169/transparent/DeclareAtTwo.java new file mode 100644 index 000000000..57c321afe --- /dev/null +++ b/tests/features169/transparent/DeclareAtTwo.java @@ -0,0 +1,17 @@ +import java.lang.annotation.*; + +public class DeclareAtTwo { +} + +aspect X { + declare @field: int DeclareAtTwo.x: @Anno2; + + @Anno + private int DeclareAtTwo.x; +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno {} + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno2 {} diff --git a/tests/features169/transparent/Generics.java b/tests/features169/transparent/Generics.java new file mode 100644 index 000000000..c1cc12614 --- /dev/null +++ b/tests/features169/transparent/Generics.java @@ -0,0 +1,37 @@ +import java.util.*; + +public class Generics<X> { + public static void main(String []argv) { + Generics<String> inst = new Generics<String>(); + List<String> ls = new ArrayList<String>(); + inst.setter(ls); + List<String> newls = inst.getter(); + + inst.setThing("abc"); + String s = inst.getThing(); + } +} + +aspect X { + private List<String> Generics.listOfString; + + public List<String> Generics.getter() { + return listOfString; + } + + public void Generics.setter(List<String> los) { + listOfString = los; + } +} + +aspect Y { + private T Generics<T>.thing; + + public T Generics<T>.getThing() { + return thing; + } + + public void Generics<T>.setThing(T thing) { + this.thing = thing; + } +} diff --git a/tests/features169/transparent/InteractingOldAndNew.java b/tests/features169/transparent/InteractingOldAndNew.java new file mode 100644 index 000000000..387b21d55 --- /dev/null +++ b/tests/features169/transparent/InteractingOldAndNew.java @@ -0,0 +1,38 @@ +// Interacting private ITDs + +public class InteractingOldAndNew { + public static void main(String []argv) { + InteractingOldAndNew inst = new InteractingOldAndNew(); + inst.setI1(12); + inst.setI2(65); + int value = inst.getI1(); + if (value!=12) { throw new RuntimeException(Integer.toString(value)); } + value = inst.getI2(); + if (value!=65) { throw new RuntimeException(Integer.toString(value)); } + } +} + + +aspect X { + private int InteractingOldAndNew.i; + + public int InteractingOldAndNew.getI1() { + return i; + } + + public void InteractingOldAndNew.setI1(int newvalue) { + i = newvalue; + } +} + +aspect Y { + private int InteractingOldAndNew.i; + + public int InteractingOldAndNew.getI2() { + return i; + } + + public void InteractingOldAndNew.setI2(int newvalue) { + i = newvalue; + } +} diff --git a/tests/features169/transparent/OneDeclareAt.java b/tests/features169/transparent/OneDeclareAt.java new file mode 100644 index 000000000..3daa279d4 --- /dev/null +++ b/tests/features169/transparent/OneDeclareAt.java @@ -0,0 +1,13 @@ +import java.lang.annotation.*; + +public class OneDeclareAt { +} + +aspect X { + declare @field: int OneDeclareAt.x: @Anno; + + private int OneDeclareAt.x; +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno {} diff --git a/tests/features169/transparent/OneDefault.java b/tests/features169/transparent/OneDefault.java new file mode 100644 index 000000000..b05375681 --- /dev/null +++ b/tests/features169/transparent/OneDefault.java @@ -0,0 +1,6 @@ +public class OneDefault { +} + +aspect X { + int OneDefault.x; +} diff --git a/tests/features169/transparent/OneDefaultAnnotated.java b/tests/features169/transparent/OneDefaultAnnotated.java new file mode 100644 index 000000000..3b603f9ee --- /dev/null +++ b/tests/features169/transparent/OneDefaultAnnotated.java @@ -0,0 +1,12 @@ +import java.lang.annotation.*; + +public class OneDefaultAnnotated { +} + +aspect X { + @Anno + int OneDefaultAnnotated.x; +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno {} diff --git a/tests/features169/transparent/OnePrivate.java b/tests/features169/transparent/OnePrivate.java new file mode 100644 index 000000000..a0de744c7 --- /dev/null +++ b/tests/features169/transparent/OnePrivate.java @@ -0,0 +1,6 @@ +public class OnePrivate { +} + +aspect X { + private int OnePrivate.x; +} diff --git a/tests/features169/transparent/OnePrivateAccessors.java b/tests/features169/transparent/OnePrivateAccessors.java new file mode 100644 index 000000000..07bfbc98c --- /dev/null +++ b/tests/features169/transparent/OnePrivateAccessors.java @@ -0,0 +1,21 @@ +import java.lang.annotation.*; + +public class OnePrivateAccessors { + public static void main(String[] argv) { + int i = new OnePrivateAccessors().run(); + if (i!=37) throw new RuntimeException(Integer.toString(i)); + } +} + +aspect X { + @Anno + private int OnePrivateAccessors.x; + + public int OnePrivateAccessors.run() { + x = 37; + return x; + } +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno {} diff --git a/tests/features169/transparent/OnePrivateAnnotated.java b/tests/features169/transparent/OnePrivateAnnotated.java new file mode 100644 index 000000000..c5e4e798d --- /dev/null +++ b/tests/features169/transparent/OnePrivateAnnotated.java @@ -0,0 +1,12 @@ +import java.lang.annotation.*; + +public class OnePrivateAnnotated { +} + +aspect X { + @Anno + private int OnePrivateAnnotated.x; +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno {} diff --git a/tests/features169/transparent/OnePrivateInitializer.java b/tests/features169/transparent/OnePrivateInitializer.java new file mode 100644 index 000000000..33d9822af --- /dev/null +++ b/tests/features169/transparent/OnePrivateInitializer.java @@ -0,0 +1,16 @@ +import java.lang.annotation.*; + +public class OnePrivateInitializer { + public static void main(String[] argv) { + int i = new OnePrivateInitializer().run(); + if (i!=42) throw new RuntimeException(Integer.toString(i)); + } +} + +aspect X { + private int OnePrivateInitializer.x = 42; + + public int OnePrivateInitializer.run() { + return x; + } +} diff --git a/tests/features169/transparent/Three.java b/tests/features169/transparent/Three.java new file mode 100644 index 000000000..f288ce35b --- /dev/null +++ b/tests/features169/transparent/Three.java @@ -0,0 +1,7 @@ +public class Three { + private int x; +} + +aspect X { + private int Three.x; +} diff --git a/tests/features169/transparent/Two.java b/tests/features169/transparent/Two.java new file mode 100644 index 000000000..c01cdd74a --- /dev/null +++ b/tests/features169/transparent/Two.java @@ -0,0 +1,7 @@ +public class Two { + public int x; +} + +aspect X { + public int Two.x; +} diff --git a/tests/features169/transparent/TwoItdsOnTarget.java b/tests/features169/transparent/TwoItdsOnTarget.java new file mode 100644 index 000000000..d83a15210 --- /dev/null +++ b/tests/features169/transparent/TwoItdsOnTarget.java @@ -0,0 +1,10 @@ +public class TwoItdsOnTarget { +} + +aspect X { + private int TwoItdsOnTarget.x; +} + +aspect Y { + private int TwoItdsOnTarget.x; +} diff --git a/tests/features169/transparent/TwoItdsOnTargetHasAlready.java b/tests/features169/transparent/TwoItdsOnTargetHasAlready.java new file mode 100644 index 000000000..f26dbcd6d --- /dev/null +++ b/tests/features169/transparent/TwoItdsOnTargetHasAlready.java @@ -0,0 +1,11 @@ +public class TwoItdsOnTargetHasAlready { + private int x; +} + +aspect X { + private int TwoItdsOnTargetHasAlready.x; +} + +aspect Y { + private int TwoItdsOnTargetHasAlready.x; +} |