diff options
Diffstat (limited to 'tests/bugs/lazyTjpXLintWarning/Scenario5.aj')
-rw-r--r-- | tests/bugs/lazyTjpXLintWarning/Scenario5.aj | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/bugs/lazyTjpXLintWarning/Scenario5.aj b/tests/bugs/lazyTjpXLintWarning/Scenario5.aj new file mode 100644 index 000000000..49627bda4 --- /dev/null +++ b/tests/bugs/lazyTjpXLintWarning/Scenario5.aj @@ -0,0 +1,24 @@ +//"XLint warning: thisJoinPoint potentially lazy but stopped by around advice which uses tjp" + +public aspect Scenario5 { + + public static boolean enabled = true; + + pointcut toBeTraced() : execution(* main(..)); + + before () : toBeTraced() && if(enabled) { + Object[] args = thisJoinPoint.getArgs(); // tjp not made lazily + System.out.println(thisJoinPoint + ", arg's: " + args.length); + } + + Object around() : toBeTraced() && if(enabled) { + Object[] args = thisJoinPoint.getArgs(); // tjp used in the around advice + return proceed(); + } + +} + +class Test{ + static void main(String [] args){ + } +} |