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:
parent
39686949d2
commit
ce7b69269b
55 changed files with 182 additions and 194 deletions
|
@ -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];
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue