aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-01-30 17:24:20 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-01-30 17:24:20 +0100
commit025dd0e76e692ad68bc206a14fd1895d90ea2686 (patch)
tree2b6fb4ec00a9a4a6b065148012e70999d79a3a69 /src/eclipseAgent/lombok
parent229cde2bf084e243913030ddad4bce13f6c38732 (diff)
downloadlombok-025dd0e76e692ad68bc206a14fd1895d90ea2686.tar.gz
lombok-025dd0e76e692ad68bc206a14fd1895d90ea2686.tar.bz2
lombok-025dd0e76e692ad68bc206a14fd1895d90ea2686.zip
[bughunt] [issue #2351] wild-stab try to fix issue 2351, without reproduction.
Diffstat (limited to 'src/eclipseAgent/lombok')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index 24c1216e..49f2e36a 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2019 The Project Lombok Authors.
+ * Copyright (C) 2009-2020 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -57,6 +57,7 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
String[] args = agentArgs == null ? new String[0] : agentArgs.split(":");
boolean forceEcj = false;
boolean forceEclipse = false;
+
for (String arg : args) {
if (arg.trim().equalsIgnoreCase("ECJ")) forceEcj = true;
if (arg.trim().equalsIgnoreCase("ECLIPSE")) forceEclipse = true;
@@ -80,6 +81,7 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
sm.registerTransformer(instrumentation);
sm.setFilter(new Filter() {
@Override public boolean shouldTransform(ClassLoader loader, String className, Class<?> classBeingDefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
+ if (loader != null && loader.getClass().toString().startsWith("org.sonar.classloader")) return false; // Relevant to bug #2351
if (!(loader instanceof URLClassLoader)) return true;
ClassLoader parent = loader.getParent();
if (parent == null) return true;