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 252830 - Hint "replace stringBuffer/Builder by String" not adequate
Summary: Hint "replace stringBuffer/Builder by String" not adequate
Status: RESOLVED DUPLICATE of bug 239082
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 8.0.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-05 10:23 UTC by neutrino
Modified: 2015-06-05 10:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description neutrino 2015-06-05 10:23:27 UTC
Consider the following code:
        StringBuilder report = new StringBuilder().append("Headline\n");
        Formatter reportf = new Formatter(report, Locale.US);
The editor proposes to change the type of "report" from StringBuilder to String, which is not possible since Formatter requires a StringBuilder as first argument.

Is it possible to check whether the variable (here "report") is used in contexts requiring StringBuilder, before offering the hint?
Comment 1 Jiri Prox 2015-06-05 10:34:22 UTC

*** This bug has been marked as a duplicate of bug 239082 ***