Browse Source

Bump "Error Prone" to 2.3.2

and gradle-errorprone-plugin to 0.6.
fixDocuLinks
Florian Schmaus 7 months ago
parent
commit
b7ea226c56
65 changed files with 173 additions and 149 deletions
  1. 7
    5
      build.gradle
  2. 2
    2
      smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
  3. 1
    0
      smack-core/src/main/java/org/jivesoftware/smack/SynchronizationPoint.java
  4. 3
    3
      smack-core/src/main/java/org/jivesoftware/smack/filter/StanzaIdFilter.java
  5. 1
    2
      smack-core/src/main/java/org/jivesoftware/smack/parsing/StandardExtensionElementProvider.java
  6. 4
    4
      smack-core/src/main/java/org/jivesoftware/smack/proxy/Socks5ProxySocketConnection.java
  7. 1
    1
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/SCRAMSHA1Mechanism.java
  8. 1
    1
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/ScramSha1PlusMechanism.java
  9. 2
    3
      smack-core/src/test/java/org/jivesoftware/smack/parsing/StandardExtensionElementParserTest.java
  10. 1
    1
      smack-core/src/test/java/org/jivesoftware/smack/util/PacketParserUtilsTest.java
  11. 4
    1
      smack-experimental/src/main/java/org/jivesoftware/smackx/hashes/element/HashElement.java
  12. 1
    0
      smack-experimental/src/main/java/org/jivesoftware/smackx/iot/Thing.java
  13. 2
    0
      smack-experimental/src/main/java/org/jivesoftware/smackx/iot/discovery/IoTDiscoveryManager.java
  14. 4
    1
      smack-experimental/src/main/java/org/jivesoftware/smackx/jingle_filetransfer/element/Range.java
  15. 1
    1
      smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamQueryIQ.java
  16. 3
    3
      smack-experimental/src/test/java/org/jivesoftware/smackx/mam/MamQueryIQProviderTest.java
  17. 1
    1
      smack-experimental/src/test/java/org/jivesoftware/smackx/mam/PagingTest.java
  18. 1
    1
      smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java
  19. 1
    1
      smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java
  20. 13
    13
      smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java
  21. 1
    1
      smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/provider/BytestreamsProvider.java
  22. 2
    2
      smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java
  23. 4
    3
      smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java
  24. 7
    1
      smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transports/jingle_ibb/element/JingleIBBTransport.java
  25. 1
    1
      smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java
  26. 1
    1
      smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java
  27. 1
    1
      smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/FormField.java
  28. 12
    12
      smack-extensions/src/main/java/org/jivesoftware/smackx/xdatavalidation/packet/ValidateElement.java
  29. 1
    1
      smack-extensions/src/test/java/org/jivesoftware/smackx/InitExtensions.java
  30. 2
    2
      smack-extensions/src/test/java/org/jivesoftware/smackx/message_correct/MessageCorrectExtensionTest.java
  31. 3
    3
      smack-im/src/main/java/org/jivesoftware/smack/roster/packet/RosterPacket.java
  32. 1
    1
      smack-im/src/test/java/org/jivesoftware/smack/im/InitSmackIm.java
  33. 3
    2
      smack-im/src/test/java/org/jivesoftware/smack/roster/RosterVersioningTest.java
  34. 1
    0
      smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java
  35. 2
    3
      smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
  36. 2
    2
      smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java
  37. 3
    0
      smack-java7/src/main/java/org/jivesoftware/smack/util/stringencoder/java7/Base64.java
  38. 2
    2
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/ContentNegotiator.java
  39. 3
    3
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java
  40. 2
    2
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/PayloadType.java
  41. 1
    1
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/sshare/ScreenShareSession.java
  42. 1
    1
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/BridgedResolver.java
  43. 1
    1
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/ICECandidate.java
  44. 5
    5
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/ICEResolver.java
  45. 1
    1
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/RTPBridge.java
  46. 3
    3
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportCandidate.java
  47. 5
    5
      smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java
  48. 3
    3
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java
  49. 7
    7
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/ext/history/AgentChatHistory.java
  50. 2
    2
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/AgentStatusRequest.java
  51. 1
    1
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/MonitorPacket.java
  52. 7
    7
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/OccupantsInfo.java
  53. 2
    2
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/QueueDetails.java
  54. 3
    3
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/QueueOverview.java
  55. 4
    4
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/ChatSettings.java
  56. 1
    1
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/GenericSettings.java
  57. 4
    4
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/OfflineSettings.java
  58. 2
    2
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/SearchSettings.java
  59. 2
    2
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/SoundSettings.java
  60. 3
    3
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/WorkgroupProperties.java
  61. 1
    1
      smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/util/MetaDataUtils.java
  62. 1
    0
      smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoKeyUtil.java
  63. 1
    1
      smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java
  64. 3
    1
      smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/PublicKeysListElement.java
  65. 1
    1
      smack-tcp/src/test/java/org/jivesoftware/smack/sm/provider/ParseStreamManagementTest.java

+ 7
- 5
build.gradle View File

@@ -10,12 +10,12 @@ buildscript {
10 10
         classpath 'org.kordamp:markdown-gradle-plugin:1.0.0'
11 11
 		classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.2'
12 12
 		classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.3.1"
13
-		classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.13'
14 13
     }
15 14
 }
16 15
 
17 16
 plugins {
18 17
     id 'ru.vyarus.animalsniffer' version '1.4.5'
18
+	id 'net.ltgt.errorprone' version '0.6'
19 19
 }
20 20
 
21 21
 apply plugin: 'org.kordamp.gradle.markdown'
@@ -156,9 +156,8 @@ allprojects {
156 156
 			// e.g. JAVA7_HOME. See SMACK-651.
157 157
 			'-Xlint:-options',
158 158
 			'-Werror',
159
-			// Needed because since adding gradle-errorprone-plugin
160
-			// See https://github.com/tbroyer/gradle-errorprone-plugin/issues/15
161
-			'-Xlint:-path',
159
+		]
160
+		options.errorprone.errorproneArgs = [
162 161
 			// Disable errorprone checks
163 162
 			'-Xep:TypeParameterUnusedInFormals:OFF',
164 163
 			// Disable errorpone StringSplitter check, as it
@@ -170,6 +169,8 @@ allprojects {
170 169
 			// TODO: change sinttest so that it has it's own
171 170
 			// BeforeClass and re-enable this check.
172 171
 			'-Xep:JUnit4ClassAnnotationNonStatic:OFF',
172
+			// Disabled but should be re-enabled at some point
173
+			//'-Xep:InconsistentCapitalization:OFF',
173 174
 		]
174 175
 	}
175 176
 
@@ -211,7 +212,8 @@ allprojects {
211 212
 	}
212 213
 
213 214
 	dependencies {
214
-		errorprone 'com.google.errorprone:error_prone_core:2.2.0'
215
+		errorprone 'com.google.errorprone:error_prone_core:2.3.2'
216
+		errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
215 217
 	}
216 218
 
217 219
 	// Make all project's 'test' target depend on javadoc, so that

+ 2
- 2
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java View File

@@ -1128,8 +1128,8 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
1128 1128
 
1129 1129
                     // If the IQ stanza is of type "get" or "set" with no registered IQ request handler, then answer an
1130 1130
                     // IQ of type 'error' with condition 'service-unavailable'.
1131
-                    ErrorIQ errorIQ = IQ.createErrorResponse(iq, StanzaError.getBuilder((
1132
-                                    replyCondition)));
1131
+                    ErrorIQ errorIQ = IQ.createErrorResponse(iq, StanzaError.getBuilder(
1132
+                                    replyCondition));
1133 1133
                     try {
1134 1134
                         sendStanza(errorIQ);
1135 1135
                     }

+ 1
- 0
smack-core/src/main/java/org/jivesoftware/smack/SynchronizationPoint.java View File

