Author: gk
Date: Wed Jul 15 15:03:46 2020
New Revision: 1879896

URL: http://svn.apache.org/viewvc?rev=1879896&view=rev
Log:
- fix security and update ant to 1.10.8
- replace ObjectUtils.equals with Objects.equals
- remove unused import
- update rulesets in pmd
- Update README.md
- fix javadoc warning in setterReferencingObject.vm

Modified:
    db/torque/torque4/trunk/README.md
    db/torque/torque4/trunk/pom.xml
    db/torque/torque4/trunk/torque-ant-tasks/pom.xml
    
db/torque/torque4/trunk/torque-ant-tasks/src/test/java/org/apache/torque/ant/task/TorqueGeneratorTaskTest.java
    
db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java
    
db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java
    
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
    
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java
    
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/bean/base/setterReferencingObject.vm
    db/torque/torque4/trunk/torque-test/README.md
    db/torque/torque4/trunk/torque-test/pom.xml
    
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java
    
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java
    
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ClobTest.java
    
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java

Modified: db/torque/torque4/trunk/README.md
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/README.md?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- db/torque/torque4/trunk/README.md (original)
+++ db/torque/torque4/trunk/README.md Wed Jul 15 15:03:46 2020
@@ -52,6 +52,12 @@ You need the ant tool installed.
 
 *Torque-test* allows to test against databases and provides a 
[README](torque-test/README.md) of its own. You need the ant tool installed.
 
+You may start Torque-Test module in the root by this command (with default 
database derbyEmbedded)
+
+```sh
+mvn clean install -PderbyEmbedded,test,beans,managers
+```
+
 #### Site module
 
 *Torque-site* is used to generate the site (add post-site to merge the 
documentation of dependend modules. You need the ant tool installed.
@@ -65,3 +71,24 @@ mvn site post-site
 - *Torque-maven-plugin* provides a Maven plugin (generator).
 
 - *Torque-ant-tasks* is to provide some ant tasks to generate the Torque 
artefacts (xml, java, sql).
+
+To build all with checksums run in root 
+
+```sh
+mvn clean install -Papache-release,beans,managers,owasp
+```
+
+You need to add at least one "database" profile (setting torque.driver).
+
+#### Provided  database profiles
+
+- derby
+- derbyEmbedded
+- hsqldb
+- mssql
+- mysql
+- oracle
+- postgresql
+- derbyEmbedded-jenkins: derby profile with default settings. Can only be run 
from parent project with `mvn -Ptest,derbyEmbedded-jenkins install`
+- hsqldb-jenkins: see above
+- apache-release: sets as database derbyEmbedded

Modified: db/torque/torque4/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/pom.xml?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- db/torque/torque4/trunk/pom.xml (original)
+++ db/torque/torque4/trunk/pom.xml Wed Jul 15 15:03:46 2020
@@ -544,7 +544,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-pmd-plugin</artifactId>
-          <version>3.10.0</version>
+          <version>3.13.0</version>
           <configuration>
             <linkXref>true</linkXref>
             <targetJdk>${maven.compiler.source}</targetJdk>
@@ -598,6 +598,14 @@
             <executable>${torque.compiler.javac}</executable>
           </configuration>
         </plugin>
+        <plugin>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>3.2.0</version>
+        <configuration>
+            <additionalparam>-Xdoclint:none</additionalparam>
+            <source>1.8</source>
+        </configuration>
+      </plugin>
       </plugins>
     </pluginManagement>
   </build>
@@ -606,11 +614,6 @@
     <plugins>
       <plugin>
         <artifactId>maven-javadoc-plugin</artifactId>
-        <version>3.2.0</version>
-        <configuration>
-            <additionalparam>-Xdoclint:none</additionalparam>
-            <source>1.8</source>
-        </configuration>
       </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
@@ -630,15 +633,20 @@
       <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
-         <version>3.13.0</version>
          <configuration>
              <minimumTokens>200</minimumTokens>
                 <rulesets>
+              <ruleset>/category/java/bestpractices.xml</ruleset>
+                <ruleset>/category/java/codestyle.xml</ruleset>
+                <ruleset>/category/java/errorprone.xml</ruleset>
+                <ruleset>/category/java/multithreading.xml</ruleset>
+              <ruleset>/category/java/performance.xml</ruleset>
+              <ruleset>/category/java/design.xml</ruleset>
                     <!-- comment default rule sets: basic, imports, unusedcode 
-->
-                <ruleset>/rulesets/java/basic.xml</ruleset>
+                <!--ruleset>/rulesets/java/basic.xml</ruleset>
                 <ruleset>/rulesets/java/finalizers.xml</ruleset>
                 <ruleset>/rulesets/java/imports.xml</ruleset>
-                <ruleset>/rulesets/java/unusedcode.xml</ruleset>
+                <ruleset>/rulesets/java/unusedcode.xml</ruleset-->
                 </rulesets>
          </configuration>
       </plugin>

Modified: db/torque/torque4/trunk/torque-ant-tasks/pom.xml
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-ant-tasks/pom.xml?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-ant-tasks/pom.xml (original)
+++ db/torque/torque4/trunk/torque-ant-tasks/pom.xml Wed Jul 15 15:03:46 2020
@@ -49,11 +49,11 @@
         <artifactId>torque-templates</artifactId>
         <version>${project.version}</version>
     </dependency>
-   <!-- SOME ant tasks depends on system tools -->
+   <!-- SOME ant tasks depends on system tools, fixes  CVE-2020-1945 -->
     <dependency>
       <groupId>org.apache.ant</groupId>
       <artifactId>ant</artifactId>
-      <version>1.10.7</version>
+      <version>1.10.8</version>
       <scope>provided</scope>
       <exclusions> 
         <exclusion>

Modified: 
db/torque/torque4/trunk/torque-ant-tasks/src/test/java/org/apache/torque/ant/task/TorqueGeneratorTaskTest.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-ant-tasks/src/test/java/org/apache/torque/ant/task/TorqueGeneratorTaskTest.java?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-ant-tasks/src/test/java/org/apache/torque/ant/task/TorqueGeneratorTaskTest.java
 (original)
+++ 
db/torque/torque4/trunk/torque-ant-tasks/src/test/java/org/apache/torque/ant/task/TorqueGeneratorTaskTest.java
 Wed Jul 15 15:03:46 2020
@@ -37,8 +37,6 @@ import java.util.StringTokenizer;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.log4j.BasicConfigurator;
-import 
org.apache.torque.templates.transformer.jdbc2schema.Jdbc2SchemaOptionName;
-import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.xmlunit.builder.DiffBuilder;
 import org.xmlunit.diff.DefaultNodeMatcher;
@@ -72,7 +70,7 @@ public class TorqueGeneratorTaskTest
     }
     
     /**
-     * @see Jdbc2SchemaTest in torque-templates
+     * compare org.apache.torque.templates.jdbc2schema.Jdbc2SchemaTest.java in 
torque-templates
      * 
      * @throws Exception
      */

