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 117841

Summary: Code Completion wrongly inserts tag.
Product: xml Reporter: tonybeckham <tonybeckham>
Component: Schema ToolsAssignee: Samaresh Panda <samaresh>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 122444    

Description tonybeckham 2007-10-04 19:57:23 UTC
Product Version: NetBeans IDE Dev (Build 200710040000) 
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05 
System: Linux version 2.6.20-16-generic running on i386; UTF-8; en_US (nb)

After successfully using code completion to generate a tag,then generate the closing tag, if you position your cursor at
the end of the opening tag code completion will suggest the opening tag again and incorrectly overwrite existing opening
tag.

Steps:
1. Create NewLoan Sample schema
2. Create a new XML schema constrained document and set the constraining schema to the newloan schema
3. In the newXMLDocument invoke Code completion and select the first choice (amount)
4. now, close the tag and accept suggestion to add closing tag
5. Add an opening "<" between the tags (where the cursor is at)
6. You get "no suggestions" notice
6. delete the "<" and you will get the suggestion of nsO:amount
7. press enter.
8. the  tag <ns0:amount> becomes <nns0:amount> even though the suggestion was ns0:amount
Comment 1 Mikhail Matveev 2007-10-18 17:26:33 UTC
Reproducible for me, WinXP.
Nice catch, Tony.
Comment 2 Samaresh Panda 2008-01-17 05:55:12 UTC
Fix integrated.
/cvs/xml/schema/completion/src/org/netbeans/modules/xml/schema/completion/util/CompletionContextImpl.java,v  <-- 
CompletionContextImpl.java
new revision: 1.20; previous revision: 1.19
/cvs/xml/schema/completion/test/unit/src/org/netbeans/modules/xml/schema/completion/BasicCompletionTest.java,v  <-- 
BasicCompletionTest.java
new revision: 1.18; previous revision: 1.17
Comment 3 tonybeckham 2008-01-17 18:36:05 UTC
Fix Verified.

Product Version: NetBeans IDE Dev (Build 200801170000)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119
System: Mac OS X version 10.5.1 running on i386; MacRoman; en_US (nb)