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: | BaseDocument should be created rather for mimeType or EditorKit instance than for kitClass | ||
---|---|---|---|
Product: | xml | Reporter: | Marek Fukala <mfukala> |
Component: | Text-Edit | Assignee: | Samaresh Panda <samaresh> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | err, jjancura, mkrauskopf, mmetelka, pjiricka, vstejskal |
Priority: | P3 | Keywords: | API |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 145026 | ||
Bug Blocks: | 113003, 114234, 114304 | ||
Attachments: | The stactrace of the language initialization invoked from opened editor (should normally never happen since it is cached based on the mimetype) |
Description
Marek Fukala
2007-09-05 12:32:10 UTC
Created attachment 48154 [details]
The stactrace of the language initialization invoked from opened editor (should normally never happen since it is cached based on the mimetype)
Nasty, I'll try to fix it somehow. *** Issue 114234 has been marked as a duplicate of this issue. *** So what about the following proposed fix????? Index: editor/libsrc/org/netbeans/editor/BaseDocument.java =================================================================== RCS file: /cvs/editor/libsrc/org/netbeans/editor/BaseDocument.java,v retrieving revision 1.146 diff -u -u -r1.146 BaseDocument.java --- editor/libsrc/org/netbeans/editor/BaseDocument.java 17 Sep 2007 17:32:13 -0000 1.146 +++ editor/libsrc/org/netbeans/editor/BaseDocument.java 24 Sep 2007 14:44:28 -0000 @@ -430,11 +430,10 @@ } Syntax getFreeSyntax() { - BaseKit kit = BaseKit.getKit(kitClass); synchronized (Settings.class) { int cnt = syntaxList.size(); return (cnt > 0) ? (Syntax)syntaxList.remove(cnt - 1) - : kit.createSyntax(this); + : BaseKit.getKit(kitClass).createSyntax(this); } } The patch is ok, but it does not fix this issue. Thanks anyway The problem shown by the stacktrace here and in #114234 was caused by by an improper use of the old editor settings infrastructure, which can't handle languages that do not use unique EditorKit implementation class. This the case of all Schliemann based languages as they all use LanguagesEditorKit. Therefore Schliemann should not use old settings infra for any mime type related settings. The fact that not all editor settings can be initialized and accessed in a mime type friendly way is a know deficiency and will be addressed as soon as we can, see issue #90403. I'm leaving this open, because BaseDocument the issue is generally valid - BaseDocument should really use mime type or editor kit directly. The following changes fix the problem in Schliemann, performance should now be better and the identifiers recognition (for languages that need one) should work properly. Checking in LanguagesEditorKit.java; /cvs/languages/engine/src/org/netbeans/modules/languages/dataobject/LanguagesEditorKit.java,v <-- LanguagesEditorKit.java new revision: 1.23; previous revision: 1.22 done Checking in Install.java; /cvs/languages/engine/src/org/netbeans/modules/languages/dataobject/Install.java,v <-- Install.java new revision: 1.3; previous revision: 1.2 done When trying to get a code completion in an xml file based on a xml schema the warnings below are printed. Code completion does not work reliably. Sometimes a code completion is offered sometimes a tooltip with "No suggestions" is displayed. Is there any chance that this will be fixed in 6.5? FINE [org.netbeans.editor.BaseDocument] java.lang.Throwable: Using deprecated document construction for org.netbeans.editor.BaseDocument, see http://www.netbeans.org/nonav/issues/show_bug.cgi?id=114747. Use -J-Dorg.netbeans.editor.BaseDocument.level=500 to see the stacktrace. at org.netbeans.editor.BaseDocument.<init>(BaseDocument.java:468) at org.netbeans.modules.xml.xdm.xam.XDMAccessProvider.loadSwingDocument(XDMAccessProvider.java:72) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.createModelSource(RuntimeCatalogModel.java:108) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.getModelSource(RuntimeCatalogModel.java:98) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.getModelSourceFromSystemWideCatalog(CatalogModelImpl.java:738) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.doGetModelSource(CatalogModelImpl.java:200) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.getModelSource(CatalogModelImpl.java:163) at org.netbeans.modules.xml.schema.completion.util.DefaultModelProvider.getCompletionModel(DefaultModelProvider.java:114) at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.specialCompletion(CompletionContextImpl.java:624) at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.initModels(CompletionContextImpl.java:594) at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:103) at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:87) at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) ADD DocumentListener to 0 present: org.netbeans.modules.xml.xam.dom.AbstractDocumentModel$WeakDocumentListener@bcff11 FINE [org.netbeans.editor.BaseDocument] java.lang.Throwable: Using deprecated document construction for org.netbeans.editor.BaseDocument, see http://www.netbeans.org/nonav/issues/show_bug.cgi?id=114747. Use -J-Dorg.netbeans.editor.BaseDocument.level=500 to see the stacktrace. at org.netbeans.editor.BaseDocument.<init>(BaseDocument.java:468) at org.netbeans.modules.xml.xdm.xam.XDMAccessProvider.loadSwingDocument(XDMAccessProvider.java:72) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.createModelSource(RuntimeCatalogModel.java:108) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.getModelSource(RuntimeCatalogModel.java:98) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.getModelSourceFromSystemWideCatalog(CatalogModelImpl.java:738) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.doGetModelSource(CatalogModelImpl.java:200) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.getModelSource(CatalogModelImpl.java:163) at org.netbeans.modules.xml.schema.completion.util.DefaultModelProvider.getCompletionModel(DefaultModelProvider.java:114) at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.specialCompletion(CompletionContextImpl.java:624) at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.initModels(CompletionContextImpl.java:594) at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:103) at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:87) at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) ADD DocumentListener to 0 present: org.netbeans.modules.xml.xam.dom.AbstractDocumentModel$WeakDocumentListener@17d565c FINE [org.netbeans.editor.BaseDocument] java.lang.Throwable: Using deprecated document construction for org.netbeans.editor.BaseDocument, see http://www.netbeans.org/nonav/issues/show_bug.cgi?id=114747. Use -J-Dorg.netbeans.editor.BaseDocument.level=500 to see the stacktrace. at org.netbeans.editor.BaseDocument.<init>(BaseDocument.java:468) at org.netbeans.modules.xml.xdm.xam.XDMAccessProvider.loadSwingDocument(XDMAccessProvider.java:72) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.createModelSource(RuntimeCatalogModel.java:108) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.getModelSource(RuntimeCatalogModel.java:98) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.getModelSourceFromSystemWideCatalog(CatalogModelImpl.java:738) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.doGetModelSource(CatalogModelImpl.java:200) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.getModelSource(CatalogModelImpl.java:163) at org.netbeans.modules.xml.schema.completion.util.DefaultModelProvider.getCompletionModel(DefaultModelProvider.java:114) at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.specialCompletion(CompletionContextImpl.java:624) at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.initModels(CompletionContextImpl.java:594) at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:103) at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:87) at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) ADD DocumentListener to 0 present: org.netbeans.modules.xml.xam.dom.AbstractDocumentModel$WeakDocumentListener@1582a88 FINE [org.netbeans.editor.BaseDocument] java.lang.Throwable: Using deprecated document construction for org.netbeans.editor.BaseDocument, see http://www.netbeans.org/nonav/issues/show_bug.cgi?id=114747. Use -J-Dorg.netbeans.editor.BaseDocument.level=500 to see the stacktrace. at org.netbeans.editor.BaseDocument.<init>(BaseDocument.java:468) at org.netbeans.modules.xml.xdm.xam.XDMAccessProvider.loadSwingDocument(XDMAccessProvider.java:72) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.createModelSource(RuntimeCatalogModel.java:108) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.getModelSource(RuntimeCatalogModel.java:98) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.getModelSourceFromSystemWideCatalog(CatalogModelImpl.java:738) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.doGetModelSource(CatalogModelImpl.java:200) at org.netbeans.modules.xml.retriever.catalog.impl.CatalogModelImpl.getModelSource(CatalogModelImpl.java:163) at org.netbeans.modules.xml.schema.completion.util.DefaultModelProvider.getCompletionModel(DefaultModelProvider.java:114) at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.specialCompletion(CompletionContextImpl.java:624) at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.initModels(CompletionContextImpl.java:594) at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:103) at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:87) at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) ADD DocumentListener to 0 present: org.netbeans.modules.xml.xam.dom.AbstractDocumentModel$WeakDocumentListener@12efc43 FINE [org.netbeans.editor.BaseDocument] java.lang.Throwable: Using deprecated document construction for org.netbeans.editor.BaseDocument, see http://www.netbeans.org/nonav/issues/show_bug.cgi?id=114747. Use -J-Dorg.netbeans.editor.BaseDocument.level=500 to see the stacktrace. at org.netbeans.editor.BaseDocument.<init>(BaseDocument.java:468) at org.netbeans.modules.xml.xdm.xam.XDMAccessProvider.loadSwingDocument(XDMAccessProvider.java:72) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.createModelSource(RuntimeCatalogModel.java:108) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.getModelSource(RuntimeCatalogModel.java:98) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.resolveModelSource(AbstractDocumentComponent.java:747) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent._resolveModel(AbstractDocumentComponent.java:774) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.resolveModel(AbstractDocumentComponent.java:766) at org.netbeans.modules.xml.schema.model.impl.ImportImpl.resolveReferencedModel(ImportImpl.java:119) at org.netbeans.modules.xml.axi.impl.AXIModelImpl.buildReferenceableCache(AXIModelImpl.java:294) at org.netbeans.modules.xml.axi.impl.ModelAccessImpl.sync(ModelAccessImpl.java:85) at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:259) at org.netbeans.modules.xml.axi.impl.AXIModelImpl.sync(AXIModelImpl.java:204) at org.netbeans.modules.xml.xam.AbstractModelFactory.getModel(AbstractModelFactory.java:137) at org.netbeans.modules.xml.axi.AXIModelFactory.getModel(AXIModelFactory.java:98) at org.netbeans.modules.xml.axi.AXIModelFactory.getModel(AXIModelFactory.java:88) at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.findAXIElementAtContext(CompletionUtil.java:448) at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.getElements(CompletionUtil.java:242) at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:110) at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:87) at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) ADD DocumentListener to 0 present: org.netbeans.modules.xml.xam.dom.AbstractDocumentModel$WeakDocumentListener@b5e5d7 FINE [org.netbeans.editor.BaseDocument] java.lang.Throwable: Using deprecated document construction for org.netbeans.editor.BaseDocument, see http://www.netbeans.org/nonav/issues/show_bug.cgi?id=114747. Use -J-Dorg.netbeans.editor.BaseDocument.level=500 to see the stacktrace. at org.netbeans.editor.BaseDocument.<init>(BaseDocument.java:468) at org.netbeans.modules.xml.xdm.xam.XDMAccessProvider.loadSwingDocument(XDMAccessProvider.java:72) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.createModelSource(RuntimeCatalogModel.java:108) at org.netbeans.modules.xml.schema.completion.RuntimeCatalogModel.getModelSource(RuntimeCatalogModel.java:98) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.resolveModelSource(AbstractDocumentComponent.java:747) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent._resolveModel(AbstractDocumentComponent.java:774) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.resolveModel(AbstractDocumentComponent.java:766) at org.netbeans.modules.xml.schema.model.impl.ImportImpl.resolveReferencedModel(ImportImpl.java:119) at org.netbeans.modules.xml.axi.impl.AXIModelImpl.buildReferenceableCache(AXIModelImpl.java:294) at org.netbeans.modules.xml.axi.impl.ModelAccessImpl.sync(ModelAccessImpl.java:85) at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:259) at org.netbeans.modules.xml.axi.impl.AXIModelImpl.sync(AXIModelImpl.java:204) at org.netbeans.modules.xml.xam.AbstractModelFactory.getModel(AbstractModelFactory.java:137) at org.netbeans.modules.xml.axi.AXIModelFactory.getModel(AXIModelFactory.java:98) at org.netbeans.modules.xml.axi.AXIModelFactory.getModel(AXIModelFactory.java:88) at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.findAXIElementAtContext(CompletionUtil.java:448) at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.getElements(CompletionUtil.java:242) at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:110) at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:87) at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) ADD DocumentListener to 0 present: org.netbeans.modules.xml.xam.dom.AbstractDocumentModel$WeakDocumentListener@e91662 From the API standpoint the work that this issue requested is done - BaseDocument can be (should be and usually is) created by using the constructor, which accepts mimetype. There are still places, that use the old constructor, hence the warning in the log. I'm passing this to the XML editor to fix. Thanks for the stactrace. See issue 145026. I want to understand whether to pass true/false in here. Integrated into 'main-golden', available in build *200808260201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/f0e52fb36b64 User: samaresh@netbeans.org Log: #114747 BaseDocument should be created for mimetype instead of kit. |