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.
AbstractNode is missing DOM Level 3 interfaces. You need to use java.lang.reflect.Proxy for this stuff since they add new methods to o.w.d.Node etc. in every release.
Ditto xml/tax/lib.
*** Issue 41025 has been marked as a duplicate of this issue. ***
BTW adding getUserData(String) is not enough (that was what I tried at first); some of the added methods have parameters or return values which are newly added interfaces, which you cannot refer to in JDK 1.4.
Downgrading to P2 becasue it's not P1 for upcomming Beta. This bug doesn't break any Functionality, so NetBeans users are not harm. This will couse problems to RE, but there's not plans to build Beta NB4.0 on jdk1.5 so far
I've played with it a bit and I think I am able to compile the XML module both on 1.5 and 1.4 at once. The solution I used is similar to the one used in form module to allow it to be compiled on 1.3 and 1.4. Basically all classes that implement those interfaces with new methods in 1.5 implement all these methods (on 1.5 and 1.4), the only problem is the set of new interfaces that they may return or take as arguments in such methods. I've modified the build scripts to check whether the compilation runs in 1.4 and in such case they generate such interfaces (with empty body) and include them in the xml/core JAR and xml/tax/lib JAR files. The general idea is that on 1.5 these interface will not be used at all as rt.jar contains them and everything will link as expected. On 1.4 however the JVM will search for these interfaces (as they are returned from some methods) and will find them in the same module JAR - again all should link correctly. I'll attach my diff. I tried to verify that everything works by opening build.xml and trying code completion (which I think is using my modified classes). Btw. it might not be that safe to assume that there is no influence on our beta. If we compile the NetBeans with 1.4 and run on 1.5 someone could get grisp on our implementation of org.w3c.dom.Node and call the method that is not implemented (will throw a linkage exception). Unlikely, but no guaranted just by successful compilation. Needs to be tested.
Created attachment 16391 [details] Changes to xml sources and build files
Well that should work as a hack, at least until DOM4 is released. :-) Still would be preferable to use proxies from a code maintenance perspective, I think. Then again, there are a lot of things that need to be overhauled in xml/* code that clearly no one has time to do. There is no risk IMHO from leaving irrelevant DOM methods unimplemented on interfaces. None of the users of the DOM tree call strange methods on it. (In fact our current impl doesn't even support DOM2 correctly, much less DOM3.)
> Btw. it might not be that safe to assume that there is no influence on > our beta. If we compile the NetBeans with 1.4 and run on 1.5 someone > could get grisp on our implementation of org.w3c.dom.Node and call the > method that is not implemented (will throw a linkage exception). > Unlikely, but no guaranted just by successful compilation. Needs to be > tested. Seconding Jesse. Invalid, Javadoc says that returned DOM is DOM level 1. Level 2 methods throw exceptions. All completion clients must obey it.
Patch applied. Thank you.
I'm able to build my own build using jdk1.5 , so it must be fixed