jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r942698 - /jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/NodeInfoImpl.java
Date Mon, 10 May 2010 09:49:45 GMT
Author: stefan
Date: Mon May 10 09:49:45 2010
New Revision: 942698

URL: http://svn.apache.org/viewvc?rev=942698&view=rev
Log:
some minor optimizations

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/NodeInfoImpl.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/NodeInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/NodeInfoImpl.java?rev=942698&r1=942697&r2=942698&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/NodeInfoImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/NodeInfoImpl.java
Mon May 10 09:49:45 2010
@@ -26,6 +26,7 @@ import org.apache.jackrabbit.spi.Propert
 
 import java.io.Serializable;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
@@ -175,9 +176,13 @@ public class NodeInfoImpl extends ItemIn
         this.index = index;
         this.primaryTypeName = primaryTypeName;
         this.mixinNames = mixinNames;
-        this.references = new ArrayList<PropertyId>();
-        while (references.hasNext()) {
-            this.references.add(references.next());
+        if (!references.hasNext()) {
+            this.references = Collections.emptyList();
+        } else {
+            this.references = new ArrayList<PropertyId>();
+            while (references.hasNext()) {
+                this.references.add(references.next());
+            }
         }
         this.propertyIds = new ArrayList<PropertyId>();
         while (propertyIds.hasNext()) {
@@ -220,9 +225,7 @@ public class NodeInfoImpl extends ItemIn
      * {@inheritDoc}
      */
     public Name[] getMixins() {
-        Name[] ret = new Name[mixinNames.length];
-        System.arraycopy(mixinNames, 0, ret, 0, mixinNames.length);
-        return ret;
+        return mixinNames;
     }
 
     /**



Mime
View raw message