Skip to content

Commit e9a0849

Browse files
authored
Merge pull request #26730 from KyleAure/fix-java-17-auto-logging
2 parents 6e89a1c + 8d14a79 commit e9a0849

File tree

16 files changed

+599
-106
lines changed

16 files changed

+599
-106
lines changed

dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/LibertyRuntimeTransformer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
/**
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
}

0 commit comments

Comments
 (0)