Skip to content

Commit e56deb1

Browse files
authored
Formatted all files (#2260)
1 parent 41c1f8a commit e56deb1

File tree

68 files changed

+2916
-2844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2916
-2844
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -893,9 +893,9 @@ private static String fractionalSecondsString(long subSecondNanos, int scale) {
893893
*
894894
* @return a Java object of the desired type.
895895
*/
896-
static final Object convertTemporalToObject(
897-
SQLServerConnection connection, JDBCType jdbcType, SSType ssType, Calendar timeZoneCalendar,
898-
int daysSinceBaseDate, long ticksSinceMidnight, int fractionalSecondsScale) throws SQLServerException {
896+
static final Object convertTemporalToObject(SQLServerConnection connection, JDBCType jdbcType, SSType ssType,
897+
Calendar timeZoneCalendar, int daysSinceBaseDate, long ticksSinceMidnight,
898+
int fractionalSecondsScale) throws SQLServerException {
899899

900900
// In cases where a Calendar object (and therefore Timezone) is not passed to the method,
901901
// use the path below instead to optimize performance.
@@ -1132,9 +1132,9 @@ static final Object convertTemporalToObject(
11321132
ts2.setNanos(subSecondNanos);
11331133
if (jdbcType == JDBCType.LOCALDATETIME) {
11341134
if (connection.getIgnoreOffsetOnDateTimeOffsetConversion()) {
1135-
return LocalDateTime.of(
1136-
cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH),
1137-
cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND), subSecondNanos);
1135+
return LocalDateTime.of(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1,
1136+
cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE),
1137+
cal.get(Calendar.SECOND), subSecondNanos);
11381138
} else {
11391139
return ts2.toLocalDateTime();
11401140
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,8 @@ private DataTypes() {
11151115
static final void throwConversionError(String fromType, String toType) throws SQLServerException {
11161116
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_unsupportedConversionFromTo"));
11171117
Object[] msgArgs = {fromType, toType};
1118-
SQLServerException.makeFromDriverError(null, null, form.format(msgArgs), SQLState.ERROR_IN_ASSIGNMENT.getSQLStateCode(), true);
1118+
SQLServerException.makeFromDriverError(null, null, form.format(msgArgs),
1119+
SQLState.ERROR_IN_ASSIGNMENT.getSQLStateCode(), true);
11191120
}
11201121

11211122
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ void failoverAdd(SQLServerConnection connection, boolean actualUseFailoverPartne
9999
try {
100100
if (useFailoverPartner != actualUseFailoverPartner) {
101101
if (connection.getConnectionLogger().isLoggable(Level.FINE))
102-
connection.getConnectionLogger()
103-
.fine(connection.toString() + " Failover detected. failover partner=" + actualFailoverPartner);
102+
connection.getConnectionLogger().fine(
103+
connection.toString() + " Failover detected. failover partner=" + actualFailoverPartner);
104104
useFailoverPartner = actualUseFailoverPartner;
105105
}
106106
// The checking for actualUseFailoverPartner may look weird but this is required

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3763,16 +3763,14 @@ void writeDatetime(java.sql.Timestamp dateValue) throws SQLServerException {
37633763
int subSecondNanos;
37643764
subSecondNanos = ldt.getNano();
37653765

3766-
37673766
// Number of days there have been since the SQL Base Date.
37683767
// These are based on SQL Server algorithms
3769-
int daysSinceSQLBaseDate = DDC.daysSinceBaseDate(ldt.getYear(),
3770-
ldt.getDayOfYear(), TDS.BASE_YEAR_1900);
3768+
int daysSinceSQLBaseDate = DDC.daysSinceBaseDate(ldt.getYear(), ldt.getDayOfYear(), TDS.BASE_YEAR_1900);
37713769

37723770
// Number of milliseconds since midnight of the current day.
37733771
int millisSinceMidnight = (subSecondNanos + Nanos.PER_MILLISECOND / 2) / Nanos.PER_MILLISECOND + // Millis into
3774-
// the current
3775-
// second
3772+
// the current
3773+
// second
37763774
1000 * ldt.getSecond() + // Seconds into the current minute
37773775
60 * 1000 * ldt.getMinute() + // Minutes into the current hour
37783776
60 * 60 * 1000 * ldt.getHour(); // Hours into the current day
@@ -5029,8 +5027,8 @@ void writeTVPRows(TVP value) throws SQLServerException {
50295027
}
50305028

50315029
private void writeInternalTVPRowValues(JDBCType jdbcType, String currentColumnStringValue, Object currentObject,
5032-
Map.Entry<Integer, SQLServerMetaData> columnPair, boolean isSqlVariant)
5033-
throws SQLServerException, IllegalArgumentException {
5030+
Map.Entry<Integer, SQLServerMetaData> columnPair,
5031+
boolean isSqlVariant) throws SQLServerException, IllegalArgumentException {
50345032
boolean isShortValue, isNull;
50355033
int dataLength;
50365034
switch (jdbcType) {
@@ -5104,7 +5102,6 @@ private void writeInternalTVPRowValues(JDBCType jdbcType, String currentColumnSt
51045102
* setScale of all BigDecimal value based on metadata as scale is not sent separately for individual
51055103
* value. Use the rounding used in Server. Say, for BigDecimal("0.1"), if scale in metadata is 0,
51065104
* then ArithmeticException would be thrown if RoundingMode is not set
5107-
*
51085105
* Additionally, we should check here if the scale is within the bounds of SQLServer as it is
51095106
* possible for a number with a scale larger than 38 to be passed in.
51105107
*/
@@ -7278,9 +7275,9 @@ final Object readDate(int valueLength, Calendar appTimeZoneCalendar, JDBCType jd
72787275

72797276
// Convert the DATE value to the desired Java type.
72807277
return DDC.convertTemporalToObject(con, jdbcType, SSType.DATE, appTimeZoneCalendar, localDaysIntoCE, 0, // midnight
7281-
// local to
7282-
// app time
7283-
// zone
7278+
// local to
7279+
// app time
7280+
// zone
72847281
0); // scale (ignored for DATE)
72857282
}
72867283

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.io.Serializable;
99
import java.sql.SQLException;
1010

11+
1112
/**
1213
* Provides an interface used to create classes that read in data from any source (such as a file) and allows a
1314
* SQLServerBulkCopy class to write the data to SQL Server tables.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ CallableStatement prepareCall(String sql, int nType, int nConcur, int nHold,
486486
* Returns the current flag for calcBigDecimalScale.
487487
*
488488
* @return calcBigDecimalScale
489-
* Whether calculating big decimal scale from input values is enabled.
489+
* Whether calculating big decimal scale from input values is enabled.
490490
*/
491491
boolean getCalcBigDecimalScale();
492492

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,13 +883,14 @@ public interface ISQLServerDataSource extends javax.sql.CommonDataSource {
883883
boolean getUseDefaultJaasConfig();
884884

885885
/**
886-
* Sets whether the default JAAS Configuration will be used. This means the system-wide JAAS configuration
886+
* Sets whether the default JAAS Configuration will be used. This means the system-wide JAAS configuration
887887
* is ignored to avoid conflicts with libraries that override the JAAS configuration.
888888
*
889889
* @param useDefaultJaasConfig
890-
* boolean property to use the default JAAS configuration
890+
* boolean property to use the default JAAS configuration
891891
*/
892892
void setUseDefaultJaasConfig(boolean useDefaultJaasConfig);
893+
893894
/**
894895
* Sets whether Fips Mode should be enabled/disabled on the connection. For FIPS enabled JVM this property should be
895896
* true.
@@ -1337,7 +1338,7 @@ public interface ISQLServerDataSource extends javax.sql.CommonDataSource {
13371338
* Returns value of 'calcBigDecimalScale' from Connection String.
13381339
*
13391340
* @param calcBigDecimalScale
1340-
* indicates whether the driver should attempt to calculate scale from inputted big decimal values
1341+
* indicates whether the driver should attempt to calculate scale from inputted big decimal values
13411342
*/
13421343
void setCalcBigDecimalScale(boolean calcBigDecimalScale);
13431344

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import java.io.Serializable;
99

10+
1011
/**
1112
* Provides an interface to the {@link SQLServerStatement} class.
1213
*/

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

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -426,16 +426,17 @@ private ReconnectThread() {}
426426
eReceived = null;
427427
stopRequested = false;
428428
if (loggerResiliency.isLoggable(Level.FINER)) {
429-
loggerResiliency.finer("Idle connection resiliency - ReconnectThread initialized. Connection retry count = " + connectRetryCount
430-
+ "; Command = " + cmd.toString());
429+
loggerResiliency.finer("Idle connection resiliency - ReconnectThread initialized. Connection retry count = "
430+
+ connectRetryCount + "; Command = " + cmd.toString());
431431
}
432432

433433
}
434434

435435
@Override
436436
public void run() {
437437
if (loggerResiliency.isLoggable(Level.FINER)) {
438-
loggerResiliency.finer("Idle connection resiliency - starting ReconnectThread for command: " + command.toString());
438+
loggerResiliency
439+
.finer("Idle connection resiliency - starting ReconnectThread for command: " + command.toString());
439440
}
440441
boolean interruptsEnabled = command.getInterruptsEnabled();
441442
/*
@@ -460,8 +461,8 @@ public void run() {
460461

461462
while ((connectRetryCount >= 0) && (!stopRequested) && keepRetrying) {
462463
if (loggerResiliency.isLoggable(Level.FINER)) {
463-
loggerResiliency.finer("Idle connection resiliency - running reconnect for command: " + command.toString() + " ; connectRetryCount = "
464-
+ connectRetryCount);
464+
loggerResiliency.finer("Idle connection resiliency - running reconnect for command: "
465+
+ command.toString() + " ; connectRetryCount = " + connectRetryCount);
465466
}
466467

467468
try {
@@ -470,21 +471,26 @@ public void run() {
470471
keepRetrying = false;
471472

472473
if (loggerResiliency.isLoggable(Level.FINE)) {
473-
loggerResiliency.fine("Idle connection resiliency - reconnect attempt succeeded ; connectRetryCount = " + connectRetryCount);
474+
loggerResiliency
475+
.fine("Idle connection resiliency - reconnect attempt succeeded ; connectRetryCount = "
476+
+ connectRetryCount);
474477
}
475478

476479
} catch (SQLServerException e) {
477480

478481
if (loggerResiliency.isLoggable(Level.FINE)) {
479-
loggerResiliency.fine("Idle connection resiliency - reconnect attempt failed ; connectRetryCount = " + connectRetryCount);
482+
loggerResiliency.fine("Idle connection resiliency - reconnect attempt failed ; connectRetryCount = "
483+
+ connectRetryCount);
480484
}
481485

482486
if (!stopRequested) {
483487
eReceived = e;
484488
if (con.isFatalError(e)) {
485489

486490
if (loggerResiliency.isLoggable(Level.FINER)) {
487-
loggerResiliency.finer("Idle connection resiliency - reconnect for command: " + command.toString() + " encountered fatal error: " + e.getMessage() + " - stopping reconnect attempt.");
491+
loggerResiliency.finer("Idle connection resiliency - reconnect for command: "
492+
+ command.toString() + " encountered fatal error: " + e.getMessage()
493+
+ " - stopping reconnect attempt.");
488494
}
489495

490496
keepRetrying = false;
@@ -495,7 +501,8 @@ public void run() {
495501
}
496502
} catch (InterruptedException ie) {
497503
if (loggerResiliency.isLoggable(Level.FINER)) {
498-
loggerResiliency.finer("Idle connection resiliency - query timed out for command: " + command.toString() + ". Stopping reconnect attempt.");
504+
loggerResiliency.finer("Idle connection resiliency - query timed out for command: "
505+
+ command.toString() + ". Stopping reconnect attempt.");
499506
}
500507

501508
// re-interrupt thread
@@ -513,7 +520,8 @@ public void run() {
513520
command.checkForInterrupt();
514521
} catch (SQLServerException e) {
515522
if (loggerResiliency.isLoggable(Level.FINER)) {
516-
loggerResiliency.finer("Idle connection resiliency - timeout occurred on reconnect: " + command.toString() + ". Stopping reconnect attempt.");
523+
loggerResiliency.finer("Idle connection resiliency - timeout occurred on reconnect: "
524+
+ command.toString() + ". Stopping reconnect attempt.");
517525
}
518526
// Interrupted, timeout occurred. Stop retrying.
519527
keepRetrying = false;
@@ -530,7 +538,8 @@ public void run() {
530538
command.setInterruptsEnabled(interruptsEnabled);
531539

532540
if (loggerResiliency.isLoggable(Level.FINER)) {
533-
loggerResiliency.finer("Idle connection resiliency - ReconnectThread exiting for command: " + command.toString());
541+
loggerResiliency
542+
.finer("Idle connection resiliency - ReconnectThread exiting for command: " + command.toString());
534543
}
535544

536545
if (timeout != null) {

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private void initAuthInit() throws SQLServerException {
6565
GSSName remotePeerName = manager.createName(spn, null);
6666

6767
if (useDefaultNativeGSSCredential) {
68-
peerCredentials = manager.createCredential(null, GSSCredential.DEFAULT_LIFETIME, kerberos, GSSCredential.INITIATE_ONLY);
68+
peerCredentials = manager.createCredential(null, GSSCredential.DEFAULT_LIFETIME, kerberos,
69+
GSSCredential.INITIATE_ONLY);
6970
}
7071

7172
if (null != peerCredentials) {
@@ -82,13 +83,13 @@ private void initAuthInit() throws SQLServerException {
8283
SQLServerDriverBooleanProperty.USE_DEFAULT_JAAS_CONFIG.toString(),
8384
Boolean.toString(SQLServerDriverBooleanProperty.USE_DEFAULT_JAAS_CONFIG.getDefaultValue())));
8485

85-
if (!configName.equals(
86-
SQLServerDriverStringProperty.JAAS_CONFIG_NAME.getDefaultValue()) && useDefaultJaas) {
86+
if (!configName.equals(SQLServerDriverStringProperty.JAAS_CONFIG_NAME.getDefaultValue())
87+
&& useDefaultJaas) {
8788
// Reset configName to default -- useDefaultJaas setting takes priority over jaasConfigName
8889
if (authLogger.isLoggable(Level.WARNING)) {
89-
authLogger.warning(toString() + String.format(
90-
"Using default JAAS configuration, configured %s=%s will not be used.",
91-
SQLServerDriverStringProperty.JAAS_CONFIG_NAME, configName));
90+
authLogger.warning(toString()
91+
+ String.format("Using default JAAS configuration, configured %s=%s will not be used.",
92+
SQLServerDriverStringProperty.JAAS_CONFIG_NAME, configName));
9293
}
9394
configName = SQLServerDriverStringProperty.JAAS_CONFIG_NAME.getDefaultValue();
9495
}

0 commit comments

Comments
 (0)