You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2020/04/22 14:54:34 UTC

[cxf] 01/04: cxf-services-sts-core: avoid null assignment

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

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

commit 16e0e3d42fa3cb27fa289cbfe87f90855649dc32
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Fri Apr 3 17:09:24 2020 +0300

    cxf-services-sts-core: avoid null assignment
---
 .../main/java/org/apache/cxf/sts/operation/AbstractOperation.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
index 0b4b80c..6404f94 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
@@ -380,7 +380,7 @@ public abstract class AbstractOperation {
         builder.setKeyIdentifierType(encryptionProperties.getKeyIdentifierType());
         builder.setKeyEncAlgo(keyWrapAlgorithm);
 
-        SecretKey symmetricKey = null;
+        final SecretKey symmetricKey;
         if (secret != null) {
             symmetricKey = KeyUtils.prepareSecretKey(encryptionProperties.getEncryptionAlgorithm(), secret);
         } else {
@@ -531,7 +531,7 @@ public abstract class AbstractOperation {
 
         TokenValidatorResponse tokenResponse = null;
         for (TokenValidator tokenValidator : tokenValidators) {
-            boolean canHandle = false;
+            final boolean canHandle;
             if (realm == null) {
                 canHandle = tokenValidator.canHandleToken(token);
             } else {
@@ -625,7 +625,7 @@ public abstract class AbstractOperation {
                 }
                 if (relationship == null || relationship.getType().equals(Relationship.FED_TYPE_IDENTITY)) {
                     // federate identity
-                    IdentityMapper identityMapper = null;
+                    final IdentityMapper identityMapper;
                     if (relationship == null) {
                         identityMapper = stsProperties.getIdentityMapper();
                     } else {