[GLASSFISH-20272] Java Version Parsing Broken Badly on Mac Created: 10/Apr/13  Updated: 07/Jun/13  Resolved: 07/Jun/13

Status: Resolved
Project: glassfish
Component/s: admin
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: Byron Nevins Assignee: Yamini K B
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


in JDK.java

getVersion() returns null when given the actual correct version string from current Macs:


This causes havoc in code that needs to find a JDK or JRE.

The code is too simple. It's a one-line regex match. In this case it does not know what the "-ea" means and punts.

Comment by Byron Nevins [ 10/Apr/13 ]


JDK.java is in nucleus/common/common-util

Comment by Byron Nevins [ 10/Apr/13 ]

This is a great candidate for unit tests. JDK.java is very stand-alone, you can write up dozens of strings to test pretty quickly.

Comment by Byron Nevins [ 10/Apr/13 ]

I just noticed – the recent additions can't possibly work. JDK was designed to describe the current JDK we are running in. As a result – all of the state is static.

The new code creates instances of JDK – but the state is still static. So every time a new instance is created, the previous values are overwritten.
I.e. this code needs to go into the shop for a refit!

Please run any changes by me before checking in...

Comment by Byron Nevins [ 08/May/13 ]

Commit 61888 broke Admin Dev Tests on Windows. 100% reproducible and confirmed.

Comment by Yamini K B [ 07/Jun/13 ]

The commit was fine, Windows hudson job fails intermittently.

Generated at Sat Oct 22 02:13:22 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.