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 239907 - ClassMemberFilters makes false assumptions about List-Type of StructureItem#getNestedItems
Summary: ClassMemberFilters makes false assumptions about List-Type of StructureItem#g...
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: CSL (API & infrastructure) (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks: 239906
  Show dependency tree
 
Reported: 2014-01-01 23:41 UTC by matthias42
Modified: 2014-02-02 19:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed patch v1 (868 bytes, patch)
2014-01-01 23:41 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description matthias42 2014-01-01 23:41:51 UTC
Created attachment 143554 [details]
proposed patch v1

While working on a new language plugin, I had to implement a StructureItem. I decided to implement getNestedItems() to return an unmodifiable List.

Without my patch from bug #239906 this works, because disableFiltering is never false in ClassMemberFilters without that patch.  So the new list is created.

With my patch, the code path for disableFiltering == true is invoked. That code path assigns the result list from StructureItem#getNestedItems directly to the result variable. The result variable is then sorted and this only works, if the list is writable => which an unmodifiable list is not ...

Work around: Use the already allocated array list from line 118 and copy the list there.
Comment 1 Milutin Kristofic 2014-01-30 15:23:51 UTC
You are right, thank you very much. I push your patch to repository.

http://hg.netbeans.org/jet-main/rev/c313fda86661
Comment 2 Quality Engineering 2014-02-01 05:46:26 UTC
Integrated into 'main-silver', will be available in build *201402010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c313fda86661
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #239907 - ClassMemberFilters makes false assumptions about List-Type of StructureItem#getNestedItems