From 891cee102534ed7086192f18ae0af6bb1ad8ba5c Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 4 Aug 2023 01:47:07 +0200 Subject: [PATCH] [fixes #3474] ASM + lombok on the classpath at runtime would cause a split package error if using the module system --- doc/changelog.markdown | 2 +- .../lombok/bytecode/ClassFileMetaData.java | 2 +- .../lombok/launch/ClassFileMetaData.java | 2 +- src/launch/lombok/launch/PackageShader.java | 21 +++++++++++++++++++ .../lombok/launch/ShadowClassLoader.java | 3 +-- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/doc/changelog.markdown b/doc/changelog.markdown index b8c4d618..dcadcbc2 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -2,7 +2,7 @@ Lombok Changelog ---------------- ### v1.18.29 "Edgy Guinea Pig" -* We recently released v1.18.28; there is no edge release since then. +* BUGFIX: If using the module system and lombok is on the runtime classpath (shouldn't be, but happens), you'd get a split package error: `Package org.objectweb.asm in both module lombok and module org.objectweb.asm`. [Issue #3474](https://github.com/projectlombok/lombok/issues/3474) ### v1.18.28 (May 24th, 2023) * PLATFORM: JDK20 support added. [Issue #3353](https://github.com/projectlombok/lombok/issues/3353). diff --git a/src/core/lombok/bytecode/ClassFileMetaData.java b/src/core/lombok/bytecode/ClassFileMetaData.java index 71e0c56c..a83b700f 100644 --- a/src/core/lombok/bytecode/ClassFileMetaData.java +++ b/src/core/lombok/bytecode/ClassFileMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2019 The Project Lombok Authors. + * Copyright (C) 2010-2023 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 diff --git a/src/launch/lombok/launch/ClassFileMetaData.java b/src/launch/lombok/launch/ClassFileMetaData.java index be3bc865..2704bd39 100644 --- a/src/launch/lombok/launch/ClassFileMetaData.java +++ b/src/launch/lombok/launch/ClassFileMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2019 The Project Lombok Authors. + * Copyright (C) 2010-2023 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 diff --git a/src/launch/lombok/launch/PackageShader.java b/src/launch/lombok/launch/PackageShader.java index b47cd943..d3f4b3ae 100644 --- a/src/launch/lombok/launch/PackageShader.java +++ b/src/launch/lombok/launch/PackageShader.java @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2023 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package lombok.launch; import java.io.UnsupportedEncodingException; diff --git a/src/launch/lombok/launch/ShadowClassLoader.java b/src/launch/lombok/launch/ShadowClassLoader.java index cb1db156..15a27f23 100644 --- a/src/launch/lombok/launch/ShadowClassLoader.java +++ b/src/launch/lombok/launch/ShadowClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2021 The Project Lombok Authors. + * Copyright (C) 2014-2023 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 @@ -34,7 +34,6 @@ import java.net.URI; import java.net.URL; import java.net.URLDecoder; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap;