Source Code Cross Referenced for TestClass2.java in  » Byte-Code » PROSE » measurements » suites » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Byte Code » PROSE » measurements.suites 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package measurements.suites;
002:
003:        public class TestClass2 extends TestClass implements  TestInterface {
004:
005:            public static boolean scallDummyMethod = false;
006:            public boolean callDummyMethod = false;
007:
008:            public void dummyMethod(boolean callRecursively) {
009:                if (callRecursively)
010:                    dummyMethod(callRecursively);
011:            }
012:
013:            public static void sdummyMethod(boolean callRecursively) {
014:                if (callRecursively)
015:                    sdummyMethod(callRecursively);
016:            }
017:
018:            // fields
019:            static int staticInt;
020:            static long staticLong;
021:            static Object staticObj;
022:
023:            private static int privateStaticInt;
024:            private static long privateStaticLong;
025:            private static Object privateStaticObj;
026:
027:            public int instanceInt;
028:            public long instanceLong;
029:            public Object instanceObj;
030:
031:            private int privateInstanceInt;
032:            private long privateInstanceLong;
033:            private Object privateInstanceObj;
034:
035:            // methods                                                          // body avoids optimizations (leaf methods)
036:            public void interfaceMethodShort() {
037:                if (callDummyMethod)
038:                    dummyMethod(callDummyMethod);
039:            }
040:
041:            public void interfaceMethodLong(Object x, Object o) {
042:                if (callDummyMethod)
043:                    dummyMethod(callDummyMethod);
044:            }
045:
046:            public void instanceMethodShort() {
047:                if (callDummyMethod)
048:                    dummyMethod(callDummyMethod);
049:            }
050:
051:            public void instanceMethodLong(Object x, Object o) {
052:                if (callDummyMethod)
053:                    dummyMethod(callDummyMethod);
054:            }
055:
056:            public static void staticMethodShort() {
057:                if (scallDummyMethod)
058:                    sdummyMethod(scallDummyMethod);
059:            }
060:
061:            public static void staticMethodLong(Object x, Object o) {
062:                if (scallDummyMethod)
063:                    sdummyMethod(scallDummyMethod);
064:            }
065:
066:            private static void privateStaticMethodShort() {
067:                if (scallDummyMethod)
068:                    sdummyMethod(scallDummyMethod);
069:            }
070:
071:            private static void privateStaticMethodLong(Object x, Object o) {
072:                if (scallDummyMethod)
073:                    sdummyMethod(scallDummyMethod);
074:            }
075:
076:            public synchronized void syncInstanceMethodShort() {
077:                if (callDummyMethod)
078:                    dummyMethod(callDummyMethod);
079:            }
080:
081:            public synchronized void syncInstanceMethodLong(Object x, Object o) {
082:                if (callDummyMethod)
083:                    dummyMethod(callDummyMethod);
084:            }
085:
086:            private void privateInstanceMethodShort() {
087:                if (callDummyMethod)
088:                    dummyMethod(callDummyMethod);
089:            }
090:
091:            private void privateInstanceMethodLong(Object x, Object o) {
092:                if (callDummyMethod)
093:                    dummyMethod(callDummyMethod);
094:            }
095:
096:            public void testPutField(int runs) {
097:
098:                for (int i = 0; i < runs; i++)
099:                    this .instanceInt = 1;
100:            }
101:
102:            public void testGetField(int runs) {
103:
104:                int localInt = 0;
105:                for (int i = 0; i < runs; i++)
106:                    localInt = this .instanceInt;
107:            }
108:
109:            public void testNonJPOperations() {
110:                int i = 1;
111:                int ii = 1;
112:                int localInt = 1;
113:                long localLong = 1;
114:                Object localObj = new Object();
115:                int[] localArr = new int[10];
116:                Object oo = new TestClass2();
117:
118:                byte b1 = 1;
119:                byte b2 = 1;
120:                short s1 = 1;
121:                short s2 = 1;
122:                int i1 = 1;
123:                int i2 = 1;
124:                long l1 = 1;
125:                long l2 = 1;
126:
127:                final Object tcObject = new TestClass2();
128:                final int[] aa = new int[10];
129:
130:                // loop tests
131:                for (ii = 0; ii < TestFrequency.LOCALLOOP; ii++)
132:                    ;
133:                for (ii = TestFrequency.LOCALLOOP; --ii >= 0;)
134:                    ;
135:
136:                // check casts
137:                for (i = TestFrequency.CHECKCAST; --i >= 0;) {
138:                    oo = (TestClass2) oo;
139:                }
140:
141:                // local operation
142:                for (i = TestFrequency.LOCALVAR; --i >= 0;) {
143:                    localInt = localInt;
144:                    localLong = localLong;
145:                    localObj = localObj;
146:                    localArr[0] = localArr[0];
147:                }
148:
149:                // local additions
150:                for (i = TestFrequency.LOCALADD; --i >= 0;) {
151:                    i1 += i2;
152:                    s1 += s2;
153:                    l1 += s2;
154:                    b1 += b2;
155:                }
156:
157:                // one throw catch
158:                //try
159:                //    {
160:                //	throw new Exception();
161:                //    }
162:                //catch (Exception e)
163:                //    {}
164:
165:            }
166:
167:            public void testFieldOperations() {
168:                int i;
169:                int localInt = 1;
170:                long localLong = 1;
171:                Object localObj = new Object();
172:                TestClass2 obj = new TestClass2();
173:
174:                // static puts
175:                for (i = TestFrequency.PUTSTATIC / 6; --i >= 0;) {
176:                    // this static set
177:                    staticInt = localInt;
178:                    staticObj = localObj;
179:                    staticLong = localLong;
180:
181:                    // private sta
182:                    privateStaticInt = localInt;
183:                    privateStaticObj = localObj;
184:                    privateStaticLong = localLong;
185:                }
186:
187:                // static puts
188:                for (i = TestFrequency.GET_ARGSSTATIC / 6; --i >= 0;) {
189:                    // this static get
190:                    localInt = staticInt;
191:                    localObj = staticObj;
192:                    localLong = staticLong;
193:
194:                    // private static get
195:                    localInt = privateStaticInt;
196:                    localObj = privateStaticObj;
197:                    localLong = privateStaticLong;
198:                }
199:
200:                // instance sets
201:                for (i = TestFrequency.PUTFIELD / 9; --i >= 0;) {
202:                    // this.x=localX
203:                    instanceInt = localInt;
204:                    instanceObj = localObj;
205:                    instanceLong = localLong;
206:
207:                    // private this.x=localX
208:                    privateInstanceInt = localInt;
209:                    privateInstanceObj = localObj;
210:                    privateInstanceLong = localLong;
211:
212:                    // obj.x = localX
213:                    obj.instanceInt = localInt;
214:                    obj.instanceLong = localLong;
215:                    obj.instanceObj = localObj;
216:
217:                }
218:
219:                // getfields
220:                for (i = TestFrequency.GET_ARGSFIELD / 9; --i >= 0;) {
221:                    // this instance get
222:                    localInt = instanceInt;
223:                    localObj = instanceObj;
224:                    localLong = instanceLong;
225:
226:                    // private instance get
227:                    localInt = privateInstanceInt;
228:                    localObj = privateInstanceObj;
229:                    localLong = privateInstanceLong;
230:
231:                    // obj gets
232:                    localInt = obj.instanceInt;
233:                    localObj = obj.instanceObj;
234:                    localLong = obj.instanceLong;
235:                }
236:            }
237:
238:            public void testMethodOperations() {
239:                TestInterface localInterface = new TestClass2();
240:                TestClass2 obj = new TestClass2();
241:                int localInt = 1;
242:                Object localObj = new Object();
243:                int i;
244:
245:                // invokeinterface
246:                for (i = TestFrequency.INVOKEINTERFACE / 2; --i >= 0;) {
247:                    localInterface.interfaceMethodShort();
248:                    localInterface.interfaceMethodLong(localObj, localObj);
249:                }
250:
251:                for (i = TestFrequency.INVOKESPECIAL / 2; --i >= 0;) {
252:                    // private
253:                    privateInstanceMethodShort();
254:                    privateInstanceMethodLong(localObj, localObj);
255:                }
256:
257:                // invoke virtual
258:                for (i = TestFrequency.INVOKEVIRTUAL / 6; --i >= 0;) {
259:                    instanceMethodShort();
260:                    instanceMethodLong(localObj, localObj);
261:
262:                    syncInstanceMethodShort();
263:                    syncInstanceMethodLong(localObj, localObj);
264:
265:                    obj.instanceMethodShort();
266:                    obj.instanceMethodLong(localObj, localObj);
267:                }
268:
269:                // invoke static
270:                for (i = TestFrequency.INVOKESTATIC / 4; --i >= 0;) {
271:                    staticMethodShort();
272:                    staticMethodLong(localObj, localObj);
273:
274:                    privateStaticMethodShort();
275:                    privateStaticMethodLong(localObj, localObj);
276:                }
277:
278:            }
279:
280:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.