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 181814 - "'" problem with hint: Inefficient use of string concatenation in Logger
Summary: "'" problem with hint: Inefficient use of string concatenation in Logger
Status: RESOLVED DUPLICATE of bug 181812
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-10 22:04 UTC by err
Modified: 2010-03-11 02:26 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 err 2010-03-10 22:04:33 UTC
Consider

    LOG.warning("x y '" + bt + "'");
    LOG.warning("x " + "y '" + bt + "'");

applying the hint to these gives

    LOG.log(Level.WARNING, "a g ''{0}''", bt);
    LOG.log(Level.WARNING,"a " + "g '" + "{0}''", bt);
Comment 1 err 2010-03-10 22:19:09 UTC
(some stuff got lost from original bug entry)
The single quote gets mangled in the following example

Consider the following two LOG, which pass *identical* strings
since "x y '" == "x " + "y '"

    LOG.warning("x y '" + bt + "'");
    LOG.warning("x " + "y '" + bt + "'");

applying the hint to these gives

    LOG.log(Level.WARNING, "a g ''{0}''", bt);
    LOG.log(Level.WARNING,"a " + "g '" + "{0}''", bt);

but these are not the same

    since "a g ''{0}''" != "a " + "g '" + "{0}''"
    since                  "a g '{0}''"



Product Version: NetBeans IDE Dev (Build 201003081350)
Java: 1.6.0_12; Java HotSpot(TM) Client VM 11.2-b01
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\dev
Comment 2 Jan Lahoda 2010-03-11 02:26:02 UTC
Seems to be very same as bug #181812 - do I miss something?

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