This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PlainSocketImpl changes to support socket timeouts (again)


>>>>> "Nic" == Nic Ferrier <nferrier@tapsellferrier.co.uk> writes:

Nic> Is there a working indent for java code? 

Nic> The Classpath people suggest use of indent with a patch one but
Nic> no one has been able to tell me which version of indent the patch
Nic> applies to.

I think Bryce wrote some patches for GNU indent.  However, I'm not
sure of the status of that.  I've never used it.

Nic> Are your style guides more than the GNU coding standard?

The GNU standards don't address Java :-(.  However, we took the GNU
standards for C and modified them for Java.  In general the mapping is
obvious.  One difference is that method braces are put just under the
method, and the return type for a method is on the same line.  E.g.:

    public static void main (String[] args)
    {
      ...
    }

There is some older code that doesn't conform to this.  Pretend it
isn't there -- I do :-)

Nic> Yeah. I don't have time to do any more tests so I wanted to leave a
Nic> comment in the code, more for myself really.
Nic> I can commit a working copy sans comment.

I think the comment is fine.

Tom> A non-static inner class will have an implicit reference to its
Tom> creating object.  So there is no need to have `socket' as a field
Tom> or as an argument to the constructor.

Nic> Yes. I like to do this for readability. I presume that the
Nic> compiler will remove (or homogenise) the dud reference.
Nic> But I'll change it if you want.

Please do.  I'm sure the compiler won't remove it.  I doubt any
compiler would.

Nic> However, without a conforming indent it's a real pain to
Nic> reproduce.

Yeah.  I don't notice it so much since I've used the GNU style for
years and it is habitual.

Nic> I probably won't get round to this particular job till the
Nic> weekend.

Ok.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]