JDK-7028468 : (fs) FileSystems.getDefault() fails when kernel micro version contains/ends non-numeric characters
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2011-03-17
  • Updated: 2012-03-20
  • Resolved: 2011-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b136Fixed
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b133)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b03, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux labpc2 2.6.38lab #1 SMP Wed Mar 16 10:47:16 CET 2011 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
When using a kernel with a non-numeric part following the version (2.6.38lab), a NumberFormatException is thrown.



REGRESSION.  Last worked in version 6u24

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use a kernel with a non-numeric part immediately following the version, start any program using java.nio.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
NIO should be initialized.
ACTUAL -
The exception pasted in Error Message(s) is thrown.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.ExceptionInInitializerError
        at java.nio.file.FileSystems.getDefault(FileSystems.java:176)
  [snip]
Caused by: java.lang.NumberFormatException: For input string: "38lab"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:492)
        at java.lang.Integer.parseInt(Integer.java:527)
        at sun.nio.fs.LinuxFileSystem.<init>(LinuxFileSystem.java:56)
        at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(LinuxFileSystemProvider.java:43)
        at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(LinuxFileSystemProvider.java:36)
        at sun.nio.fs.UnixFileSystemProvider.<init>(UnixFileSystemProvider.java:55)
        at sun.nio.fs.LinuxFileSystemProvider.<init>(LinuxFileSystemProvider.java:38)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:530)
[snip]

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Use a version suffix starting with -

Comments
EVALUATION The version check assumes the micro number only contains numbers.
18-03-2011