title: Error ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.happydroids.droidtowers.entities.GridObject;
body: <p>I'm trying to compile the following project: <a href="https://github.com/pplante/droidtowers" rel="nofollow">https://github.com/pplante/droidtowers</a>
  (the December 02 version, which is the last one that works). I managed to get all the dependencies etc and it compiles both under eclipse and IntelliJ-IDEA (which is the original project). However, when running under eclipse the following error appears at this line:</p>
  
  <pre><code>Array&lt;GridObject&gt; rooms = new Array&lt;GridObject&gt;(gameGrid.getInstancesOf(Room.class).items);
  </code></pre>
  
  <p>This crashes the game after a new game is started, past the Main Menu.</p>
  
  <p>Now, I know that the Room class extends GridObject, and this runs fine under IntelliJ. I can't wrap my head around what can be the problem, or difference between both executables, so any help would be welcome. Maybe there's a default in the compiler overriden in the IDEA project? (I made the eclipse project from scratch).</p>
  
  <p>This is using the latest Java, and android sdk.</p>
  
  <p>ADDENDUM: Here's the full stacktrace:</p>
  
  <pre><code>ago 05, 2013 3:14:57 PM com.happydroids.platform.DesktopUncaughtExceptionHandler uncaughtException
  SEVERE: Uncaught exception!
  com.badlogic.gdx.utils.GdxRuntimeException: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.happydroids.droidtowers.entities.GridObject;
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:111)
  Caused by: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.happydroids.droidtowers.entities.GridObject;
    at com.happydroids.droidtowers.controllers.AvatarLayer.setupInitialAvatars(AvatarLayer.java:191)
    at com.happydroids.droidtowers.scenes.TowerScene.create(TowerScene.java:145)
    at com.happydroids.droidtowers.scenes.components.SceneManager.pushScene(SceneManager.java:39)
    at com.happydroids.droidtowers.scenes.components.SceneManager.changeScene(SceneManager.java:26)
    at com.happydroids.droidtowers.scenes.LoadTowerSplashScene.render(LoadTowerSplashScene.java:29)
    at com.happydroids.droidtowers.DroidTowersGame.render(DroidTowersGame.java:216)
    at com.happydroids.droidtowers.LwjglApplicationShim.render(LwjglApplicationShim.java:50)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:190)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:108)
  
  com.badlogic.gdx.utils.GdxRuntimeException: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.happydroids.droidtowers.entities.GridObject;
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:111)
  Caused by: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.happydroids.droidtowers.entities.GridObject;
    at com.happydroids.droidtowers.controllers.AvatarLayer.setupInitialAvatars(AvatarLayer.java:191)
    at com.happydroids.droidtowers.scenes.TowerScene.create(TowerScene.java:145)
    at com.happydroids.droidtowers.scenes.components.SceneManager.pushScene(SceneManager.java:39)
    at com.happydroids.droidtowers.scenes.components.SceneManager.changeScene(SceneManager.java:26)
    at com.happydroids.droidtowers.scenes.LoadTowerSplashScene.render(LoadTowerSplashScene.java:29)
    at com.happydroids.droidtowers.DroidTowersGame.render(DroidTowersGame.java:216)
    at com.happydroids.droidtowers.LwjglApplicationShim.render(LwjglApplicationShim.java:50)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:190)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:108)
  </code></pre>