1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

Bump "Error Prone" to 2.0.15

and fix a few things :)
This commit is contained in:
Florian Schmaus 2017-02-11 16:16:41 +01:00
parent ef0af66b21
commit 4c646436a5
246 changed files with 1122 additions and 124 deletions

View file

@ -72,6 +72,7 @@ public final class CarbonManager extends Manager {
static {
XMPPConnectionRegistry.addConnectionCreationListener(new ConnectionCreationListener() {
@Override
public void connectionCreated(XMPPConnection connection) {
getInstanceFor(connection);
}
@ -271,6 +272,7 @@ public final class CarbonManager extends Manager {
try {
connection().sendIqWithResponseCallback(setIQ, new StanzaListener() {
@Override
public void processStanza(Stanza packet) {
enabled_state = use;
}

View file

@ -44,6 +44,7 @@ public abstract class AbstractHttpOverXmpp extends IQ {
this.version = Objects.requireNonNull(builder.version, "version must not be null");
}
@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
IQChildElementXmlStringBuilder builder = getIQHoxtChildElementBuilder(xml);
builder.optAppend(headers);

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2016 Florian Schmaus
* Copyright © 2016-2017 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,6 +16,7 @@
*/
package org.jivesoftware.smackx.iot.control.element;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@ -31,7 +32,21 @@ public class IoTSetRequest extends IQ {
public IoTSetRequest(Collection<? extends SetData> setData) {
super(ELEMENT, NAMESPACE);
setType(Type.set);
this.setData = Collections.unmodifiableCollection(setData);
/*
* Ugly workaround for the following error prone false positive:
*
* IoTSetRequest.java:34: error: incompatible types: Collection<CAP#1> cannot be converted to Collection<SetData>
* this.setData = Collections.unmodifiableCollection(setDataA);
* ^
* where CAP#1 is a fresh type-variable:
* CAP#1 extends SetData from capture of ? extends SetData
*/
Collection<SetData> tmp = new ArrayList<>(setData.size());
for (SetData data : setData) {
tmp.add(data);
}
this.setData = Collections.unmodifiableCollection(tmp);
}
public Collection<SetData> getSetData() {

View file

@ -30,7 +30,7 @@ public abstract class SetData implements NamedElement {
DOUBLE,
;
private String toStringCache;
private final String toStringCache;
private Type() {
toStringCache = this.name().toLowerCase(Locale.US);

View file

@ -61,6 +61,7 @@ public final class IoTDataManager extends IoTManager {
// Ensure a IoTDataManager exists for every connection.
static {
XMPPConnectionRegistry.addConnectionCreationListener(new ConnectionCreationListener() {
@Override
public void connectionCreated(XMPPConnection connection) {
if (!isAutoEnableActive()) return;
getInstanceFor(connection);

View file

@ -74,6 +74,7 @@ public final class IoTDiscoveryManager extends Manager {
// Ensure a IoTProvisioningManager exists for every connection.
static {
XMPPConnectionRegistry.addConnectionCreationListener(new ConnectionCreationListener() {
@Override
public void connectionCreated(XMPPConnection connection) {
if (!IoTManager.isAutoEnableActive()) return;
getInstanceFor(connection);

View file

@ -62,6 +62,7 @@ public final class NodeInfo {
}
@Override
@SuppressWarnings("ReferenceEquality")
public int hashCode() {
if (this == EMPTY) {
return 0;

View file

@ -82,6 +82,7 @@ public final class IoTProvisioningManager extends Manager {
// Ensure a IoTProvisioningManager exists for every connection.
static {
XMPPConnectionRegistry.addConnectionCreationListener(new ConnectionCreationListener() {
@Override
public void connectionCreated(XMPPConnection connection) {
if (!IoTManager.isAutoEnableActive()) return;
getInstanceFor(connection);