Issue Details (XML | Word | Printable)

Key: MULE-639
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dirk Olmes
Reporter: Holger Hoffstaette
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Mule

Investigate JDK 1.5 as base platform for upcoming Mule versions

Created: 05/Mar/06 02:44 PM   Updated: 01/Oct/08 10:51 AM
Component/s: Build: JDK Compatibility
Affects Version/s: None
Fix Version/s: 2.1.0

Time Tracking:
Not Specified

Issue Links:
Block
 
Related
 

Labels:
User impact: Medium
Affects Docs: Yes
Migration Impact:
Jackie, ensure the installation prerequisites state the minimum requirement for Java 5 at runtime. Compile-time (build) will not work with Java 6 currently, as there are issues with JDBC 4.0 API changes in JDK, which are not backwards-compatible. Java 6 at runtime is perfectly fine, however.


 Description  « Hide
In MULE-637 I suggested we investigate JDK 1.5 as base platform for Mule 2.x, with 1.4 backward compatibility provided e.g. by Retrotranslator (http://retrotranslator.sourceforge.net/). It backports almost all new features in JDK 1.5, provides util.concurrent via the backport library that we use now and also adds any new methods. The bytecode rewriting is done either at build time (rewrite 1.5-classes via ant task into new dir) or at load time (not recommended for obvious class loader issues).
Based on some experiments I did with a project using util.concurrent & JNI, all I can say is "it just works". Quick, easily extensible/fixable (drop retroextension on classpath - done!), very well maintained, friendly license.

Andrew replied: "I think jumping onto a JDK 5.x wagon would simply cut off most of the enterpise users of Mule (and those, by projects nature, are expected to be the mainstream). It's simply because great number of those are still restricted to 1.3 JDK, and bringing 1.4 into the scene is a feat in itself."

This argument really only holds if deployment on 1.4 is abandoned, which I did not advocate. Mule 2.x jars would simply be available in two editions, one for JDK 1.5+ and one "classic".

Andrew: "Yes, I know about Retrotranslator, and have used an alternative, Retroweaver before (the latter, IMO, is a more mature product). While they both work, the answer is short - no technical advisor in XXXBank or YYYTelecom, etc. will approve such a schema."

Unless you are thinking of retroweaver-ng (which is a complete rewrite and was released only a few days ago?!) I think you are confusing them? The old retroweaver did not rewrite many methods and certainly did not rewrite util.concurrent (according to the site -ng however does and I need to check it out).

However, regardless which retrozapper is chosen, my point is that we can probably:

  • automate building the "classic" edition as part of the dist target, including all tests
  • do not ship a new release unless both the regular and the "classic" edition pass all their tests (or at least both fail exactly the same tests)

Again, I severely doubt anybody will ever know or care that the classic edition was retrozapped from a JDK 1.5 build - as long as all tests pass and no compatibility regressions can be observed, there is effectively no discernible difference between compiling for 1.4 or retrozapping. Added bonus: at least Retrotranslator's newly introduced code is sometimes more efficient than the workarounds required for JDK 1.4.

Q: what happens when we do indeed find that something works on 1.5 and fails on 1.4?
A: I'll think about that when we come there, OK?

If organizations want or need to build mule they can always do so with 1.5 (any dev should be able to do that, even in a bank and then retrozap themselves before testing - so it really needs to be part of the build+test suite. I don't think that would overstrain anybody.

There is no reason why an OSS project should by slowed down by an organization's backwardness which is often based on arbitrary policy. In the long term moving to JDK 1.5+ is unavoidable anyway so why fight?



 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Holger Hoffstaette added a comment - 01/Aug/06 02:32 PM
Collecting some more benefits of 1.5 -
  • @Override and friends - I'm mostly not convinced about annotations but used sparingly they have their use, e.g. there are many places where methods were overridden but super() was not called though it should have been, or methods accidentally overrode others that were not supposed to be.
  • covariant return types should have been in the language since 1.0 (MULE-947)
  • obviously more consistent interfaces with less typecasting, especially collections (where possible). Unfortunately this won't really help much with generic "Object" parameters e.g. for transformers. Downside: a lot more typing. Upside: generic functions can do some pretty cool things when done right.
  • no more build problems with maybe-wrongly-compiled dependencies

Travis Carlson added a comment - 01/Dec/06 04:23 PM
It looks like OSGi lets you define the minimum JDK requirements on a per-bundle basis, so in theory for Mule 2.x you would only need JDK 5 if you're using Mule modules/transports which need JDK 5:

http://wiki.eclipse.org/index.php/Execution_Environments


Dirk Olmes added a comment - 16/Apr/08 06:42 AM
After some internal discussions we have come to the conclusion that we don't switch to JDK5 for Mue 2.0.0 but may do so starting from Mule 2.1.0.

Dirk Olmes added a comment - 01/Oct/08 03:22 AM
Hooray, we finally have a definitive decision. Mule 2.1.0 and above will be JDK5 and above only.

Now we can go and remove the dual-JDK-build workarounds from the toplevel POMs and move the enforcer forward to JDK5 only. This also opens up the route for dependencies that are available as JDK5 only.


Andrew Perepelytsya added a comment - 01/Oct/08 08:47 AM
And... you forgot to resolve the issue, Dirk Oh my, 2.5 years

Dirk Olmes added a comment - 01/Oct/08 10:00 AM
The plan was to keep the issue open until all workarounds/multi-JDK build was removed from all POMs.

Andrew Perepelytsya added a comment - 01/Oct/08 10:11 AM
The issue said 'investigate', could wait to close it. This part is done, I guess. There will be more activities related to Java 5 and Java 6, can we file them as specific tasks? They aren't trivial by any means...

Andrew Perepelytsya added a comment - 01/Oct/08 10:11 AM
grr, should type 'coudln't wait to close it'

Dirk Olmes added a comment - 01/Oct/08 10:51 AM
Ok, fair enough.