jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r785519 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/nodetype/compact/ main/java/org/apache/jackrabbit/core/nodetype/xml/ main/java/org/apache/jackrabbit/core/value/ test/java/org/apache/jackrabbit/core/n...
Date Wed, 17 Jun 2009 09:19:04 GMT
Author: angela
Date: Wed Jun 17 09:19:04 2009
New Revision: 785519

URL: http://svn.apache.org/viewvc?rev=785519&view=rev
Log:
JCR-2147: Remove deprecated classes in jackrabbit-core

- remove ValueFactoryImpl#getInstance()
- replace usages


Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeWriter.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/ValueFactoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java?rev=785519&r1=785518&r2=785519&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java
Wed Jun 17 09:19:04 2009
@@ -28,7 +28,6 @@
 import javax.jcr.NamespaceException;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
-import javax.jcr.ValueFactory;
 import javax.jcr.query.qom.QueryObjectModelConstants;
 import javax.jcr.version.OnParentVersionAction;
 
@@ -39,7 +38,6 @@
 import org.apache.jackrabbit.core.nodetype.ItemDef;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.value.InternalValueFactory;
-import org.apache.jackrabbit.core.value.ValueFactoryImpl;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.apache.jackrabbit.spi.commons.nodetype.compact.Lexer;
 import org.apache.jackrabbit.spi.Name;
@@ -93,6 +91,8 @@
      */
     private HashSet usedNamespaces = new HashSet();
 
+    private final ValueFactoryQImpl factory;
+
     /**
      * Creates a new nodetype writer
      *
@@ -105,6 +105,7 @@
         this.npResolver = npResolver;
         this.out = new StringWriter();
         this.nsWriter = out;
+        factory = new ValueFactoryQImpl(InternalValueFactory.getInstance(), npResolver);

     }
 
     /**
@@ -313,7 +314,6 @@
      */
     private void writeDefaultValues(InternalValue[] dva) throws IOException {
         if (dva != null && dva.length > 0) {
-            ValueFactoryQImpl factory = ValueFactoryImpl.getInstance(npResolver);
             String delim = " = '";
             for (int i = 0; i < dva.length; i++) {
                 out.write(delim);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeWriter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeWriter.java?rev=785519&r1=785518&r2=785519&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeWriter.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeWriter.java
Wed Jun 17 09:19:04 2009
@@ -22,7 +22,7 @@
 import org.apache.jackrabbit.core.nodetype.ValueConstraint;
 import org.apache.jackrabbit.core.util.DOMBuilder;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.core.value.ValueFactoryImpl;
+import org.apache.jackrabbit.core.value.InternalValueFactory;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver;
@@ -86,6 +86,8 @@
     /** The namespace resolver. */
     private final NamePathResolver resolver;
 
+    private final ValueFactoryQImpl factory;
+
     /**
      * Creates a node type definition file writer. The given namespace
      * registry is used for the XML namespace bindings.
@@ -110,6 +112,7 @@
 
         NamespaceResolver nsResolver = new AdditionalNamespaceResolver(registry);
         resolver = new DefaultNamePathResolver(nsResolver);
+        factory = new ValueFactoryQImpl(InternalValueFactory.getInstance(), resolver);
     }
 
     /**
@@ -257,7 +260,6 @@
         // default values
         InternalValue[] defaults = def.getDefaultValues();
         if (defaults != null && defaults.length > 0) {
-            ValueFactoryQImpl factory = ValueFactoryImpl.getInstance(resolver);
             builder.startElement(Constants.DEFAULTVALUES_ELEMENT);
             for (int i = 0; i < defaults.length; i++) {
                 InternalValue v = defaults[i];

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/ValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/ValueFactoryImpl.java?rev=785519&r1=785518&r2=785519&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/ValueFactoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/ValueFactoryImpl.java
Wed Jun 17 09:19:04 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.value;
 
-import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.data.DataIdentifier;
 import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
@@ -57,23 +56,6 @@
         this.store = store;
     }
 
-    /**
-     * Constructs a new <code>ValueFactoryQImpl</code>. If possible,
-     * an existing value factory is reused.
-     * @deprecated
-     * If possible this method should not be used, instead the value factory
-     * should be retrieved from the session.
-     *
-     * @param resolver <code>NamePathResolver</code>
-     */
-    public static ValueFactoryQImpl getInstance(NamePathResolver resolver) {
-        if (resolver instanceof SessionImpl) {
-            return (ValueFactoryImpl) ((SessionImpl) resolver).getValueFactory();
-        } else {
-            return new ValueFactoryImpl(resolver, null);
-        }
-    }
-
     public Value createValue(QValue qvalue) {
         if (qvalue instanceof InternalValue && PropertyType.BINARY == qvalue.getType())
{
             try {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java?rev=785519&r1=785518&r2=785519&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
Wed Jun 17 09:19:04 2009
@@ -26,7 +26,7 @@
 import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.nodetype.PropDef;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.core.value.ValueFactoryImpl;
+import org.apache.jackrabbit.core.value.InternalValueFactory;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NameFactory;
@@ -151,7 +151,7 @@
             InternalValue[] values = def.getDefaultValues();
             NamespaceResolver nsResolver = new AdditionalNamespaceResolver(registry);
             NamePathResolver resolver = new DefaultNamePathResolver(nsResolver);
-            ValueFactoryQImpl factory = ValueFactoryImpl.getInstance(resolver);
+            ValueFactoryQImpl factory = new ValueFactoryQImpl(InternalValueFactory.getInstance(),
resolver);
             return factory.createValue(values[index]).getString();
         } catch (RepositoryException e) {
             throw new AssertionFailedError(e.getMessage());



Mime
View raw message