Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-2139

Reversi: IndexOutOfBoundError and user can make consecutive moves

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.0
    • Fix Version/s: 2.9.1
    • Component/s: None
    • Labels:
      None

      Description

      I was playing a game of Reversi, and I noticed that at some point, one user could make consecutive moves. At some point, the game went into a state where neither player could make a move anymore.

      This stack trace was logged (which I'm not sure if it is related, but assume so):

      Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: Index 64 out of bounds for length 64
      	at org.jivesoftware.game.reversi.ReversiModel.getFlipCount(ReversiModel.java:333)
      	at org.jivesoftware.game.reversi.ReversiModel.isValidMove(ReversiModel.java:244)
      	at org.jivesoftware.game.reversi.ReversiModel.makeMove(ReversiModel.java:170)
      	at org.jivesoftware.game.reversi.ReversiPanel$ReversiBlockMouseListener.mouseClicked(ReversiPanel.java:339)
      	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6638)
      	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              guus Guus der Kinderen
              Reporter:
              guus Guus der Kinderen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: