Menu

#658 can't find referenced field java.lang.Boolean default

v5.3.3
closed-works-for-me
None
High
2019-12-06
2017-07-29
Java
No

interface Foo {

Boolean getDefault();

}

class FooImpl implements Foo {

private Boolean defaultValue;

@Override
public Boolean getDefault() {
return defaultValue;
}
}

Warning: FooImpl: can't find referenced field 'java.lang.Boolean default' in program class FooImpl

There is no field called "default", it is defaultValue. Default is a keyword in java, so use defaultValue.

Discussion

  • Eric Lafortune

    Eric Lafortune - 2017-08-15

    I can't reproduce the problem with your example -- it works just fine. If ProGuard mentions a field called "default", it's not making that name up, so it must be somewhere in your code. Maybe starting from a clean build helps? Otherwise, do you have a small zip file of this project with all the necessary files to reproduce the issue?

     
  • Eric Lafortune

    Eric Lafortune - 2017-08-15
    • status: open --> open-works-for-me
    • assigned_to: Eric Lafortune
     
  • Java

    Java - 2017-08-20

    Does proguard assume that there is a member variable "default" for getDefault() method?

     
    • Eric Lafortune

      Eric Lafortune - 2017-08-20

      No, Java bytecode doesn't have such conventions, so ProGuard doesn't need to perform such transformations or make assumptions.

       
  • T. Neidhart

    T. Neidhart - 2019-12-06
    • status: open-works-for-me --> closed-works-for-me
    • Priority: 5 --> High
     

Log in to post a comment.

MongoDB Logo MongoDB