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 208852 - SchemaBasedCompletionProvider uses wrong primary file
Summary: SchemaBasedCompletionProvider uses wrong primary file
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.2
Hardware: PC All
: P3 normal (vote)
Assignee: emi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-25 13:08 UTC by emi
Modified: 2012-03-15 14:57 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 emi 2012-02-25 13:08:55 UTC
SchemaBasedCompletionProvider uses CompletionUtil.getPrimaryFile() when given a JTextComponent component as an argument.

This is wrong: the proper way is to get the DataObject from the (Base)Document, then get the primary file.

CompletionUtil.getPrimaryFile() uses the active TopComponent instead which seems to work because the given JTextComponent usually is in the active TopComponent but it's just by chance no race conditions showed up there.

The whole module dependency on Window System API should be removed after the fix.
Comment 1 Quality Engineering 2012-03-04 09:31:11 UTC
Integrated into 'main-golden', will be available in build *201203040400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/67c7d11b5455
User: Emilian Bold <emi@netbeans.org>
Log: #208852: SchemaBasedCompletionProvider uses wrong primary file
Comment 2 Svata Dedic 2012-03-15 14:57:08 UTC
reassigning to the fix author. Thanks, Emilian.