1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-10 02:39:39 +02:00

Various code cleanup

This commit is contained in:
Paul Schaub 2021-12-28 13:32:50 +01:00
parent 39686949d2
commit ce7b69269b
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
55 changed files with 182 additions and 194 deletions

View file

@ -14,8 +14,8 @@ public class HexUtil {
*
* @see <a href="https://stackoverflow.com/a/9855338">
* How to convert a byte array to a hex string in Java?</a>
* @param bytes
* @return
* @param bytes bytes
* @return hex encoding
*/
public static String bytesToHex(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];

View file

@ -13,7 +13,7 @@ import java.io.OutputStream;
* At that point, first all the buffered data is being written to the underlying stream, followed by any successive
* data that may get written to the {@link ProxyOutputStream}.
*
* This class is useful if we need to provide an {@link OutputStream} at one point in time where the final
* This class is useful if we need to provide an {@link OutputStream} at one point in time when the final
* target output stream is not yet known.
*/
public class ProxyOutputStream extends OutputStream {

View file

@ -14,8 +14,8 @@ import java.util.TimeZone;
*/
public class UTCUtil {
public static SimpleDateFormat UTC_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
public static SimpleDateFormat[] UTC_PARSERS = new SimpleDateFormat[] {
public static final SimpleDateFormat UTC_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
public static final SimpleDateFormat[] UTC_PARSERS = new SimpleDateFormat[] {
UTC_FORMATTER,
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"),
new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'"),
@ -38,6 +38,7 @@ public class UTCUtil {
try {
return parser.parse(dateString);
} catch (ParseException e) {
// Try next parser
}
}
return null;

View file

@ -18,6 +18,7 @@ import org.junit.jupiter.api.Test;
*/
public class HexUtilTest {
@SuppressWarnings("CharsetObjectCanBeUsed")
private static final Charset ASCII = Charset.forName("US-ASCII");
@Test