From 40d0df6dfa1d78d0d146641eeaafe9eb28f9fecf Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 4 Jul 2006 02:20:10 +0000 Subject: [PATCH] Properly quell the unchecked warning. I'm not entirely sure whether there is a construct that could be made to do what I want in a type safe manner. The method returns Class which is correctly expresses the valid types that can be returned. However, I can't pass the capture (NodeObject extends DObject) to a method that takes . I'm not entirely sure why not, but I imagine it has something to do with the subtleties of type-erasure, or maybe it's just a limitation of the inference that can be done by the compiler. I don't know what type is considered to be, I would have thought just NodeObject but apparently not. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4242 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/presents/peer/server/PeerManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/presents/peer/server/PeerManager.java b/src/java/com/threerings/presents/peer/server/PeerManager.java index 46f2a001b..c2654d53d 100644 --- a/src/java/com/threerings/presents/peer/server/PeerManager.java +++ b/src/java/com/threerings/presents/peer/server/PeerManager.java @@ -105,7 +105,8 @@ public class PeerManager this, PresentsServer.clmgr.getClientFactory())); // create our node object - Class clazz = (Class)getNodeObjectClass(); + @SuppressWarnings("unchecked") Class clazz = + (Class)getNodeObjectClass(); PresentsServer.omgr.createObject(clazz, new Subscriber() { public void objectAvailable (NodeObject object) { finishInit(object);