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 16819 - Consider use of System.getProperty("java.version")
Summary: Consider use of System.getProperty("java.version")
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on: 16813
Blocks:
  Show dependency tree
 
Reported: 2001-10-22 12:58 UTC by Jesse Glick
Modified: 2001-10-29 16:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-10-22 12:58:55 UTC
If you assume java.version means anything, you may be wrong. It is not
guaranteed to be in any particular format. java.specification.version
is more reliable; to use this, it is easiest to use code such as:

import org.openide.modules.*;
if (Dependency.JAVA_SPEC.compareTo(new SpecificationVersion("1.3")) >= 0) {
    // 1.3 or higher
} else {
    // pre-1.3
}

The following classes are possible offenders:

org.netbeans.modules.debugger.support.util.Utils
org.netbeans.modules.debugger.support.java.JavaElementSelector
org.netbeans.modules.debugger.jpda.Launcher
Comment 1 Daniel Prusa 2001-10-23 12:56:50 UTC
Fixed in JavaElementSelector and Launcher.

In Utils we need to detect java version rather than specification 
version to set classic switch appropriately to avoid some serious 
problems with debugging on HotSpot.
Comment 2 Jan Stola 2001-10-29 16:18:42 UTC
Closed.