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

Summary: "'" problem with hint: Inefficient use of string concatenation in Logger
Product: java Reporter: err <err>
Component: HintsAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

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 ***