Skip to content

Commit 68064c0

Browse files
committed
Fix | Comments
1 parent 0e1ae15 commit 68064c0

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ String getClassNameInternal() {
7070
return "SQLServerCallableStatement";
7171
}
7272

73-
Map<String,Integer> map = new ConcurrentHashMap<>();
73+
Map<String, Integer> map = new ConcurrentHashMap<>();
7474
AtomicInteger ai = new AtomicInteger(0);
7575

7676
/**
@@ -1304,7 +1304,7 @@ private int findColumn(String columnName) throws SQLServerException {
13041304
l = parameterNames.size();
13051305
}
13061306
if (l == 0) { // Server didn't return anything, user might not have access
1307-
map.putIfAbsent(columnName,ai.incrementAndGet());
1307+
map.putIfAbsent(columnName, ai.incrementAndGet());
13081308
return map.get(columnName);// attempting to look up the first column will return no access exception
13091309
}
13101310

src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableMixedTest.java

+3-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import java.sql.CallableStatement;
88
import java.sql.Connection;
9-
import java.sql.DriverManager;
109
import java.sql.ResultSet;
1110
import java.sql.SQLException;
1211
import java.sql.Statement;
@@ -90,14 +89,12 @@ public void datatypestest() throws Exception {
9089
@Tag("xAzureSQLDW")
9190
@Tag("xAzureSQLMI")
9291
public void noPrivilegeTest() throws SQLException {
93-
try (Connection c = getConnection();
94-
Statement stmt = c.createStatement()) {
92+
try (Connection c = getConnection(); Statement stmt = c.createStatement()) {
9593
String tableName = RandomUtil.getIdentifier("jdbc_priv");
9694
String procName = RandomUtil.getIdentifier("priv_proc");
9795
String user = "priv_user" + UUID.randomUUID();
9896
String pass = "priv_pass" + UUID.randomUUID();
9997

100-
10198
stmt.execute(
10299
"CREATE TABLE " + AbstractSQLGenerator.escapeIdentifier(tableName) + " (id int, name varchar(50))");
103100
stmt.execute("CREATE PROC " + AbstractSQLGenerator.escapeIdentifier(procName)
@@ -113,11 +110,9 @@ public void noPrivilegeTest() throws SQLException {
113110
} catch (SQLException e) {
114111
assertTrue(e.getMessage().matches(TestResource.formatErrorMsg("R_NoPrivilege")));
115112
} finally {
116-
TestUtils.dropProcedureIfExists(procName, stmt);
117-
TestUtils.dropTableIfExists(tableName, stmt);
118-
stmt.close();
119-
c.close();
120113
try (Connection c2 = getConnection(); Statement stmt2 = c2.createStatement()) {
114+
TestUtils.dropProcedureIfExists(procName, stmt2);
115+
TestUtils.dropTableIfExists(tableName, stmt2);
121116
stmt2.execute("DROP USER " + AbstractSQLGenerator.escapeIdentifier(user));
122117
stmt2.execute("DROP LOGIN " + AbstractSQLGenerator.escapeIdentifier(user));
123118
}

0 commit comments

Comments
 (0)