Skip to content

Commit

Permalink
Formatting and java doc fix (#2350)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyc committed Mar 18, 2024
1 parent 26803d2 commit 00a2556
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3509,8 +3509,7 @@ private void login(String primary, String primaryInstanceName, int primaryPortNu
// Whereas for dbMirroring, we sleep for every two attempts as each attempt is to a different server.
// Make sure there's enough time to do another retry
if (!isDBMirroring || (isDBMirroring && (0 == attemptNumber % 2))
&& (attemptNumber < connectRetryCount && connectRetryCount != 0)
&& timerRemaining(
&& (attemptNumber < connectRetryCount && connectRetryCount != 0) && timerRemaining(
timerExpire) > (TimeUnit.SECONDS.toMillis(connectRetryInterval) + 2 * timeForFirstTry)) {

// don't wait for TNIR
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/microsoft/sql/DateTimeOffset.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ private DateTimeOffset(java.sql.Timestamp timestamp, int minutesOffset) {

/**
* Constructs a DateTimeOffset from an existing java.time.OffsetDateTime
* DateTimeOffset represents values to 100 nanosecond precision. If the java.time.OffsetDateTime instance
* represents a value that is more precise, the value is rounded to the nearest multiple of 100 nanoseconds. Values
* within 50 nanoseconds of the next second are rounded up to the next second.
*
* @param offsetDateTime
* A java.time.OffsetDateTime value
* @apiNote DateTimeOffset represents values to 100 nanosecond precision. If the java.time.OffsetDateTime instance
* represents a value that is more precise, the value is rounded to the nearest multiple of 100 nanoseconds. Values
* within 50 nanoseconds of the next second are rounded up to the next second.
*/
private DateTimeOffset(java.time.OffsetDateTime offsetDateTime) {
int hundredNanos = ((offsetDateTime.getNano() + 50) / 100);
Expand Down Expand Up @@ -123,13 +123,13 @@ public static DateTimeOffset valueOf(java.sql.Timestamp timestamp, Calendar cale

/**
* Directly converts a {@link java.time.OffsetDateTime} value to an equivalent {@link DateTimeOffset} value
* DateTimeOffset represents values to 100 nanosecond precision. If the java.time.OffsetDateTime instance
* represents a value that is more precise, the value is rounded to the nearest multiple of 100 nanoseconds. Values
* within 50 nanoseconds of the next second are rounded up to the next second.
*
* @param offsetDateTime
* A java.time.OffsetDateTime value
* @return The DateTimeOffset value of the input java.time.OffsetDateTime
* @apiNote DateTimeOffset represents values to 100 nanosecond precision. If the java.time.OffsetDateTime instance
* represents a value that is more precise, the value is rounded to the nearest multiple of 100 nanoseconds. Values
* within 50 nanoseconds of the next second are rounded up to the next second.
*/
public static DateTimeOffset valueOf(java.time.OffsetDateTime offsetDateTime) {
return new DateTimeOffset(offsetDateTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ public void testConnectNoTnir() {
org.junit.Assume.assumeTrue(isWindows);

// no retries no TNIR should fail even tho host is defined in host file
try (Connection con = PrepUtil.getConnection(
connectionString + ";transparentNetworkIPResolution=false;connectRetryCount=0;serverName=" + tnirHost);) {
try (Connection con = PrepUtil.getConnection(connectionString
+ ";transparentNetworkIPResolution=false;connectRetryCount=0;serverName=" + tnirHost);) {
assertTrue(con == null, TestResource.getResource("R_shouldNotConnect"));
} catch (Exception e) {
assertTrue(e.getMessage().matches(TestUtils.formatErrorMsg("R_tcpipConnectionFailed"))
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/com/microsoft/sqlserver/jdbc/TestResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,6 @@ protected Object[][] getContents() {
{"R_noLoginModulesConfiguredForJdbcDriver",
"javax.security.auth.login.LoginException (No LoginModules configured for SQLJDBCDriver)"},
{"R_unexpectedThreadCount", "Thread count is higher than expected."},
{"R_expectedClassDoesNotMatchActualClass", "Expected column class {0} does not match actual column class {1} for column {2}."}};
{"R_expectedClassDoesNotMatchActualClass",
"Expected column class {0} does not match actual column class {1} for column {2}."}};
}

0 comments on commit 00a2556

Please sign in to comment.