#88 Added Errorprone to project

This commit is contained in:
Shekhar Gulati
2017-06-17 03:50:21 +05:30
parent f5d9a0b535
commit 5e5440119d
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -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
+3 -2
View File
@@ -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));
} }
/** /**