United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6286011 (se) DevPollSelectorProvider stops being the default on Solaris 10
JDK-6286011 : (se) DevPollSelectorProvider stops being the default on Solaris 10

Details
Type:
Bug
Submit Date:
2005-06-15
Status:
Resolved
Updated Date:
2010-04-03
Project Name:
JDK
Resolved Date:
2005-08-10
Component:
core-libs
OS:
generic,solaris_10
Sub-Component:
java.nio
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.2_08,5.0u6
Fixed Versions:

Related Reports
Backport:
Backport:

Sub Tasks

Description
sun/nio/ch/DefaultSelectorProvider intends, I believe, to provide a PollSelectorProvider on Solaris versions earlier than 5.7, and give DevPollSelectorProvider otherwise.

It actually performs a lexical comparison of the os.version property, and therefore fails to select appropriately when the os.version is "5.10".
###@###.### 2005-06-15 16:12:34 GMT

                                    

Comments
WORK AROUND


If you want to use /dev/poll but aren't getting it by default:

java -Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.DevPollSelectorProvider
###@###.### 2005-06-15 16:12:34 GMT
                                     
2005-06-15
SUGGESTED FIX


In ws/j2se/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java , change:

        String[] numbers = result.split("\\.", 0);
	if (numbers[1].compareTo("7") < 0)
		return new sun.nio.ch.PollSelectorProvider();
	...
...to:
        String[] numbers = result.split("\\.", 0);
	if ( Integer.parseInt(numbers[1]) < 7)
		return new sun.nio.ch.PollSelectorProvider();
	...

However, if Solaris version 2.6 is no longer a relevant platform, the comparison can be dropped (it's still there in an early Java 1.6), and we can simply "return new sun.nio.ch.DevPollSelectorProvider();" without checking the property.

(We will never be using PollSelectorProvider unless specified by the user in the property java.nio.channels.spi.SelectorProvider)


###@###.### 2005-06-15 16:12:34 GMT
                                     
2005-06-15
EVALUATION

The submitter is correct.  This should be fixed in the earliest possible
5.0 update release.

###@###.### 2005-06-16 20:46:55 GMT
                                     
2005-06-15



Hardware and Software, Engineered to Work Together