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 - Enahancement to Cast hint when the type of variable is String.
Summary: Enahancement to Cast hint when the type of variable is String.
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2006-06-17 08:03 UTC by _ sandipchitale
Modified: 2013-09-02 14:23 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
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?