jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1324752 - in /jackrabbit/oak/trunk/oak-jcr/src: main/java/org/apache/jackrabbit/oak/jcr/ main/java/org/apache/jackrabbit/oak/jcr/query/ main/java/org/apache/jackrabbit/oak/jcr/query/qom/ test/java/org/apache/jackrabbit/oak/jcr/query/qom/
Date Wed, 11 Apr 2012 13:16:21 GMT
Author: mduerig
Date: Wed Apr 11 13:16:21 2012
New Revision: 1324752

URL: http://svn.apache.org/viewvc?rev=1324752&view=rev
Log:
OAK-15: Clean up oak-jcr
- add missing @Override
- suppress deprecation warnings where applicable
- add private constructor to utility class
- make fields final when possible
- make methods static when possible
- remove redundant throws clauses from implementation classes

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/ValueConverter.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/ColumnImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelFactoryImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SelectorImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/qom/QomTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Wed Apr 11 13:16:21 2012
@@ -289,6 +289,7 @@ public class NodeImpl extends ItemImpl i
     /**
      * @see Node#setProperty(String, InputStream)
      */
+    @SuppressWarnings("deprecation")
     @Override
     public Property setProperty(String name, InputStream value) throws RepositoryException
{
         Value v = (value == null ? null : getValueFactory().createValue(value));

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
Wed Apr 11 13:16:21 2012
@@ -232,6 +232,7 @@ public class PropertyImpl extends ItemIm
     /**
      * @see Property#setValue(InputStream)
      */
+    @SuppressWarnings("deprecation")
     @Override
     public void setValue(InputStream value) throws RepositoryException {
         checkStatus();
@@ -364,6 +365,7 @@ public class PropertyImpl extends ItemIm
     /**
      * @see Property#getStream()
      */
+    @SuppressWarnings("deprecation")
     @Override
     public InputStream getStream() throws RepositoryException {
         return getValue().getStream();

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
Wed Apr 11 13:16:21 2012
@@ -99,7 +99,9 @@ public class QueryManagerImpl implements
         }
     }
 
-    private HashMap<String, CoreValue> convertMap(HashMap<String, Value> bindVariableMap)
throws RepositoryException {
+    private static HashMap<String, CoreValue> convertMap(HashMap<String, Value>
bindVariableMap)
+            throws RepositoryException {
+        
         HashMap<String, CoreValue> map = new HashMap<String, CoreValue>();
         for (Entry<String, Value> e : bindVariableMap.entrySet()) {
             map.put(e.getKey(), ValueConverter.convert(e.getValue()));

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
Wed Apr 11 13:16:21 2012
@@ -18,14 +18,15 @@
  */
 package org.apache.jackrabbit.oak.jcr.query;
 
-import java.util.Iterator;
+import org.apache.jackrabbit.commons.iterator.RowIteratorAdapter;
+import org.apache.jackrabbit.oak.api.Result;
+import org.apache.jackrabbit.oak.api.ResultRow;
+
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.RowIterator;
-import org.apache.jackrabbit.commons.iterator.RowIteratorAdapter;
-import org.apache.jackrabbit.oak.api.Result;
-import org.apache.jackrabbit.oak.api.ResultRow;
+import java.util.Iterator;
 
 /**
  * The implementation of the corresponding JCR interface.
@@ -52,7 +53,7 @@ public class QueryResultImpl implements 
     public RowIterator getRows() throws RepositoryException {
         Iterator<RowImpl> it = new Iterator<RowImpl>() {
 
-            private Iterator<? extends ResultRow> it = result.getRows().iterator();
+            private final Iterator<? extends ResultRow> it = result.getRows().iterator();
 
             @Override
             public boolean hasNext() {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java
Wed Apr 11 13:16:21 2012
@@ -18,13 +18,13 @@
  */
 package org.apache.jackrabbit.oak.jcr.query;
 
-import javax.jcr.ItemNotFoundException;
+import org.apache.jackrabbit.oak.api.ResultRow;
+import org.apache.jackrabbit.oak.query.CoreValue;
+
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.query.Row;
-import org.apache.jackrabbit.oak.api.ResultRow;
-import org.apache.jackrabbit.oak.query.CoreValue;
 
 /**
  * The implementation of the corresponding JCR interface.
@@ -37,38 +37,46 @@ public class RowImpl implements Row {
         this.row = row;
     }
 
+    @Override
     public Node getNode() throws RepositoryException {
         // TODO row node
         return null;
     }
 
+    @Override
     public Node getNode(String selectorName) throws RepositoryException {
         // TODO row node
         return null;
     }
 
+    @Override
     public String getPath() throws RepositoryException {
         return row.getPath();
     }
 
+    @Override
     public String getPath(String selectorName) throws RepositoryException {
         return row.getPath(selectorName);
     }
 
+    @Override
     public double getScore() throws RepositoryException {
         // TODO row score
         return 0;
     }
 
+    @Override
     public double getScore(String selectorName) throws RepositoryException {
         // TODO row score
         return 0;
     }
 
-    public Value getValue(String columnName) throws ItemNotFoundException, RepositoryException
{
+    @Override
+    public Value getValue(String columnName) throws RepositoryException {
         return ValueConverter.convert(row.getValue(columnName));
     }
 
+    @Override
     public Value[] getValues() throws RepositoryException {
         CoreValue[] values = row.getValues();
         int len = values.length;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/ValueConverter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/ValueConverter.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/ValueConverter.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/ValueConverter.java
Wed Apr 11 13:16:21 2012
@@ -18,14 +18,15 @@
  */
 package org.apache.jackrabbit.oak.jcr.query;
 
+import org.apache.jackrabbit.commons.SimpleValueFactory;
+import org.apache.jackrabbit.oak.query.CoreValue;
+import org.apache.jackrabbit.oak.query.CoreValueFactory;
+
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 import javax.jcr.ValueFormatException;
-import org.apache.jackrabbit.commons.SimpleValueFactory;
-import org.apache.jackrabbit.oak.query.CoreValue;
-import org.apache.jackrabbit.oak.query.CoreValueFactory;
 
 /**
  * Convert values to the jcr-core flavor.
@@ -35,6 +36,9 @@ public class ValueConverter {
     private static final CoreValueFactory coreValueFactory = new CoreValueFactory();
     private static final ValueFactory jcrValueFactory = new SimpleValueFactory();
 
+    private ValueConverter() {
+    }
+
     public static CoreValue convert(Value v) throws RepositoryException {
         switch (v.getType()) {
         case PropertyType.BINARY:

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/ColumnImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/ColumnImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/ColumnImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/ColumnImpl.java
Wed Apr 11 13:16:21 2012
@@ -33,14 +33,17 @@ public class ColumnImpl extends QOMNode 
         this.columnName = columnName;
     }
 
+    @Override
     public String getColumnName() {
         return columnName;
     }
 
+    @Override
     public String getPropertyName() {
         return propertyName;
     }
 
+    @Override
     public String getSelectorName() {
         return selectorName;
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinImpl.java
Wed Apr 11 13:16:21 2012
@@ -21,9 +21,9 @@ import javax.jcr.query.qom.Join;
 public class JoinImpl extends SourceImpl implements Join {
 
     private final JoinConditionImpl joinCondition;
-    private JoinType joinType;
-    private SourceImpl left;
-    private SourceImpl right;
+    private final JoinType joinType;
+    private final SourceImpl left;
+    private final SourceImpl right;
 
     public JoinImpl(SourceImpl left, SourceImpl right, JoinType joinType,
             JoinConditionImpl joinCondition) {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelFactoryImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelFactoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelFactoryImpl.java
Wed Apr 11 13:16:21 2012
@@ -51,95 +51,117 @@ import javax.jcr.query.qom.UpperCase;
  */
 public class QueryObjectModelFactoryImpl implements QueryObjectModelFactory {
 
+    @Override
     public AndImpl and(Constraint constraint1, Constraint constraint2) {
         return new AndImpl((ConstraintImpl) constraint1, (ConstraintImpl) constraint2);
     }
 
+    @Override
     public OrderingImpl ascending(DynamicOperand operand) {
         return new OrderingImpl((DynamicOperandImpl) operand, Order.ASCENDING);
     }
 
+    @Override
     public BindVariableValueImpl bindVariable(String bindVariableName) {
         return new BindVariableValueImpl(bindVariableName);
     }
 
+    @Override
     public ChildNode childNode(String selectorName, String path) {
         return new ChildNodeImpl(selectorName, path);
     }
 
+    @Override
     public ChildNodeJoinCondition childNodeJoinCondition(String childSelectorName, String
parentSelectorName)
             {
         return new ChildNodeJoinConditionImpl(childSelectorName, parentSelectorName);
     }
 
+    @Override
     public Column column(String selectorName, String propertyName, String columnName) {
         return new ColumnImpl(selectorName, propertyName, columnName);
     }
 
+    @Override
     public Comparison comparison(DynamicOperand operand1, String operator, StaticOperand
operand2)
             {
         return new ComparisonImpl((DynamicOperandImpl) operand1, Operator.getOperatorByName(operator),
(StaticOperandImpl) operand2);
     }
 
+    @Override
     public DescendantNode descendantNode(String selectorName, String path) {
         return new DescendantNodeImpl(selectorName, path);
     }
 
+    @Override
     public DescendantNodeJoinCondition descendantNodeJoinCondition(String descendantSelectorName,
             String ancestorSelectorName) {
         return new DescendantNodeJoinConditionImpl(descendantSelectorName, ancestorSelectorName);
     }
 
+    @Override
     public Ordering descending(DynamicOperand operand) {
         return new OrderingImpl((DynamicOperandImpl) operand, Order.DESCENDING);
     }
 
+    @Override
     public EquiJoinCondition equiJoinCondition(String selector1Name, String property1Name,
String selector2Name,
             String property2Name) {
         return new EquiJoinConditionImpl(selector1Name, property1Name, selector2Name, property2Name);
     }
 
+    @Override
     public FullTextSearch fullTextSearch(String selectorName, String propertyName,
             StaticOperand fullTextSearchExpression) {
         return new FullTextSearchImpl(selectorName, propertyName, (StaticOperandImpl) fullTextSearchExpression);
     }
 
+    @Override
     public FullTextSearchScore fullTextSearchScore(String selectorName) {
         return new FullTextSearchScoreImpl(selectorName);
     }
 
+    @Override
     public Join join(Source left, Source right, String joinType, JoinCondition joinCondition)
{
         return new JoinImpl((SourceImpl) left, (SourceImpl) right, JoinType.getJoinTypeByName(joinType),
(JoinConditionImpl) joinCondition);
     }
 
+    @Override
     public Length length(PropertyValue propertyValue) {
         return new LengthImpl((PropertyValueImpl) propertyValue);
     }
 
+    @Override
     public Literal literal(Value literalValue) {
         return new LiteralImpl(literalValue);
     }
 
+    @Override
     public LowerCase lowerCase(DynamicOperand operand) {
         return new LowerCaseImpl((DynamicOperandImpl) operand);
     }
 
+    @Override
     public NodeLocalName nodeLocalName(String selectorName) {
         return new NodeLocalNameImpl(selectorName);
     }
 
+    @Override
     public NodeName nodeName(String selectorName) {
         return new NodeNameImpl(selectorName);
     }
 
+    @Override
     public Not not(Constraint constraint) {
         return new NotImpl((ConstraintImpl) constraint);
     }
 
+    @Override
     public Or or(Constraint constraint1, Constraint constraint2) {
         return new OrImpl((ConstraintImpl) constraint1, (ConstraintImpl) constraint2);
     }
 
+    @Override
     public PropertyExistence propertyExistence(String selectorName, String propertyName)
{
         return new PropertyExistenceImpl(selectorName, propertyName);
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
Wed Apr 11 13:16:21 2012
@@ -13,13 +13,12 @@
  */
 package org.apache.jackrabbit.oak.jcr.query.qom;
 
-import java.util.ArrayList;
-import java.util.HashMap;
+import org.apache.jackrabbit.commons.SimpleValueFactory;
+
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
-import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.qom.Column;
 import javax.jcr.query.qom.Constraint;
@@ -27,7 +26,8 @@ import javax.jcr.query.qom.Ordering;
 import javax.jcr.query.qom.QueryObjectModel;
 import javax.jcr.query.qom.Selector;
 import javax.jcr.query.qom.Source;
-import org.apache.jackrabbit.commons.SimpleValueFactory;
+import java.util.ArrayList;
+import java.util.HashMap;
 
 /**
  * The implementation of the corresponding JCR interface.
@@ -106,7 +106,7 @@ public class QueryObjectModelImpl implem
     }
 
     @Override
-    public QueryResult execute() throws InvalidQueryException, RepositoryException {
+    public QueryResult execute() throws RepositoryException {
         // TODO Auto-generated method stub
         return null;
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SelectorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SelectorImpl.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SelectorImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SelectorImpl.java
Wed Apr 11 13:16:21 2012
@@ -32,10 +32,12 @@ public class SelectorImpl extends Source
         this.selectorName = selectorName;
     }
 
+    @Override
     public String getNodeTypeName() {
         return nodeTypeName;
     }
 
+    @Override
     public String getSelectorName() {
         return selectorName;
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/qom/QomTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/qom/QomTest.java?rev=1324752&r1=1324751&r2=1324752&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/qom/QomTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/query/qom/QomTest.java
Wed Apr 11 13:16:21 2012
@@ -18,7 +18,9 @@
  */
 package org.apache.jackrabbit.oak.jcr.query.qom;
 
-import static org.junit.Assert.assertEquals;
+import org.apache.jackrabbit.commons.SimpleValueFactory;
+import org.junit.Test;
+
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
@@ -53,22 +55,15 @@ import javax.jcr.query.qom.SameNodeJoinC
 import javax.jcr.query.qom.Selector;
 import javax.jcr.query.qom.Source;
 import javax.jcr.query.qom.UpperCase;
-import org.apache.jackrabbit.commons.SimpleValueFactory;
-import org.junit.Before;
-import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 /**
  * Tests the QueryObjectModelFactory and other QOM classes.
  */
 public class QomTest {
-
-    QueryObjectModelFactory f = new QueryObjectModelFactoryImpl();
-    private ValueFactory vf;
-
-    @Before
-    public void setup() {
-        vf = new SimpleValueFactory();
-    }
+    private final QueryObjectModelFactory f = new QueryObjectModelFactoryImpl();
+    private final ValueFactory vf = new SimpleValueFactory();
 
     @Test
     public void and() throws RepositoryException {



Mime
View raw message