From 1e40a199aaa1e626e9b36fc8f636289499d66fb5 Mon Sep 17 00:00:00 2001 From: Martin O'Connor <38929043+martinoconnor@users.noreply.github.com> Date: Fri, 31 Dec 2021 21:29:22 -0500 Subject: [PATCH] [fixes projectlombok/lombok#1036] Exclude the classloader for jasperreports-plugin due to a classloader conflict with ECJ --- doc/changelog.markdown | 1 + src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/changelog.markdown b/doc/changelog.markdown index b6b42b3949..c94d90be2b 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -6,6 +6,7 @@ Lombok Changelog * FEATURE: `@ToString` has an annotation parameter called `onlyExplicitlyIncluded`. There's now a config key `lombok.toString.onlyExplicitlyIncluded` to set this property as well. [Issue #2849](https://github.com/projectlombok/lombok/pull/2849). * FEATURE: Turning a field named `uShape` into a getter is tricky: `getUShape` or `getuShape`? The community is split on which style to use. Lombok does `getUShape`, but if you prefer the `getuShape` style, add to `lombok.config`: `lombok.accessors.capitalization = beanspec`. [Issue #2693](https://github.com/projectlombok/lombok/issues/2693) [Pull Request #2996](https://github.com/projectlombok/lombok/pull/2996). Thanks __@YonathanSherwin__! * BUGFIX: Various save actions and refactor scripts in eclipse work better. [Issue #2995](https://github.com/projectlombok/lombok/issues/2995) [Issue #1309](https://github.com/projectlombok/lombok/issues/1309) [Issue #2985](https://github.com/projectlombok/lombok/issues/2985) [Issue #2509](https://github.com/projectlombok/lombok/issues/2509) +* BUGFIX: Eclipse projects using the jasperreports-plugin will now compile [Issue #1036](https://github.com/projectlombok/lombok/issues/1036) * SECURITY: A widely reported security issue with log4j2 ([CVE-2021-44228](https://www.randori.com/blog/cve-2021-44228/)) has absolutely no effect on either lombok itself nor does usage of lombok on its own, or even the usage of lombok's `@Log4j2`, cause any issues whatsoever: You have to ship your own log4j2 dependency in your app - update that to 2.17 or otherwise mitigate this issue (see the CVE page). To avoid unneccessary warnings from dependency checkers, our dep on log4j2, which is used solely for testing, isn't shipped by us, and cannot be exploited in any way, has been updated to 2.17.0. [Issue #3063](https://github.com/projectlombok/lombok/issues/3063) ### v1.18.22 (October 6th, 2021) diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index 76a65e1666..2e35cf5777 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -59,7 +59,10 @@ private static void registerPatchScripts(Instrumentation instrumentation, boolea 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().getName().startsWith("org.sonar.classloader.")) return false; // Relevant to bug #2351 + if (loader != null) { + if (loader.getClass().getName().startsWith("org.sonar.classloader.")) return false; // Relevant to bug #2351 + if (loader.toString().contains("com.alexnederlof:jasperreports-plugin")) return false; //Relevant to bug #1036 + } if (!(loader instanceof URLClassLoader)) return true; ClassLoader parent = loader.getParent(); if (parent == null) return true;