Code review request: 8003263: redundant cast build failure after 8003120

Weijun Wang weijun.wang at oracle.com
Thu Nov 15 12:46:43 UTC 2012


Ping again.

If there is no more suggestion, I'll push my fix in the first webrev. 
Here I'm more concerned about the build failure than the behavior of the 
input streams.

Thanks
Max


On 11/12/2012 06:22 PM, Weijun Wang wrote:
> In fact, it looks like the resources object here is of type
> InputStreamEnumeration (in
> com/sun/naming/internal/VersionHelper12.java), with an
> open-on-nextElement style. This means we can completely remove the while
> (resources.hasMore()) block.
>
> Lance and Andrew added for confirmation.
>
> Thanks
> Max
>
> On 11/12/2012 05:42 PM, Alan Bateman wrote:
>> On 12/11/2012 08:43, Weijun Wang wrote:
>>> A small webrev:
>>>
>>>   http://cr.openjdk.java.net/~weijun/8003263/webrev.00/
>>>
>>> The reason is that 8003120 added a new line
>>>
>>>    InputStream istream = (InputStream)resources.next();
>>>
>>> but resources is already of type NamingEnumeration<InputStream>.
>>>
>>> Building now shows
>>>
>>> ../../../src/share/classes/com/sun/naming/internal/ResourceManager.java:563:
>>>
>>> warning: [cast] redundant cast to InputStream
>>>                         InputStream istream =
>>> (InputStream)resources.next();
>>>
>>> Noreg-trivial.
>> Looks okay to me, just wondering if we should do a more complete fix for
>> 8003120 while you are there (meaning it should attempt to close all
>> resources even if there is an IOException is thrown during close).
>>
>> -Alan



More information about the core-libs-dev mailing list