JDK-8171194 : Exception "Duplicate field name&signature in class file" should report the name and signature of the field
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,9,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-12-14
  • Updated: 2017-08-25
  • Resolved: 2017-03-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8
10 b21Fixed 8u152Fixed
Description
Sometimes I get the following exception when running unit tests:

java.lang.ClassFormatError: Duplicate field name&signature in class file CampaignClient
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Unfortunately, without a field name + signature I have no way of knowing what
is triggering the problem. The class in question is quite big so removing
code by trial and error is very time consuming.

Would like:

java.lang.ClassFormatError: Duplicate field name LOG with signature
org.slf4j.Logger in class file CampaignClient
Comments
The synopsis doesn't reflect the request. Should read something like Exception "Duplicate field name&signature in class file" should report the name and signature of the field
14-12-2016