commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From van...@apache.org
Subject commons-crypto git commit: Add clirr:check target to CI build.
Date Mon, 01 Oct 2018 19:46:55 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master 057487902 -> ea5ecc369


Add clirr:check target to CI build.

- add default implementations for new interface methods that were added
- add an excludes file with an entry to ignore the current clirr failure
- disable javancss plugin since it does not like java 8 default methods

Closes #82


Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/ea5ecc36
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/ea5ecc36
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/ea5ecc36

Branch: refs/heads/master
Commit: ea5ecc369edbf4ba91986e4ede0eea170d8c94c5
Parents: 0574879
Author: Marcelo Vanzin <vanzin@cloudera.com>
Authored: Mon Oct 1 12:46:23 2018 -0700
Committer: Marcelo Vanzin <vanzin@cloudera.com>
Committed: Mon Oct 1 12:46:23 2018 -0700

----------------------------------------------------------------------
 .travis.yml                                     |  1 +
 clirr-excludes.xml                              | 26 ++++++++++++++++++++
 pom.xml                                         | 16 +++++++++++-
 .../commons/crypto/cipher/CryptoCipher.java     | 16 +++++++-----
 4 files changed, 52 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/ea5ecc36/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index dc97190..41d9766 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,6 +25,7 @@ before_install:
 script:
   - mvn apache-rat:check
   - mvn site
+  - mvn clirr:check
 
 after_success:
   - mvn clean test jacoco:report coveralls:report

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/ea5ecc36/clirr-excludes.xml
----------------------------------------------------------------------
diff --git a/clirr-excludes.xml b/clirr-excludes.xml
new file mode 100644
index 0000000..f9709de
--- /dev/null
+++ b/clirr-excludes.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   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.
+-->
+<differences>
+  <difference>
+    <!--
+      Ignore added methods to CryptoCipher interface. clirr does not detect default methods
+      introduced in Java 8.
+    -->
+    <className>org/apache/commons/crypto/cipher/CryptoCipher</className>
+    <differenceType>7012</differenceType>
+    <method>*</method>
+  </difference>
+</differences>

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/ea5ecc36/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d0a0811..1277133 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
   <parent>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-parent</artifactId>
-    <version>43</version>
+    <version>47</version>
   </parent>
 
   <groupId>org.apache.commons</groupId>
@@ -312,6 +312,13 @@ The following provides more details on the included cryptographic software:
             <artifactId>coveralls-maven-plugin</artifactId>
             <version>3.1.0</version>
           </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>clirr-maven-plugin</artifactId>
+            <configuration>
+              <ignoredDifferencesFile>${basedir}/clirr-excludes.xml</ignoredDifferencesFile>
+            </configuration>
+          </plugin>
         </plugins>
       </build>
       <reporting>
@@ -636,6 +643,13 @@ The following provides more details on the included cryptographic software:
           </excludes>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>javancss-maven-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
     </plugins>
   </reporting>
   <dependencies>

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/ea5ecc36/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java
index 668ef2f..722bc6c 100644
--- a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java
+++ b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java
@@ -34,7 +34,7 @@ import javax.crypto.ShortBufferException;
  * Note that implementations must provide a constructor that has 2 parameters:
  * <br>
  * a Properties instance and a String (transformation)
- * 
+ *
  */
 public interface CryptoCipher extends Closeable {
 
@@ -60,7 +60,7 @@ public interface CryptoCipher extends Closeable {
     /**
      * Initializes the cipher with mode, key and iv.
      *
-     * @param mode {@link javax.crypto.Cipher#ENCRYPT_MODE} or 
+     * @param mode {@link javax.crypto.Cipher#ENCRYPT_MODE} or
      *             {@link javax.crypto.Cipher#DECRYPT_MODE}
      * @param key crypto key for the cipher
      * @param params the algorithm parameters
@@ -177,8 +177,10 @@ public interface CryptoCipher extends Closeable {
      * has not been overridden by an implementation
      *
      */
-    void updateAAD(byte[] aad)
-            throws IllegalArgumentException, IllegalStateException, UnsupportedOperationException;
+    default void updateAAD(byte[] aad)
+            throws IllegalArgumentException, IllegalStateException, UnsupportedOperationException
{
+      throw new UnsupportedOperationException();
+    }
 
     /**
      * Continues a multi-part update of the Additional Authentication
@@ -203,6 +205,8 @@ public interface CryptoCipher extends Closeable {
      * has not been overridden by an implementation
      *
      */
-    void updateAAD(ByteBuffer aad)
-            throws IllegalArgumentException, IllegalStateException, UnsupportedOperationException;
+    default void updateAAD(ByteBuffer aad)
+            throws IllegalArgumentException, IllegalStateException, UnsupportedOperationException
{
+      throw new UnsupportedOperationException();
+    }
 }


Mime
View raw message