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 217825 - Bundle.AAAA() string compared with ==
Summary: Bundle.AAAA() string compared with ==
Status: VERIFIED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 7.2
Hardware: All All
: P1 normal (vote)
Assignee: Petr Cyhelsky
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2012-09-04 15:01 UTC by Tomas Hurka
Modified: 2012-09-10 07:35 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
suspicious string comparisons via == (6.78 KB, text/plain)
2012-09-04 15:01 UTC, Tomas Hurka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hurka 2012-09-04 15:01:54 UTC
Created attachment 123891 [details]
suspicious string comparisons via ==

There are cases where strings returned from Bundle.AAA() calls are compared via ==. This is wrong, since Bundle.AAA() can return different instances of String. See attached file for list of suspicious cases.
Comment 1 Petr Cyhelsky 2012-09-04 16:33:43 UTC
fixed in: http://hg.netbeans.org/profiler-main/rev/06afba0cc4c2
Comment 2 Tomas Hurka 2012-09-05 07:49:50 UTC
Verified in profiler-main build.
Comment 3 Tomas Hurka 2012-09-05 10:53:12 UTC
Transplanted to release72 branch

changeset:   239474:b6fdee87798c
branch:      release72
parent:      239311:60eb0ef30dec
user:        Petr Cyhelsky <cyhelsky@netbeans.org>
date:        Tue Sep 04 18:30:20 2012 +0200
summary:     #217825 - replacing == with .equals() in bundle strings comparisons

changeset:   239475:df10b3a34a8c
branch:      release72
tag:         tip
user:        Tomas Hurka <thurka@netbeans.org>
date:        Wed Sep 05 12:49:45 2012 +0200
summary:     spec. version increased for #217825
Comment 4 Quality Engineering 2012-09-05 12:26:37 UTC
Integrated into 'releases', will be available in build *201209051408* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/b6fdee87798c
User: Petr Cyhelsky <cyhelsky@netbeans.org>
Log: #217825 - replacing == with .equals() in bundle strings comparisons
(transplanted from 06afba0cc4c270395c143871b6b42a10e9bde5ab)
Comment 5 Quality Engineering 2012-09-06 02:12:10 UTC
Integrated into 'main-golden', will be available in build *201209060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/06afba0cc4c2
User: Petr Cyhelsky <cyhelsky@netbeans.org>
Log: #217825 - replacing == with .equals() in bundle strings comparisons
Comment 6 Petr Cyhelsky 2012-09-10 07:35:27 UTC
this cannot be verified directly, but the code is in the patch, so setting whiteboard to 72patch1-verified