Menu

#5 exclude unreachable constructors

next release build
open
None
7
2004-06-26
2004-05-28
No

I have an idea that it will be easy to exclude
unreachable (private at the bytecode, not source code,
level) constructors when they can be proven to be
unreachable. Specifically, if the class is abstract.

This already matches my own coding style for "static"
APIs and will get rid of an annoying edge case (private
methods that are never meant to be executed). If this
works, it could done in the next build on 2.0 branch.

A new instr.* prop should govern whether this exclusion
is done.

Discussion

  • Vlad Roubtsov

    Vlad Roubtsov - 2004-06-24
    • priority: 5 --> 7
    • assigned_to: nobody --> vlad_r
     
  • Vlad Roubtsov

    Vlad Roubtsov - 2004-06-26
    • milestone: --> next release build
     
  • Ryan Bloom

    Ryan Bloom - 2004-07-14

    Logged In: YES
    user_id=1020759

    I have a patch for this, but I couldn't figure out how to
    attach it to this bug, so I have posted it on-line at:

    http://rkbloom.net/rbb/megapatch

    Ryan

     
  • Justin Knowlden

    Justin Knowlden - 2004-10-24

    Logged In: YES
    user_id=1018677

    What is the status of this request? I was about to submit a
    feature request regarding the exclusion of
    unreachable/unused constructors of "static" classes.

    By static classes I mean classes where all methods are
    static; a utility or helper class. In these classes, I only
    ever call the methods; therefore, I never create an instance
    of the class.

    I have a few of these in my project, which generates a
    "false negative" in my coverage; the coverage shows that
    some code was not covered, but I never intended for it to
    be. The code that is not covered is the implied constructor;
    I never define a constructor in these types of classes.

    Side note: EMMA is not the only coverage tool that acts this
    way. JCoverage (the crappy product that it is), performs in
    the same way. Therefore, I will not be dissapointed if this
    feature request cannot or should not be implemented. I will
    simply have to learn Zen and satisfy myself with 97%
    coverage ... hmmmmmmmmmmmmm

     
  • Vlad Roubtsov

    Vlad Roubtsov - 2004-10-26

    Logged In: YES
    user_id=1013207

    This feature can be implemented. The most detailed
    description of what I was planning to do can be found here:
    http://sourceforge.net/mailarchive/forum.php?thread_id=5244259&forum_id=40481

    I did not receive any feedback to my post above. If you have
    some, don't bother doing so via the mailing list (it will be
    deactivated in near future because the forum seems to be
    where the "action" is), but you can do so via this RFE or
    the forum.

    This feature is in the list that will be implemented in the
    next minor version. No actual work has been done towards it
    specifically yet. The problem is with how many RFEs there
    are and how few spare hours I have...

     

Log in to post a comment.