From 6407e5617d8942e103a7b6410cfde8d8fab46e00 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Tue, 5 Apr 2011 20:08:55 +0000 Subject: [PATCH] - use paul's awesome generics magic in Spatial.getUserData git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7193 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/scene/Spatial.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/src/core/com/jme3/scene/Spatial.java b/engine/src/core/com/jme3/scene/Spatial.java index f82c39cf3..205610b5f 100644 --- a/engine/src/core/com/jme3/scene/Spatial.java +++ b/engine/src/core/com/jme3/scene/Spatial.java @@ -1157,16 +1157,16 @@ public abstract class Spatial implements Savable, Cloneable, Collidable { } } - public Object getUserData(String key) { + public T getUserData(String key) { if (userData == null) { return null; } Savable s = userData.get(key); if (s instanceof UserData) { - return ((UserData) s).getValue(); + return (T)((UserData) s).getValue(); } else { - return s; + return (T)s; } }