开发者

Eclipse debugging, breakpoint - "ArrayIndexOutOfBoundsException: caught and uncaught", what does this mean?

I'm trying to debug my game and it's driving me nuts, plus it's getting late. Anyone in the mood to try to figure this one out?

 public class Board {

     private int COLUMNS = 8;
     private int ROWS = 8;
     private Square[][] grid;

     public Board(){
      addGrid();
     }

     public void addGrid(){
      grid = new Square[COLUMNS][ROWS];
      for(int row = 0; row < 7; row++){
       for(int col = 0; col < 7; col++){
        grid[col][row] = new Square(this);
       }
      }
     }

I set watchpoints at the three first lines, and a breakpoint at the first line in the addGrid method. After accessing the two constants (first line in addGrid()), it opens up Launcher.class saying "Class File Editor" and "Source not found".

The stacktrace:

Thread [main] (Suspended) 
 Launcher$AppClassLoader.loadClass(String, boolean) line: 293 
 Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 248 
 Board.addGrid() line: 14 
 Board.<init>() line: 开发者_如何学JAVA10 
 Game.<init>() line: 9 
 Game.main(String[]) line: 5 

Eclipse also created a breakpoint for me, as seen in the title.

I have no idea why this is happening, the array looks fine to me.


This looks like you have a breakpoint set to trigger when you load the class. I really hate it when this happens, and it usually manifests itself with an error like that one. Try opening up the menu controlling where breakpoints are set and see if you can find something for "on class load."

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