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

Summary: SchemaBasedCompletionProvider uses wrong primary file
Product: xml Reporter: emi <emi>
Component: CodeAssignee: emi <emi>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.2   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:

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.