Solved ArrayIndexOutOfBoundsException

Discussion in 'Plugin Development' started by cfil360, Apr 25, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    cfil360

    I keep getting an out of bounds exception for what i believe is no reason.
    Here is my code:
    Code:java
    1. public Location deserializeLoc(String s){
    2. String[] st = s.split(",");
    3. Bukkit.broadcastMessage(st.length + "");
    4. return new Location(Bukkit.getWorld(st[0]), Integer.parseInt(st[1]), Integer.parseInt(st[2]), Integer.parseInt(st[3]), Integer.parseInt(st[4]), Integer.parseInt(st[5]));
    5. }


    Here is the string
    Code:
    HG1,1000,5,996,78,25
     
  2. cfil360 Are you sure that's the string? Output s as debug and see what it says
     
    cfil360 likes this.
  3. Offline

    cfil360

    AdamQpzm likes this.
Thread Status:
Not open for further replies.

Share This Page