-
Notifications
You must be signed in to change notification settings - Fork 125
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
Duplicate class error when using apache commons Pair without importing java.util.Map #627
Comments
@mattstermiller thanks for reporting this. A fix is on the way. |
During testing the issue appears only with Java 8. As a sanity check are you using Java 8? Thanks. |
- one-off temporary fix, exclusive to Java 8: ensure top-level java.util.Map class loads before inner class Entry
No, I'm using Oracle's Java 17:
|
What version of gradle? |
|
I just updated my wrapper to the latest 8.10.2 and the issue persists. |
Please try with release 2024.1.37. I will continue to try to reproduce on JDKs greater than 8. |
A clean and build with these dependency updates gave the same error.
|
Are you using the duplicate-class.zip example? Using that I can only repro w JDK 8 |
if you are building from the command line, ensure you are performing a clean build. Also make sure there aren't any stray java daemon processes that gradle could be using in error. Otherwise, it should work. If it doesn't, try making a project from scratch by placing the build.gradle file in an empty directory and loading it in IJ as a project. Then add your source file and ensure gradle etc. is setup correctly. apply plugin: 'java'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation("org.apache.commons:commons-lang3:3.17.0")
implementation("systems.manifold:manifold-ext-rt:2024.1.37")
annotationProcessor("systems.manifold:manifold-ext:2024.1.37")
}
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xplugin:Manifold']
} |
Here's my project settings: I tried several other SDKs in my list which are based on java 11 or 17 (clean then build) and they all fail with the same duplicate class error. I've made sure there are no other gradle daemons or java processes running. As far as making a project from scratch, that's what I've already done for this minimal repro project I provided. |
- revise fix for #627, use reflection to enable compiling manifold itself with jdk 11+ only for building Xxx_11.java11+ source files
Describe the bug
Using manifold-ext and the Pair type from org.apache.commons:commons-lang3 WITHOUT any import of java.util.Map causes a duplicate class compiler error:
Simply adding
import java.util.Map;
to any java file in the project makes the error go away. But this is certainly not obvious and turns up as an unused import and could be auto-removed by some IDEs.To Reproduce
Steps to reproduce the behavior:
./gradlew assemble
Expected behavior
Project should compile without error.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: