01: /**************************************************************************************
02: * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
03: * http://aspectwerkz.codehaus.org *
04: * ---------------------------------------------------------------------------------- *
05: * The software in this package is published under the terms of the LGPL license *
06: * a copy of which has been included with this distribution in the license.txt file. *
07: **************************************************************************************/package test.withincode;
08:
09: import test.handler.HandlerTestBeforeException;
10:
11: /**
12: * Target for test with withincode(staticinitialization)
13: *
14: * @author <a href="mailto:the_mindstorm@evolva.ro">Alex Popescu</a>
15: *
16: * @WithincodeClinit
17: */
18: public class Target {
19: private static CtorCallTarget s_field;
20:
21: static {
22: s_field = new CtorCallTarget(); // SET && CALL(CTOR)
23:
24: if (null != s_field) { // GET
25: ;
26: }
27:
28: try {
29: staticMethod();
30: } catch (HandlerTestBeforeException htbe) {
31: ;
32: }
33: }
34:
35: public static final void staticMethod()
36: throws HandlerTestBeforeException {
37: throw new HandlerTestBeforeException();
38: }
39:
40: private static class CtorCallTarget {
41: public CtorCallTarget() {
42: }
43: }
44:
45: public static interface IWithincodeClinitAnnotation {
46: String value();
47: }
48: }
|