Hi, I'm a new subscriber--funny that the first thing that'd make me delurk (and a few days late) has nothing to do with Ant per se. So I hope it isn't presumptuous of me to say:
-1 I'm not sure this is "Stronger JLS Adherence" so much as "Stronger Jikes Suggested Style Adherence". While it's true that the public modifier on interface members is redundant I don't recall anything in the JLS "strongly discouraging" it. (The only style guidelines that I remember being in the JLS are the Naming Conventions given in Section 6.8 and a suggested order for modifers given in secs. 8.3.1 and 8.4.1.) As a practical matter, as a fallible programmer I prefer to have the public modifier on methods in an interface: that way you can cut and paste the method signatures from the interface into a class that's going to implement the interface and not have to go in add add the (now required) public modifier to all the methods. Less typing and less opportunity for mistakes. I love jikes for its pedantry but I think this warning is not about pedantry but about a personal stylistic foible of the Jikes authors. I don't care about leaving the 'final static' off constants since you don't have to reuse the signature anywhere. This is obvious not a huge big deal, but all these little things add up. -Peter P.S. If someone can show me that this recommendation actually comes from the JLS then I'll have to consider whether I'd rather turn in my Pedant First Class badge or my Pragmatic Programmer card. Hope that doesn't happen. ;-) -----Original Message----- From: Peter Donald [mailto:[EMAIL PROTECTED] Sent: Saturday, November 25, 2000 5:53 PM To: [EMAIL PROTECTED] Subject: Re: Stronger JLS Adherence At 07:29 24/11/00 -0800, you wrote: > >--- Peter Donald <[EMAIL PROTECTED]> wrote: >> Hi, >> >> Would it be possible for me to update Ant source to be more compliant >> with >> JLS. Essentially this involves removing public/static/final modifiers >> from >> methods/variables defined in interfaces. >> >> Example error is ... >> >> [javac] >> >C:/donaldp/jakarta-ant/src/main/org/apache/tools/tar/TarConstants.java:74:5 : >> 74:5: Warning: The use of the "public" modifier in this context is >> redundant and strongly discouraged as a matter of style. > >Isn't jikes amazing??? > >+1, although I'm guilty of declaring interface methods as public out of >pure habit... I'll have to fix that (thanks for the .ant.properties hint). > >I thought any variables declared in interfaces *had* to be declared "static >final"? Variables in interfaces are automatically public + final + static and the compiler knows this and thus does not need the possibly fallable programmers to tell them this ;) So if any specifiers are given they have to be public final static or else none ;) Cheers, Pete *------------------------------------------------------* | Despite your efforts to be a romantic hero, you will | | gradually evolve into a postmodern plot device. | *------------------------------------------------------*
