mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-11-03 16:46:01 +00:00
#88 Added Errorprone to project
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'net.researchgate.release' version '2.3.3'
|
id 'net.researchgate.release' version '2.3.3'
|
||||||
|
id "net.ltgt.errorprone" version "0.0.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'com.shekhargulati'
|
group 'com.shekhargulati'
|
||||||
@@ -10,6 +11,7 @@ apply plugin: 'maven-publish'
|
|||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
apply plugin: "jacoco"
|
apply plugin: "jacoco"
|
||||||
apply from: rootProject.file('gradle/checkstyle.gradle')
|
apply from: rootProject.file('gradle/checkstyle.gradle')
|
||||||
|
apply plugin: "net.ltgt.errorprone"
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
package strman;
|
package strman;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
@@ -324,7 +325,7 @@ public abstract class Strman {
|
|||||||
*/
|
*/
|
||||||
public static String base64Decode(final String value) {
|
public static String base64Decode(final String value) {
|
||||||
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
|
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
|
||||||
return new String(Base64.getDecoder().decode(value));
|
return new String(Base64.getDecoder().decode(value), StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -335,7 +336,7 @@ public abstract class Strman {
|
|||||||
*/
|
*/
|
||||||
public static String base64Encode(final String value) {
|
public static String base64Encode(final String value) {
|
||||||
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
|
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
|
||||||
return Base64.getEncoder().encodeToString(value.getBytes());
|
return Base64.getEncoder().encodeToString(value.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user