Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Java 11 language features where possible #99

Merged
merged 1 commit into from
Jun 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static void premain(String agentArguments, Instrumentation instrumentatio
} else if (t.startsWith("error=")) {
Listener.ERROR = new PrintWriter(new OutputStreamWriter(new FileOutputStream(t.substring(6)), StandardCharsets.UTF_8));
} else if (t.startsWith("listener=")) {
ActivityListener.LIST.add((ActivityListener) AgentMain.class.getClassLoader().loadClass(t.substring(9)).newInstance());
ActivityListener.LIST.add((ActivityListener) AgentMain.class.getClassLoader().loadClass(t.substring(9)).getDeclaredConstructor().newInstance());
} else if (t.equals("dumpatshutdown")) {
Runtime.getRuntime().addShutdownHook(new Thread("File handles dumping shutdown hook") {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void testInstrumentations() throws Exception {
OutputStreamWriter osw = new OutputStreamWriter(baos, StandardCharsets.UTF_8);
PrintWriter pw = new PrintWriter(osw)) {
CheckClassAdapter.verify(classReader, false, pw);
errors = new String(baos.toByteArray(), StandardCharsets.UTF_8);
errors = baos.toString(StandardCharsets.UTF_8);
}
assertTrue("Verification failed for " + c + "\n" + errors, errors.isEmpty());
}
Expand Down