From cc0431581cf8b290357675b1c5964640c8850285 Mon Sep 17 00:00:00 2001 From: Lertsenem Date: Wed, 30 Jul 2014 00:12:43 +0200 Subject: [PATCH] Cast error in RegularLevel and Heap The (Collection) bundle.getCollection(ITEM) cast fails at compile time because Item extends (well, implements) Bundlable, not the opposite. --- src/com/watabou/pixeldungeon/items/Heap.java | 2 +- src/com/watabou/pixeldungeon/levels/RegularLevel.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/watabou/pixeldungeon/items/Heap.java b/src/com/watabou/pixeldungeon/items/Heap.java index 59325bc..6f4fa6d 100644 --- a/src/com/watabou/pixeldungeon/items/Heap.java +++ b/src/com/watabou/pixeldungeon/items/Heap.java @@ -324,7 +324,7 @@ public void destroy() { public void restoreFromBundle( Bundle bundle ) { pos = bundle.getInt( POS ); type = Type.valueOf( bundle.getString( TYPE ) ); - items = new LinkedList( (Collection) bundle.getCollection( ITEMS ) ); + items = new LinkedList( (Collection) ((Collection) bundle.getCollection( ITEMS )) ); } @Override diff --git a/src/com/watabou/pixeldungeon/levels/RegularLevel.java b/src/com/watabou/pixeldungeon/levels/RegularLevel.java index 450dd8a..e7badb9 100644 --- a/src/com/watabou/pixeldungeon/levels/RegularLevel.java +++ b/src/com/watabou/pixeldungeon/levels/RegularLevel.java @@ -682,7 +682,7 @@ public void storeInBundle( Bundle bundle ) { public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); - rooms = new HashSet( (Collection) bundle.getCollection( "rooms" ) ); + rooms = new HashSet( (Collection) ((Collection) bundle.getCollection( "rooms" )) ); for (Room r : rooms) { if (r.type == Type.WEAK_FLOOR) { weakFloorCreated = true;