abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1220338 - in /abdera/abdera2: activities/src/main/java/org/apache/abdera2/activities/extra/ activities/src/main/java/org/apache/abdera2/activities/model/ activities/src/main/java/org/apache/abdera2/activities/model/objects/ activities/src/...
Date Sun, 18 Dec 2011 06:14:45 GMT
Author: jmsnell
Date: Sun Dec 18 06:14:44 2011
New Revision: 1220338

URL: http://svn.apache.org/viewvc?rev=1220338&view=rev
Log:
Some findbugs fixes...

Modified:
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ASContext.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/managed/Configuration.java
    abdera/abdera2/common/src/main/java/org/apache/abdera2/common/date/DateTimes.java

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ASContext.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ASContext.java?rev=1220338&r1=1220337&r2=1220338&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ASContext.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ASContext.java
Sun Dec 18 06:14:44 2011
@@ -40,7 +40,7 @@ import org.apache.abdera2.common.templat
 public final class ASContext 
   extends AbstractContext {
   private static final long serialVersionUID = 4445623432125049535L;
-  private final ASBase base;
+  private final transient ASBase base;
   
   public static ASContext create(ASBase base) {
     return new ASContext(base);

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java?rev=1220338&r1=1220337&r2=1220338&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java
Sun Dec 18 06:14:44 2011
@@ -20,6 +20,7 @@ package org.apache.abdera2.activities.ex
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Reader;
+import java.io.Serializable;
 import java.lang.reflect.Method;
 import java.util.AbstractSet;
 import java.util.Collections;
@@ -832,7 +833,10 @@ public final class Extra {
   }
   
   static class UpdatedComparator<X extends ASObject>
-    extends DateTimes.DateTimeComparator<X> {
+    extends DateTimes.DateTimeComparator<X>
+    implements Serializable {
+      private static final long serialVersionUID = 6821667653694869403L;
+
       public int compare(X a1, X a2) {
         DateTime d1 = a1.getUpdated();
         DateTime d2 = a2.getUpdated();
@@ -841,7 +845,10 @@ public final class Extra {
   }
   
   static class PublishedComparator<X extends ASObject>
-    extends DateTimes.DateTimeComparator<X> {
+    extends DateTimes.DateTimeComparator<X>
+    implements Serializable {
+      private static final long serialVersionUID = -8381760915617994979L;
+
       public int compare(X a1, X a2) {
         return innerCompare(
           a1.getPublished(), 

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java?rev=1220338&r1=1220337&r2=1220338&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java
Sun Dec 18 06:14:44 2011
@@ -557,6 +557,11 @@ public class ASBase 
   }
   
   @SuppressWarnings("rawtypes")
+  /**
+   * ASBase.clone() differs from the standard implementation of 
+   * Object.clone() in that it uses the ASBase objects template()
+   * method to create a new immutable copy of this object.
+   */
   public Object clone() throws CloneNotSupportedException {
     return this.<ASBase,Builder>template().get();
   }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java?rev=1220338&r1=1220337&r2=1220338&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java
Sun Dec 18 06:14:44 2011
@@ -127,7 +127,7 @@ public class NameObject 
       return (M)this;
     }
     public M pronunciationUrl(String fn) {
-      return pronunciationUrl(fn);
+      return pronunciationUrl(new IRI(fn));
     }
     public M pronunciationUrl(IRI fn) {
       set("pronunciationUrl",fn);

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java?rev=1220338&r1=1220337&r2=1220338&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java
Sun Dec 18 06:14:44 2011
@@ -35,11 +35,11 @@ public class TaskObject extends ASObject
   }
   
   public <X extends ASObject>X getObject() {
-    return (X) getProperty("for");
+    return this.<X>getProperty("for");
   }
   
   public <X extends ASObject>X getActor() {
-    return (X) getProperty("actor");
+    return this.<X>getProperty("actor");
   }
   
   public Iterable<String> getSupersedes() {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java?rev=1220338&r1=1220337&r2=1220338&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java
Sun Dec 18 06:14:44 2011
@@ -53,6 +53,8 @@ public class ActivitiesResponseContext<T
           type.setParameter("charset", "UTF-8");
         setContentType(type.toString());
     } catch (Exception e) {
+      // it's ok to ignore this exception
+      log.debug("Error setting charset parameter",e);
     }
     log.debug(String.format("Content-Type: %s", getContentType()));
   }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java?rev=1220338&r1=1220337&r2=1220338&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java
Sun Dec 18 06:14:44 2011
@@ -23,7 +23,7 @@ import org.apache.abdera2.common.misc.Mo
 public class ProtocolException extends RuntimeException {
 
     private static final long serialVersionUID = 1017447143200419489L;
-    private final ErrorObject error;
+    private final transient ErrorObject error;
 
     public ProtocolException(ErrorObject error) {
         super(String.format("%d::%s",error.getCode(),error.getDisplayName()));

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/managed/Configuration.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/managed/Configuration.java?rev=1220338&r1=1220337&r2=1220338&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/managed/Configuration.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/managed/Configuration.java
Sun Dec 18 06:14:44 2011
@@ -26,7 +26,9 @@ public abstract class Configuration {
 
     static Properties loadFileAsProperties(String fileLocation) throws IOException {
         Properties props = new Properties();
-        props.load(new FileInputStream(fileLocation));
+        FileInputStream in = new FileInputStream(fileLocation);
+        props.load(in);
+        in.close();
         return props;
     }
 

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/date/DateTimes.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/date/DateTimes.java?rev=1220338&r1=1220337&r2=1220338&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/date/DateTimes.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/date/DateTimes.java Sun
Dec 18 06:14:44 2011
@@ -17,6 +17,7 @@
  */
 package org.apache.abdera2.common.date;
 
+import java.io.Serializable;
 import java.util.Calendar;
 import java.util.Comparator;
 import java.util.Date;
@@ -307,7 +308,10 @@ public final class DateTimes {
   /**
    * Convenience Utility for Comparing DateTime instances
    */
-  public static abstract class DateTimeComparator<X> implements Comparator<X>
{
+  public static abstract class DateTimeComparator<X> 
+    implements Comparator<X>, Serializable {
+    private static final long serialVersionUID = -3081540045542491405L;
+
     public int innerCompare(DateTime d1, DateTime d2) {
       if (onlySecondIsNull(d1,d2)) return 1;
       if (onlyFirstIsNull(d1,d2)) return -1;



Mime
View raw message