This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 9cfe543c81a Fix sonar issue on FirebirdAuthenticationEngine (#37987)
9cfe543c81a is described below
commit 9cfe543c81a132640ce88de0d35fac194b763730
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Feb 8 23:54:18 2026 +0800
Fix sonar issue on FirebirdAuthenticationEngine (#37987)
---
.../firebird/authentication/FirebirdAuthenticationEngine.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/proxy/frontend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/frontend/firebird/authentication/FirebirdAuthenticationEngine.java
b/proxy/frontend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/frontend/firebird/authentication/FirebirdAuthenticationEngine.java
index 7096a480fb8..cbd172e794f 100644
---
a/proxy/frontend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/frontend/firebird/authentication/FirebirdAuthenticationEngine.java
+++
b/proxy/frontend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/frontend/firebird/authentication/FirebirdAuthenticationEngine.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.proxy.frontend.firebird.authentication;
+import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import io.netty.channel.ChannelHandlerContext;
import org.apache.shardingsphere.authentication.AuthenticatorFactory;
@@ -62,8 +63,6 @@ public final class FirebirdAuthenticationEngine implements
AuthenticationEngine
private FirebirdSRPAuthenticationData authData;
- private FirebirdAuthenticationMethod plugin;
-
private AuthenticationResult currentAuthResult;
private int connectionId;
@@ -124,7 +123,8 @@ public final class FirebirdAuthenticationEngine implements
AuthenticationEngine
String username = connectPacket.getLogin();
Grantee grantee = new Grantee(username, "");
Optional<ShardingSphereUser> user = rule.findUser(grantee);
- plugin = FirebirdAuthenticationMethod.valueOf(getPluginName(rule,
user.get()));
+ Preconditions.checkState(user.isPresent());
+ FirebirdAuthenticationMethod plugin =
FirebirdAuthenticationMethod.valueOf(getPluginName(rule, user.get()));
FirebirdAuthenticationMethod userPlugin = connectPacket.getPlugin();
if (plugin != userPlugin) {
acceptPacket.setAcceptDataPacket(new byte[0], "", plugin, 0, "");