Merge branch 'stable-2.16' into stable-3.0
* stable-2.16: Make toString(), hashCode(), equals() and friends final in AutoValue classes Schema_169: Increase log severity level Schema_146: Fix FutureReturnValueIgnored warning flagged by error prone Fix various usages of the Flogger API Schema_169: Fix usage of Flogger to log exception stack trace Keep alive database connection to prevent exceeding wait timeout Change-Id: Ic8885a66acb123b52a30a74a63a2b2e5411dd453
This commit is contained in:
@@ -284,7 +284,7 @@ class OpenIdServiceImpl {
|
||||
// right now. Instead of blocking all of them log the error and
|
||||
// let the authentication complete anyway.
|
||||
//
|
||||
logger.atSevere().log("Invalid PAPE response %s: %s", openidIdentifier, err);
|
||||
logger.atSevere().withCause(err).log("Invalid PAPE response from %s", openidIdentifier);
|
||||
unsupported = true;
|
||||
ext = null;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class StarredChangesUtil {
|
||||
public abstract String label();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public final String toString() {
|
||||
return accountId() + SEPARATOR + label();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ public class ProjectWatches {
|
||||
public abstract ImmutableSet<NotifyType> notifyTypes();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public final String toString() {
|
||||
List<NotifyType> notifyTypes = new ArrayList<>(notifyTypes());
|
||||
StringBuilder notifyValue = new StringBuilder();
|
||||
notifyValue.append(firstNonNull(filter(), FILTER_ALL)).append(" [");
|
||||
|
||||
@@ -196,7 +196,7 @@ public abstract class ExternalId implements Serializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public final String toString() {
|
||||
return get();
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ public abstract class ExternalId implements Serializable {
|
||||
* that was loaded from Git can be equal with an external ID that was created from code.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public final boolean equals(Object obj) {
|
||||
if (!(obj instanceof ExternalId)) {
|
||||
return false;
|
||||
}
|
||||
@@ -457,7 +457,7 @@ public abstract class ExternalId implements Serializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
public final int hashCode() {
|
||||
return Objects.hash(key(), accountId(), email(), password());
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ public abstract class ExternalId implements Serializable {
|
||||
* </pre>
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
public final String toString() {
|
||||
Config c = new Config();
|
||||
writeToConfig(c);
|
||||
return c.toText();
|
||||
|
||||
@@ -65,7 +65,7 @@ public abstract class ChangeTriplet {
|
||||
public abstract Change.Key id();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public final String toString() {
|
||||
return format(branch(), id());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public abstract class ConfigKey {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public final String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(section()).append(".");
|
||||
if (subsection() != null) {
|
||||
|
||||
@@ -230,7 +230,8 @@ public class PluginConfigFactory implements ReloadPluginListener {
|
||||
cfg.load();
|
||||
} catch (ConfigInvalidException e) {
|
||||
// This is an error in user input, don't spam logs with a stack trace.
|
||||
logger.atWarning().log("Failed to load %s: %s", pluginConfigFile.toAbsolutePath(), e);
|
||||
logger.atWarning().log(
|
||||
"Failed to load %s: %s", pluginConfigFile.toAbsolutePath(), e.getMessage());
|
||||
} catch (IOException e) {
|
||||
logger.atWarning().withCause(e).log("Failed to load %s", pluginConfigFile.toAbsolutePath());
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public abstract class ScheduleConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public final String toString() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
b.append(formatValue(keyInterval()));
|
||||
b.append(", ");
|
||||
|
||||
@@ -157,11 +157,11 @@ public class Text extends RawText {
|
||||
return Charset.forName(encoding);
|
||||
|
||||
} catch (IllegalCharsetNameException err) {
|
||||
logger.atSevere().log("Invalid detected charset name '%s': %s", encoding, err);
|
||||
logger.atSevere().log("Invalid detected charset name '%s': %s", encoding, err.getMessage());
|
||||
return ISO_8859_1;
|
||||
|
||||
} catch (UnsupportedCharsetException err) {
|
||||
logger.atSevere().log("Detected charset '%s' not supported: %s", encoding, err);
|
||||
logger.atSevere().log("Detected charset '%s' not supported: %s", encoding, err.getMessage());
|
||||
return ISO_8859_1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class SectionSortCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
public final int hashCode() {
|
||||
return cachedHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,12 +260,12 @@ class RelatedChangesSorter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
public final int hashCode() {
|
||||
return Objects.hash(patchSet().getId(), commit());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public final boolean equals(Object obj) {
|
||||
if (!(obj instanceof PatchSetData)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public abstract class LabelVote {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public final String toString() {
|
||||
return format();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ java_package_configuration(
|
||||
javacopts = [
|
||||
"-XepDisableWarningsInGeneratedCode",
|
||||
"-Xep:AmbiguousMethodReference:WARN",
|
||||
"-Xep:AutoValueFinalMethods:ERROR",
|
||||
"-Xep:BadAnnotationImplementation:WARN",
|
||||
"-Xep:BadComparable:WARN",
|
||||
"-Xep:BoxedPrimitiveConstructor:ERROR",
|
||||
|
||||
Reference in New Issue
Block a user