Achal1607 opened a new pull request, #8460: URL: https://github.com/apache/netbeans/pull/8460
When you open any Maven project, when Netbeans tries to parse `pom.xml` sometimes it shows the class cast exception as seen in issue https://github.com/oracle/javavscode/issues/378 and https://github.com/oracle/javavscode/issues/185. The root cause is if some of the modules are not included like `org.netbeans.modules.editor.structure` and `org.netbeans.modules.editor.deprecated.pre65formatting`, then `LspMavenErrorProvider` class sends document as `FilterDocument` instead of `NbEditorDocument` which causes this class cast exception. This PR addresses above mentioned issue by introducing a new utility method that accepts a `Document` and ensures it is returned as a `BaseDocument`. If the given `Document` is already an instance of `BaseDocument`, it is returned as-is; otherwise, it is converted accordingly. This approach ensures that the implementation remains agnostic to the available modules, providing a consistent and reliable way to work with `BaseDocument` regardless of the module configuration. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists