commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <...@finemaltcoding.com>
Subject Re: [VOTE] (3) XxxUtilsConstructors last chance
Date Wed, 21 Aug 2002 23:15:00 GMT
"Stephen Colebourne" <scolebourne@btopenworld.com> writes:

> This discussion has gone on for days. This is my last attempt at a decision.
> As such I am placing what is in _my_ judgement the only option likely to be
> compromised on.
> 
> No compromise = no change = private
> 
> "Static utility classes should have public final constructors"
> [  ] +1  I agree
> [  ] +0  I can accept this
> [  ] -0  I don't like it, but won't block it
> [  ] -1 I disagree
> 
> If the vote passes, [collections], [lang], [io] and [pattern] are affected.
> However it is up to the projects as to their approach to implementation.
> This is a vote in principle.
> 
> 
> Background (if you got bored by the threads)
> - A static utility class has only static methods and fields
> - Certain tools need instances of static utility classes
> - These classes are not intended to be used as beans, hence private
> constructors
> - The compromise gives public constructors to satisfy the bean based tools
> and final to keep the utilities from being abused by subclassing

Now you want to change the JLS, Stephen?  Constructors cannot be
final.

dlr@despot:dlr$ javac test.java
test.java:8: modifier final not allowed here
    public final test() {}
                 ^
1 error
dlr@despot:dlr$ jikes test.java

Found 1 semantic error compiling "test.java":

     8.     public final test() {}
                   <--->
*** Error: "final" is not a valid constructor modifier.
-- 

Daniel Rall <dlr@finemaltcoding.com>

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message