Menu

#762 obfuscated class name does not have consistent capitalization

v6.1
open-works-for-me
None
Medium
2019-09-05
2019-08-16
Doug Simon
No

Using ProGuard 6.1.1 and JDK 11.0.3, I'm seeing class files generated where the filesystem path for the class representing the package of the class does not have the same capitalization as the fully qualified name of the class in the class file.

For example, the class file com/acme/N/a.class defines a class named com.acme.n.a:

> javap --class-path . com.acme.n.a
Compiled from "stripped"
public class com.acme.n.a extends org.acme.BasePhase {
...

This causes problems when trying to compile a module-info.java that references the obfuscated class:

module-info.java:16: error: cannot access a
    provides org.acme.PluginFactory with com.acme.N.a;
                                                                                                                                                      ^
  bad class file: com/acme/N/a.class
    class file contains wrong class: com.acme.n.a
    Please remove or make sure it appears in the correct subdirectory of the classpath.

I can work around this with the -dontusemixedcaseclassnames option but it would be nice if I did not have to.

Discussion

  • Eric Lafortune

    Eric Lafortune - 2019-09-05

    ProGuard consistently distinguishes between similar mixed-case class names (they're just different strings after all), but your file system probably doesn't. Somewhere in your build process, the files must have been unpacked from their jars, with the similarly named files overwriting one another.

     
  • Eric Lafortune

    Eric Lafortune - 2019-09-05
    • status: open --> open-works-for-me
    • assigned_to: Eric Lafortune
     

Log in to post a comment.

MongoDB Logo MongoDB