classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposed coding standard updates


From: Dalibor Topic
Subject: Re: Proposed coding standard updates
Date: Sat, 03 Apr 2004 00:17:09 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040316

Tom Tromey wrote:
I'd like to propose a couple new extensions to our Java coding
standard.

This comes from ZipEntry:

        dostime = (cal.get(cal.YEAR) - 1980 & 0x7f) << 25

Here, `cal' is a local variable and YEAR is a static field in
Calendar.  This is valid code, but I find it somewhat confusing; the
stuff before "." is evaluated for side effects only.  I'd rather we
not use static members with a non-static qualifier, and instead write
`Calendar.YEAR'.

I'd also like to get rid of unused `import' statements.

These might just be academic for the time being, I don't know if any
current compiler except the one in Eclipse can detect these things.
Still, I'd like to update hacking.texinfo and change these constructs
when they are found.

I'd like to add that 1980, 0x7f and 25 could also be replaced by more meaningfully named constants.

cheers,
dalibor topic




reply via email to

[Prev in Thread] Current Thread [Next in Thread]