Modified: 
db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java
 (original)
+++ 
db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java
 Wed Jul 15 15:03:46 2020
@@ -21,7 +21,6 @@ package org.apache.torque.generator.cont
 
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -34,10 +33,6 @@ import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.config.ConfigurationFactory;
-import org.apache.logging.log4j.core.config.ConfigurationSource;
 import org.apache.torque.generator.GeneratorException;
 import org.apache.torque.generator.configuration.Configuration;
 import org.apache.torque.generator.configuration.ConfigurationException;

Modified: 
db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java
 (original)
+++ 
db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java
 Wed Jul 15 15:03:46 2020
@@ -1,5 +1,7 @@
 package org.apache.torque.generator.source;
 
+import java.util.Objects;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -24,7 +26,6 @@ import org.apache.commons.jxpath.ri.QNam
 import org.apache.commons.jxpath.ri.compiler.NodeTest;
 import org.apache.commons.jxpath.ri.compiler.NodeTypeTest;
 import org.apache.commons.jxpath.ri.model.NodePointer;
-import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
 
 /**
@@ -189,7 +190,7 @@ public class SourceElementAttributePoint
         {
             return false;
         }
-        return ObjectUtils.equals(name, other.name);
+        return Objects.equals(name, other.name);
     }
 
     @Override

Modified: 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
 (original)
+++ 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
 Wed Jul 15 15:03:46 2020
@@ -22,8 +22,7 @@ package org.apache.torque.om;
 import java.sql.Types;
 import java.util.ArrayList;
 import java.util.List;
-
-import org.apache.commons.lang3.ObjectUtils;
+import java.util.Objects;
 
 /**
  * This class can be used as an ObjectKey to uniquely identify an
@@ -234,7 +233,7 @@ public class ComboKey extends ObjectKey<
                 isEqual = key.length == keys2.length;
                 for (int i = 0; i < key.length && isEqual; i++)
                 {
-                    isEqual &= ObjectUtils.equals(key[i], keys2[i]);
+                    isEqual &= Objects.equals(key[i], keys2[i]);
                 }
             }
             else if (keyObj instanceof SimpleKey[])
@@ -243,7 +242,7 @@ public class ComboKey extends ObjectKey<
                 isEqual = key.length == keys2.length;
                 for (int i = 0; i < key.length && isEqual; i++)
                 {
-                    isEqual &= ObjectUtils.equals(key[i], keys2[i]);
+                    isEqual &= Objects.equals(key[i], keys2[i]);
                 }
             }
         }

Modified: 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java
 (original)
+++ 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java
 Wed Jul 15 15:03:46 2020
@@ -22,8 +22,8 @@ package org.apache.torque.util.functions
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 
-import org.apache.commons.lang3.ObjectUtils;
 import org.apache.torque.Column;
 
 /**
@@ -194,7 +194,7 @@ public abstract class AbstractFunction i
             {
                 Column column = (Column) argument;
                 if (columnFound
-                        && !ObjectUtils.equals(tableName, 
column.getTableName()))
+                        && !Objects.equals(tableName, column.getTableName()))
                 {
                     // cannot determine unique table name, return null
                     return null;
@@ -224,7 +224,7 @@ public abstract class AbstractFunction i
             {
                 Column column = (Column) argument;
                 if (columnFound
-                        && !ObjectUtils.equals(schemaName, 
column.getSchemaName()))
+                        && !Objects.equals(schemaName, column.getSchemaName()))
                 {
                     // cannot determine unique schema name, return null
                     return null;
@@ -256,7 +256,7 @@ public abstract class AbstractFunction i
             {
                 Column column = (Column) argument;
                 if (columnFound
-                        && !ObjectUtils.equals(
+                        && !Objects.equals(
                                 fullTableName,
                                 column.getFullTableName()))
                 {

Modified: 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/bean/base/setterReferencingObject.vm
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/bean/base/setterReferencingObject.vm?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/bean/base/setterReferencingObject.vm
 (original)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/bean/base/setterReferencingObject.vm
 Wed Jul 15 15:03:46 2020
@@ -32,7 +32,7 @@
      * $description
 #end
      *
-     * @param v new value
+     * @param list new value
      */
     public void ${setter}($fieldType list)
     {

Modified: db/torque/torque4/trunk/torque-test/README.md
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/README.md?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/README.md (original)
+++ db/torque/torque4/trunk/torque-test/README.md Wed Jul 15 15:03:46 2020
@@ -38,7 +38,7 @@ src/test/profile/<database>/
 
 #### Maven profiles
 
-Each database proifle is mapped to a Maven profile, but additional maven 
profiles exist:
+Each database profile is mapped to a Maven profile, but additional maven 
profiles exist:
 
 - derbyEmbedded-jenkins: derby profile with default settings. Can only be run 
from parent project with `mvn -Ptest,derbyEmbedded-jenkins install` because 
database url is adjusted to this start location
 

Modified: db/torque/torque4/trunk/torque-test/pom.xml
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/pom.xml?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/pom.xml (original)
+++ db/torque/torque4/trunk/torque-test/pom.xml Wed Jul 15 15:03:46 2020
@@ -609,6 +609,7 @@
             <exclude>src/main/generated-java/**/*</exclude>
             <exclude>docker-java.properties</exclude><!-- ignored, not 
template -->
             <exclude>**/torque.usersettings.properties</exclude>
+            <exclude>torque-test/target/**</exclude><!-- generated derby -->
           </excludes>
         </configuration>
         <executions>

Modified: 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java
 (original)
+++ 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java
 Wed Jul 15 15:03:46 2020
@@ -1,5 +1,8 @@
 package org.apache.torque.datatypes;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -35,13 +38,6 @@ import org.apache.torque.util.JdbcTypedV
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-
 
 /**
  * Tests the data types BOOLEANINT and BOOLEANCHAR.

Modified: 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java
 (original)
+++ 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java
 Wed Jul 15 15:03:46 2020
@@ -1,5 +1,10 @@
 package org.apache.torque.datatypes;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -32,12 +37,6 @@ import org.apache.torque.om.Persistent;
 import org.apache.torque.util.BasePeerImpl;
 import org.junit.jupiter.params.provider.ArgumentsSource;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertNull;
-
 
 
 /**

Modified: 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ClobTest.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ClobTest.java?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ClobTest.java
 (original)
+++ 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ClobTest.java
 Wed Jul 15 15:03:46 2020
@@ -1,5 +1,7 @@
 package org.apache.torque.datatypes;
 
+import static org.junit.Assert.assertEquals;
+
 import java.util.List;
 
 import org.apache.torque.BaseDatabaseTestCase;
@@ -8,12 +10,6 @@ import org.apache.torque.criteria.Criter
 import org.apache.torque.test.dbobject.ClobType;
 import org.apache.torque.test.peer.ClobTypePeer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertNull;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Modified: 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java?rev=1879896&r1=1879895&r2=1879896&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java
 (original)
+++ 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java
 Wed Jul 15 15:03:46 2020
@@ -1,5 +1,10 @@
 package org.apache.torque.om;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -32,12 +37,6 @@ import org.apache.torque.test.peer.Types
 import org.apache.torque.test.peer.TypesPrimitivePeer;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertNotNull;
-
 /**
  * Test the various setBy and getBy methods that can be used to access field
  * values.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to