-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
9, 10, 11, 12
-
b24
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The attached code compiles fine on JDK 8 but fails with "double cannot be converted to CAP#1" error on JDK 10
REGRESSION : Last worked in version 10.0.2
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the attached Java file
---------- BEGIN SOURCE ----------
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package incompatibletypes;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
/**
*
* @author david
*/
public class IncompatibleTypes {
JSpinner exposureShift = new JSpinner(new SpinnerNumberModel(0, -2, 2, 1.0 / 3) {
@Override
public Object getPreviousValue() {
double nv = ((Double) getValue()) - 1 / 3d;
nv = Math.round(nv * 3) / 3d;
if (getMinimum().compareTo(nv) <= 0) {
return nv;
}
return getValue();
}
@Override
public Object getNextValue() {
double nv = ((Double) getValue()) + 1 / 3d;
nv = Math.round(nv * 3) / 3d;
if (getMaximum().compareTo(nv) >= 0) {
return nv;
}
return getValue();
}
});
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Hello world");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None found. No matter what argument I feed to compareTo, I get the same error.
FREQUENCY : always
The attached code compiles fine on JDK 8 but fails with "double cannot be converted to CAP#1" error on JDK 10
REGRESSION : Last worked in version 10.0.2
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the attached Java file
---------- BEGIN SOURCE ----------
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package incompatibletypes;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
/**
*
* @author david
*/
public class IncompatibleTypes {
JSpinner exposureShift = new JSpinner(new SpinnerNumberModel(0, -2, 2, 1.0 / 3) {
@Override
public Object getPreviousValue() {
double nv = ((Double) getValue()) - 1 / 3d;
nv = Math.round(nv * 3) / 3d;
if (getMinimum().compareTo(nv) <= 0) {
return nv;
}
return getValue();
}
@Override
public Object getNextValue() {
double nv = ((Double) getValue()) + 1 / 3d;
nv = Math.round(nv * 3) / 3d;
if (getMaximum().compareTo(nv) >= 0) {
return nv;
}
return getValue();
}
});
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Hello world");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None found. No matter what argument I feed to compareTo, I get the same error.
FREQUENCY : always