Skip to content
Permalink
Browse files

Add Error Prone 2.0.18 to build system

and fix a few things.
  • Loading branch information...
Flowdalic committed Mar 7, 2017
1 parent 8fa7ed0 commit e2e396e0d9236db563ead3b3a42e052ef64e7802
@@ -4,7 +4,7 @@ android:
- android-8
jdk:
- oraclejdk8
- oraclejdk7

sudo: false
cache:
directories:
@@ -2,11 +2,15 @@ import org.gradle.plugins.signing.Sign

buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}

dependencies {
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0"
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.9'
}
}

@@ -16,6 +20,7 @@ allprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'jacoco'
apply plugin: 'net.ltgt.errorprone'

repositories {
mavenLocal()
@@ -108,6 +113,12 @@ allprojects {
}
}

// Pin the errorprone version to prevent "unsupported major.minor
// version 52.0" error messages caused by the errorprone javac.
// See https://github.com/tbroyer/gradle-errorprone-plugin/issues/18 for more information.
configurations.errorprone {
resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.18'
}
}

gradle.taskGraph.whenReady { taskGraph ->
@@ -94,6 +94,7 @@ protected DateFormat initialValue() {
};
private static final Pattern xep0091Pattern = Pattern.compile("^\\d+T\\d+:\\d+:\\d+$");

@SuppressWarnings("ImmutableEnumChecker")
private static enum DateFormatType {
// @formatter:off
XEP_0082_DATE_PROFILE("yyyy-MM-dd"),
@@ -391,9 +392,10 @@ private static Calendar determineNearestDate(final Calendar now, List<Calendar>

Collections.sort(dates, new Comparator<Calendar>() {

@Override
public int compare(Calendar o1, Calendar o2) {
Long diff1 = new Long(now.getTimeInMillis() - o1.getTimeInMillis());
Long diff2 = new Long(now.getTimeInMillis() - o2.getTimeInMillis());
Long diff1 = now.getTimeInMillis() - o1.getTimeInMillis();
Long diff2 = now.getTimeInMillis() - o2.getTimeInMillis();
return diff1.compareTo(diff2);
}

@@ -75,6 +75,7 @@ protected void onStartTag(String prefix, String localpart, Map<String, String> a
}
}

@Override
protected void onEndTag(String qName) {
if (streamPrefix == null || !qName.startsWith(streamPrefix)) {
// Shortcut if streamPrefix is not yet set or if qName does not even
@@ -87,6 +87,7 @@
*
* @return the String representation of this JID.
*/
@Override
public String toString();

/**
@@ -368,10 +369,12 @@
/**
* Return the downcasted instance of this Jid. This method is unsafe, make sure to check that this is actually of the type of are casting to.
*
* @param jidClass the class of JID to downcast too.
* @param <T> the Jid type to downcast to.
* @return the downcasted instanced of this
* @throws ClassCastException if this JID is not assignable to the type T.
*/
public <T extends Jid> T downcast();
public <T extends Jid> T downcast(Class<T> jidClass) throws ClassCastException;

/**
* Compares the given CharSequence with this JID. Returns true if {@code equals(charSequence.toString()} would
@@ -381,6 +384,7 @@
* @return true if if {@code equals(charSequence.toString()} would return true.
* @see #equals(String)
*/
@SuppressWarnings("NonOverridingEquals")
public boolean equals(CharSequence charSequence);

/**
@@ -392,6 +396,7 @@
* @param string the String to compare this JID with.
* @return true if {@code toString().equals(string)}.
*/
@SuppressWarnings("NonOverridingEquals")
public boolean equals(String string);

/**
@@ -77,9 +77,8 @@ public final boolean hasLocalpart() {
}

@Override
@SuppressWarnings("unchecked")
public final <T extends Jid> T downcast() {
return (T) this;
public final <T extends Jid> T downcast(Class<T> jidClass) {
return jidClass.cast(this);
}

@Override
@@ -196,6 +195,7 @@ public final boolean equals(Object other) {
return false;
}

@SuppressWarnings("NonOverridingEquals")
@Override
public final boolean equals(CharSequence charSequence) {
if (charSequence == null) {
@@ -204,6 +204,7 @@ public final boolean equals(CharSequence charSequence) {
return equals(charSequence.toString());
}

@SuppressWarnings("NonOverridingEquals")
@Override
public final boolean equals(String string) {
return toString().equals(string);
@@ -97,6 +97,7 @@ public V get(Object key) {
* @param key the key of the value to remove.
* @return the remove value, or {@code null}.
*/
@Override
public V remove(Object key) {
ExpireElement<V> e = cache.remove(key);
if (e == null) {

0 comments on commit e2e396e

Please sign in to comment.
You can’t perform that action at this time.