Other files ignored by Codecov
pom.xml
has changed.
667 | 667 | boolean append = true; |
|
668 | 668 | if (null != mssqlJdbcProperties) { |
|
669 | 669 | String endpoints = mssqlJdbcProperties.getProperty(AKV_TRUSTED_ENDPOINTS_KEYWORD); |
|
670 | - | if (null != endpoints && !endpoints.isBlank()) { |
|
670 | + | if (null != endpoints && !endpoints.trim().isEmpty()) { |
|
671 | 671 | endpoints = endpoints.trim(); |
|
672 | 672 | // Append if the list starts with a semicolon. |
|
673 | 673 | if (';' != endpoints.charAt(0)) { |
677 | 677 | } |
|
678 | 678 | String[] entries = endpoints.split(";"); |
|
679 | 679 | for (String entry : entries) { |
|
680 | - | if (null != entry && !entry.isBlank()) { |
|
680 | + | if (null != entry && !entry.trim().isEmpty()) { |
|
681 | 681 | trustedEndpoints.add(entry.trim()); |
|
682 | 682 | } |
|
683 | 683 | } |
14 | 14 | import java.io.InputStream; |
|
15 | 15 | import java.io.StringReader; |
|
16 | 16 | import java.math.BigInteger; |
|
17 | + | import java.nio.Buffer; |
|
17 | 18 | import java.nio.ByteBuffer; |
|
18 | 19 | import java.nio.ByteOrder; |
|
19 | 20 | import java.nio.file.Files; |
153 | 154 | ByteBuffer buffer = ByteBuffer.allocate((int) f.length()); |
|
154 | 155 | try (FileInputStream in = new FileInputStream(f)) { |
|
155 | 156 | in.getChannel().read(buffer); |
|
156 | - | buffer.order(ByteOrder.LITTLE_ENDIAN).rewind(); |
|
157 | + | ((Buffer) buffer.order(ByteOrder.LITTLE_ENDIAN)).rewind(); |
|
157 | 158 | ||
158 | 159 | long magic = buffer.getInt() & 0xFFFFFFFFL; |
|
159 | 160 | if (PVK_MAGIC != magic) { |
161 | 162 | "", false); |
|
162 | 163 | } |
|
163 | 164 | ||
164 | - | buffer.position(buffer.position() + 8); // skip reserved and keytype |
|
165 | + | ((Buffer) buffer).position(((Buffer) buffer).position() + 8); // skip reserved and keytype |
|
165 | 166 | boolean encrypted = buffer.getInt() != 0; |
|
166 | 167 | int saltLength = buffer.getInt(); |
|
167 | 168 | int keyLength = buffer.getInt(); |
|
168 | 169 | byte[] salt = new byte[saltLength]; |
|
169 | 170 | buffer.get(salt); |
|
170 | 171 | ||
171 | - | buffer.position(buffer.position() + 8); // skip btype(1b), version(1b), reserved(2b), and keyalg(4b) |
|
172 | + | ((Buffer) buffer).position(((Buffer) buffer).position() + 8); // skip btype(1b), version(1b), reserved(2b), |
|
173 | + | // and keyalg(4b) |
|
172 | 174 | ||
173 | 175 | byte[] key = new byte[keyLength - 8]; |
|
174 | 176 | buffer.get(key); |
184 | 186 | } |
|
185 | 187 | ||
186 | 188 | ByteBuffer buff = ByteBuffer.wrap(key).order(ByteOrder.LITTLE_ENDIAN); |
|
187 | - | buff.position(RSA2_MAGIC.length); // skip the header |
|
189 | + | ((Buffer) buff).position(RSA2_MAGIC.length); // skip the header |
|
188 | 190 | ||
189 | 191 | int byteLength = buff.getInt() / 8; |
|
190 | 192 | BigInteger publicExponent = BigInteger.valueOf(buff.getInt()); |
29 | 29 | ||
30 | 30 | ||
31 | 31 | /** |
|
32 | - | * Utility class for all Data Dependant Conversions (DDC). |
|
32 | + | * Utility class for all Data Dependent Conversions (DDC). |
|
33 | 33 | */ |
|
34 | 34 | ||
35 | 35 | final class DDC { |
348 | 348 | byte[] longbArray = new byte[bLength]; |
|
349 | 349 | Util.writeLong(bi.longValue(), longbArray, 0); |
|
350 | 350 | /* |
|
351 | - | * TDS 2.2.5.5.1.4 Fixed-Point Numbers |
|
352 | - | * Money is represented as a 8 byte signed integer, with one 4-byte integer that represents |
|
353 | - | * the more significant half, and one 4-byte integer that represents the less significant half. |
|
351 | + | * TDS 2.2.5.5.1.4 Fixed-Point Numbers Money is represented as a 8 byte signed integer, with one 4-byte |
|
352 | + | * integer that represents the more significant half, and one 4-byte integer that represents the less |
|
353 | + | * significant half. |
|
354 | 354 | */ |
|
355 | 355 | System.arraycopy(longbArray, 0, valueBytes, 4, 4); |
|
356 | 356 | System.arraycopy(longbArray, 4, valueBytes, 0, 4); |
653 | 653 | if (firstDash > 0 && secondDash > 0 && secondDash < dividingSpace - 1) { |
|
654 | 654 | if (firstDash == YEAR_LENGTH && (secondDash - firstDash > 1 && secondDash - firstDash <= MONTH_LENGTH + 1) |
|
655 | 655 | && (dividingSpace - secondDash > 1 && dividingSpace - secondDash <= DAY_LENGTH + 1)) { |
|
656 | - | year = Integer.parseInt(s, 0, firstDash, 10); |
|
657 | - | month = Integer.parseInt(s, firstDash + 1, secondDash, 10); |
|
658 | - | day = Integer.parseInt(s, secondDash + 1, dividingSpace, 10); |
|
656 | + | year = Integer.parseInt(s.substring(0, firstDash)); |
|
657 | + | month = Integer.parseInt(s.substring(firstDash + 1, secondDash)); |
|
658 | + | day = Integer.parseInt(s.substring(secondDash + 1, dividingSpace)); |
|
659 | 659 | ||
660 | 660 | if ((month >= 1 && month <= MAX_MONTH) && (day >= 1 && day <= MAX_DAY)) { |
|
661 | 661 | parsedDate = true; |
669 | 669 | // Convert the time; default missing nanos |
|
670 | 670 | int len = s.length(); |
|
671 | 671 | if (firstColon > 0 && secondColon > 0 && secondColon < len - 1) { |
|
672 | - | hour = Integer.parseInt(s, dividingSpace + 1, firstColon, 10); |
|
673 | - | minute = Integer.parseInt(s, firstColon + 1, secondColon, 10); |
|
672 | + | hour = Integer.parseInt(s.substring(dividingSpace + 1, firstColon)); |
|
673 | + | minute = Integer.parseInt(s.substring(firstColon + 1, secondColon)); |
|
674 | 674 | if (period > 0 && period < len - 1) { |
|
675 | - | second = Integer.parseInt(s, secondColon + 1, period, 10); |
|
675 | + | second = Integer.parseInt(s.substring(secondColon + 1, period)); |
|
676 | 676 | int nanoPrecision = len - (period + 1); |
|
677 | 677 | if (nanoPrecision > 9) |
|
678 | 678 | throw new java.lang.IllegalArgumentException(formatError); |
|
679 | 679 | if (!Character.isDigit(s.charAt(period + 1))) |
|
680 | 680 | throw new java.lang.IllegalArgumentException(formatError); |
|
681 | - | int tmpNanos = Integer.parseInt(s, period + 1, len, 10); |
|
681 | + | int tmpNanos = Integer.parseInt(s.substring(period + 1, len)); |
|
682 | 682 | while (nanoPrecision < 9) { |
|
683 | 683 | tmpNanos *= 10; |
|
684 | 684 | nanoPrecision++; |
687 | 687 | } else if (period > 0) { |
|
688 | 688 | throw new java.lang.IllegalArgumentException(formatError); |
|
689 | 689 | } else { |
|
690 | - | second = Integer.parseInt(s, secondColon + 1, len, 10); |
|
690 | + | second = Integer.parseInt(s.substring(secondColon + 1, len)); |
|
691 | 691 | } |
|
692 | 692 | } else { |
|
693 | 693 | throw new java.lang.IllegalArgumentException(formatError); |
Files | Complexity | Coverage |
---|---|---|
src/main/java | 45.26% | 59.25% |
Project Totals (133 files) | 45.26% | 59.25% |