File tree Expand file tree Collapse file tree 16 files changed +599
-106
lines changed
com.ibm.ws.ras.instrument_test/test
test data/com/ibm/example/bytecode
com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main Expand file tree Collapse file tree 16 files changed +599
-106
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ private static boolean isTransformPossible(byte[] bytes) {
202202 if (isJDK8WithHotReplaceBug )
203203 return classFileVersion <= Opcodes .V1_7 ;
204204 else
205- return classFileVersion <= Opcodes .V11 ;
205+ return classFileVersion <= Opcodes .V22 ;
206206 }
207207
208208 /**
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2023 IBM Corporation and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License 2.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-2.0/
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ *
10+ * Contributors:
11+ * IBM Corporation - initial API and implementation
12+ *******************************************************************************/
13+ package com .ibm .example .bytecode ;
14+
15+ public class HelloWorldJava11 {
16+ public static void printHi () {
17+ System .out .println ("hi" );
18+ }
19+
20+ public static int addThingsStatic (int a , int b ) {
21+ int c = a + b ;
22+ return c ;
23+ }
24+
25+ public int addThings (int a , int b ) {
26+ int c = a + b ;
27+ return c ;
28+ }
29+
30+ public Object instancer (Class blah ) throws IllegalAccessException , InstantiationException {
31+ return blah .newInstance ();
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2023 IBM Corporation and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License 2.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-2.0/
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ *
10+ * Contributors:
11+ * IBM Corporation - initial API and implementation
12+ *******************************************************************************/
13+ package com .ibm .example .bytecode ;
14+
15+ public class HelloWorldJava17 {
16+ public static void printHi () {
17+ System .out .println ("hi" );
18+ }
19+
20+ public static int addThingsStatic (int a , int b ) {
21+ int c = a + b ;
22+ return c ;
23+ }
24+
25+ public int addThings (int a , int b ) {
26+ int c = a + b ;
27+ return c ;
28+ }
29+
30+ public Object instancer (Class blah ) throws IllegalAccessException , InstantiationException {
31+ return blah .newInstance ();
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2023 IBM Corporation and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License 2.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-2.0/
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ *
10+ * Contributors:
11+ * IBM Corporation - initial API and implementation
12+ *******************************************************************************/
13+ package com .ibm .example .bytecode ;
14+
15+ public class HelloWorldJava21 {
16+ public static void printHi () {
17+ System .out .println ("hi" );
18+ }
19+
20+ public static int addThingsStatic (int a , int b ) {
21+ int c = a + b ;
22+ return c ;
23+ }
24+
25+ public int addThings (int a , int b ) {
26+ int c = a + b ;
27+ return c ;
28+ }
29+
30+ public Object instancer (Class blah ) throws IllegalAccessException , InstantiationException {
31+ return blah .newInstance ();
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2023 IBM Corporation and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License 2.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-2.0/
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ *
10+ * Contributors:
11+ * IBM Corporation - initial API and implementation
12+ *******************************************************************************/
13+ package com .ibm .example .bytecode ;
14+
15+ public class HelloWorldJava6 {
16+ public static void printHi () {
17+ System .out .println ("hi" );
18+ }
19+
20+ public static int addThingsStatic (int a , int b ) {
21+ int c = a + b ;
22+ return c ;
23+ }
24+
25+ public int addThings (int a , int b ) {
26+ int c = a + b ;
27+ return c ;
28+ }
29+
30+ public Object instancer (Class blah ) throws IllegalAccessException , InstantiationException {
31+ return blah .newInstance ();
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2023 IBM Corporation and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License 2.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-2.0/
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ *
10+ * Contributors:
11+ * IBM Corporation - initial API and implementation
12+ *******************************************************************************/
13+ package com .ibm .example .bytecode ;
14+
15+ public class HelloWorldJava7 {
16+ public static void printHi () {
17+ System .out .println ("hi" );
18+ }
19+
20+ public static int addThingsStatic (int a , int b ) {
21+ int c = a + b ;
22+ return c ;
23+ }
24+
25+ public int addThings (int a , int b ) {
26+ int c = a + b ;
27+ return c ;
28+ }
29+
30+ public Object instancer (Class blah ) throws IllegalAccessException , InstantiationException {
31+ return blah .newInstance ();
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2023 IBM Corporation and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License 2.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-2.0/
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ *
10+ * Contributors:
11+ * IBM Corporation - initial API and implementation
12+ *******************************************************************************/
13+ package com .ibm .example .bytecode ;
14+
15+ public class HelloWorldJava7StaticInit {
16+ public static final int staticint = 0 ;
17+
18+ static String someString = new String ();
19+
20+ static {
21+ System .out .println ("HiStatic" );
22+ }
23+
24+ public static void printHi () {
25+ System .out .println ("hi" );
26+ }
27+
28+ public static int addThingsStatic (int a , int b ) {
29+ int c = a + b ;
30+ return c ;
31+ }
32+
33+ public int addThings (int a , int b ) {
34+ int c = a + b ;
35+ return c ;
36+ }
37+
38+ public Object instancer (Class blah ) throws IllegalAccessException , InstantiationException {
39+ return blah .newInstance ();
40+ }
41+ }
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2023 IBM Corporation and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License 2.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-2.0/
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ *
10+ * Contributors:
11+ * IBM Corporation - initial API and implementation
12+ *******************************************************************************/
13+ package com .ibm .example .bytecode ;
14+
15+ public class HelloWorldJava8 {
16+ public static void printHi () {
17+ System .out .println ("hi" );
18+ }
19+
20+ public static int addThingsStatic (int a , int b ) {
21+ int c = a + b ;
22+ return c ;
23+ }
24+
25+ public int addThings (int a , int b ) {
26+ int c = a + b ;
27+ return c ;
28+ }
29+
30+ public Object instancer (Class blah ) throws IllegalAccessException , InstantiationException {
31+ return blah .newInstance ();
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2023 IBM Corporation and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License 2.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-2.0/
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ *
10+ * Contributors:
11+ * IBM Corporation - initial API and implementation
12+ *******************************************************************************/
13+ package com .ibm .example .bytecode ;
14+
15+ import java .util .concurrent .Callable ;
16+
17+ public class HelloWorldJava8Lambdas {
18+ public static void printHi () {
19+ System .out .println ("hi" );
20+ }
21+
22+ public static int addThingsStatic (int a , int b ) {
23+ Callable <String > helloLambda = () -> "Hello" ;
24+ int c = a + b ;
25+ return c ;
26+ }
27+
28+ public int addThings (int a , int b ) {
29+ int c = a + b ;
30+ return c ;
31+ }
32+
33+ public Object instancer (Class blah ) throws IllegalAccessException , InstantiationException {
34+ return blah .newInstance ();
35+ }
36+ }
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2023 IBM Corporation and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License 2.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-2.0/
7+ *
8+ * SPDX-License-Identifier: EPL-2.0
9+ *
10+ * Contributors:
11+ * IBM Corporation - initial API and implementation
12+ *******************************************************************************/
13+ package com .ibm .example .bytecode ;
14+
15+ public class HelloWorldJava8StaticInit {
16+ public static final int staticint = 0 ;
17+
18+ static String someString = new String ();
19+
20+ static {
21+ System .out .println ("HiStatic" );
22+ }
23+
24+ public static void printHi () {
25+ System .out .println ("hi" );
26+ }
27+
28+ public static int addThingsStatic (int a , int b ) {
29+ int c = a + b ;
30+ return c ;
31+ }
32+
33+ public int addThings (int a , int b ) {
34+ int c = a + b ;
35+ return c ;
36+ }
37+
38+ public Object instancer (Class blah ) throws IllegalAccessException , InstantiationException {
39+ return blah .newInstance ();
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments