From 27d7cdb7312bdc380a2a405333942800329966b1 Mon Sep 17 00:00:00 2001 From: ehilsdal Date: Mon, 23 Aug 2004 23:42:09 +0000 Subject: [PATCH] Fix for bugzilla bug 71087: underspecification of primitive conversion --- docs/progGuideDB/semantics.xml | 41 +++++++++++++++++++++++++++++++--- 1 file 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 @@ - picks out join points where an int 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 int (or + a byte, short, or + char; anything assignable to an + int) is being passed as an argument. + Second, though, it makes the value of that argument + available to the enclosing advice or pointcut. @@ -697,6 +700,38 @@ advice will be of type java.lang.Integer. + + The "boxing" of the primitive value is based on the + original primitive type. So in the + following program + + + + public class InstanceOf { + + public static void main(String[] args) { + doInt(5); + } + + static void doInt(int i) { } + } + + aspect IntToLong { + pointcut el(long l) : + execution(* doInt(..)) args(l); + + before(Object o) : el(o) { + System.out.println(o.getClass()); + } + } + + + + The pointcut will match and expose the integer argument, + but it will expose it as an Integer, + not a Long. + + -- 2.39.5