@@ -55,6 +55,7 @@ public class SynchronizationPoint<E extends Exception> {
55 55
     /**
56 56
      * Initialize (or reset) this synchronization point.
57 57
      */
58
+    @SuppressWarnings("LockNotBeforeTry")
58 59
     public void init() {
59 60
         connectionLock.lock();
60 61
         state = State.Initial;

+ 3
- 3
smack-core/src/main/java/org/jivesoftware/smack/filter/StanzaIdFilter.java View File

@@ -41,10 +41,10 @@ public class StanzaIdFilter implements StanzaFilter {
41 41
     /**
42 42
      * Creates a new stanza ID filter using the specified stanza ID.
43 43
      *
44
-     * @param stanzaID the stanza ID to filter for.
44
+     * @param stanzaId the stanza ID to filter for.
45 45
      */
46
-    public StanzaIdFilter(String stanzaID) {
47
-        this.stanzaId = StringUtils.requireNotNullNorEmpty(stanzaID, "Stanza ID must not be null nor empty.");
46
+    public StanzaIdFilter(String stanzaId) {
47
+        this.stanzaId = StringUtils.requireNotNullNorEmpty(stanzaId, "Stanza ID must not be null nor empty.");
48 48
     }
49 49
 
50 50
     @Override

+ 1
- 2
smack-core/src/main/java/org/jivesoftware/smack/parsing/StandardExtensionElementProvider.java View File

@@ -21,7 +21,6 @@ import java.util.LinkedHashMap;
21 21
 import java.util.Map;
22 22
 
23 23
 import org.jivesoftware.smack.packet.StandardExtensionElement;
24
-import org.jivesoftware.smack.packet.StandardExtensionElement.Builder;
25 24
 import org.jivesoftware.smack.provider.ExtensionElementProvider;
26 25
 import org.jivesoftware.smack.util.ParserUtils;
27 26
 import org.jivesoftware.smack.util.StringUtils;
@@ -46,7 +45,7 @@ public class StandardExtensionElementProvider extends ExtensionElementProvider<S
46 45
         // we are parsing here.
47 46
         String name = parser.getName();
48 47
         String namespace = parser.getNamespace();
49
-        Builder builder = StandardExtensionElement.builder(name, namespace);
48
+        StandardExtensionElement.Builder builder = StandardExtensionElement.builder(name, namespace);
50 49
         final int namespaceCount = parser.getNamespaceCount(initialDepth);
51 50
         final int attributeCount = parser.getAttributeCount();
52 51
         final Map<String, String> attributes = new LinkedHashMap<>(namespaceCount + attributeCount);

+ 4
- 4
smack-core/src/main/java/org/jivesoftware/smack/proxy/Socks5ProxySocketConnection.java View File

@@ -102,7 +102,7 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
102 102
             fill(in, buf, 2);
103 103
 
104 104
             boolean check = false;
105
-            switch ((buf[1]) & 0xff) {
105
+            switch (buf[1] & 0xff) {
106 106
                 case 0:                // NO AUTHENTICATION REQUIRED
107 107
                     check = true;
108 108
                     break;
@@ -132,13 +132,13 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
132 132
 */
133 133
                     index = 0;
134 134
                     buf[index++] = 1;
135
-                    buf[index++] = (byte) (user.length());
135
+                    buf[index++] = (byte) user.length();
136 136
                     byte[] userBytes = user.getBytes(StringUtils.UTF8);
137 137
                     System.arraycopy(userBytes, 0, buf, index,
138 138
                         user.length());
139 139
                     index += user.length();
140 140
                     byte[] passwordBytes = passwd.getBytes(StringUtils.UTF8);
141
-                    buf[index++] = (byte) (passwordBytes.length);
141
+                    buf[index++] = (byte) passwordBytes.length;
142 142
                     System.arraycopy(passwordBytes, 0, buf, index,
143 143
                         passwd.length());
144 144
                     index += passwd.length();
@@ -207,7 +207,7 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
207 207
             byte[] hostb = host.getBytes(StringUtils.UTF8);
208 208
             int len = hostb.length;
209 209
             buf[index++] = 3;      // DOMAINNAME
210
-            buf[index++] = (byte) (len);
210
+            buf[index++] = (byte) len;
211 211
             System.arraycopy(hostb, 0, buf, index, len);
212 212
             index += len;
213 213
             buf[index++] = (byte) (port >>> 8);

+ 1
- 1
smack-core/src/main/java/org/jivesoftware/smack/sasl/core/SCRAMSHA1Mechanism.java View File

@@ -36,7 +36,7 @@ public class SCRAMSHA1Mechanism extends ScramMechanism {
36 36
                 return MAC.hmacsha1(key, str);
37 37
             }
38 38
         };
39
-        NAME = (new SCRAMSHA1Mechanism()).getName();
39
+        NAME = new SCRAMSHA1Mechanism().getName();
40 40
     }
41 41
 
42 42
     public static final String NAME;

+ 1
- 1
smack-core/src/main/java/org/jivesoftware/smack/sasl/core/ScramSha1PlusMechanism.java View File

@@ -21,7 +21,7 @@ import org.jivesoftware.smack.sasl.SASLMechanism;
21 21
 public class ScramSha1PlusMechanism extends ScramPlusMechanism {
22 22
 
23 23
     static {
24
-        NAME = (new ScramSha1PlusMechanism()).getName();
24
+        NAME = new ScramSha1PlusMechanism().getName();
25 25
     }
26 26
 
27 27
     public static final String NAME;

+ 2
- 3
smack-core/src/test/java/org/jivesoftware/smack/parsing/StandardExtensionElementParserTest.java View File

@@ -20,7 +20,6 @@ import static org.jivesoftware.smack.util.PacketParserUtils.getParserFor;
20 20
 import static org.junit.Assert.assertEquals;
21 21
 
22 22
 import org.jivesoftware.smack.packet.StandardExtensionElement;
23
-import org.jivesoftware.smack.packet.StandardExtensionElement.Builder;
24 23
 
25 24
 import org.junit.Test;
26 25
 
@@ -28,7 +27,7 @@ public class StandardExtensionElementParserTest {
28 27
 
29 28
     @Test
30 29
     public void buildAndParse() throws Exception {
31
-        Builder builder = StandardExtensionElement.builder("foo", "ns1");
30
+        StandardExtensionElement.Builder builder = StandardExtensionElement.builder("foo", "ns1");
32 31
         builder.addAttribute("attr1", "attr1-value");
33 32
         builder.addElement(StandardExtensionElement.builder("bar", "ns2").addAttribute("attr2", "attr2-value").build());
34 33
         builder.addElement("another-element", "another-element-text");
@@ -53,7 +52,7 @@ public class StandardExtensionElementParserTest {
53 52
 
54 53
     @Test
55 54
     public void buildWithAttrNamespacesAndParse() throws Exception {
56
-        Builder builder = StandardExtensionElement.builder("foo", "ns1-value");
55
+        StandardExtensionElement.Builder builder = StandardExtensionElement.builder("foo", "ns1-value");
57 56
         builder.addAttribute("xmlns:ns2", "ns2-value");
58 57
         builder.addAttribute("ns2:bar", "bar-ns2-value");
59 58
         final String elementString = builder.build().toXML(null).toString();

+ 1
- 1
smack-core/src/test/java/org/jivesoftware/smack/util/PacketParserUtilsTest.java View File

@@ -813,7 +813,7 @@ public class PacketParserUtilsTest {
813 813
         final String stanza = "<iq type='result' to='foo@bar.com' from='baz.com' id='42'/>";
814 814
         XmlPullParser parser = TestUtils.getParser(stanza, "iq");
815 815
         CharSequence content = PacketParserUtils.parseContent(parser);
816
-        assertEquals("", content);
816
+        assertEquals("", content.toString());
817 817
     }
818 818
 
819 819
     @Test

+ 4
- 1
smack-experimental/src/main/java/org/jivesoftware/smackx/hashes/element/HashElement.java View File

@@ -112,7 +112,10 @@ public class HashElement implements ExtensionElement {
112 112
         if (other == null || !(other instanceof HashElement)) {
113 113
             return false;
114 114
         }
115
-        return this.hashCode() == other.hashCode();
115
+
116
+        HashElement otherHashElement = (HashElement) other;
117
+        return this.getAlgorithm() == otherHashElement.getAlgorithm() &&
118
+            this.getHashB64().equals(otherHashElement.getHashB64());
116 119
     }
117 120
 
118 121
     @Override

+ 1
- 0
smack-experimental/src/main/java/org/jivesoftware/smackx/iot/Thing.java View File

@@ -79,6 +79,7 @@ public final class Thing {
79 79
 
80 80
     private String toStringCache;
81 81
 
82
+    @SuppressWarnings("ObjectToString")
82 83
     @Override
83 84
     public String toString() {
84 85
         if (toStringCache == null) {

+ 2
- 0
smack-experimental/src/main/java/org/jivesoftware/smackx/iot/discovery/IoTDiscoveryManager.java View File

@@ -149,6 +149,8 @@ public final class IoTDiscoveryManager extends Manager {
149 149
 
150 150
         connection.registerIQRequestHandler(new AbstractIqRequestHandler(IoTDisowned.ELEMENT, IoTDisowned.NAMESPACE,
151 151
                         IQ.Type.set, Mode.sync) {
152
+
153
+            @SuppressWarnings("ObjectToString")
152 154
             @Override
153 155
             public IQ handleIQRequest(IQ iqRequest) {
154 156
                 if (!isRegistry(iqRequest.getFrom())) {

+ 4
- 1
smack-experimental/src/main/java/org/jivesoftware/smackx/jingle_filetransfer/element/Range.java View File

@@ -125,7 +125,10 @@ public class Range implements NamedElement {
125 125
             return false;
126 126
         }
127 127
 
128
-        return this.hashCode() == other.hashCode();
128
+        Range otherRange = (Range) other;
129
+        return this.getOffset() == otherRange.getOffset() &&
130
+            this.getLength() == otherRange.getLength() &&
131
+            this.getHash().equals(otherRange.getHash());
129 132
     }
130 133
 
131 134
     @Override

+ 1
- 1
smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamQueryIQ.java View File

@@ -92,7 +92,7 @@ public class MamQueryIQ extends IQ {
92 92
             if (field == null) {
93 93
                 throw new IllegalArgumentException("If a data form is given it must posses a hidden form type field");
94 94
             }
95
-            if (!field.getValues().get(0).equals(MamElements.NAMESPACE)) {
95
+            if (!field.getValues().get(0).toString().equals(MamElements.NAMESPACE)) {
96 96
                 throw new IllegalArgumentException(
97 97
                         "Value of the hidden form type field must be '" + MamElements.NAMESPACE + "'");
98 98
             }

+ 3
- 3
smack-experimental/src/test/java/org/jivesoftware/smackx/mam/MamQueryIQProviderTest.java View File

@@ -63,8 +63,8 @@ public class MamQueryIQProviderTest {
63 63
         List<FormField> fields1 = dataForm1.getFields();
64 64
         Assert.assertEquals(fields1.get(0).getType(), FormField.Type.hidden);
65 65
         Assert.assertEquals(fields1.get(1).getType(), FormField.Type.text_single);
66
-        Assert.assertEquals(fields1.get(1).getValues().get(0), "Where arth thou, my Juliet?");
67
-        Assert.assertEquals(fields1.get(2).getValues().get(0), "{http://jabber.org/protocol/mood}mood/lonely");
66
+        Assert.assertEquals(fields1.get(1).getValues().get(0).toString(), "Where arth thou, my Juliet?");
67
+        Assert.assertEquals(fields1.get(2).getValues().get(0).toString(), "{http://jabber.org/protocol/mood}mood/lonely");
68 68
 
69 69
         // example2
70 70
         IQ iq2 = PacketParserUtils.parseStanza(exampleMamQueryIQ2);
@@ -77,7 +77,7 @@ public class MamQueryIQProviderTest {
77 77
         Assert.assertEquals(dataForm2.getType(), DataForm.Type.form);
78 78
 
79 79
         List<FormField> fields2 = dataForm2.getFields();
80
-        Assert.assertEquals(fields2.get(0).getValues().get(0), "urn:xmpp:mam:1");
80
+        Assert.assertEquals(fields2.get(0).getValues().get(0).toString(), "urn:xmpp:mam:1");
81 81
         Assert.assertTrue(fields2.get(0).getValues().size() == 1);
82 82
         Assert.assertEquals(fields2.get(1).getType(), FormField.Type.jid_single);
83 83
         Assert.assertEquals(fields2.get(2).getType(), FormField.Type.text_single);

+ 1
- 1
smack-experimental/src/test/java/org/jivesoftware/smackx/mam/PagingTest.java View File

@@ -45,7 +45,7 @@ public class PagingTest extends MamTest {
45 45
         mamQueryIQ.addExtension(rsmSet);
46 46
 
47 47
         Assert.assertEquals(mamQueryIQ.getDataForm(), dataForm);
48
-        Assert.assertEquals(mamQueryIQ.getDataForm().getFields().get(0).getValues().get(0), "urn:xmpp:mam:1");
48
+        Assert.assertEquals(mamQueryIQ.getDataForm().getFields().get(0).getValues().get(0).toString(), "urn:xmpp:mam:1");
49 49
         Assert.assertEquals(mamQueryIQ.toXML(StreamOpen.CLIENT_NAMESPACE).toString(), pagingStanza);
50 50
     }
51 51
 

+ 1
- 1
smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java View File

@@ -490,7 +490,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
490 490
     private static String getNextSessionID() {
491 491
         StringBuilder buffer = new StringBuilder();
492 492
         buffer.append(SESSION_ID_PREFIX);
493
-        buffer.append(Math.abs(randomGenerator.nextLong()));
493
+        buffer.append(randomGenerator.nextInt(Integer.MAX_VALUE) + randomGenerator.nextInt(Integer.MAX_VALUE));
494 494
         return buffer.toString();
495 495
     }
496 496
 

+ 1
- 1
smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java View File

@@ -732,7 +732,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
732 732
     private static String getNextSessionID() {
733 733
         StringBuilder buffer = new StringBuilder();
734 734
         buffer.append(SESSION_ID_PREFIX);
735
-        buffer.append(Math.abs(randomGenerator.nextLong()));
735
+        buffer.append(randomGenerator.nextInt(Integer.MAX_VALUE) + randomGenerator.nextInt(Integer.MAX_VALUE));
736 736
         return buffer.toString();
737 737
     }
738 738
 

+ 13
- 13
smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java View File

@@ -269,9 +269,9 @@ public class Bytestream extends IQ {
269 269
 
270 270
         public static String ELEMENTNAME = "streamhost";
271 271
 
272
-        private final Jid JID;
272
+        private final Jid jid;
273 273
 
274
-        private final String addy;
274
+        private final String address;
275 275
 
276 276
         private final int port;
277 277
 
@@ -282,13 +282,13 @@ public class Bytestream extends IQ {
282 282
         /**
283 283
          * Default constructor.
284 284
          *
285
-         * @param JID The JID of the stream host.
285
+         * @param jid The JID of the stream host.
286 286
          * @param address The internet address of the stream host.
287 287
          * @param port port of the stream host.
288 288
          */
289
-        public StreamHost(final Jid JID, final String address, int port) {
290
-            this.JID = Objects.requireNonNull(JID, "StreamHost JID must not be null");
291
-            this.addy = StringUtils.requireNotNullNorEmpty(address, "StreamHost address must not be null");
289
+        public StreamHost(final Jid jid, final String address, int port) {
290
+            this.jid = Objects.requireNonNull(jid, "StreamHost JID must not be null");
291
+            this.address = StringUtils.requireNotNullNorEmpty(address, "StreamHost address must not be null");
292 292
             this.port = port;
293 293
         }
294 294
 
@@ -298,7 +298,7 @@ public class Bytestream extends IQ {
298 298
          * @return Returns the JID of the stream host.
299 299
          */
300 300
         public Jid getJID() {
301
-            return JID;
301
+            return jid;
302 302
         }
303 303
 
304 304
         /**
@@ -307,7 +307,7 @@ public class Bytestream extends IQ {
307 307
          * @return Returns the internet address of the stream host.
308 308
          */
309 309
         public String getAddress() {
310
-            return addy;
310
+            return address;
311 311
         }
312 312
 
313 313
         /**
@@ -349,15 +349,15 @@ public class Bytestream extends IQ {
349 349
 
350 350
         public static String ELEMENTNAME = "streamhost-used";
351 351
 
352
-        private final Jid JID;
352
+        private final Jid jid;
353 353
 
354 354
         /**
355 355
          * Default constructor.
356 356
          *
357
-         * @param JID The JID of the selected stream host.
357
+         * @param jid The JID of the selected stream host.
358 358
          */
359
-        public StreamHostUsed(final Jid JID) {
360
-            this.JID = JID;
359
+        public StreamHostUsed(final Jid jid) {
360
+            this.jid = jid;
361 361
         }
362 362
 
363 363
         /**
@@ -366,7 +366,7 @@ public class Bytestream extends IQ {
366 366
          * @return Returns the JID of the selected stream host.
367 367
          */
368 368
         public Jid getJID() {
369
-            return JID;
369
+            return jid;
370 370
         }
371 371
 
372 372
         @Override

+ 1
- 1
smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/provider/BytestreamsProvider.java View File

@@ -89,7 +89,7 @@ public class BytestreamsProvider extends IQProvider<Bytestream> {
89 89
         if (mode == null) {
90 90
             toReturn.setMode(Mode.tcp);
91 91
         } else {
92
-            toReturn.setMode((Bytestream.Mode.fromName(mode)));
92
+            toReturn.setMode(Bytestream.Mode.fromName(mode));
93 93
         }
94 94
         toReturn.setSessionID(id);
95 95
         return toReturn;

+ 2
- 2
smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java View File

@@ -268,7 +268,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
268 268
      * attributes.
269 269
      *
270 270
      */
271
-    public static class Identity implements Comparable<Identity>, TypedCloneable<Identity> {
271
+    public static final class Identity implements Comparable<Identity>, TypedCloneable<Identity> {
272 272
 
273 273
         private final String category;
274 274
         private final String type;
@@ -482,7 +482,7 @@ public class DiscoverInfo extends IQ implements TypedCloneable<DiscoverInfo> {
482 482
      * as well as specific feature types of interest, if any (e.g., for the purpose of feature
483 483
      * negotiation).
484 484
      */
485
-    public static class Feature implements TypedCloneable<Feature> {
485
+    public static final class Feature implements TypedCloneable<Feature> {
486 486
 
487 487
         private final String variable;
488 488
 

+ 4
- 3
smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java View File

@@ -260,7 +260,7 @@ public final class FileTransferNegotiator extends Manager {
260 260
     public static String getNextStreamID() {
261 261
         StringBuilder buffer = new StringBuilder();
262 262
         buffer.append(STREAM_INIT_PREFIX);
263
-        buffer.append(Math.abs(randomGenerator.nextLong()));
263
+        buffer.append(randomGenerator.nextInt(Integer.MAX_VALUE) + randomGenerator.nextInt(Integer.MAX_VALUE));
264 264
 
265 265
         return buffer.toString();
266 266
     }
@@ -342,10 +342,11 @@ public final class FileTransferNegotiator extends Manager {
342 342
         boolean isByteStream = false;
343 343
         boolean isIBB = false;
344 344
         for (CharSequence variable : field.getValues()) {
345
-            if (variable.equals(Bytestream.NAMESPACE) && !IBB_ONLY) {
345
+            String variableString = variable.toString();
346
+            if (variableString.equals(Bytestream.NAMESPACE) && !IBB_ONLY) {
346 347
                 isByteStream = true;
347 348
             }
348
-            else if (variable.equals(DataPacketExtension.NAMESPACE)) {
349
+            else if (variableString.equals(DataPacketExtension.NAMESPACE)) {
349 350
                 isIBB = true;
350 351
             }
351 352
         }

+ 7
- 1
smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transports/jingle_ibb/element/JingleIBBTransport.java View File

@@ -81,7 +81,13 @@ public class JingleIBBTransport extends JingleContentTransport {
81 81
             return false;
82 82
         }
83 83
 
84
-        return this == other || this.hashCode() == other.hashCode();
84
+        if (this == other) {
85
+            return true;
86
+        }
87
+
88
+        JingleIBBTransport otherTransport = (JingleIBBTransport) other;
89
+        return this.getSessionId().equals(otherTransport.getSessionId()) &&
90
+            this.getBlockSize() == otherTransport.getBlockSize();
85 91
     }
86 92
 
87 93
     @Override

+ 1
- 1
smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java View File

@@ -216,7 +216,7 @@ public final class PubSubManager extends Manager {
216 216
             FormField nodeTypeField = config.getField(ConfigureNodeFields.node_type.getFieldName());
217 217
 
218 218
             if (nodeTypeField != null)
219
-                isLeafNode = nodeTypeField.getValues().get(0).equals(NodeType.leaf.toString());
219
+                isLeafNode = nodeTypeField.getValues().get(0).toString().equals(NodeType.leaf.toString());
220 220
         }
221 221
 
222 222
         // Errors will cause exceptions in getReply, so it only returns

+ 1
- 1
smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java View File

@@ -84,7 +84,7 @@ import org.jxmpp.jid.EntityBareJid;
84 84
  *
85 85
  * @author Kirill Maximov (kir@maxkir.com)
86 86
  */
87
-public class VCard extends IQ {
87
+public final class VCard extends IQ {
88 88
     public static final String ELEMENT = "vCard";
89 89
     public static final String NAMESPACE = "vcard-temp";
90 90
 

+ 1
- 1
smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/FormField.java View File

@@ -480,7 +480,7 @@ public class FormField implements NamedElement {
480 480
      *
481 481
      * @author Gaston Dombiak
482 482
      */
483
-    public static class Option implements NamedElement {
483
+    public static final class Option implements NamedElement {
484 484
 
485 485
         public static final String ELEMENT = "option";
486 486
 

+ 12
- 12
smack-extensions/src/main/java/org/jivesoftware/smackx/xdatavalidation/packet/ValidateElement.java View File

@@ -133,11 +133,11 @@ public abstract class ValidateElement implements ExtensionElement {
133 133
 
134 134
         /**
135 135
          * Basic validate element constructor.
136
-         * @param dataType
136
+         * @param datatype
137 137
          * @see #getDatatype()
138 138
          */
139
-        public BasicValidateElement(String dataType) {
140
-            super(dataType);
139
+        public BasicValidateElement(String datatype) {
140
+            super(datatype);
141 141
         }
142 142
 
143 143
         @Override
@@ -176,11 +176,11 @@ public abstract class ValidateElement implements ExtensionElement {
176 176
 
177 177
         /**
178 178
          * Open validate element constructor.
179
-         * @param dataType
179
+         * @param datatype
180 180
          * @see #getDatatype()
181 181
          */
182
-        public OpenValidateElement(String dataType) {
183
-            super(dataType);
182
+        public OpenValidateElement(String datatype) {
183
+            super(datatype);
184 184
         }
185 185
 
186 186
         @Override
@@ -218,14 +218,14 @@ public abstract class ValidateElement implements ExtensionElement {
218 218
 
219 219
         /**
220 220
          * Range validate element constructor.
221
-         * @param dataType
221
+         * @param datatype
222 222
          * @param min the minimum allowable value. This attribute is OPTIONAL. The value depends on the datatype in use.
223 223
          * @param max the maximum allowable value. This attribute is OPTIONAL. The value depends on the datatype in use.
224 224
          * @see #getDatatype()
225 225
          *
226 226
          */
227
-        public RangeValidateElement(String dataType, String min, String max) {
228
-            super(dataType);
227
+        public RangeValidateElement(String datatype, String min, String max) {
228
+            super(datatype);
229 229
             this.min = min;
230 230
             this.max = max;
231 231
         }
@@ -283,12 +283,12 @@ public abstract class ValidateElement implements ExtensionElement {
283 283
 
284 284
         /**
285 285
          * Regex validate element.
286
-         * @param dataType
286
+         * @param datatype
287 287
          * @param regex
288 288
          * @see #getDatatype()
289 289
          */
290
-        public RegexValidateElement(String dataType, String regex) {
291
-            super(dataType);
290
+        public RegexValidateElement(String datatype, String regex) {
291
+            super(datatype);
292 292
             this.regex = regex;
293 293
         }
294 294
 

+ 1
- 1
smack-extensions/src/test/java/org/jivesoftware/smackx/InitExtensions.java View File

@@ -22,7 +22,7 @@ import org.jivesoftware.smack.test.util.SmackTestSuite;
22 22
 public class InitExtensions extends SmackTestSuite {
23 23
 
24 24
     static {
25
-        (new ExtensionsInitializer()).initialize();
25
+        new ExtensionsInitializer().initialize();
26 26
     }
27 27
 
28 28
 }

+ 2
- 2
smack-extensions/src/test/java/org/jivesoftware/smackx/message_correct/MessageCorrectExtensionTest.java View File

@@ -42,11 +42,11 @@ public class MessageCorrectExtensionTest {
42 42
         Message initialMessage = PacketParserUtils.parseStanza(initialMessageXml);
43 43
         MessageCorrectExtension messageCorrectExtension = new MessageCorrectExtension(idInitialMessage);
44 44
 
45
-        Assert.assertEquals(messageCorrectExtension.toXML(null).toString(), messageCorrectionXml);
45
+        Assert.assertEquals(messageCorrectExtension.toXML(null).toString(), messageCorrectionXml.toString());
46 46
 
47 47
         initialMessage.addExtension(messageCorrectExtension);
48 48
 
49
-        Assert.assertEquals(initialMessage.toXML(null), expectedXml);
49
+        Assert.assertEquals(initialMessage.toXML(null), expectedXml.toString());
50 50
     }
51 51
 
52 52
 }

+ 3
- 3
smack-im/src/main/java/org/jivesoftware/smack/roster/packet/RosterPacket.java View File

@@ -39,7 +39,7 @@ import org.jxmpp.jid.BareJid;
39 39
  * @author Matt Tucker
40 40
  * @author Florian Schmaus
41 41
  */
42
-public class RosterPacket extends IQ {
42
+public final class RosterPacket extends IQ {
43 43
 
44 44
     public static final String ELEMENT = QUERY_ELEMENT;
45 45
     public static final String NAMESPACE = "jabber:iq:roster";
@@ -110,7 +110,7 @@ public class RosterPacket extends IQ {
110 110
      * the groups the roster item belongs to.
111 111
      */
112 112
     // TODO Make this class immutable.
113
-    public static class Item implements NamedElement {
113
+    public static final class Item implements NamedElement {
114 114
 
115 115
         /**
116 116
          * The constant value "{@value}".
@@ -295,7 +295,7 @@ public class RosterPacket extends IQ {
295 295
             final int prime = 31;
296 296
             int result = 1;
297 297
             result = prime * result + ((groupNames == null) ? 0 : groupNames.hashCode());
298
-            result = prime * result + ((subscriptionPending) ? 0 : 1);
298
+            result = prime * result + (subscriptionPending ? 0 : 1);
299 299
             result = prime * result + ((itemType == null) ? 0 : itemType.hashCode());
300 300
             result = prime * result + ((name == null) ? 0 : name.hashCode());
301 301
             result = prime * result + ((jid == null) ? 0 : jid.hashCode());

+ 1
- 1
smack-im/src/test/java/org/jivesoftware/smack/im/InitSmackIm.java View File

@@ -19,7 +19,7 @@ package org.jivesoftware.smack.im;
19 19
 public class InitSmackIm {
20 20
 
21 21
     static {
22
-        (new SmackImInitializer()).initialize();
22
+        new SmackImInitializer().initialize();
23 23
     }
24 24
 
25 25
 }

+ 3
- 2
smack-im/src/test/java/org/jivesoftware/smack/roster/RosterVersioningTest.java View File

@@ -26,7 +26,7 @@ import java.io.IOException;
26 26
 import java.util.Collection;
27 27
 import java.util.HashSet;
28 28
 
29
-import org.jivesoftware.smack.ConnectionConfiguration.Builder;
29
+import org.jivesoftware.smack.ConnectionConfiguration;
30 30
 import org.jivesoftware.smack.DummyConnection;
31 31
 import org.jivesoftware.smack.SmackException;
32 32
 import org.jivesoftware.smack.XMPPException;
@@ -71,7 +71,7 @@ public class RosterVersioningTest {
71 71
         DirectoryRosterStore store = DirectoryRosterStore.init(tmpFolder.newFolder("store"));
72 72
         populateStore(store);
73 73
 
74
-        Builder<?, ?> builder = DummyConnection.getDummyConfigurationBuilder();
74
+        ConnectionConfiguration.Builder<?, ?> builder = DummyConnection.getDummyConfigurationBuilder();
75 75
         connection = new DummyConnection(builder.build());
76 76
         connection.connect();
77 77
         connection.login();
@@ -175,6 +175,7 @@ public class RosterVersioningTest {
175 175
     /**
176 176
      * Test roster versioning with roster pushes.
177 177
      */
178
+    @SuppressWarnings("UndefinedEquals")
178 179
     @Test(timeout = 5000)
179 180
     public void testRosterVersioningWithCachedRosterAndPushes() throws Throwable {
180 181
         answerWithEmptyRosterResult();

+ 1
- 0
smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java View File

@@ -66,6 +66,7 @@ public abstract class AbstractSmackIntTest {
66 66
         }
67 67
     }
68 68
 
69
+    @SuppressWarnings("ThreadPriorityCheck")
69 70
     protected void waitUntilTrue(Condition condition) throws TimeoutException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
70 71
         final long deadline = System.currentTimeMillis() + timeout;
71 72
         do {

+ 2
- 3
smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java View File

@@ -51,7 +51,6 @@ import org.jivesoftware.smack.XMPPException;
51 51
 import org.jivesoftware.smack.debugger.ConsoleDebugger;
52 52
 import org.jivesoftware.smack.tcp.XMPPTCPConnection;
53 53
 import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
54
-import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration.Builder;
55 54
 import org.jivesoftware.smack.util.StringUtils;
56 55
 
57 56
 import org.jivesoftware.smackx.debugger.EnhancedDebugger;
@@ -221,7 +220,7 @@ public class SmackIntegrationTestFramework {
221 220
                     continue;
222 221
                 }
223 222
                 Class<?> retClass = method.getReturnType();
224
-                if (!(retClass.equals(Void.TYPE))) {
223
+                if (!retClass.equals(Void.TYPE)) {
225 224
                     LOGGER.warning("SmackIntegrationTest annotation on method that does not return void");
226 225
                     continue;
227 226
                 }
@@ -560,7 +559,7 @@ public class SmackIntegrationTestFramework {
560 559
             accountPassword = StringUtils.insecureRandomString(16);
561 560
         }
562 561
 
563
-        Builder builder = getConnectionConfigurationBuilder(config);
562
+        XMPPTCPConnectionConfiguration.Builder builder = getConnectionConfigurationBuilder(config);
564 563
         builder.setUsernameAndPassword(accountUsername, accountPassword)
565 564
                .setResource(middlefix + '-' + testRunResult.testRunId);
566 565
 

+ 2
- 2
smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java View File

@@ -148,11 +148,11 @@ public class FormTest extends AbstractSmackIntegrationTest {
148 148
             assertNotNull(completedForm.getField("name"));
149 149
             assertNotNull(completedForm.getField("description"));
150 150
             assertEquals(
151
-                completedForm.getField("name").getValues().get(0),
151
+                 completedForm.getField("name").getValues().get(0).toString(),
152 152
                 "Credit card number invalid");
153 153
             assertNotNull(completedForm.getField("time"));
154 154
             assertNotNull(completedForm.getField("age"));
155
-            assertEquals("The age is bad", "20", completedForm.getField("age").getValues().get(0));
155
+            assertEquals("The age is bad", "20", completedForm.getField("age").getValues().get(0).toString());
156 156
 
157 157
         }
158 158
         finally {

+ 3
- 0
smack-java7/src/main/java/org/jivesoftware/smack/util/stringencoder/java7/Base64.java View File

@@ -375,6 +375,7 @@ public final class Base64
375 375
      * @return the <var>destination</var> array
376 376
      * @since 1.3
377 377
      */
378
+    @SuppressWarnings("UnnecessaryParentheses")
378 379
     private static byte[] encode3to4(
379 380
      byte[] source, int srcOffset, int numSigBytes,
380 381
      byte[] destination, int destOffset, int options )
@@ -600,6 +601,7 @@ public final class Base64
600 601
      * @see Base64#DONT_BREAK_LINES
601 602
      * @since 2.0
602 603
      */
604
+    @SuppressWarnings("UnnecessaryParentheses")
603 605
     public static String encodeBytes( byte[] source, int off, int len, int options )
604 606
     {
605 607
         // Isolate options
@@ -727,6 +729,7 @@ public final class Base64
727 729
      * @return the number of decoded bytes converted
728 730
      * @since 1.3
729 731
      */
732
+    @SuppressWarnings("UnnecessaryParentheses")
730 733
     private static int decode4to3( byte[] source, int srcOffset, byte[] destination, int destOffset, int options )
731 734
     {
732 735
 		byte[] DECODABET = getDecodabet( options );

+ 2
- 2
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/ContentNegotiator.java View File

@@ -230,12 +230,12 @@ public class ContentNegotiator extends JingleNegotiator {
230 230
         boolean result = true;
231 231
 
232 232
         MediaNegotiator mediaNeg = getMediaNegotiator();
233
-        if ((mediaNeg == null) || (!mediaNeg.isFullyEstablished())) {
233
+        if ((mediaNeg == null) || !mediaNeg.isFullyEstablished()) {
234 234
             result = false;
235 235
         }
236 236
 
237 237
         TransportNegotiator transNeg = getTransportNegotiator();
238
-        if ((transNeg == null) || (!transNeg.isFullyEstablished())) {
238
+        if ((transNeg == null) || !transNeg.isFullyEstablished()) {
239 239
             result = false;
240 240
         }
241 241
 

+ 3
- 3
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java View File

@@ -62,7 +62,7 @@ import org.jxmpp.jid.Jid;
62 62
  * @author Alvaro Saurin
63 63
  * @author Jeff Williams
64 64
  */
65
-public class JingleSession extends JingleNegotiator implements MediaReceivedListener {
65
+public final class JingleSession extends JingleNegotiator implements MediaReceivedListener {
66 66
 
67 67
     private static final Logger LOGGER = Logger.getLogger(JingleSession.class.getName());
68 68
 
@@ -235,7 +235,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
235 235
      * Generate a unique session ID.
236 236
      */
237 237
     protected static String generateSessionId() {
238
-        return String.valueOf(Math.abs(randomGenerator.nextLong()));
238
+        return String.valueOf(randomGenerator.nextInt(Integer.MAX_VALUE) + randomGenerator.nextInt(Integer.MAX_VALUE));
239 239
     }
240 240
 
241 241
     /**
@@ -478,7 +478,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
478 478
 
479 479
             // The the packet.
480 480
             // CHECKSTYLE:OFF
481
-            if ((getConnection() != null) && (getConnection().isConnected()))
481
+            if ((getConnection() != null) && getConnection().isConnected())
482 482
                 getConnection().sendStanza(jout);
483 483
             // CHECKSTYLE:ON
484 484
         }

+ 2
- 2
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/PayloadType.java View File

@@ -172,7 +172,7 @@ public class PayloadType {
172 172
         if (obj == null) {
173 173
             return false;
174 174
         }
175
-        if (getClass() != obj.getClass()) {
175
+        if (!(obj instanceof PayloadType)) {
176 176
             return false;
177 177
         }
178 178
         final PayloadType other = (PayloadType) obj;
@@ -244,7 +244,7 @@ public class PayloadType {
244 244
     /**
245 245
      * Audio payload type.
246 246
      */
247
-    public static class Audio extends PayloadType {
247
+    public static final class Audio extends PayloadType {
248 248
 
249 249
         private int clockRate;
250 250
 

+ 1
- 1
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/sshare/ScreenShareSession.java View File

@@ -78,7 +78,7 @@ public class ScreenShareSession extends JingleMediaSession {
78 78
     public void initialize() {
79 79
 
80 80
         JingleSession session = getJingleSession();
81
-        if ((session != null) && (session.getInitiator().equals(session.getConnection().getUser()))) {
81
+        if (session != null && session.getInitiator().equals(session.getConnection().getUser())) {
82 82
             // If the initiator of the jingle session is us then we transmit a screen share.
83 83
             try {
84 84
                 InetAddress remote = InetAddress.getByName(getRemote().getIp());

+ 1
- 1
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/BridgedResolver.java View File

@@ -73,7 +73,7 @@ public class BridgedResolver extends TransportResolver {
73 73
 
74 74
         clearCandidates();
75 75
 
76
-        sid = Math.abs(random.nextLong());
76
+        sid = random.nextInt(Integer.MAX_VALUE);
77 77
 
78 78
         RTPBridge rtpBridge = RTPBridge.getRTPBridge(connection, String.valueOf(sid));
79 79
 

+ 1
- 1
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/ICECandidate.java View File

@@ -30,7 +30,7 @@ import java.util.logging.Logger;
30 30
  *
31 31
  * @author Thiago Camargo
32 32
  */
33
-public class ICECandidate extends TransportCandidate implements Comparable<ICECandidate> {
33
+public final class ICECandidate extends TransportCandidate implements Comparable<ICECandidate> {
34 34
 
35 35
     private static final Logger LOGGER = Logger.getLogger(ICECandidate.class.getName());
36 36
 

+ 5
- 5
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/ICEResolver.java View File

@@ -145,7 +145,7 @@ public class ICEResolver extends TransportResolver {
145 145
                     LOGGER.log(Level.WARNING, "exeption", e1);
146 146
                 }
147 147
 
148
-                TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress().getHostAddress(), 1, nicNum, String.valueOf(Math.abs(random.nextLong())), candidate.getPort(), "1", candidate.getPriority(), iceType);
148
+                TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress().getHostAddress(), 1, nicNum, String.valueOf(random.nextInt(Integer.MAX_VALUE)), candidate.getPort(), "1", candidate.getPriority(), iceType);
149 149
                 transportCandidate.setLocalIp(candidate.getBase().getAddress().getInetAddress().getHostAddress());
150 150
                 transportCandidate.setPort(getFreePort());
151 151
                 try {
@@ -186,16 +186,16 @@ public class ICEResolver extends TransportResolver {
186 186
                     network = 0;
187 187
                 }
188 188
 
189
-                sid = Math.abs(random.nextLong());
189
+                sid = random.nextInt(Integer.MAX_VALUE);
190 190
 
191 191
                 RTPBridge rtpBridge = RTPBridge.getRTPBridge(connection, String.valueOf(sid));
192 192
 
193 193
                 TransportCandidate localCandidate = new ICECandidate(
194
-                        rtpBridge.getIp(), 1, network, String.valueOf(Math.abs(random.nextLong())), rtpBridge.getPortA(), "1", 0, ICECandidate.Type.relay);
194
+                    rtpBridge.getIp(), 1, network, String.valueOf(random.nextInt(Integer.MAX_VALUE)), rtpBridge.getPortA(), "1", 0, ICECandidate.Type.relay);
195 195
                 localCandidate.setLocalIp(localIp);
196 196
 
197 197
                 TransportCandidate remoteCandidate = new ICECandidate(
198
-                        rtpBridge.getIp(), 1, network, String.valueOf(Math.abs(random.nextLong())), rtpBridge.getPortB(), "1", 0, ICECandidate.Type.relay);
198
+                        rtpBridge.getIp(), 1, network, String.valueOf(random.nextInt(Integer.MAX_VALUE)), rtpBridge.getPortB(), "1", 0, ICECandidate.Type.relay);
199 199
                 remoteCandidate.setLocalIp(localIp);
200 200
 
201 201
                 localCandidate.setSymmetric(remoteCandidate);
@@ -260,7 +260,7 @@ public class ICEResolver extends TransportResolver {
260 260
                     if (!found) {
261 261
                         try {
262 262
                             TransportCandidate publicCandidate = new ICECandidate(
263
-                                    publicIp, 1, 0, String.valueOf(Math.abs(random.nextLong())), getFreePort(), "1", 0, ICECandidate.Type.srflx);
263
+                                    publicIp, 1, 0, String.valueOf(random.nextInt(Integer.MAX_VALUE)), getFreePort(), "1", 0, ICECandidate.Type.srflx);
264 264
                             publicCandidate.setLocalIp(InetAddress.getLocalHost().getHostAddress());
265 265
 
266 266
                             try {

+ 1
- 1
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/RTPBridge.java View File

@@ -447,7 +447,7 @@ public class RTPBridge extends IQ {
447 447
 
448 448
         DiscoverInfo discoInfo = disco.discoverInfo(connection.getXMPPServiceDomain());
449 449
         for (DiscoverInfo.Identity identity : discoInfo.getIdentities()) {
450
-            if ((identity.getName() != null) && (identity.getName().startsWith("rtpbridge"))) {
450
+            if (identity.getName() != null && identity.getName().startsWith("rtpbridge")) {
451 451
                 return true;
452 452
             }
453 453
         }

+ 3
- 3
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportCandidate.java View File

@@ -309,7 +309,7 @@ public abstract class TransportCandidate {
309 309
         if (obj == null) {
310 310
             return false;
311 311
         }
312
-        if (getClass() != obj.getClass()) {
312
+        if (!(obj instanceof TransportCandidate)) {
313 313
             return false;
314 314
         }
315 315
         final TransportCandidate other = (TransportCandidate) obj;
@@ -447,7 +447,7 @@ public abstract class TransportCandidate {
447 447
     /**
448 448
      * Type-safe enum for the transportElement protocol.
449 449
      */
450
-    public static class Protocol {
450
+    public static final class Protocol {
451 451
 
452 452
         public static final Protocol UDP = new Protocol("udp");
453 453
 
@@ -584,7 +584,7 @@ public abstract class TransportCandidate {
584 584
             if (obj == null) {
585 585
                 return false;
586 586
             }
587
-            if (getClass() != obj.getClass()) {
587
+            if (!(obj instanceof Channel)) {
588 588
                 return false;
589 589
             }
590 590
             final Channel other = (Channel) obj;

+ 5
- 5
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java View File

@@ -317,8 +317,8 @@ public abstract class TransportNegotiator extends JingleNegotiator {
317 317
                         TransportCandidate bestRemote = getBestRemoteCandidate();
318 318
                         // State state = getState();
319 319
 
320
-                        if ((bestRemote != null)
321
-                                && ((getNegotiatorState() == JingleNegotiatorState.PENDING))) {
320
+                        if (bestRemote != null
321
+                                && getNegotiatorState() == JingleNegotiatorState.PENDING) {
322 322
                             // Accepting the remote candidate
323 323
                             if (!acceptedRemoteCandidates.contains(bestRemote)) {
324 324
                                 Jingle jout = new Jingle(JingleActionEnum.CONTENT_ACCEPT);
@@ -335,7 +335,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
335 335
                                 }
336 336
                                 acceptedRemoteCandidates.add(bestRemote);
337 337
                             }
338
-                            if ((isEstablished()) && (getNegotiatorState() == JingleNegotiatorState.PENDING)) {
338
+                            if (isEstablished() && getNegotiatorState() == JingleNegotiatorState.PENDING) {
339 339
                                 setNegotiatorState(JingleNegotiatorState.SUCCEEDED);
340 340
                                 try {
341 341
                                     triggerTransportEstablished(getAcceptedLocalCandidate(), bestRemote);
@@ -409,8 +409,8 @@ public abstract class TransportNegotiator extends JingleNegotiator {
409 409
 
410 410
                         bestRemote = getBestRemoteCandidate();
411 411
                         // State state = getState();
412
-                        if ((bestRemote != null)
413
-                                && ((getNegotiatorState() == JingleNegotiatorState.PENDING))) {
412
+                        if (bestRemote != null
413
+                                && getNegotiatorState() == JingleNegotiatorState.PENDING) {
414 414
                             if (!acceptedRemoteCandidates.contains(bestRemote)) {
415 415
                                 Jingle jout = new Jingle(JingleActionEnum.CONTENT_ACCEPT);
416 416
                                 JingleContent content = parentNegotiator.getJingleContent();

+ 3
- 3
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java View File

@@ -276,7 +276,7 @@ public class AgentSession {
276 276
         synchronized (this.metaData) {
277 277
             List<String> oldVals = metaData.get(key);
278 278
 
279
-            if ((oldVals == null) || (!oldVals.get(0).equals(val))) {
279
+            if (oldVals == null || !oldVals.get(0).equals(val)) {
280 280
                 oldVals.set(0, val);
281 281
 
282 282
                 setStatus(presenceMode, maxChats);
@@ -635,7 +635,7 @@ public class AgentSession {
635 635
     }
636 636
 
637 637
     public Iterator<WorkgroupQueue> getQueues() {
638
-        return Collections.unmodifiableMap((new HashMap<>(queues))).values().iterator();
638
+        return Collections.unmodifiableMap(new HashMap<>(queues)).values().iterator();
639 639
     }
640 640
 
641 641
     public void addQueueUsersListener(QueueUsersListener listener) {
@@ -703,7 +703,7 @@ public class AgentSession {
703 703
     private void fireOfferRequestEvent(OfferRequestProvider.OfferRequestPacket requestPacket) {
704 704
         Offer offer = new Offer(this.connection, this, requestPacket.getUserID(),
705 705
                 requestPacket.getUserJID(), this.getWorkgroupJID(),
706
-                new Date((new Date()).getTime() + (requestPacket.getTimeout() * 1000)),
706
+                                new Date(new Date().getTime() + (requestPacket.getTimeout() * 1000)),
707 707
                 requestPacket.getSessionID(), requestPacket.getMetaData(), requestPacket.getContent());
708 708
 
709 709
         synchronized (offerListeners) {

+ 7
- 7
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/ext/history/AgentChatHistory.java View File

@@ -103,7 +103,7 @@ public class AgentChatHistory extends IQ {
103 103
             boolean done = false;
104 104
             while (!done) {
105 105
                 int eventType = parser.next();
106
-                if ((eventType == XmlPullParser.START_TAG) && ("chat-session".equals(parser.getName()))) {
106
+                if (eventType == XmlPullParser.START_TAG && "chat-session".equals(parser.getName())) {
107 107
                     agentChatHistory.addChatSession(parseChatSetting(parser));
108 108
 
109 109
                 }
@@ -126,24 +126,24 @@ public class AgentChatHistory extends IQ {
126 126
 
127 127
             while (!done) {
128 128
                 int eventType = parser.next();
129
-                if ((eventType == XmlPullParser.START_TAG) && ("date".equals(parser.getName()))) {
129
+                if (eventType == XmlPullParser.START_TAG && "date".equals(parser.getName())) {
130 130
                     String dateStr = parser.nextText();
131 131
                     long l = Long.valueOf(dateStr).longValue();
132 132
                     date = new Date(l);
133 133
                 }
134
-                else if ((eventType == XmlPullParser.START_TAG) && ("duration".equals(parser.getName()))) {
134
+                else if (eventType == XmlPullParser.START_TAG && "duration".equals(parser.getName())) {
135 135
                     duration = Long.valueOf(parser.nextText()).longValue();
136 136
                 }
137
-                else if ((eventType == XmlPullParser.START_TAG) && ("visitorsName".equals(parser.getName()))) {
137
+                else if (eventType == XmlPullParser.START_TAG && "visitorsName".equals(parser.getName())) {
138 138
                     visitorsName = parser.nextText();
139 139
                 }
140
-                else if ((eventType == XmlPullParser.START_TAG) && ("visitorsEmail".equals(parser.getName()))) {
140
+                else if (eventType == XmlPullParser.START_TAG && "visitorsEmail".equals(parser.getName())) {
141 141
                     visitorsEmail = parser.nextText();
142 142
                 }
143
-                else if ((eventType == XmlPullParser.START_TAG) && ("sessionID".equals(parser.getName()))) {
143
+                else if (eventType == XmlPullParser.START_TAG && "sessionID".equals(parser.getName())) {
144 144
                     sessionID = parser.nextText();
145 145
                 }
146
-                else if ((eventType == XmlPullParser.START_TAG) && ("question".equals(parser.getName()))) {
146
+                else if (eventType == XmlPullParser.START_TAG && "question".equals(parser.getName())) {
147 147
                     question = parser.nextText();
148 148
                 }
149 149
                 else if (eventType == XmlPullParser.END_TAG && "chat-session".equals(parser.getName())) {

+ 2
- 2
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/AgentStatusRequest.java View File

@@ -127,7 +127,7 @@ public class AgentStatusRequest extends IQ {
127 127
             boolean done = false;
128 128
             while (!done) {
129 129
                 int eventType = parser.next();
130
-                if ((eventType == XmlPullParser.START_TAG) && ("agent".equals(parser.getName()))) {
130
+                if (eventType == XmlPullParser.START_TAG && "agent".equals(parser.getName())) {
131 131
                     statusRequest.agents.add(parseAgent(parser));
132 132
                 }
133 133
                 else if (eventType == XmlPullParser.END_TAG &&
@@ -146,7 +146,7 @@ public class AgentStatusRequest extends IQ {
146 146
             String name = null;
147 147
             while (!done) {
148 148
                 int eventType = parser.next();
149
-                if ((eventType == XmlPullParser.START_TAG) && ("name".equals(parser.getName()))) {
149
+                if (eventType == XmlPullParser.START_TAG && "name".equals(parser.getName())) {
150 150
                     name = parser.nextText();
151 151
                 }
152 152
                 else if (eventType == XmlPullParser.END_TAG &&

+ 1
- 1
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/MonitorPacket.java View File

@@ -86,7 +86,7 @@ public class MonitorPacket extends IQ {
86 86
 
87 87
             while (!done) {
88 88
                 int eventType = parser.next();
89
-                if ((eventType == XmlPullParser.START_TAG) && ("isMonitor".equals(parser.getName()))) {
89
+                if (eventType == XmlPullParser.START_TAG && "isMonitor".equals(parser.getName())) {
90 90
                     String value = parser.nextText();
91 91
                     if ("false".equalsIgnoreCase(value)) {
92 92
                         packet.setMonitor(false);

+ 7
- 7
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/OccupantsInfo.java View File

@@ -142,8 +142,8 @@ public class OccupantsInfo extends IQ {
142 142
             boolean done = false;
143 143
             while (!done) {
144 144
                 int eventType = parser.next();
145
-                if ((eventType == XmlPullParser.START_TAG) &&
146
-                        ("occupant".equals(parser.getName()))) {
145
+                if (eventType == XmlPullParser.START_TAG &&
146
+                        "occupant".equals(parser.getName())) {
147 147
                     occupantsInfo.occupants.add(parseOccupantInfo(parser));
148 148
                 } else if (eventType == XmlPullParser.END_TAG &&
149 149
                         ELEMENT_NAME.equals(parser.getName())) {
@@ -161,13 +161,13 @@ public class OccupantsInfo extends IQ {
161 161
             Date joined = null;
162 162
             while (!done) {
163 163
                 int eventType = parser.next();
164
-                if ((eventType == XmlPullParser.START_TAG) && ("jid".equals(parser.getName()))) {
164
+                if (eventType == XmlPullParser.START_TAG && "jid".equals(parser.getName())) {
165 165
                     jid = parser.nextText();
166
-                } else if ((eventType == XmlPullParser.START_TAG) &&
167
-                        ("nickname".equals(parser.getName()))) {
166
+                } else if (eventType == XmlPullParser.START_TAG &&
167
+                        "nickname".equals(parser.getName())) {
168 168
                     nickname = parser.nextText();
169
-                } else if ((eventType == XmlPullParser.START_TAG) &&
170
-                        ("joined".equals(parser.getName()))) {
169
+                } else if (eventType == XmlPullParser.START_TAG &&
170
+                        "joined".equals(parser.getName())) {
171 171
                     try {
172 172
                         synchronized (UTC_FORMAT) {
173 173
                             joined = UTC_FORMAT.parse(parser.nextText());

+ 2
- 2
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/QueueDetails.java View File

@@ -168,8 +168,8 @@ public final class QueueDetails implements ExtensionElement {
168 168
                     }
169 169
 
170 170
                     eventType = parser.next();
171
-                    while ((eventType != XmlPullParser.END_TAG)
172
-                                || (!"user".equals(parser.getName()))) {
171
+                    while (eventType != XmlPullParser.END_TAG
172
+                                || !"user".equals(parser.getName())) {
173 173
                         if ("position".equals(parser.getName())) {
174 174
                             position = Integer.parseInt(parser.nextText());
175 175
                         }

+ 3
- 3
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/QueueOverview.java View File

@@ -133,8 +133,8 @@ public class QueueOverview implements ExtensionElement {
133 133
             SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
134 134
 
135 135
             eventType = parser.next();
136
-            while ((eventType != XmlPullParser.END_TAG)
137
-                         || (!ELEMENT_NAME.equals(parser.getName()))) {
136
+            while (eventType != XmlPullParser.END_TAG
137
+                         || !ELEMENT_NAME.equals(parser.getName())) {
138 138
                 if ("count".equals(parser.getName())) {
139 139
                     queueOverview.setUserCount(Integer.parseInt(parser.nextText()));
140 140
                 }
@@ -143,7 +143,7 @@ public class QueueOverview implements ExtensionElement {
143 143
                 }
144 144
                 else if ("oldest".equals(parser.getName())) {
145 145
                     try {
146
-                        queueOverview.setOldestEntry((dateFormat.parse(parser.nextText())));
146
+                        queueOverview.setOldestEntry(dateFormat.parse(parser.nextText()));
147 147
                     } catch (ParseException e) {
148 148
                         throw new SmackException(e);
149 149
                     }

+ 4
- 4
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/ChatSettings.java View File

@@ -136,7 +136,7 @@ public class ChatSettings extends IQ {
136 136
             boolean done = false;
137 137
             while (!done) {
138 138
                 int eventType = parser.next();
139
-                if ((eventType == XmlPullParser.START_TAG) && ("chat-setting".equals(parser.getName()))) {
139
+                if (eventType == XmlPullParser.START_TAG && "chat-setting".equals(parser.getName())) {
140 140
                     chatSettings.addSetting(parseChatSetting(parser));
141 141
 
142 142
                 }
@@ -156,13 +156,13 @@ public class ChatSettings extends IQ {
156 156
 
157 157
             while (!done) {
158 158
                 int eventType = parser.next();
159
-                if ((eventType == XmlPullParser.START_TAG) && ("key".equals(parser.getName()))) {
159
+                if (eventType == XmlPullParser.START_TAG && "key".equals(parser.getName())) {
160 160
                     key = parser.nextText();
161 161
                 }
162
-                else if ((eventType == XmlPullParser.START_TAG) && ("value".equals(parser.getName()))) {
162
+                else if (eventType == XmlPullParser.START_TAG && "value".equals(parser.getName())) {
163 163
                     value = parser.nextText();
164 164
                 }
165
-                else if ((eventType == XmlPullParser.START_TAG) && ("type".equals(parser.getName()))) {
165
+                else if (eventType == XmlPullParser.START_TAG && "type".equals(parser.getName())) {
166 166
                     type = Integer.parseInt(parser.nextText());
167 167
                 }
168 168
                 else if (eventType == XmlPullParser.END_TAG && "chat-setting".equals(parser.getName())) {

+ 1
- 1
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/GenericSettings.java View File

@@ -88,7 +88,7 @@ public class GenericSettings extends IQ {
88 88
 
89 89
             while (!done) {
90 90
                 int eventType = parser.next();
91
-                if ((eventType == XmlPullParser.START_TAG) && ("entry".equals(parser.getName()))) {
91
+                if (eventType == XmlPullParser.START_TAG && "entry".equals(parser.getName())) {
92 92
                     eventType = parser.next();
93 93
                     String name = parser.nextText();
94 94
                     eventType = parser.next();

+ 4
- 4
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/OfflineSettings.java View File

@@ -118,16 +118,16 @@ public class OfflineSettings extends SimpleIQ {
118 118
 
119 119
             while (!done) {
120 120
                 int eventType = parser.next();
121
-                if ((eventType == XmlPullParser.START_TAG) && ("redirectPage".equals(parser.getName()))) {
121
+                if (eventType == XmlPullParser.START_TAG && "redirectPage".equals(parser.getName())) {
122 122
                     redirectPage = parser.nextText();
123 123
                 }
124
-                else if ((eventType == XmlPullParser.START_TAG) && ("subject".equals(parser.getName()))) {
124
+                else if (eventType == XmlPullParser.START_TAG && "subject".equals(parser.getName())) {
125 125
                     subject = parser.nextText();
126 126
                 }
127
-                else if ((eventType == XmlPullParser.START_TAG) && ("offlineText".equals(parser.getName()))) {
127
+                else if (eventType == XmlPullParser.START_TAG && "offlineText".equals(parser.getName())) {
128 128
                     offlineText = parser.nextText();
129 129
                 }
130
-                else if ((eventType == XmlPullParser.START_TAG) && ("emailAddress".equals(parser.getName()))) {
130
+                else if (eventType == XmlPullParser.START_TAG && "emailAddress".equals(parser.getName())) {
131 131
                     emailAddress = parser.nextText();
132 132
                 }
133 133
                 else if (eventType == XmlPullParser.END_TAG && "offline-settings".equals(parser.getName())) {

+ 2
- 2
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/SearchSettings.java View File

@@ -87,10 +87,10 @@ public class SearchSettings extends SimpleIQ {
87 87
 
88 88
             while (!done) {
89 89
                 int eventType = parser.next();
90
-                if ((eventType == XmlPullParser.START_TAG) && ("forums".equals(parser.getName()))) {
90
+                if (eventType == XmlPullParser.START_TAG && "forums".equals(parser.getName())) {
91 91
                     forums = parser.nextText();
92 92
                 }
93
-                else if ((eventType == XmlPullParser.START_TAG) && ("kb".equals(parser.getName()))) {
93
+                else if ((eventType == XmlPullParser.START_TAG) && "kb".equals(parser.getName())) {
94 94
                     kb = parser.nextText();
95 95
                 }
96 96
                 else if (eventType == XmlPullParser.END_TAG && "search-settings".equals(parser.getName())) {

+ 2
- 2
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/SoundSettings.java View File

@@ -76,10 +76,10 @@ public class SoundSettings extends SimpleIQ {
76 76
 
77 77
             while (!done) {
78 78
                 int eventType = parser.next();
79
-                if ((eventType == XmlPullParser.START_TAG) && ("outgoingSound".equals(parser.getName()))) {
79
+                if (eventType == XmlPullParser.START_TAG && "outgoingSound".equals(parser.getName())) {
80 80
                     soundSettings.setOutgoingSound(parser.nextText());
81 81
                 }
82
-                else if ((eventType == XmlPullParser.START_TAG) && ("incomingSound".equals(parser.getName()))) {
82
+                else if ((eventType == XmlPullParser.START_TAG) && "incomingSound".equals(parser.getName())) {
83 83
                     soundSettings.setIncomingSound(parser.nextText());
84 84
                 }
85 85
                 else if (eventType == XmlPullParser.END_TAG && "sound-settings".equals(parser.getName())) {

+ 3
- 3
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/settings/WorkgroupProperties.java View File

@@ -103,13 +103,13 @@ public class WorkgroupProperties extends IQ {
103 103
 
104 104
             while (!done) {
105 105
                 int eventType = parser.next();
106
-                if ((eventType == XmlPullParser.START_TAG) && ("authRequired".equals(parser.getName()))) {
106
+                if (eventType == XmlPullParser.START_TAG && "authRequired".equals(parser.getName())) {
107 107
                     props.setAuthRequired(Boolean.valueOf(parser.nextText()).booleanValue());
108 108
                 }
109
-                else if ((eventType == XmlPullParser.START_TAG) && ("email".equals(parser.getName()))) {
109
+                else if (eventType == XmlPullParser.START_TAG && "email".equals(parser.getName())) {
110 110
                     props.setEmail(parser.nextText());
111 111
                 }
112
-                else if ((eventType == XmlPullParser.START_TAG) && ("name".equals(parser.getName()))) {
112
+                else if (eventType == XmlPullParser.START_TAG && "name".equals(parser.getName())) {
113 113
                     props.setFullName(parser.nextText());
114 114
                 }
115 115
                 else if (eventType == XmlPullParser.END_TAG && "workgroup-properties".equals(parser.getName())) {

+ 1
- 1
smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/util/MetaDataUtils.java View File

@@ -58,7 +58,7 @@ public class MetaDataUtils {
58 58
 
59 59
             // Keep parsing until we've gotten to end of meta-data.
60 60
             while ((eventType != XmlPullParser.END_TAG)
61
-                    || (!parser.getName().equals(MetaData.ELEMENT_NAME))) {
61
+                    || !parser.getName().equals(MetaData.ELEMENT_NAME)) {
62 62
                 String name = parser.getAttributeValue(0);
63 63
                 String value = parser.nextText();
64 64
 

+ 1
- 0
smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoKeyUtil.java View File

@@ -40,6 +40,7 @@ import org.jivesoftware.smackx.omemo.trust.OmemoFingerprint;
40 40
  * @param <T_Bundle>    Bundle class
41 41
  * @author Paul Schaub
42 42
  */
43
+@SuppressWarnings("InconsistentCapitalization")
43 44
 public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_ECPub, T_Bundle> {
44 45
     private static final Logger LOGGER = Logger.getLogger(OmemoKeyUtil.class.getName());
45 46
 

+ 1
- 1
smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java View File

@@ -172,7 +172,7 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
172 172
         byte[] body;
173 173
         byte[] ciphertext;
174 174
 
175
-        body = (message.getBytes(StringUtils.UTF8));
175
+        body = message.getBytes(StringUtils.UTF8);
176 176
         ciphertext = cipher.doFinal(body);
177 177
 
178 178
         byte[] clearKeyWithAuthTag = new byte[messageKey.length + 16];

+ 3
- 1
smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/PublicKeysListElement.java View File

@@ -150,7 +150,9 @@ public final class PublicKeysListElement implements ExtensionElement {
150 150
                 return true;
151 151
             }
152 152
 
153
-            return hashCode() == o.hashCode();
153
+            PubkeyMetadataElement otherPubkeyMetadataElement = (PubkeyMetadataElement) o;
154
+            return this.getV4Fingerprint().equals(otherPubkeyMetadataElement.getV4Fingerprint()) &&
155
+                this.getDate().equals(otherPubkeyMetadataElement.getDate());
154 156
         }
155 157
     }
156 158
 }

+ 1
- 1
smack-tcp/src/test/java/org/jivesoftware/smack/sm/provider/ParseStreamManagementTest.java View File

@@ -68,7 +68,7 @@ public class ParseStreamManagementTest {
68 68
 
69 69
     @Test
70 70
     public void testParseEnabledInvariant() throws XmlPullParserException, IOException {
71
-        String enabledString = (new StreamManagement.Enabled("stream-id", false)).toXML(null).toString();
71
+        String enabledString = new StreamManagement.Enabled("stream-id", false).toXML(null).toString();
72 72
         XmlPullParser parser = PacketParserUtils.getParserFor(enabledString);
73 73
         StreamManagement.Enabled enabled = ParseStreamManagement.enabled(parser);
74 74
 

Loading…
Cancel
Save