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

Summary: Expose CharSequence comparator via Code Model API
Product: cnd Reporter: Vladimir Kvashin <vkvashin>
Component: Code ModelAssignee: Vladimir Kvashin <vkvashin>
Status: RESOLVED WORKSFORME    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

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