Menu

#15 Shrinker fails to keep protected methods

closed-wont-fix
None
4
2003-05-03
2003-01-22
Anonymous
No

When shrinking with the option:

-keepclasseswithmembers public class * {
protected *;
}

the following class is not preserved in the output jar:
public class Test {
public Test() {

\}

protected void doSomething\(String s\) \{
    System.out.println\("Do

Something." + s);
}

}

Related

Bugs: #607
Bugs: #631

Discussion

  • Nobody/Anonymous

    Logged In: NO

    logged by: Justin Walsh (justinw@medscheme.co.za)

     
  • Eric Lafortune

    Eric Lafortune - 2003-01-27
    • priority: 5 --> 4
     
  • Eric Lafortune

    Eric Lafortune - 2003-01-27
    • assigned_to: nobody --> lafortune
     
  • Eric Lafortune

    Eric Lafortune - 2003-01-27

    Logged In: YES
    user_id=555208

    The specification
    "protected *;"
    is interpreted as
    "protected <fields>;"
    "protected <methods>;"

    -keepclasseswithmembers then looks for classes that have at
    least
    one of each. This specification is so uncommon that I wonder
    whether it is worth changing its behavior.

    The intended specification is probably just "protected
    <methods>;".

    Even then, it is very unusual to try to keep all classes that
    happen to have one or more protected methods. ProGuard doesn't
    object and even handles the latter specification, but using
    wildcards in the members of -keepclasseswithmembers is
    probably not
    a good idea.

    I could add a check, along with some more checks for meaningless
    specifications like
    "abstract <fields>;"

    Eric.

     
  • Eric Lafortune

    Eric Lafortune - 2003-05-03
    • status: open --> closed-wont-fix
     

Log in to post a comment.

MongoDB Logo MongoDB