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

Install bytebuddy agent once per JVM #74

Merged
merged 2 commits into from
Jun 18, 2021
Merged
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 @@ -20,15 +20,12 @@
import net.bytebuddy.pool.TypePool;
import net.bytebuddy.utility.JavaModule;

import java.lang.instrument.Instrumentation;
import java.util.*;

import static net.bytebuddy.matcher.ElementMatchers.*;

public class JabelCompilerPlugin implements Plugin {

@Override
public void init(JavacTask task, String... args) {
static {
Map<String, AsmVisitorWrapper> visitors = new HashMap<String, AsmVisitorWrapper>() {{
// Disable the preview feature check
AsmVisitorWrapper checkSourceLevelAdvice = Advice.to(CheckSourceLevelAdvice.class)
Expand Down Expand Up @@ -118,7 +115,10 @@ public void init(JavacTask task, String... args) {
Collections.emptySet(),
Collections.emptyMap()
);
}

@Override
public void init(JavacTask task, String... args) {
Context context = ((JavacTaskImpl) task).getContext();
JavacMessages.instance(context).add(locale -> new ResourceBundle() {
@Override
Expand Down