Thread: Exception in thread "Thread-3" java.lang.ArrayIndexOutOfBoundsException: Index

Results 1 to 2 of 2
  1. #1 Exception in thread "Thread-3" java.lang.ArrayIndexOutOfBoundsException: Index 
    Banned
    Join Date
    Dec 2014
    Posts
    79
    Thanks given
    28
    Thanks received
    14
    Rep Power
    0




    Code:
    ObjectHandler.removeObject(spawnObject, 3310, 3303, 0);
    LINE 327
    Code:
    public static void removeObject(int spawnObject, int x, int y, int height) {
    		globalObjects.remove(spawnObject);
    		
    	}
    spawnObject = 38660




    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Sep 2007
    Age
    27
    Posts
    2,426
    Thanks given
    125
    Thanks received
    505
    Rep Power
    386
    The reason for this error is it's attempting to remove something from the list @ index spawnObject, which is 38660.

    You're going to need to iterate the list, and find the entry with the id of 38660. I would suggest using https://docs.oracle.com/javase/8/doc...ion.Predicate- Collection.removeIf to accomplish this, although I believe that will only work if you're running Java 8.
    Attached image
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 5
    Last Post: 04-29-2015, 08:53 PM
  2. Replies: 1
    Last Post: 04-26-2015, 12:23 PM
  3. Replies: 3
    Last Post: 01-06-2014, 07:14 AM
  4. Replies: 0
    Last Post: 07-10-2012, 01:37 AM
  5. Replies: 7
    Last Post: 12-03-2011, 09:38 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •