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]
Other format: [Raw text]

Re: [PATCH] Normalization of Java sources


On 11:34 Tue 11 Jan     , Mark Wielaard wrote:
> On Tue, 2011-01-11 at 09:57 +0000, Andrew Haley wrote:
> > On 01/10/2011 10:43 PM, Dr Andrew John Hughes wrote:
> > > Back in June last year, I normalised the whitespace in the GNU Classpath
> > > Java sources using a script written by Kelly O'Hair (attached) which was originally
> > > used for the OpenJDK sources.  To quote the script, it:
> > >
> > > # Parses java files:
> > > #   1. Removes from the end of lines spaces and TABs
> > > #   2. Replaces TABs by spaces
> > > #   3. Replaces all NewLine separators by Unix NewLine separators
> > > #   4. Makes one and only one empty line at the end of each file
> > >
> > > The attached patch does the same for gcj trunk, bringing the GNU Classpath
> > > and libjava gcj sources back in sync.  It also extends the normalization to the
> > > gcj-local sources in libjava.
> > >
> > 
> > > 	Normalise whitespace.
> > >
> > > Following this patch's approval, I'll merge the remaining Classpath changes
> > > over.
> > >
> > > Ok for trunk?
> > 
> > I'd rather not, given the limited utility of the change and the fact
> > that it messes up the diffs, making life difficult for the maintenance
> > programmer.
> > 
> > However, we're going to get the changes anyway the next time there's
> > a merge from Classpath, and we want to minimize divergence with that
> > code base, so it's OK to do this on the Classpath source.
> 
> I had missed this was done to the GNU Classpath sources. Which shows how
> little I hack these days :{ If I had noticed I would also have suggested
> not doing this for the same reasons Andrew gives. Sorry I missed it. But
> yeah, if it keeps libgcj and classpath in sync then please do it to
> both, but only for those files really necessary. If you do please do
> update the hacking guides. This change makes us use even more non-gnu
> standard coding style (2 and I think 4 seems not according to the
> current style):
> http://www.gnu.org/software/classpath/docs/cp-hacking.html#SEC10
> Files under classpath/doc/cp-hacking.texinfo
> 

I reviewed the style guidelines both at the time and just now.  Can
you point me to where you think this contradicts them?  I believe it
does require 2 *space* indentation, which would contradict the use of
tabs.

My reading of them is that they don't say either way.  OpenJDK, in
comparison, is especially stringent, refusing to even allow commits
that break these rules.  I made the changes to Classpath in order to
have the same rules apply to both, mainly just to make the lives of
those of us working with both codebases a little easier.  I have a
filter in emacs for tabs to keep the OpenJDK files in order, which was
causing additional whitespace diffs when editing Classpath files.  To
avoid having to turn it on and off all the time, I normalised
Classpath as there didn't seem to be anything in the rules against it
and no existing consistency in the sources.

In retrospect, it probably wasn't the best idea, but we should at least
match gcj's Classpath sources to Classpath now, so that future merges
aren't obliterated by whitespace diffs.

> Thanks,
> 
> Mark
> 

Thanks,
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


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