summaryrefslogtreecommitdiffstats
path: root/docs/progGuideDB
diff options
context:
space:
mode:
authorehilsdal <ehilsdal>2004-08-23 23:42:09 +0000
committerehilsdal <ehilsdal>2004-08-23 23:42:09 +0000
commit27d7cdb7312bdc380a2a405333942800329966b1 (patch)
tree583f589053d9335af19933a41c9741cdb38735d0 /docs/progGuideDB
parent6a1dcf2e9e9f077b6adb733654c4d3b727a1d1de (diff)
downloadaspectj-27d7cdb7312bdc380a2a405333942800329966b1.tar.gz
aspectj-27d7cdb7312bdc380a2a405333942800329966b1.zip
Fix for bugzilla bug 71087:
underspecification of primitive conversion
Diffstat (limited to 'docs/progGuideDB')
-rw-r--r--docs/progGuideDB/semantics.xml41
1 files changed, 38 insertions, 3 deletions
diff --git a/docs/progGuideDB/semantics.xml b/docs/progGuideDB/semantics.xml
index 3c1c8fe32..cef27728b 100644
--- a/docs/progGuideDB/semantics.xml
+++ b/docs/progGuideDB/semantics.xml
@@ -652,9 +652,12 @@
</programlisting>
<para>
- picks out join points where an <literal>int</literal> is being
- passed as an argument. Second, though, it makes the value of that
- argument available to the enclosing advice or pointcut.
+ picks out join points where an <literal>int</literal> (or
+ a <literal>byte</literal>, <literal>short</literal>, or
+ <literal>char</literal>; anything assignable to an
+ <literal>int</literal>) is being passed as an argument.
+ Second, though, it makes the value of that argument
+ available to the enclosing advice or pointcut.
</para>
<para>
@@ -697,6 +700,38 @@
advice will be of type <literal>java.lang.Integer</literal>.
</para>
+ <para>
+ The "boxing" of the primitive value is based on the
+ <emphasis>original</emphasis> primitive type. So in the
+ following program
+ </para>
+
+<programlisting>
+ public class InstanceOf {
+
+ public static void main(String[] args) {
+ doInt(5);
+ }
+
+ static void doInt(int i) { }
+ }
+
+ aspect IntToLong {
+ pointcut el(long l) :
+ execution(* doInt(..)) <![CDATA[&&]]> args(l);
+
+ before(Object o) : el(o) {
+ System.out.println(o.getClass());
+ }
+ }
+</programlisting>
+
+ <para>
+ The pointcut will match and expose the integer argument,
+ but it will expose it as an <literal>Integer</literal>,
+ not a <literal>Long</literal>.
+ </para>
+
</sect2>
<sect2>