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 125701 - Expose CharSequence comparator via Code Model API
Summary: Expose CharSequence comparator via Code Model API
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-21 18:19 UTC by Vladimir Kvashin
Modified: 2009-05-05 12:33 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 Vladimir Kvashin 2008-01-21 18:19:43 UTC
After changing strings to CharSequences in model API,
the following problem arouse:
client can't compare model names with strings.

CharSequence.equals returns false, if the parameter string isn't an instance of CharSequence.
So if a client enumerates model elements and compares their names with some string, he'll never find the element he
interested in.

A comparator that should be used for such purposes should be exposed via Code Model API.
(Now it resides in org.netbeans.modules.cnd.utils)
Comment 1 Vladimir Kvashin 2008-09-16 23:37:50 UTC
I'd like to note that there is a CharSequenceUtilities class in org.netbeans.lib.editor.util.
Probably it's worth moving this class to some more common place and referring to it instead.
Comment 2 Vladimir Voskresensky 2009-05-05 12:33:05 UTC
CharSequenceKey with it's utility methods and comparators is now available for clients