abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r555876 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/factory/ core/src/main/java/org/apache/abdera/util/ parser/src/main/java/org/apache/abdera/parser/stax/
Date Fri, 13 Jul 2007 05:17:33 GMT
Author: jmsnell
Date: Thu Jul 12 22:17:32 2007
New Revision: 555876

URL: http://svn.apache.org/viewvc?view=rev&rev=555876
Log:
Returning a List<String> does not really make any sense since the user is not going
to ever have the ability or the need to modify the list.

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractExtensionFactory.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java?view=diff&rev=555876&r1=555875&r2=555876
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java
Thu Jul 12 22:17:32 2007
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.factory;
 
-import java.util.List;
-
 import org.apache.abdera.model.Base;
 import org.apache.abdera.model.Element;
 
@@ -57,7 +55,7 @@
    *
    * @return A List of Namespace URIs Supported by this Extension
    */
-  List<String> getNamespaces();
+  String[] getNamespaces();
 
   /**
    * Retrieve an ElementWrapper for the specified Element or return

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java?view=diff&rev=555876&r1=555875&r2=555876
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
Thu Jul 12 22:17:32 2007
@@ -64,14 +64,15 @@
     wrappers.put(internal, wrapper);
   }
 
-  public List<String> getNamespaces() {
+  public String[] getNamespaces() {
     List<String> ns = new ArrayList<String>();
     synchronized(factories) {
       for (ExtensionFactory factory : factories) {
-        ns.addAll(factory.getNamespaces());
+        String[] namespaces = factory.getNamespaces();
+        for (String uri : namespaces) ns.add(uri);
       }
     }
-    return ns;
+    return ns.toArray(new String[ns.size()]);
   }
 
   public boolean handlesNamespace(String namespace) {

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractExtensionFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractExtensionFactory.java?view=diff&rev=555876&r1=555875&r2=555876
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractExtensionFactory.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractExtensionFactory.java
Thu Jul 12 22:17:32 2007
@@ -73,8 +73,8 @@
     return element != null && qname != null ? mimetypes.get(qname) : null;
   }
 
-  public List<String> getNamespaces() {
-    return new ArrayList<String>(namespaces);  // return a copy
+  public String[] getNamespaces() {
+    return namespaces.toArray(new String[namespaces.size()]);
   }
 
   public boolean handlesNamespace(String namespace) {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java?view=diff&rev=555876&r1=555875&r2=555876
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
Thu Jul 12 22:17:32 2007
@@ -808,7 +808,7 @@
       factoriesMap.getElementWrapper(internal));
   }
 
-  public List<String> getNamespaces() {
+  public String[] getNamespaces() {
     return factoriesMap.getNamespaces();
   }
 



Mime
View raw message