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.

Bug 42628 - xml/core module cannot be built under JDK 1.5
Summary: xml/core module cannot be built under JDK 1.5
Status: CLOSED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@xml
URL:
Keywords:
: 41025 (view as bug list)
Depends on: 46883
Blocks:
  Show dependency tree
 
Reported: 2004-04-30 03:27 UTC by Jesse Glick
Modified: 2006-03-24 10:00 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Changes to xml sources and build files (23.14 KB, patch)
2004-07-22 15:30 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-04-30 03:27:05 UTC
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.
Comment 1 Jesse Glick 2004-04-30 03:32:18 UTC
Ditto xml/tax/lib.
Comment 2 Petr Pisl 2004-04-30 10:35:32 UTC
*** Issue 41025 has been marked as a duplicate of this issue. ***
Comment 3 Jesse Glick 2004-04-30 18:26:54 UTC
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.
Comment 4 dmladek 2004-06-09 09:41:56 UTC
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
Comment 5 Jaroslav Tulach 2004-07-22 15:29:25 UTC
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.

Comment 6 Jaroslav Tulach 2004-07-22 15:30:04 UTC
Created attachment 16391 [details]
Changes to xml sources and build files
Comment 7 Jesse Glick 2004-07-22 17:37:34 UTC
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.)
Comment 8 _ pkuzel 2004-07-30 12:13:51 UTC
> 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.
Comment 9 _ pkuzel 2004-08-03 16:12:10 UTC
Patch applied. Thank you.
Comment 10 dmladek 2004-08-24 16:05:13 UTC
I'm able to build my own build using jdk1.5 , so it must be fixed