-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
8u92
-
x86
-
other
FULL PRODUCT VERSION :
java version 1.8.0_92
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.10586] (and also on Windows 7)
A DESCRIPTION OF THE PROBLEM :
java.lang.IndexOutOfBoundsException when removing the last elemnt which is selected - just see the Source-Code.
REGRESSION. Last worked in version 8u74
ADDITIONAL REGRESSION INFORMATION:
none, using -ea option
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
just start the provided source code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exeception, the list view shoudl cleanly drop the selection and remove the last element.
ACTUAL -
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
ERROR MESSAGES/STACK TRACES THAT OCCUR :
1.8.0_92
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.remove(ArrayList.java:492)
at com.sun.javafx.collections.ObservableListWrapper.doRemove(ObservableListWrapper.java:116)
at javafx.collections.ModifiableObservableListBase.remove(ModifiableObservableListBase.java:179)
at org.sdun.bugs.ListViewSelection.start(ListViewSelection.java:49)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Exception running application org.sdun.bugs.ListViewSelection
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package org.sdun.bugs;
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
*
* based on example from
* http://docs.oracle.com/javafx/2/ui_controls/list-view.htm
*
*/
public class ListViewSelection extends Application {
public static final ObservableList names =
FXCollections.observableArrayList();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("List View Sample");
System.err.println(System.getProperty("java.version"));
final ListView listView = new ListView();
listView.setPrefSize(200, 250);
listView.setEditable(true);
names.addAll("Adam");
listView.setItems(names);
StackPane root = new StackPane();
root.getChildren().add(listView);
primaryStage.setScene(new Scene(root, 200, 250));
primaryStage.show();
// removing the last selected element
// throws IndexOutOfBoundsException
listView.getSelectionModel().clearAndSelect(1);
names.remove(1);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
i have not found one that works for may case.
java version 1.8.0_92
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.10586] (and also on Windows 7)
A DESCRIPTION OF THE PROBLEM :
java.lang.IndexOutOfBoundsException when removing the last elemnt which is selected - just see the Source-Code.
REGRESSION. Last worked in version 8u74
ADDITIONAL REGRESSION INFORMATION:
none, using -ea option
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
just start the provided source code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exeception, the list view shoudl cleanly drop the selection and remove the last element.
ACTUAL -
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
ERROR MESSAGES/STACK TRACES THAT OCCUR :
1.8.0_92
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.remove(ArrayList.java:492)
at com.sun.javafx.collections.ObservableListWrapper.doRemove(ObservableListWrapper.java:116)
at javafx.collections.ModifiableObservableListBase.remove(ModifiableObservableListBase.java:179)
at org.sdun.bugs.ListViewSelection.start(ListViewSelection.java:49)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Exception running application org.sdun.bugs.ListViewSelection
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package org.sdun.bugs;
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
*
* based on example from
* http://docs.oracle.com/javafx/2/ui_controls/list-view.htm
*
*/
public class ListViewSelection extends Application {
public static final ObservableList names =
FXCollections.observableArrayList();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("List View Sample");
System.err.println(System.getProperty("java.version"));
final ListView listView = new ListView();
listView.setPrefSize(200, 250);
listView.setEditable(true);
names.addAll("Adam");
listView.setItems(names);
StackPane root = new StackPane();
root.getChildren().add(listView);
primaryStage.setScene(new Scene(root, 200, 250));
primaryStage.show();
// removing the last selected element
// throws IndexOutOfBoundsException
listView.getSelectionModel().clearAndSelect(1);
names.remove(1);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
i have not found one that works for may case.