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

Fix or suppress warnings

This commit is contained in:
Florian Schmaus 2014-04-03 23:00:36 +02:00
parent d8a5610d7b
commit ef43ba6322
14 changed files with 40 additions and 42 deletions

View file

@ -24,7 +24,9 @@ import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import javax.net.SocketFactory;
import org.jivesoftware.smack.util.StringUtils;
import java.util.regex.Matcher;
@ -78,6 +80,7 @@ class HTTPProxySocketFactory
{
String proxyhost = proxy.getProxyAddress();
int proxyPort = proxy.getProxyPort();
@SuppressWarnings("resource")
Socket socket = new Socket(proxyhost,proxyPort);
String hostport = "CONNECT " + host + ":" + port;
String proxyLine;

View file

@ -22,6 +22,7 @@ import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import javax.net.SocketFactory;
/**
@ -67,6 +68,7 @@ public class Socks4ProxySocketFactory
}
@SuppressWarnings("resource")
private Socket socks4ProxifiedSocket(String host, int port)
throws IOException
{

View file

@ -16,13 +16,13 @@
*/
package org.jivesoftware.smack.util;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.fail;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLNotEqual;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Locale;
import java.util.Properties;
@ -49,7 +49,6 @@ public class PacketParserUtilsTest {
outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
}
@SuppressWarnings("deprecation")
@Test
public void singleMessageBodyTest() throws Exception {
String defaultLanguage = Packet.getDefaultLanguage();
@ -199,7 +198,6 @@ public class PacketParserUtilsTest {
}
@SuppressWarnings("deprecation")
@Test
public void singleMessageSubjectTest() throws Exception {
String defaultLanguage = Packet.getDefaultLanguage();
@ -349,7 +347,6 @@ public class PacketParserUtilsTest {
}
@SuppressWarnings("deprecation")
@Test
public void multipleMessageBodiesTest() throws Exception {
String defaultLanguage = Packet.getDefaultLanguage();
@ -503,7 +500,6 @@ public class PacketParserUtilsTest {
}
@SuppressWarnings("deprecation")
@Test
public void multipleMessageSubjectsTest() throws Exception {
String defaultLanguage = Packet.getDefaultLanguage();
@ -657,7 +653,6 @@ public class PacketParserUtilsTest {
}
@SuppressWarnings("deprecation")
@Test
public void invalidMessageBodyContainingTagTest() throws Exception {
String control = XMLBuilder.create("message")
@ -691,7 +686,6 @@ public class PacketParserUtilsTest {
}
@SuppressWarnings("deprecation")
@Test
public void invalidXMLInMessageBody() throws Exception {
String validControl = XMLBuilder.create("message")
@ -768,7 +762,6 @@ public class PacketParserUtilsTest {
assertXMLEqual(stanza, presence.toXML().toString());
}
@SuppressWarnings("deprecation")
@Test
public void validatePresenceProbe() throws Exception {
String stanza = "<presence from='mercutio@example.com' id='xv291f38' to='juliet@example.com' type='unsubscribed'/>";
@ -779,7 +772,6 @@ public class PacketParserUtilsTest {
assertEquals(Presence.Type.unsubscribed, presence.getType());
}
@SuppressWarnings("deprecation")
@Test
public void validatePresenceOptionalElements() throws Exception {
String stanza = "<presence xml:lang='en' type='unsubscribed'>"