--- /dev/null
+public aspect AspectBoolean {\r
+\r
+ // The pointcuts here expose context\r
+ before(Boolean i): within(AutoboxingZ) && call(* met*(..)) && args(i) {\r
+ System.err.println("Boolean:"+i);\r
+ }\r
+\r
+ before(boolean i): within(AutoboxingZ) && call(* met*(..)) && args(i) {\r
+ System.err.println("boolean:"+i);\r
+ }\r
+}\r
--- /dev/null
+public aspect AspectByte {\r
+\r
+ // The pointcuts here expose context\r
+ before(Byte i): within(AutoboxingB) && call(* met*(..)) && args(i) {\r
+ System.err.println("Byte:"+i);\r
+ }\r
+\r
+ before(byte i): within(AutoboxingB) && call(* met*(..)) && args(i) {\r
+ System.err.println("byte:"+i);\r
+ }\r
+}\r
--- /dev/null
+public aspect AspectChar {\r
+\r
+ // The pointcuts here expose context\r
+ before(Character i): within(AutoboxingC) && call(* met*(..)) && args(i) {\r
+ System.err.println("Character:"+i);\r
+ }\r
+\r
+ before(char i): within(AutoboxingC) && call(* met*(..)) && args(i) {\r
+ System.err.println("char:"+i);\r
+ }\r
+}\r
--- /dev/null
+public aspect AspectDouble {\r
+\r
+ // The pointcuts here expose context\r
+ before(Double i): within(AutoboxingD) && call(* met*(..)) && args(i) {\r
+ System.err.println("Double:"+i);\r
+ }\r
+\r
+ before(double i): within(AutoboxingD) && call(* met*(..)) && args(i) {\r
+ System.err.println("double:"+i);\r
+ }\r
+}\r
--- /dev/null
+public aspect AspectFloat {\r
+\r
+ // The pointcuts here expose context\r
+ before(Float i): within(AutoboxingF) && call(* met*(..)) && args(i) {\r
+ System.err.println("Float:"+i);\r
+ }\r
+\r
+ before(float i): within(AutoboxingF) && call(* met*(..)) && args(i) {\r
+ System.err.println("float:"+i);\r
+ }\r
+}\r
--- /dev/null
+public aspect AspectInteger {\r
+\r
+ // The pointcuts here expose context\r
+ before(Integer i): within(AutoboxingI) && call(* met*(..)) && args(i) {\r
+ System.err.println("Matching by Integer:"+i);\r
+ }\r
+\r
+ before(int i): within(AutoboxingI) && call(* met*(..)) && args(i) {\r
+ System.err.println("Matching by int:"+i);\r
+ }\r
+}\r
--- /dev/null
+public aspect AspectLong {\r
+\r
+ // The pointcuts here expose context\r
+ before(Long i): within(AutoboxingJ) && call(* met*(..)) && args(i) {\r
+ System.err.println("Long:"+i);\r
+ }\r
+\r
+ before(long i): within(AutoboxingJ) && call(* met*(..)) && args(i) {\r
+ System.err.println("long:"+i);\r
+ }\r
+}\r
--- /dev/null
+public aspect AspectShort {\r
+\r
+ // The pointcuts here expose context\r
+ before(Short i): within(AutoboxingS) && call(* met*(..)) && args(i) {\r
+ System.err.println("Short:"+i);\r
+ }\r
+\r
+ before(short i): within(AutoboxingS) && call(* met*(..)) && args(i) {\r
+ System.err.println("short:"+i);\r
+ }\r
+}\r
--- /dev/null
+public class AutoboxingB {
+
+ public static void method_takes_Byte(Byte i) { System.err.println("method_takes_Byte="+i);}
+ public static void method_takes_byte(byte i) { System.err.println("method_takes_byte="+i);}
+
+ public static void main(String[] argv) {
+ Byte one = new Byte("1");
+ byte two = '2';
+ Byte three = new Byte("3");
+ byte four = '4' ;
+ method_takes_Byte(one);
+ method_takes_Byte(two);
+ method_takes_byte(three);
+ method_takes_byte(four);
+ }
+}
--- /dev/null
+public class AutoboxingC {
+
+ public static void method_takes_Character(Character i) { System.err.println("method_takes_Character="+i);}
+ public static void method_takes_char(char i) { System.err.println("method_takes_char="+i);}
+
+ public static void main(String[] argv) {
+ Character one = new Character('1');
+ char two = '2';
+ Character three = new Character('3');
+ char four = '4';
+ method_takes_Character(one);
+ method_takes_Character(two);
+ method_takes_char(three);
+ method_takes_char(four);
+ }
+}
--- /dev/null
+public class AutoboxingD {
+
+ public static void method_takes_Double(Double i) { System.err.println("method_takes_Double="+i);}
+ public static void method_takes_double(double i) { System.err.println("method_takes_double="+i);}
+
+ public static void main(String[] argv) {
+ Double one = new Double(100.0f);
+ double two = 200.0f;
+ Double three = new Double(300.0f);
+ double four = 400.0f;
+ method_takes_Double(one);
+ method_takes_Double(two);
+ method_takes_double(three);
+ method_takes_double(four);
+ }
+}
--- /dev/null
+public class AutoboxingF {
+
+ public static void method_takes_Float(Float i) { System.err.println("method_takes_Float="+i);}
+ public static void method_takes_float(float i) { System.err.println("method_takes_float="+i);}
+
+ public static void main(String[] argv) {
+ Float one = new Float(100.0f);
+ float two = 200.0f;
+ Float three = new Float(300.0f);
+ float four = 400.0f;
+ method_takes_Float(one);
+ method_takes_Float(two);
+ method_takes_float(three);
+ method_takes_float(four);
+ }
+}
--- /dev/null
+public class AutoboxingI {
+
+ public static void method_takes_Integer(Integer i) { System.err.println("method_takes_Integer="+i);}
+ public static void method_takes_int(int i) { System.err.println("method_takes_int="+i);}
+
+ public static void main(String[] argv) {
+ Integer one = new Integer(10000);
+ int two = 20000;
+ Integer three = new Integer(30000);
+ int four = 40000;
+ method_takes_Integer(one);
+ method_takes_Integer(two);
+ method_takes_int(three);
+ method_takes_int(four);
+ }
+}
--- /dev/null
+public class AutoboxingJ {
+
+ public static void method_takes_Long(Long i) { System.err.println("method_takes_Long="+i);}
+ public static void method_takes_long(long i) { System.err.println("method_takes_long="+i);}
+
+ public static void main(String[] argv) {
+ Long one = new Long(1000000);
+ long two = 2000000;
+ Long three = new Long(3000000);
+ long four = 4000000;
+ method_takes_Long(one);
+ method_takes_Long(two);
+ method_takes_long(three);
+ method_takes_long(four);
+ }
+}
--- /dev/null
+public class AutoboxingS {
+
+ public static void method_takes_Short(Short i) { System.err.println("method_takes_Short="+i);}
+ public static void method_takes_short(short i) { System.err.println("method_takes_short="+i);}
+
+ public static void main(String[] argv) {
+ Short one = new Short("100");
+ short two = 200;
+ Short three = new Short("300");
+ short four = 400;
+ method_takes_Short(one);
+ method_takes_Short(two);
+ method_takes_short(three);
+ method_takes_short(four);
+ }
+}
--- /dev/null
+public class AutoboxingZ {
+
+ public static void method_takes_Boolean(Boolean b) { System.err.println("method_takes_Boolean="+b);}
+ public static void method_takes_boolean(boolean b) { System.err.println("method_takes_boolean="+b);}
+
+ public static void main(String[] argv) {
+ Boolean t = new Boolean(false);
+ boolean f = false;
+ method_takes_Boolean(t);
+ method_takes_Boolean(f);
+ method_takes_boolean(t);
+ method_takes_boolean(f);
+ }
+}
--- /dev/null
+public class SimpleAutoboxing {
+
+ public static void method_takes_Integer(Integer i) { System.err.println("method_takes_Integer="+i);}
+
+ public static void main(String[] argv) {
+ int one = 20000;
+ method_takes_Integer(one);
+ }
+}
--- /dev/null
+public aspect SimpleAutoboxingAspect {\r
+\r
+ // The pointcuts here expose context\r
+ before(Integer i): within(SimpleAutoboxing) && call(* met*(..)) && args(i) {\r
+ System.err.println("Matching by Integer:"+i);\r
+ }\r
+\r
+ before(int i): within(SimpleAutoboxing) && call(* met*(..)) && args(i) {\r
+ System.err.println("Matching by int:"+i);\r
+ }\r
+}\r
--- /dev/null
+<project name="Java 5 compilation of test source" default="default" basedir=".">
+
+ <target name="default" >
+ <delete dir="output" failonerror="false"/>
+ <mkdir dir="output"/>
+ <javac destdir="output" debug="on" srcdir="." includes="*.java"/>
+ <zip file="testcode.jar" basedir="output" includes="**/*"/>
+ <delete dir="output"/>
+ </target>
+
+</project>