Author: awiner
Date: Thu Mar 26 19:34:30 2009
New Revision: 758810
URL: http://svn.apache.org/viewvc?rev=758810&view=rev
Log:
Fix warnings.
Modified:
incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/conversion/BeanJsonConverter.java
incubator/shindig/trunk/java/common/src/test/java/org/apache/shindig/protocol/conversion/BeanJsonConverterTest.java
incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth/OAuthRequestTest.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/service/AppDataHandler.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/SampleRealm.java
Modified:
incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/conversion/BeanJsonConverter.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/conversion/BeanJsonConverter.java?rev=758810&r1=758809&r2=758810&view=diff
==============================================================================
---
incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/conversion/BeanJsonConverter.java
(original)
+++
incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/conversion/BeanJsonConverter.java
Thu Mar 26 19:34:30 2009
@@ -117,7 +117,7 @@
}
public <T> T convertToObject(String string, Class<T> clazz) {
- return (T)convertToObject(string, (Type) clazz);
+ return clazz.cast(convertToObject(string, (Type) clazz));
}
@SuppressWarnings("unchecked")
Modified:
incubator/shindig/trunk/java/common/src/test/java/org/apache/shindig/protocol/conversion/BeanJsonConverterTest.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/common/src/test/java/org/apache/shindig/protocol/conversion/BeanJsonConverterTest.java?rev=758810&r1=758809&r2=758810&view=diff
==============================================================================
---
incubator/shindig/trunk/java/common/src/test/java/org/apache/shindig/protocol/conversion/BeanJsonConverterTest.java
(original)
+++
incubator/shindig/trunk/java/common/src/test/java/org/apache/shindig/protocol/conversion/BeanJsonConverterTest.java
Thu Mar 26 19:34:30 2009
@@ -99,7 +99,7 @@
Object object = beanJsonConverter.convertToObject(simpleJson, null);
- Map<String, Object> map = (Map<String, Object>) object;
+ Map<?, ?> map = (Map<?, ?>) object;
assertEquals("world", map.get("hello"));
assertEquals(10, map.get("count"));
Modified:
incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth/OAuthRequestTest.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth/OAuthRequestTest.java?rev=758810&r1=758809&r2=758810&view=diff
==============================================================================
---
incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth/OAuthRequestTest.java
(original)
+++
incubator/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth/OAuthRequestTest.java
Thu Mar 26 19:34:30 2009
@@ -1042,7 +1042,7 @@
}
});
try {
- HttpResponse resp =
client.sendRawPost(FakeOAuthServiceProvider.RESOURCE_URL,
+ client.sendRawPost(FakeOAuthServiceProvider.RESOURCE_URL,
"funky-content", raw);
fail("Should have thrown with oauth_body_hash mismatch");
} catch (RuntimeException e) {
@@ -1061,7 +1061,7 @@
}
});
try {
- HttpResponse resp =
client.sendFormPost(FakeOAuthServiceProvider.RESOURCE_URL, "foo=bar");
+ client.sendFormPost(FakeOAuthServiceProvider.RESOURCE_URL, "foo=bar");
fail("Should have thrown with oauth signature mismatch");
} catch (RuntimeException e) {
// good
@@ -1081,7 +1081,7 @@
}
});
try {
- HttpResponse resp =
client.sendRawPost(FakeOAuthServiceProvider.RESOURCE_URL,
+ client.sendRawPost(FakeOAuthServiceProvider.RESOURCE_URL,
"funky-content", raw);
fail("Should have thrown with body hash in form encoded request");
} catch (RuntimeException e) {
Modified:
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/service/AppDataHandler.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/service/AppDataHandler.java?rev=758810&r1=758809&r2=758810&view=diff
==============================================================================
---
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/service/AppDataHandler.java
(original)
+++
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/service/AppDataHandler.java
Thu Mar 26 19:34:30 2009
@@ -92,6 +92,8 @@
HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
HandlerPreconditions.requireSingular(userIds, "Multiple userIds not
supported");
+ @SuppressWarnings("unchecked")
+ // As of today, this is the only format supported by the AppData protocol
Map<String, String> values = request.getTypedParameter("data", Map.class);
for (String key : values.keySet()) {
if (!isValidKey(key)) {
Modified:
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/SampleRealm.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/SampleRealm.java?rev=758810&r1=758809&r2=758810&view=diff
==============================================================================
---
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/SampleRealm.java
(original)
+++
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/SampleRealm.java
Thu Mar 26 19:34:30 2009
@@ -18,30 +18,24 @@
*/
package org.apache.shindig.social.sample.oauth;
-import org.jsecurity.realm.AuthorizingRealm;
-import org.jsecurity.authz.AuthorizationInfo;
-import org.jsecurity.authz.AuthorizationException;
-import org.jsecurity.authz.SimpleAuthorizationInfo;
-import org.jsecurity.subject.PrincipalCollection;
+import org.apache.shindig.social.sample.spi.JsonDbOpensocialService;
+import org.jsecurity.authc.AccountException;
+import org.jsecurity.authc.AuthenticationException;
import org.jsecurity.authc.AuthenticationInfo;
import org.jsecurity.authc.AuthenticationToken;
-import org.jsecurity.authc.AuthenticationException;
-import org.jsecurity.authc.AccountException;
-import org.jsecurity.authc.UsernamePasswordToken;
import org.jsecurity.authc.SimpleAuthenticationInfo;
-import org.apache.shindig.social.sample.spi.JsonDbOpensocialService;
-import org.apache.shindig.social.opensocial.spi.UserId;
-import org.apache.shindig.social.opensocial.spi.SocialSpiException;
-import org.apache.shindig.social.opensocial.model.Person;
-import org.apache.shindig.common.util.ImmediateFuture;
-import org.apache.shindig.protocol.ResponseError;
-import org.json.JSONObject;
-import org.json.JSONArray;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Inject;
+import org.jsecurity.authc.UsernamePasswordToken;
+import org.jsecurity.authz.AuthorizationException;
+import org.jsecurity.authz.AuthorizationInfo;
+import org.jsecurity.authz.SimpleAuthorizationInfo;
+import org.jsecurity.realm.AuthorizingRealm;
+import org.jsecurity.subject.PrincipalCollection;
import java.util.Set;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Inject;
+
/**
* A Sample Jsecurity Realm that uses the JSON DB to get passwords
*