java.lang.ArithmeticException: / by zero

JDK Bug System | Webbug Group | 7 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    FULL PRODUCT VERSION : java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 10.0.14393] A DESCRIPTION OF THE PROBLEM : Pressing arrow keys when an empty TabPane is focused generates java.lang.ArithmeticException. See "steps to reproduce" and "error message" sections for more details. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Define a JavaFX application with an empty TabPane. 2. Launch an application. 3. Make sure that a TabPane is focused. 4. Press any arrow key on a keyboard - an exception is thrown. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - An exception should not be thrown. ACTUAL - An exception (java.lang.ArithmeticException) is thrown. ERROR MESSAGES/STACK TRACES THAT OCCUR : Exception in thread "JavaFX Application Thread" java.lang.ArithmeticException: / by zero at com.sun.javafx.scene.control.behavior.TabPaneBehavior.nextIndex(TabPaneBehavior.java:187) at com.sun.javafx.scene.control.behavior.TabPaneBehavior.findValidTab(TabPaneBehavior.java:175) at com.sun.javafx.scene.control.behavior.TabPaneBehavior.moveSelection(TabPaneBehavior.java:160) at com.sun.javafx.scene.control.behavior.TabPaneBehavior.moveSelection(TabPaneBehavior.java:155) at com.sun.javafx.scene.control.behavior.TabPaneBehavior.selectPreviousTab(TabPaneBehavior.java:151) at com.sun.javafx.scene.control.behavior.TabPaneBehavior.callAction(TabPaneBehavior.java:74) at com.sun.javafx.scene.control.behavior.BehaviorBase.callActionForEvent(BehaviorBase.java:218) at com.sun.javafx.scene.control.behavior.BehaviorBase.lambda$new$74(BehaviorBase.java:135) at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Scene$KeyHandler.process(Scene.java:3964) at javafx.scene.Scene$KeyHandler.access$1800(Scene.java:3910) at javafx.scene.Scene.impl_processKeyEvent(Scene.java:2040) at javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2501) at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:216) at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:148) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$353(GlassViewEventHandler.java:247) at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:246) at com.sun.glass.ui.View.handleKeyEvent(View.java:546) at com.sun.glass.ui.View.notifyKey(View.java:966) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191) at java.lang.Thread.run(Thread.java:745) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public class App extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) { TabPane tabPane = new TabPane(); Scene scene = new Scene(tabPane, 1024, 768); stage.setScene(scene); stage.show(); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Unfortunately, an 'outside' workaround is not possible for this bug.

    JDK Bug System | 7 months ago | Webbug Group
    java.lang.ArithmeticException: / by zero

    Root Cause Analysis

    1. java.lang.ArithmeticException

      / by zero

      at com.sun.javafx.scene.control.behavior.TabPaneBehavior.nextIndex()
    2. com.sun.javafx
      EventUtil.fireEvent
      1. com.sun.javafx.scene.control.behavior.TabPaneBehavior.nextIndex(TabPaneBehavior.java:187)
      2. com.sun.javafx.scene.control.behavior.TabPaneBehavior.findValidTab(TabPaneBehavior.java:175)
      3. com.sun.javafx.scene.control.behavior.TabPaneBehavior.moveSelection(TabPaneBehavior.java:160)
      4. com.sun.javafx.scene.control.behavior.TabPaneBehavior.moveSelection(TabPaneBehavior.java:155)
      5. com.sun.javafx.scene.control.behavior.TabPaneBehavior.selectPreviousTab(TabPaneBehavior.java:151)
      6. com.sun.javafx.scene.control.behavior.TabPaneBehavior.callAction(TabPaneBehavior.java:74)
      7. com.sun.javafx.scene.control.behavior.BehaviorBase.callActionForEvent(BehaviorBase.java:218)
      8. com.sun.javafx.scene.control.behavior.BehaviorBase.lambda$new$74(BehaviorBase.java:135)
      9. com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
      10. com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
      11. com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
      12. com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
      13. com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
      14. com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
      15. com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      16. com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      17. com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      18. com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      19. com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      20. com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
      21. com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
      21 frames
    3. javafx.event
      Event.fireEvent
      1. javafx.event.Event.fireEvent(Event.java:198)
      1 frame
    4. javafx.scene
      Scene$ScenePeerListener.keyEvent
      1. javafx.scene.Scene$KeyHandler.process(Scene.java:3964)
      2. javafx.scene.Scene$KeyHandler.access$1800(Scene.java:3910)
      3. javafx.scene.Scene.impl_processKeyEvent(Scene.java:2040)
      4. javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2501)
      4 frames
    5. com.sun.javafx
      GlassViewEventHandler$KeyEventNotification.run
      1. com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:216)
      2. com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:148)
      2 frames
    6. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    7. com.sun.javafx
      GlassViewEventHandler.handleKeyEvent
      1. com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$353(GlassViewEventHandler.java:247)
      2. com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
      3. com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:246)
      3 frames
    8. com.sun.glass
      WinApplication.lambda$null$148
      1. com.sun.glass.ui.View.handleKeyEvent(View.java:546)
      2. com.sun.glass.ui.View.notifyKey(View.java:966)
      3. com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      4. com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
      4 frames
    9. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame