directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Karasulu <akaras...@apache.org>
Subject Re: I'm confused
Date Sat, 20 Nov 2010 23:29:59 GMT
On Sun, Nov 21, 2010 at 12:23 AM, Felix Knecht <felix@otego.com> wrote:

> What's the meaning of this method WRT to its comment and its naming (value
> is declared as int):
>
> /**
>  * @return The hex value for this flag, in its position.
>  * For instance, getting the flag 5 will return 0x0000 0010
>  */
> public int getHexValue()
> {
>    return 1 << value;
> }
>
> - IMO a hex is an alphanumeric pattern (abcdef0123456789), so how can this
> method return an int representing a hex?
> - 'value' represents all set flags, nto a specific one, but no method
> parameter is given to specifiy a specific flag ...
>
> Any ideas ?
>

Yeah that's pretty cryptic. You're just multiplying by 2 here.

First off this method is never used anywhere so you can delete it. I have no
idea where it came from or where it might have been used if at all.

The javadoc example is all dorked too. The hex value shown is not 5 which
should be 0x0000 0101. Maybe the bit shift was intended in the other
direction by the javadoc. The history on this is lost from svn blame so hard
to tell what it was about. Regardless the end result should be 0x0000 1010
which is 8+2 or 10.


> PS
> Taken from
> apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlags.java
>

I am confused as well :-\

-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org
To set up a meeting with me: http://tungle.me/AlexKarasulu

Mime
View raw message