Update ErrorProne to 2.2.0 and fix failures

This commit is contained in:
Eric Anderson 2018-01-10 09:30:38 -08:00
parent 16cec947c5
commit af0283477d
4 changed files with 5 additions and 4 deletions

View File

@ -212,7 +212,7 @@ public abstract class AbstractConfigurationBuilder<T extends Configuration>
private static String wordWrap(String text, int startPos, int maxPos) {
StringBuilder builder = new StringBuilder();
int pos = startPos;
String[] parts = text.split("\\n");
String[] parts = text.split("\\n", -1);
boolean isBulleted = parts.length > 1;
for (String part : parts) {
int lineStart = startPos;

View File

@ -35,7 +35,7 @@ subprojects {
dependencies {
// The ErrorProne plugin defaults to the latest, which would break our
// build if error prone releases a new version with a new check
errorprone 'com.google.errorprone:error_prone_core:2.1.3'
errorprone 'com.google.errorprone:error_prone_core:2.2.0'
apt 'com.google.guava:guava-beta-checker:1.0'
}
} else {

View File

@ -226,7 +226,7 @@ public abstract class Http2ClientStreamTransportState extends AbstractClientStre
private static Charset extractCharset(Metadata headers) {
String contentType = headers.get(GrpcUtil.CONTENT_TYPE_KEY);
if (contentType != null) {
String[] split = contentType.split("charset=");
String[] split = contentType.split("charset=", 2);
try {
return Charset.forName(split[split.length - 1].trim());
} catch (Exception t) {

View File

@ -1725,7 +1725,8 @@ public abstract class AbstractInteropTest {
try {
certificates = Arrays.asList(sslSession.getPeerCertificates());
} catch (SSLPeerUnverifiedException e) {
fail("No cert");
// Should never happen
throw new AssertionError(e);
}
X509Certificate x509cert = (X509Certificate) certificates.get(0);