code review request: 6969292: make DNS lookup for realm/kdc really work

Weijun Wang Weijun.Wang at Sun.COM
Mon Jul 19 01:57:50 UTC 2010


Yes, you are correct.

In fact, I've thought about this. The original code was:

1196         boolean found = false;
1197         for (int i = 0; i < records.length; i++) {
1198             if (records[i].equals(mapRealm)) {
1199                 found = true;
1200                 realm = records[i];
1201             }
1202         }

and I asked myself: should I also loop thru all elements?

I'll add a break. This is not a good coding style.

Thanks
Max


On 07/17/2010 04:28 PM, Alan Bateman wrote:
> Valerie (Yu-Ching) Peng wrote:
>>
>> Looks fine except the following minor nit:
>> - Why not return realm on line 1224 after a match is found? Doesn't
>> seem necessary to continue w/ the whole for-loop.
> Indeed, looks like it is missing a "break".
>
> -Alan.



More information about the security-dev mailing list