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.
I have implemented the editor/indent module IndentTaskFactory and registered it to text/x-jsp mimetype. When I press enter in a JSP page the IndentTask.reindent() method is called multiple times. It is caused by the used mechanism of collecting tasks in TaskHandler.MimeItem.createTask(). It uses mimelookup to find instancies of IndentTaskFactory for all possible mimepaths in the document. There are multiple mimepaths in JSP document. For example: text/x-jsp, text/x-jsp/text/java, text/x-jsp/text/x-el etc. The current mimelookup algorithm returns the implementation registered to text/x-jsp for each ot these mimepaths. Since they are stored in a hashmap with MimePath key the same instance of IndentTaskFactory is used multiple times.
We may need to change the composition of MimeLookup. That will have to be made carefully as it affects pretty much everything.
Yes, but Milo, please workaround the problem in your implementation asap as we agreed. Thanks.
I have added check for whether a multiple same factories registration. Checking in TaskHandler.java; /cvs/editor/indent/src/org/netbeans/modules/editor/indent/TaskHandler.java,v <-- TaskHandler.java new revision: 1.3; previous revision: 1.2 I have filed a separate issue 108173 for the mimepaths resolving order.