jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r638027 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: fs/mem/MemoryFileSystem.java nodetype/compact/CompactNodeTypeDefReader.java query/lucene/DefaultHighlighter.java
Date Mon, 17 Mar 2008 19:07:46 GMT
Author: jukka
Date: Mon Mar 17 12:07:44 2008
New Revision: 638027

URL: http://svn.apache.org/viewvc?rev=638027&view=rev
Log:
JCR-1479: [PATCH] don't use the reflective form of {Collection}.toArray
    - Applied patch by Dave Brosius

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java?rev=638027&r1=638026&r2=638027&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
Mon Mar 17 12:07:44 2008
@@ -214,7 +214,7 @@
                 selectedNames.add(name.substring(folderPath.length() + 1));
             }
         }
-        return (String[]) selectedNames.toArray(new String[0]);
+        return (String[]) selectedNames.toArray(new String[selectedNames.size()]);
     }
 
     public String[] listFiles(String folderPath) {
@@ -236,7 +236,7 @@
                 result.add(names[i]);
             }
         }
-        return (String[]) result.toArray(new String[0]);
+        return (String[]) result.toArray(new String[result.size()]);
     }
 
     public void move(String srcPath, String destPath)

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java?rev=638027&r1=638026&r2=638027&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
Mon Mar 17 12:07:44 2008
@@ -290,7 +290,7 @@
             supertypes.add(toQName(currentToken));
             nextToken();
         } while (currentTokenEquals(Lexer.LIST_DELIMITER));
-        ntd.setSupertypes((Name[]) supertypes.toArray(new Name[0]));
+        ntd.setSupertypes((Name[]) supertypes.toArray(new Name[supertypes.size()]));
     }
 
     /**
@@ -363,11 +363,11 @@
         }
 
         if (propertyDefinitions.size() > 0) {
-            ntd.setPropertyDefs((PropDef[]) propertyDefinitions.toArray(new PropDef[0]));
+            ntd.setPropertyDefs((PropDef[]) propertyDefinitions.toArray(new PropDef[propertyDefinitions.size()]));
         }
 
         if (nodeDefinitions.size() > 0) {
-            ntd.setChildNodeDefs((NodeDef[]) nodeDefinitions.toArray(new NodeDef[0]));
+            ntd.setChildNodeDefs((NodeDef[]) nodeDefinitions.toArray(new NodeDef[nodeDefinitions.size()]));
         }
     }
 
@@ -506,7 +506,7 @@
             defaultValues.add(value);
             nextToken();
         } while (currentTokenEquals(Lexer.LIST_DELIMITER));
-        pdi.setDefaultValues((InternalValue[]) defaultValues.toArray(new InternalValue[0]));
+        pdi.setDefaultValues((InternalValue[]) defaultValues.toArray(new InternalValue[defaultValues.size()]));
     }
 
     /**
@@ -532,7 +532,7 @@
             constraints.add(constraint);
             nextToken();
         } while (currentTokenEquals(Lexer.LIST_DELIMITER));
-        pdi.setValueConstraints((ValueConstraint[]) constraints.toArray(new ValueConstraint[0]));
+        pdi.setValueConstraints((ValueConstraint[]) constraints.toArray(new ValueConstraint[constraints.size()]));
     }
 
     /**
@@ -571,7 +571,7 @@
             types.add(toQName(currentToken));
             nextToken();
         } while (currentTokenEquals(Lexer.LIST_DELIMITER));
-        ndi.setRequiredPrimaryTypes((Name[]) types.toArray(new Name[0]));
+        ndi.setRequiredPrimaryTypes((Name[]) types.toArray(new Name[types.size()]));
         nextToken();
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java?rev=638027&r1=638026&r2=638027&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultHighlighter.java
Mon Mar 17 12:07:44 2008
@@ -155,7 +155,7 @@
             }
         }
 
-        TermVectorOffsetInfo[] offsets = (TermVectorOffsetInfo[]) list.toArray(new TermVectorOffsetInfo[0]);
+        TermVectorOffsetInfo[] offsets = (TermVectorOffsetInfo[]) list.toArray(new TermVectorOffsetInfo[list.size()]);
         // sort offsets
         if (terms.length > 1) {
             java.util.Arrays.sort(offsets, new TermVectorOffsetInfoSorter());



Mime
View raw message