abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1174419 - /abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/activities/FeedToActivityConverter.java
Date Thu, 22 Sep 2011 22:17:49 GMT
Author: jmsnell
Date: Thu Sep 22 22:17:49 2011
New Revision: 1174419

URL: http://svn.apache.org/viewvc?rev=1174419&view=rev
Log:
minor tweak

Modified:
    abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/activities/FeedToActivityConverter.java

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/activities/FeedToActivityConverter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/activities/FeedToActivityConverter.java?rev=1174419&r1=1174418&r2=1174419&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/activities/FeedToActivityConverter.java
(original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/activities/FeedToActivityConverter.java
Thu Sep 22 22:17:49 2011
@@ -123,6 +123,17 @@ public class FeedToActivityConverter {
     return activity;
   }
   
+  protected String objectType(ExtensibleElement ext) {
+    String objtype = null;
+    if (ext.has(OBJECTTYPE)) {
+      String val = ext.getSimpleExtension(OBJECTTYPE);
+      int n = val.lastIndexOf('/');
+      if (n > -1) val = val.substring(n+1);
+      objtype = val;
+    }
+    return objtype;
+  }
+  
   protected ASObject object(ExtensibleElement ext) {
     ASObject obj = new ASObject();
     if (ext.has(Constants.ID))
@@ -135,12 +146,7 @@ public class FeedToActivityConverter {
       Text text = ext.getExtension(Constants.SUMMARY);
       obj.setSummary(text.getValue());
     }
-    if (ext.has(OBJECTTYPE)) {
-      String val = ext.getSimpleExtension(OBJECTTYPE);
-      int n = val.lastIndexOf('/');
-      if (n > -1) val = val.substring(n+1);
-      obj.setObjectType(val);
-    }
+    obj.setObjectType(objectType(ext));
     LinkRelSelector sel = 
       new LinkRelSelector("alternate","preview");
     List<Link> links = ext.getExtensions(Constants.LINK, sel);



Mime
View raw message