Skip to content

Commit

Permalink
[fixes #1036] Exclude the classloader for
Browse files Browse the repository at this point in the history
jasperreports-plugin due to a
classloader conflict with ECJ
  • Loading branch information
Martin O'Connor authored and rspilker committed Jan 7, 2022
1 parent 3de5d09 commit 1e40a19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/changelog.markdown
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
Expand Up @@ -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;
Expand Down

1 comment on commit 1e40a19

@mkielar
Copy link

@mkielar mkielar commented on 1e40a19 Jan 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! I reported this bug almost six years ago and now I wouldn't even know how to set up things that led to it, that's how far I wandered away from what I have been doing back then.

What's even more amazing is that the fix is basically a one-liner.

Anyways, just came here to say thanks and good job!

Please sign in to comment.