Menu

#586 Unnecessary change of member access level

v5.2
closed-fixed
None
5
2016-10-23
2015-11-18
stegeto22
No

In the proguard.classfile.editor.AccessFixer.MyAccessFixer.visitProgramMember() there is a condition, which could never be met:

            int requiredAccessLevel =
                programClass.equals(referencingClass)         ? AccessUtil.PRIVATE         :
                inSamePackage(programClass, referencingClass) ? AccessUtil.PACKAGE_VISIBLE :
                **programClass.extends_(referencingClass) &&
                referencingClass.extends_(programClass)**       ? AccessUtil.PROTECTED       :
                                                                AccessUtil.PUBLIC;

I think ("A extends B" AND "B extends A") is never possible. Maybe an OR was intended.

I stumbled over this, when I inspected some of the obfuscated class files, were the access level of some members changed to PUBLIC.

Discussion

  • Eric Lafortune

    Eric Lafortune - 2015-11-19

    Thanks for your report. You're right; that condition doesn't make much sense. It was the result of some refactoring. The intention is more complex, involving the class in the method invocation and the class that actually contains the method . I'll fix it for the upcoming ProGuard 5.3.

     
  • Eric Lafortune

    Eric Lafortune - 2015-11-19
    • status: open --> open-fixed
     
  • Eric Lafortune

    Eric Lafortune - 2016-10-23
    • Status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB