Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#116 [Patch] Single implementation

open
None
7
2011-06-19
2011-06-17
No

There are some checks that prevent classes to be merged with the interface that it is the sole implementer of. The attached patch lifts some restrictions that don't make sense in this case.

The instanceof check isn't needed if the parent class is abstract.

The change in shadowsAnyMethods is required if the class has a public static method. I'm a bit uncertain if it's the best possible fix though.

Discussion

  • Eric Lafortune
    Eric Lafortune
    2011-06-19

    • assigned_to: nobody --> lafortune
    • priority: 5 --> 7
     
  • Eric Lafortune
    Eric Lafortune
    2011-06-19

    This is a tricky area. I'll check.

     
  • Unfortunately, these modifications aren't enough. I also need to change the check for what classes gets initialized. Preferably it would be possible to configure which classes should be checked (only optional API:s).

    I haven't started working on this yet though, and I'm not sure I will. I will do a little bit more investigation, but it is probable that I will keep my old class merger instead as it finds more classes to merge. Your code it too correct. :-)