Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26730 from KyleAure/fix-java-17-auto-logging
- Loading branch information
Showing
16 changed files
with
599 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
dev/com.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava11.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
public class HelloWorldJava11 { | ||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
dev/com.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava17.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
public class HelloWorldJava17 { | ||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
dev/com.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava21.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
public class HelloWorldJava21 { | ||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
dev/com.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava6.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
public class HelloWorldJava6 { | ||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
dev/com.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava7.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
public class HelloWorldJava7 { | ||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...m.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava7StaticInit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
public class HelloWorldJava7StaticInit { | ||
public static final int staticint = 0; | ||
|
||
static String someString = new String(); | ||
|
||
static { | ||
System.out.println("HiStatic"); | ||
} | ||
|
||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
dev/com.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava8.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
public class HelloWorldJava8 { | ||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
dev/com.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava8Lambdas.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
import java.util.concurrent.Callable; | ||
|
||
public class HelloWorldJava8Lambdas { | ||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
Callable<String> helloLambda = () -> "Hello"; | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...m.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava8StaticInit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
public class HelloWorldJava8StaticInit { | ||
public static final int staticint = 0; | ||
|
||
static String someString = new String(); | ||
|
||
static { | ||
System.out.println("HiStatic"); | ||
} | ||
|
||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...bm.ws.ras.instrument_test/test/com/ibm/example/bytecode/HelloWorldJava8StaticLambdas.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package com.ibm.example.bytecode; | ||
|
||
import java.util.concurrent.Callable; | ||
|
||
public class HelloWorldJava8StaticLambdas { | ||
public static final Callable<String> helloLambda = () -> "Hello"; | ||
|
||
public static final Converter<String> STRING_CONVERTER; | ||
|
||
public static void printHi() { | ||
System.out.println("hi"); | ||
} | ||
|
||
static { | ||
STRING_CONVERTER = (v -> v); | ||
} | ||
|
||
public static int addThingsStatic(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public int addThings(int a, int b) { | ||
int c = a + b; | ||
return c; | ||
} | ||
|
||
public Object instancer(Class blah) throws IllegalAccessException, InstantiationException { | ||
return blah.newInstance(); | ||
} | ||
|
||
public static interface Converter<T> { | ||
T convert(String param1String); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
dev/com.ibm.ws.ras.instrument_test/test/com/ibm/example/bytecode/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## Source files | ||
|
||
The classes in this directory are the source files for the .class files located in the `test data` directory. | ||
If you are adding a new class to this directory you need to manually compile it at the java level it was written to be tested against. | ||
|
||
### Generate new class files | ||
|
||
```sh | ||
cd com.ibm.ws.ras.instrument_test | ||
|
||
# TODO Add JDK 11 to your path | ||
|
||
javac -d "test/test data/" test/com/ibm/example/bytecode/HelloWorldJava11.java |
Oops, something went wrong.