shindig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lind...@apache.org
Subject svn commit: r993228 - in /shindig/trunk/java: common/src/main/java/org/apache/shindig/common/uri/ gadgets/src/main/java/org/apache/shindig/gadgets/features/ gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ gadgets/src/main/java/org/apache/shin...
Date Tue, 07 Sep 2010 06:44:31 GMT
Author: lindner
Date: Tue Sep  7 06:44:30 2010
New Revision: 993228

URL: http://svn.apache.org/viewvc?rev=993228&view=rev
Log:
minor cleanups, close streams, make inner classes final

Modified:
    shindig/trunk/java/common/src/main/java/org/apache/shindig/common/uri/Uri.java
    shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/BrowserSpecificFeatureResource.java
    shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ServletUtil.java
    shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java

Modified: shindig/trunk/java/common/src/main/java/org/apache/shindig/common/uri/Uri.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/uri/Uri.java?rev=993228&r1=993227&r2=993228&view=diff
==============================================================================
--- shindig/trunk/java/common/src/main/java/org/apache/shindig/common/uri/Uri.java (original)
+++ shindig/trunk/java/common/src/main/java/org/apache/shindig/common/uri/Uri.java Tue Sep
 7 06:44:30 2010
@@ -402,7 +402,7 @@ public final class Uri {
    * Interim typed, but not checked, exception facilitating migration
    * of Uri methods to throwing a checked UriException later.
    */
-  public static class UriException extends IllegalArgumentException {
+  public static final class UriException extends IllegalArgumentException {
     private UriException(Exception e) {
       super(e);
     }

Modified: shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/BrowserSpecificFeatureResource.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/BrowserSpecificFeatureResource.java?rev=993228&r1=993227&r2=993228&view=diff
==============================================================================
--- shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/BrowserSpecificFeatureResource.java
(original)
+++ shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/BrowserSpecificFeatureResource.java
Tue Sep  7 06:44:30 2010
@@ -236,7 +236,7 @@ public class BrowserSpecificFeatureResou
       public abstract boolean match(String in, String key);
     }
     
-    private static class VersionNumber {
+    private static final class VersionNumber {
       private final int[] parts;
       
       private VersionNumber(String str) {

Modified: shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ServletUtil.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ServletUtil.java?rev=993228&r1=993227&r2=993228&view=diff
==============================================================================
--- shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ServletUtil.java
(original)
+++ shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ServletUtil.java
Tue Sep  7 06:44:30 2010
@@ -201,14 +201,18 @@ public final class ServletUtil {
     pw.write(response.getEncoding());
     pw.write(",");
     pw.flush();
-    
+
     // Stream out the base64-encoded data.
     // Ctor args indicate to encode w/o line breaks.
     Base64InputStream b64input = new Base64InputStream(response.getResponse(), true, 0, null);
     byte[] buf = new byte[1024];
     int read = -1;
-    while ((read = b64input.read(buf, 0, 1024)) > 0) {
-      os.write(buf, 0, read);
+    try {
+      while ((read = b64input.read(buf, 0, 1024)) > 0) {
+        os.write(buf, 0, read);
+      }
+    } finally {
+      IOUtils.closeQuietly(b64input);
     }
     
     // Complete the JSON object.

Modified: shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java?rev=993228&r1=993227&r2=993228&view=diff
==============================================================================
--- shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java
(original)
+++ shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/UserPref.java
Tue Sep  7 06:44:30 2010
@@ -238,7 +238,7 @@ public class UserPref {
    * Simple data structure representing a value/displayValue pair
    * for UserPref enums. Value is EnumValue@value, and DisplayValue is EnumValue@displayValue.
    */
-  public static class EnumValuePair {
+  public static final class EnumValuePair {
     private final String value;
     private final String displayValue;
 



Mime
View raw message