This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 78204

Summary: Enahancement to Cast hint when the type of variable is String.
Product: java Reporter: _ sandipchitale <sandipchitale>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: blocker CC: markiewb
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description _ sandipchitale 2006-06-17 08:03:45 UTC
When I have something like:

String name = namesList(i);

The hint appears which offers me to add a cast to type String so that the code 
looks like this:

String name = (String)namesList(i);

This is all well and good.

However it will be really nice if an additonal hint offered to wrap the return 
value in String.valueOf() resulting in code:

String name = String.valueOf(nameList(i));

That way it will work when the return type of the expression is primitive also.

Similar hints sensitive to int and or Integer could also be developed.

int i = Integer.parseInt(zipCodesStrings.get(i));

etc. etc.

Makes sense?