Bug 96111 - privileged access to private generic fields crash ajc
Summary: privileged access to private generic fields crash ajc
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.5.0 M3   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 97092 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-20 10:57 EDT by Samuel Gélineau CLA
Modified: 2005-06-03 11:35 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Gélineau CLA 2005-05-20 10:57:57 EDT
import java.util.*;

public class Bug {
  public HashSet<Integer> _public;
  private HashSet<Integer> _private;
  private HashSet typeless;

  public static void main(String[] args) {
  }
}

privileged aspect Spy {
  after() : execution(void main(String[])) {
    HashSet _typeless = new Bug().typeless; // works
    HashSet<Integer> _public = new Bug()._public; // works
    HashSet<Integer> _private = new Bug()._private; // fails to compile
  }
}
Comment 1 Andrew Clement CLA 2005-05-20 11:09:18 EDT
Can you confirm the crash you see?  Is it this one?

C:\Bug.aj [error] Internal compiler error
org.aspectj.weaver.BCException: Bad type signature <
	at org.aspectj.weaver.TypeX.forSignature(TypeX.java:207)
	at org.aspectj.weaver.Member.signatureToTypes(Member.java:153)
	at org.aspectj.weaver.Member.<init>(Member.java:54)
	at org.aspectj.weaver.ResolvedMember.<init>(ResolvedMember.java:80)
	at
org.aspectj.weaver.AjcMemberMaker.privilegedAccessMethodForFieldSet(AjcMemberMaker.java:318)
	at
org.aspectj.ajdt.internal.compiler.lookup.PrivilegedFieldBinding.<init>(PrivilegedFieldBinding.java:41)

Related to parsing of generic signatures.
Comment 2 Samuel Gélineau CLA 2005-05-20 12:19:43 EDT
yes, it is.
Comment 3 William Ono CLA 2005-05-28 02:06:15 EDT
*** Bug 97092 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Clement CLA 2005-06-01 12:25:44 EDT
Although the stack trace is different to 97763, the fix for that bug fixes this
one too.  Thanks for the simple test program!!

Waiting for dev build to be available before closing...
Comment 5 Andrew Clement CLA 2005-06-03 11:35:13 EDT
Fixed in latest dev build from http://eclipse.org/aspectj/downloads.php