#114 disallow instantiation of utility class

release_3.1
closed
Check (274)
5
2012-10-10
2002-11-07
Lars Kühne
No

Utility classes that extend Object and contain only
static methods should only contain a private (or maybe
protected, configurable) constructor to disallow
instantiation.

Example:

public class Util
{
public static multiply(int a, int b)
{
return a * b;
}
}

should be flagged, as it contains an implicit public
constructor.

Discussion

  • Lars Kühne

    Lars Kühne - 2003-01-04

    Logged In: YES
    user_id=401384

    I have an initial implementation for this request now.

    Holding back the CVS checkin until we leave feature freeze
    mode for release 3.0.

     
  • Lars Kühne

    Lars Kühne - 2003-02-23

    Logged In: YES
    user_id=401384

    implementation and docs are now in CVS,
    HideUtilityClassConstructor will be included in release 3.1

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks