cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [06/30] cayenne git commit: CAY-2377. Cleanup deprecated code.
Date Thu, 07 Dec 2017 10:09:35 GMT
CAY-2377. Cleanup deprecated code.


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/13056c18
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/13056c18
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/13056c18

Branch: refs/heads/master
Commit: 13056c18c415682c3ea58e1b4595a1110100bf81
Parents: 0ece129
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Tue Oct 24 12:35:27 2017 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Wed Nov 15 10:27:46 2017 +0300

----------------------------------------------------------------------
 assembly/pom.xml                                |  6 --
 .../org/apache/cayenne/access/Transaction.java  | 56 ------------
 .../cayenne/access/jdbc/JDBCResultIterator.java | 21 -----
 .../java/org/apache/cayenne/exp/Expression.java | 39 ---------
 .../java/org/apache/cayenne/exp/Property.java   | 13 ---
 .../org/apache/cayenne/query/SelectQuery.java   |  2 +-
 .../exp/Expression_ParamsLegacyTest.java        | 92 --------------------
 .../org/apache/cayenne/exp/PropertyTest.java    |  9 --
 .../apache/cayenne/query/ColumnSelectIT.java    | 13 ---
 docs/doc/src/main/resources/UPGRADE.txt         | 13 ++-
 10 files changed, 13 insertions(+), 251 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/assembly/pom.xml
----------------------------------------------------------------------
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 1f5efd0..96c42e2 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -90,12 +90,6 @@
 			<version>${project.version}</version>
 		</dependency>
 
-        <dependency>
-            <groupId>org.apache.cayenne</groupId>
-            <artifactId>cayenne-java8</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
 		 <dependency>
             <groupId>org.apache.cayenne</groupId>
             <artifactId>cayenne-dbcp2</artifactId>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/cayenne-server/src/main/java/org/apache/cayenne/access/Transaction.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/Transaction.java b/cayenne-server/src/main/java/org/apache/cayenne/access/Transaction.java
deleted file mode 100644
index 779ba34..0000000
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/Transaction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.access;
-
-import org.apache.cayenne.configuration.server.ServerRuntime;
-import org.apache.cayenne.tx.BaseTransaction;
-
-/**
- * @deprecated since 4.0. For manual transaction management use
- *             {@link BaseTransaction} static methods or better -
- *             {@link ServerRuntime#performInTransaction(org.apache.cayenne.tx.TransactionalOperation)}
- *             . Also note that since 4.0 an actual Transaction is an interface
- *             located in a different package:
- *             {@link org.apache.cayenne.tx.Transaction}
- */
-@Deprecated
-public abstract class Transaction {
-
-    /**
-     * Binds a Transaction to the current thread.
-     * 
-     * @since 1.2
-     */
-    @Deprecated
-    public static void bindThreadTransaction(org.apache.cayenne.tx.Transaction transaction)
{
-        BaseTransaction.bindThreadTransaction(transaction);
-    }
-
-    /**
-     * Returns a Transaction associated with the current thread, or null if
-     * there is no such Transaction.
-     * 
-     * @since 1.2
-     */
-    @Deprecated
-    public static org.apache.cayenne.tx.Transaction getThreadTransaction() {
-        return BaseTransaction.getThreadTransaction();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java
b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java
index d6a4a34..bdd97db 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java
@@ -166,25 +166,4 @@ public class JDBCResultIterator<T> implements ResultIterator<T>
{
         }
     }
 
-    /**
-     * @deprecated since 4.0 always returns false. Connection closing is outside
-     *             the scope of this iterator. See
-     *             {@link ConnectionAwareResultIterator} for a replacement.
-     */
-    @Deprecated
-    public boolean isClosingConnection() {
-        return false;
-    }
-
-    /**
-     * Sets the <code>closingConnection</code> property.
-     * 
-     * @deprecated since 4.0 does nothing. Connection closing is outside the
-     *             scope of this iterator. See
-     *             {@link ConnectionAwareResultIterator} for a replacement.
-     */
-    @Deprecated
-    public void setClosingConnection(boolean flag) {
-        // noop
-    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java
index 9d9c47a..ce2636f 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java
@@ -337,45 +337,6 @@ public abstract class Expression implements Serializable, XMLSerializable
{
 	}
 
 	/**
-	 * A shortcut for <code>expWithParams(params, true)</code>.
-	 * 
-	 * @deprecated since 4.0 use {@link #params(Map)}
-	 */
-	@Deprecated
-	public Expression expWithParameters(Map<String, ?> parameters) {
-		return expWithParameters(parameters, true);
-	}
-
-	/**
-	 * Creates and returns a new Expression instance using this expression as a
-	 * prototype. All ExpressionParam operands are substituted with the values
-	 * in the <code>params</code> map.
-	 * <p>
-	 * <i>Null values in the <code>params</code> map should be explicitly
-	 * created in the map for the corresponding key. </i>
-	 * </p>
-	 * 
-	 * @param parameters
-	 *            a map of parameters, with each key being a string name of an
-	 *            expression parameter, and value being the value that should be
-	 *            used in the final expression.
-	 * @param pruneMissing
-	 *            If <code>true</code>, subexpressions that rely on missing
-	 *            parameters will be pruned from the resulting tree. If
-	 *            <code>false</code> , any missing values will generate an
-	 *            exception.
-	 * @return Expression resulting from the substitution of parameters with
-	 *         real values, or null if the whole expression was pruned, due to
-	 *         the missing parameters.
-	 * 
-	 * @deprecated since 4.0 use {@link #params(Map, boolean)} instead.
-	 */
-	@Deprecated
-	public Expression expWithParameters(Map<String, ?> parameters, boolean pruneMissing)
{
-		return params(parameters, pruneMissing);
-	}
-
-	/**
 	 * Creates a new expression that joins this object with another expression,
 	 * using specified join type. It is very useful for incrementally building
 	 * chained expressions, like long AND or OR statements.

http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
index 07b63a0..8260333 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
@@ -85,19 +85,6 @@ public class Property<E> {
     private final Class<? super E> type;
 
     /**
-     * Constructs a new property with the given name.
-     *
-     * @param name name of the property (usually it's obj path)
-     *
-     * @see Property#create(String, Class)
-     * @deprecated use factory method Property.create("propertyName", PropertyType.class)
-     */
-    @Deprecated
-	public Property(final String name) {
-        this(name, null);
-    }
-
-    /**
      * Constructs a new property with the given name and type.
      *
      * @param name of the property (usually it's obj path)

http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java b/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java
index b2d5bd1..da8b83d 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java
@@ -446,7 +446,7 @@ public class SelectQuery<T> extends AbstractQuery implements ParameterizedQuery,
 	 * Returns a query built using this query as a prototype, using a set of
 	 * parameters to build the qualifier.
 	 * 
-	 * @see org.apache.cayenne.exp.Expression#expWithParameters(java.util.Map,
+	 * @see org.apache.cayenne.exp.Expression#params(java.util.Map,
 	 *      boolean) parameter substitution.
 	 */
 	public SelectQuery<T> queryWithParameters(Map<String, ?> parameters, boolean
pruneMissing) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/cayenne-server/src/test/java/org/apache/cayenne/exp/Expression_ParamsLegacyTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/Expression_ParamsLegacyTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/exp/Expression_ParamsLegacyTest.java
deleted file mode 100644
index efe4667..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/Expression_ParamsLegacyTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.exp;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.HashMap;
-
-import org.junit.Test;
-
-/**
- * Testing deprecated Expression.expWithParameters(..) API.
- * 
- * @deprecated since 4.0
- */
-@Deprecated
-public class Expression_ParamsLegacyTest {
-
-	@SuppressWarnings("serial")
-	@Test
-	public void testExpWithParams_Prune() throws Exception {
-		Expression e = ExpressionFactory
-				.exp("k1 = $test or k2 = $v2 or k3 = $v3");
-
-		Expression ep = e.expWithParameters(new HashMap<String, Object>() {
-			{
-				put("test", "T");
-				put("v2", "K");
-				put("v3", 5);
-			}
-		}, true);
-
-		assertEquals("(k1 = \"T\") or (k2 = \"K\") or (k3 = 5)", ep.toString());
-	}
-
-	@SuppressWarnings("serial")
-	@Test
-	public void testExpWithParams_PrunePartial() throws Exception {
-		Expression e = ExpressionFactory
-				.exp("k1 = $test or k2 = $v2 or k3 = $v3");
-
-		Expression ep = e.expWithParameters(new HashMap<String, Object>() {
-			{
-				put("test", "T");
-				put("v3", 5);
-			}
-		}, true);
-
-		assertEquals("(k1 = \"T\") or (k3 = 5)", ep.toString());
-	}
-
-	@SuppressWarnings("serial")
-	@Test
-	public void testExpWithParams_NoPrune() throws Exception {
-		Expression e = ExpressionFactory
-				.exp("k1 = $test or k2 = $v2 or k3 = $v3");
-
-		Expression ep = e.expWithParameters(new HashMap<String, Object>() {
-			{
-				put("test", "T");
-				put("v2", "K");
-				put("v3", 5);
-			}
-		}, false);
-
-		assertEquals("(k1 = \"T\") or (k2 = \"K\") or (k3 = 5)", ep.toString());
-	}
-
-	@Test(expected = ExpressionException.class)
-	public void testExpWithParams_NoPrune_Partial() throws Exception {
-		Expression e = ExpressionFactory
-				.exp("k1 = $test or k2 = $v2 or k3 = $v3");
-		e.expWithParameters(new HashMap<String, Object>(), false);
-	}
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java
index 83b5868..4260bf6 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java
@@ -288,15 +288,6 @@ public class PropertyTest {
         assertEquals("test.path", ex.toString());
     }
 
-    @SuppressWarnings("deprecation")
-    @Test
-    public void testDeprecatedConstruct() {
-        Property<String> p = new Property<>("p");
-        assertNull(p.getType());
-        assertEquals("p", p.getName());
-        assertEquals(new ASTObjPath("p"), p.getExpression());
-    }
-
     @Test
     public void testCreationWithName() {
         Property<String> p1 = new Property<>("p1", String.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/cayenne-server/src/test/java/org/apache/cayenne/query/ColumnSelectIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/ColumnSelectIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/ColumnSelectIT.java
index fe4edba..84fadd4 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/ColumnSelectIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/ColumnSelectIT.java
@@ -1007,19 +1007,6 @@ public class ColumnSelectIT extends ServerCase {
     }
 
     /*
-     * Test deprecated property constructor
-     */
-
-    @Test
-    @SuppressWarnings("deprecation")
-    public void testDeprecateConstructor() {
-        Property<String> property = new Property<>("artistName");
-        List<String> names = ObjectSelect.columnQuery(Artist.class, property).select(context);
-        assertEquals(20, names.size());
-    }
-
-
-    /*
      * Test selection from nested context
      */
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/13056c18/docs/doc/src/main/resources/UPGRADE.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/UPGRADE.txt b/docs/doc/src/main/resources/UPGRADE.txt
index 4c720e8..a5635bf 100644
--- a/docs/doc/src/main/resources/UPGRADE.txt
+++ b/docs/doc/src/main/resources/UPGRADE.txt
@@ -98,7 +98,18 @@ UPGRADING TO 4.1.M2
       - removed from org.apache.cayenne.lifecycle.db and org.apache.cayenne.lifecycle.db.auto
classes with @Audit annotation;
       - removed Audit db-entities, obj-entities and relationships from lifecycle-map.map.xml;
       - removed org.apache.cayenne.lifecycle.unit {no usage};
-
+      - removed org.apache.cayenne.access.Transaction {since 4.0. For manual transaction
management use BaseTransaction or
+      ServerRuntime#performInTransaction(org.apache.cayenne.tx.TransactionalOperation) Also
note that since 4.0 an actual Transaction is an interface
+      located in a different package: org.apache.cayenne.tx.Transaction};
+      - removed boolean isClosingConnection(); void setClosingConnection(boolean flag) {since
4.0 always returns false; since 4.0 does nothing.
+      Connection closing is outside the scope of this iterator. See ConnectionAwareResultIterator}
in org.apache.cayenne.jdbc.JDBCResultIterator;
+      - removed Expression expWithParameters(Map<String, ?> parameters) {since 4.0
use #params(Map)} in org.apache.cayenne.exp.Expression;
+      - removed Expression expWithParameters(Map<String, ?> parameters, boolean pruneMissing)
{since 4.0 use #params(Map, boolean)}
+      in org.apache.cayenne.exp.Expression;
+      - removed org.apache.cayenne.exp.Expression_ParamsLegacyTest;
+      - removed Property(final String name) {use factory method Property.create("propertyName",
PropertyType.class)} in org.apache.cayenne.exp.Property;
+      - removed void testDeprecatedConstruct(); in org.apache.cayenne.exp.PropertyTest;
+      - removed void testDeprecatedConstruct(); in org.apache.cayenne.query.ColumnSelectIT;
 
 
 UPGRADING TO 4.1.M1


Mime
View raw message