Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] StackOverflowError

i'm getting this error:

Exception in thread "main" java.lang.StackOverflowError
at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:225)
       at java.lang.ThreadLocal.get(ThreadLocal.java:127)
at org.aspectj.runtime.internal.cflowstack.ThreadStackFactoryImpl$ThreadCounterImpl.getThreadCounter(ThreadStackFactoryImpl.java:38) at org.aspectj.runtime.internal.cflowstack.ThreadStackFactoryImpl$ThreadCounterImpl.isNotZero(ThreadStackFactoryImpl.java:43) at org.aspectj.runtime.internal.CFlowCounter.isValid(CFlowCounter.java:45) at TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20) at TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20) at TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20) at TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20) at TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20) at TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20) at TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20) at TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20)
       %------CUT MORE LINES LIKE THE ABOVE ONES-----%


this is the TrackHelloWorld aspect:

public aspect TrackHelloWorld {

       pointcut printing(): execution(* ServerImpl.print(..));

       pointcut doNothing(): execution(* ServerImpl.doNothing());

       pointcut nestedCall(): cflow(printing());

       before(): printing() {
               //System.out.println("Before printing...");
       }
       after(): printing() {
               //System.out.println("After printing...");
       }

       after(): nestedCall(){};

}

and this is the ServerImpl :

public class ServerImpl implements Service, ServiceAttributes {

       private String header = "";

       private int count = 0;


       public void print (final String msg) {

               doNothing();

               return;
       }


       public String getHeader () {
               return header;
       }

       public void setHeader (final String header) {
               this.header = header;
       }

       public int getCount () {
               return count;
       }

       public void setCount (final int count) {
               this.count = count;
       }


       public void doNothing() {

               return;

       }
}


what I do is to call the print() method thousands of times (say 100K, but i have to get even higher) to see
processing time.
i defined the cflow pointcut to be able to capture the calls to doNothing() when occuring from inside the print(String s) method.

I get the error even if I call the method only 1 or 10 (or less then thousands) times.

thanks for any help




Back to the top