You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2022/07/12 20:39:13 UTC

[jspwiki] branch master updated (d3d54c88d -> 5ed57bd79)

This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git


    from d3d54c88d * Use diamond type <>. * Remove unnecessary boxing. * Remove unnecessary unboxing. * Replace 'String.indexOf()' expression with 'contains()'. * Replace 'for' loop with enhanced 'for' loop.
     new 8f50025a4 Make final variable when is possible.
     new 5ed57bd79 remove extra semicolon.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 jspwiki-main/src/main/java/org/apache/wiki/pages/PageSorter.java | 2 +-
 jspwiki-util/src/main/java/org/apache/wiki/util/CryptoUtil.java  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)


[jspwiki] 01/02: Make final variable when is possible.

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 8f50025a42cb282689626fd7889ab79593d0aaef
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Fri Jun 24 22:38:16 2022 +0200

    Make final variable when is possible.
---
 jspwiki-util/src/main/java/org/apache/wiki/util/CryptoUtil.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/jspwiki-util/src/main/java/org/apache/wiki/util/CryptoUtil.java b/jspwiki-util/src/main/java/org/apache/wiki/util/CryptoUtil.java
index 52a19e1b9..ad44cf8b0 100644
--- a/jspwiki-util/src/main/java/org/apache/wiki/util/CryptoUtil.java
+++ b/jspwiki-util/src/main/java/org/apache/wiki/util/CryptoUtil.java
@@ -177,7 +177,7 @@ public final class CryptoUtil
         //The term SSHA is used as a password prefix for backwards compatibility, but we use SHA-1 when fetching an instance
         //of MessageDigest, as it is the guaranteed option. We also need to remove curly braces surrounding the string for
         //backwards compatibility.
-        String algorithmToUse = algorithm.equals(SSHA) ? SHA1 : algorithm;
+        final String algorithmToUse = algorithm.equals(SSHA) ? SHA1 : algorithm;
         final MessageDigest digest = MessageDigest.getInstance( algorithmToUse.substring( 1, algorithmToUse.length() -1 ) );
         digest.update( password );
         final byte[] hash = digest.digest( salt );
@@ -205,7 +205,7 @@ public final class CryptoUtil
         {
             throw new IllegalArgumentException( "Hash not prefixed by expected algorithm; is it really a salted hash?" );
         }
-        String algorithm = entry.startsWith( SSHA ) ? SSHA : SHA256;
+        final String algorithm = entry.startsWith( SSHA ) ? SSHA : SHA256;
 
         final byte[] challenge = Base64.getDecoder().decode( entry.substring( algorithm.length() )
                 .getBytes( StandardCharsets.UTF_8 ) );
@@ -218,7 +218,7 @@ public final class CryptoUtil
         // The term SSHA is used as a password prefix for backwards compatibility, but we use SHA-1 when fetching an instance
         // of MessageDigest, as it is the guaranteed option. We also need to remove curly braces surrounding the string for
         // backwards compatibility.
-        String algorithmToUse = algorithm.equals(SSHA) ? SHA1 : algorithm;
+        final String algorithmToUse = algorithm.equals(SSHA) ? SHA1 : algorithm;
         final MessageDigest digest = MessageDigest.getInstance( algorithmToUse.substring( 1, algorithmToUse.length() -1 ) );
         digest.update( password );
         final byte[] hash = digest.digest( salt );


[jspwiki] 02/02: remove extra semicolon.

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 5ed57bd793f56f90aea5dbd2a6e5d40467e2e85c
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Fri Jun 24 22:40:39 2022 +0200

    remove extra semicolon.
---
 jspwiki-main/src/main/java/org/apache/wiki/pages/PageSorter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/jspwiki-main/src/main/java/org/apache/wiki/pages/PageSorter.java b/jspwiki-main/src/main/java/org/apache/wiki/pages/PageSorter.java
index f284d75be..9a22af40a 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/pages/PageSorter.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/pages/PageSorter.java
@@ -95,7 +95,7 @@ public class PageSorter implements Comparator< String > {
         if( className != null && !className.isEmpty() ) {
             try {
                 final Class< Comparator< String > > cl = ClassUtil.findClass( "org.apache.wiki.util.comparators", className );
-                m_comparator = ClassUtil.buildInstance( cl );;
+                m_comparator = ClassUtil.buildInstance( cl );
             } catch( final Exception e ) {
                 LOG.error( "Falling back to default \"natural\" comparator", e );
             }