commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Reilly" <tim.rei...@consultant.com>
Subject RE: [uid] Uuid
Date Sun, 04 Jan 2004 04:48:39 GMT
I had few questions about the Uuid code and/or coding conventions:
First, sorry to be a newbie, but I'm seeing the
$Header tags $Header:...$ and @version $Revision: ... $ tags.
They look like xdoclet tags perhaps, are they something a contributor should
be adding, or is this something committers add prior to a commit? If
contributor's should be maintaining prior to sending patches, what is the
convention for updating the version? For example sending a patch for
something that has version 1.1 I assume should be changed to 1.2? When or
what determines a major version/revision 2.0?

Second, I had some questions about the level of compliance with the
checkstyle checks:
I'm adding some code I normally wouldn't so that checkstyle checks pass, but
I'm wondering if I should be doing these things (what is the expected
checkstyle compliance?)

For instance:
To avoid magic numbers
I changed
{
	buf.insert(8, '-');
	buf.insert(13, '-');
	buf.insert(18, '-');
	buf.insert(23, '-');
}
-- to --
public static final int TOKENS_IN_UUID = 5;
private static final int[] FORMAT_POSITIONS = {8, 13, 18, 23};
...
 for (int i = 0; i < TOKENS_IN_UUID - 1; i++) {
                buf.insert(FORMAT_POSITIONS[i], '-');
            }
but the first way seems more efficient to me.
----
Also to avoid "Definition of equals with corresponding definition of
hashCode" warning I've added: --------

/** @see java.lang.Object#hashCode() */
 public int hashCode() {
    return super.hashCode();
 }

Third, based on some previous discussions on this list, I think Sun
convention is to use the UUID naming instead of Uuid. Should these be
renamed?


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


Mime
View raw message