Community
Participate
Working Groups
I am writing an aspect with a pointcut before execution of a method in a non-public class in a different package. When I compile with aspectj1.1rc1 I get the following error message: > > TraceAspect.java:15 The type edu.gatech.Argument is not visible for the > argument t of the method ajc$before$TraceAspect$1b1 > before (edu.gatech.Argument t): execution (* *(edu.gatech.Argument)) && > args(t) { > ^^^^^^^^^^^^^^^^^^^ > > 1 error Source code used: ----------- TraceAspect.java import edu.gatech.*; privileged aspect TraceAspect { pointcut myTrace(): within(TraceAspect); pointcut javaCode(): within(java..*) || call(* java..*(..)); // a point cut that matches any static method call. pointcut methodExec(): call(* *(..)) && !javaCode() && !myTrace(); before (edu.gatech.Argument t): execution (* *(edu.gatech.Argument)) && args(t) { } } ----------- source code (edu/gatech/Main.java) package edu.gatech; class Argument { public int a; public String b; }; public class Main { public static void foo(Argument t) { } public static void main(String []args) { Argument t = new Argument(); foo(t); } } ---------------
Created attachment 4327 [details] Source code to reproduce the problem To reproduce the problem: - untar the attached file - cd bug35593/src - Edit the makefile and set your Java path correctly - Type make from the command line
This is fixed in the current tree and tested by extending an existing privileged test for a variety of argument positions. It was very easy to reproduce this test case from the supplied code. For your future reference, the short example that you provided in the text of the bug report is much more useful than the attachment. attachments are most useful when the test case is very complicated. Reducing the test case to two short self-contained files like you did is the most useful option.
Changing status to fixed