tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: [OT] of the different methods to get a user-id
Date Mon, 16 Feb 2009 21:10:17 GMT
Hash: SHA1


On 2/12/2009 10:27 PM, Caldarale, Charles R wrote:
>> From: Christopher Schultz []
>> Subject: Re: [OT] of the different methods to get a user-id
>> I don't understand that, either. I suppose this works differently in
>> different languages, though:
>> return i++;
>> return (i++);
> Not any that I'm aware of; the value of the i++ expression is the same, regardless of
the number of parentheses you wrap it in.

But sometimes the value is surprising.

For instance.

i = i++

yields different results depending on what language you are using. C and
Java produce different outputs (which really surprised me!).

>> What I also don't understand is why userPrincipal is used directly
>> instead of this.getUserPrincipal, which would allow some measure of
>> extensibility of the class.
> Since the userPrincipal field is protected, not private, the subclass
> can just use it to store its Principal object, so I don't see a real
> problem.

I'm not saying it's not legal, I'm just saying it's not extensible. If a
superclass wants to override getUserPrincipal for some reason, the
subclass doesn't benefit (or doesn't work, in certain situations). Thsi
is one of the reasons I hate using protected members: members become
part of the interface, which is ... weird.

- -chris

Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message