01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest;
05:
06: public class InstrumentedObject {
07: private long longValue;
08: private boolean booleanValue;
09: private InstrumentedObject objectValue;
10: private InstrumentedObject objectValue1;
11: private InstrumentedObject objectValue2;
12:
13: public InstrumentedObject(boolean sub) {
14: this .longValue = System.currentTimeMillis();
15: this .booleanValue = System.currentTimeMillis() % 2 == 0;
16: if (sub) {
17: this .objectValue = new InstrumentedObject(false);
18: this .objectValue1 = new InstrumentedObject(false);
19: this .objectValue2 = new InstrumentedObject(false);
20: }
21: }
22:
23: public void accessValues() {
24: myMethod(longValue, booleanValue, objectValue, objectValue1,
25: objectValue2);
26: if (objectValue != null) {
27: objectValue.accessValues();
28: objectValue1.accessValues();
29: objectValue2.accessValues();
30: }
31: }
32:
33: public void setValues() {
34: this .longValue = System.currentTimeMillis();
35: this .booleanValue = System.currentTimeMillis() % 2 == 0;
36: this .objectValue = new InstrumentedObject(false);
37: this .objectValue1 = new InstrumentedObject(false);
38: this .objectValue2 = new InstrumentedObject(false);
39: }
40:
41: private void myMethod(long longValue2, boolean booleanValue2,
42: InstrumentedObject value, InstrumentedObject value1,
43: InstrumentedObject value2) {
44: // doNothing
45:
46: }
47: }
|