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.
Summary: | model.findComponent(position) returns Component incorrectly | ||
---|---|---|---|
Product: | xml | Reporter: | Praveen Savur <praveensavur> |
Component: | XDM | Assignee: | bhate <bhate> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 80402 |
Description
Praveen Savur
2006-07-18 06:31:05 UTC
Raised to P1. What I got when follow exact this test case is OutOfBoundIndex exception. Somehow the jdk validation return wrong lineNumber: java.lang.IndexOutOfBoundsException: Index: 77, Size: 17 at java.util.ArrayList.RangeCheck(ArrayList.java:546) at java.util.ArrayList.get(ArrayList.java:321) at org.netbeans.modules.xml.xam.spi.XsdBasedValidator$Handler.getPosition(XsdBasedValidator.java:204) at org.netbeans.modules.xml.xam.spi.XsdBasedValidator$Handler.logValidationErrors(XsdBasedValidator.java:238) at org.netbeans.modules.xml.xam.spi.XsdBasedValidator$Handler.error(XsdBasedValidator.java:208) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:175) Another stack traces when remove 'name' attribute from wsdl:message (source view) and do validate are: java.lang.NullPointerException at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.getAccess(AbstractDocumentComponent.java:414) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.findPosition(AbstractDocumentComponent.java:418) at org.netbeans.modules.xml.wsdl.ui.netbeans.module.WSDLMultiViewSupport.getLineNumber(WSDLMultiViewSupport.java:184) at org.netbeans.modules.xml.wsdl.ui.netbeans.module.WSDLMultiViewSupport.annotateSourceView(WSDLMultiViewSupport.java:171) at org.netbeans.modules.xml.wsdl.ui.netbeans.module.WSDLMultiViewSupport.showComponent(WSDLMultiViewSupport.java:136) and: java.lang.NullPointerException at org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor.checkReference(FindReferencedVisitor.java:110) at org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor.visit(FindReferencedVisitor.java:66) at org.netbeans.modules.xml.wsdl.model.impl.MessageImpl.accept(MessageImpl.java:56) at org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor.visitChildren(FindReferencedVisitor.java:124) at org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor.find(FindReferencedVisitor.java:57) at org.netbeans.modules.xml.wsdl.model.impl.GlobalReferenceImpl.get(GlobalReferenceImpl.java:66) at org.netbeans.modules.xml.wsdl.model.impl.GlobalReferenceImpl.get(GlobalReferenceImpl.java:36) at org.netbeans.modules.xml.wsdl.validator.visitor.WSDLSemanticsVisitor.visit(WSDLSemanticsVisitor.java:540) Fixed in release55. /cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentComponent.java,v <-- AbstractDocumentComponent.java new revision: 1.1.2.20; previous revision: 1.1.2.19 /cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentModel.java,v <-- AbstractDocumentModel.java new revision: 1.1.2.11; previous revision: 1.1.2.10 /cvs/xml/xam/src/org/netbeans/modules/xml/xam/spi/Attic/XsdBasedValidator.java,v <-- XsdBasedValidator.java new revision: 1.1.2.11; previous revision: 1.1.2.10 /cvs/xml/wsdl/api/src/org/netbeans/modules/xml/wsdl/model/visitor/FindReferencedVisitor.java,v <-- FindReferencedVisitor.java new revision: 1.2.2.8; previous revision: 1.2.2.7 Fix merged into release55_beta2: /cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentComponent.java,v <-- AbstractDocumentComponent.java new revision: 1.1.2.19.2.1; previous revision: 1.1.2.19 /cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentModel.java,v <-- AbstractDocumentModel.java new revision: 1.1.2.9.2.2; previous revision: 1.1.2.9.2.1 /cvs/xml/xam/src/org/netbeans/modules/xml/xam/spi/Attic/XsdBasedValidator.java,v <-- XsdBasedValidator.java new revision: 1.1.2.4.2.2; previous revision: 1.1.2.4.2.1 /cvs/xml/wsdl/api/src/org/netbeans/modules/xml/wsdl/model/visitor/FindReferencedVisitor.java,v <-- FindReferencedVisitor.java new revision: 1.2.2.7.2.1; previous revision: 1.2.2.7 Nam, Chris and I could still reproducible this bug. Both for bpel and schema. So reopening this. The issue seems to be in XDM NodeByPositionVisitor. I verify the position calculation by XsdBasedValidator is accurate. Note that schema validator returns end position of the involved element. Make P2 since there is no exceptions involved, no data corruption, visibility is subtle, and work-around available (add-remove space in source view and then validate again will make the reported line correct again). Same cause as issue 80899, fixed by ajit in release55. Work-around in editor client code by dynamically insert space into the document after create new component (done by Praveen for bpel editor). Verified Ajit fix actually fix this bpel test case. Give Ajit credit and close as duplicate. Note, it would be best to have a unit test that actually fail w/o this fix. correct Ajit user name. Work around of programmatically adding whitespece into swingdocument in ValidationOutputWindowController. Needs to be removed after beta. This issue is fixed in xdm and in branch release55. can be verified with netbeans release55 daily build. Praveen pl remove workaround, once beta2 is released. Fix verified in NetBeans IDE Dev (Build 200704091800) |