From 79e58f29519cd28efd0edf12b9fefa275718f971 Mon Sep 17 00:00:00 2001 From: Rahul Sharma Date: Tue, 2 Jan 2024 22:28:56 +0530 Subject: [PATCH] Review Comments --- .../io/cdap/plugin/oracle/OracleConstants.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleConstants.java b/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleConstants.java index ebaf8447..99ba9116 100644 --- a/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleConstants.java +++ b/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleConstants.java @@ -16,6 +16,8 @@ package io.cdap.plugin.oracle; +import javax.annotation.Nullable; + /** * Oracle Constants. */ @@ -47,17 +49,17 @@ private OracleConstants() { * @return Connection String based on the given ConnectionType */ public static String getConnectionString(String connectionType, - String host, - int port, + @Nullable String host, + @Nullable int port, String database) { if (OracleConstants.TNS_CONNECTION_TYPE.equalsIgnoreCase(connectionType)) { return String.format(OracleConstants.ORACLE_CONNECTION_STRING_TNS_FORMAT, database); - } else if (OracleConstants.SERVICE_CONNECTION_TYPE.equalsIgnoreCase(connectionType)) { + } + if (OracleConstants.SERVICE_CONNECTION_TYPE.equalsIgnoreCase(connectionType)) { return String.format(OracleConstants.ORACLE_CONNECTION_STRING_SERVICE_NAME_FORMAT, host, port, database); - } else { - return String.format(OracleConstants.ORACLE_CONNECTION_STRING_SID_FORMAT, - host, port, database); } + return String.format(OracleConstants.ORACLE_CONNECTION_STRING_SID_FORMAT, + host, port, database); } }