Summary: | cant resolve this type for Object[]?! | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | attila lendvai <101> | ||||
Component: | Compiler | Assignee: | Andrew Clement <aclement> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | aclement | ||||
Version: | 1.2 | ||||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
attila lendvai
2004-06-08 09:33:05 EDT
Created attachment 11709 [details]
the file in question
i've tried to reproduce this with no luck. seems to be connected to the actual
setup of aspects inheriting, etc.
the line in question is: params = (Object[])params.clone()
Through working on a couple of other bugs, I think we've finally come to understand what you are seeing here. Calling clone() on an array type is treated very specially by the JVM, and was not handled correctly in our type resolution. I suspect the fix for bug 72150 also fixed this problem. I'll leave Andy to verify that... As Adrian says - I believe this is fixed. Here is an example program that can recreate it. Compile this: public class A { public void A() { Object[] x = new String[2]; Object[] p = (Object[])x.clone(); } } Using something like the 1.5 java compiler (which puts the clone() calls against the correct type 'Object[]' in the bytecode rather than against the superclass 'Object'). (I can imagine other compiler variants also do this) "javac -d bin A.java" Now, create this aspect: aspect Asp { before(): call(* *(..)) { } } And compile against the binary for A.class: ajc -inpath bin Asp.java And you will get: C:\ajbugs\66113\Asp.java:2 warning can not resolve this member: java.lang.Object [Ljava.lang.Object;.clone() [Xlint:unresolvableMember] C:\ajbugs\66113\bin\A.class error can't find type [Ljava.lang.Object; (no source information available) 1 error, 1 warning With the latest development version of AspectJ (available from the website), this compiles OK and you get no errors. positive, bug fixed, thanks! :) |