mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-24 03:27:59 +01:00
Make JUL Loggers final (SMACK-536)
This commit is contained in:
parent
f0c6d1f1d3
commit
54a421e84e
30 changed files with 109 additions and 109 deletions
|
@ -39,7 +39,7 @@ import java.util.logging.Logger;
|
|||
* @author Matt Tucker
|
||||
*/
|
||||
public class AccountManager {
|
||||
private static Logger logger = Logger.getLogger(AccountManager.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(AccountManager.class.getName());
|
||||
|
||||
private Connection connection;
|
||||
private Registration info = null;
|
||||
|
@ -134,7 +134,7 @@ public class AccountManager {
|
|||
}
|
||||
}
|
||||
catch (XMPPException xe) {
|
||||
logger.log(Level.SEVERE, "Error retrieving account attributes from server", xe);
|
||||
LOGGER.log(Level.SEVERE, "Error retrieving account attributes from server", xe);
|
||||
}
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ public class AccountManager {
|
|||
return info.getAttributes().get(name);
|
||||
}
|
||||
catch (XMPPException xe) {
|
||||
logger.log(Level.SEVERE, "Error retrieving account attribute " + name + " info from server", xe);
|
||||
LOGGER.log(Level.SEVERE, "Error retrieving account attribute " + name + " info from server", xe);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ public class AccountManager {
|
|||
return info.getInstructions();
|
||||
}
|
||||
catch (XMPPException xe) {
|
||||
logger.log(Level.SEVERE, "Error retrieving account instructions from server", xe);
|
||||
LOGGER.log(Level.SEVERE, "Error retrieving account instructions from server", xe);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ import org.jivesoftware.smack.packet.Presence;
|
|||
* @author Guenther Niess
|
||||
*/
|
||||
public abstract class Connection {
|
||||
private static Logger log = Logger.getLogger(Connection.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(Connection.class.getName());
|
||||
|
||||
/**
|
||||
* Counter to uniquely identify connections that are created.
|
||||
|
@ -793,7 +793,7 @@ public abstract class Connection {
|
|||
debuggerClass = Class.forName(className);
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.warning("Unabled to instantiate debugger class " + className);
|
||||
LOGGER.warning("Unabled to instantiate debugger class " + className);
|
||||
}
|
||||
}
|
||||
if (debuggerClass == null) {
|
||||
|
@ -807,7 +807,7 @@ public abstract class Connection {
|
|||
Class.forName("org.jivesoftware.smack.debugger.LiteDebugger");
|
||||
}
|
||||
catch (Exception ex2) {
|
||||
log.warning("Unabled to instantiate either Smack debugger class");
|
||||
LOGGER.warning("Unabled to instantiate either Smack debugger class");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ import java.util.logging.Logger;
|
|||
*/
|
||||
class PacketReader {
|
||||
|
||||
private static Logger log = Logger.getLogger(PacketReader.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(PacketReader.class.getName());
|
||||
|
||||
private Thread readerThread;
|
||||
private ExecutorService listenerExecutor;
|
||||
|
@ -135,7 +135,7 @@ class PacketReader {
|
|||
catch (Exception e) {
|
||||
// Catch and print any exception so we can recover
|
||||
// from a faulty listener and finish the shutdown process
|
||||
log.log(Level.SEVERE, "Error in listener while closing connection", e);
|
||||
LOGGER.log(Level.SEVERE, "Error in listener while closing connection", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ class PacketReader {
|
|||
parser.setInput(connection.reader);
|
||||
}
|
||||
catch (XmlPullParserException xppe) {
|
||||
log.log(Level.WARNING, "Error while resetting parser", xppe);
|
||||
LOGGER.log(Level.WARNING, "Error while resetting parser", xppe);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ class PacketReader {
|
|||
try {
|
||||
listenerWrapper.notifyListener(packet);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.SEVERE, "Exception in packet listener", e);
|
||||
LOGGER.log(Level.SEVERE, "Exception in packet listener", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.util.logging.Logger;
|
|||
* @author Matt Tucker
|
||||
*/
|
||||
class PacketWriter {
|
||||
private static Logger log = Logger.getLogger(PacketWriter.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(PacketWriter.class.getName());
|
||||
|
||||
private Thread writerThread;
|
||||
private Writer writer;
|
||||
|
@ -88,7 +88,7 @@ class PacketWriter {
|
|||
queue.put(packet);
|
||||
}
|
||||
catch (InterruptedException ie) {
|
||||
log.log(Level.SEVERE, "Failed to queue packet to send to server: " + packet.toString(), ie);
|
||||
LOGGER.log(Level.SEVERE, "Failed to queue packet to send to server: " + packet.toString(), ie);
|
||||
return;
|
||||
}
|
||||
synchronized (queue) {
|
||||
|
@ -172,7 +172,7 @@ class PacketWriter {
|
|||
writer.flush();
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.warning("Error flushing queue during shutdown, ignore and continue");
|
||||
LOGGER.warning("Error flushing queue during shutdown, ignore and continue");
|
||||
}
|
||||
|
||||
// Delete the queue contents (hopefully nothing is left).
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.util.logging.Logger;
|
|||
* @author Francisco Vives
|
||||
*/
|
||||
public class ReconnectionManager implements ConnectionListener {
|
||||
private static Logger log = Logger.getLogger(ReconnectionManager.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ReconnectionManager.class.getName());
|
||||
|
||||
// Holds the connection to the server
|
||||
private Connection connection;
|
||||
|
@ -134,7 +134,7 @@ public class ReconnectionManager implements ConnectionListener {
|
|||
.notifyAttemptToReconnectIn(remainingSeconds);
|
||||
}
|
||||
catch (InterruptedException e1) {
|
||||
log.warning("Sleeping thread interrupted");
|
||||
LOGGER.warning("Sleeping thread interrupted");
|
||||
// Notify the reconnection has failed
|
||||
ReconnectionManager.this.notifyReconnectionFailed(e1);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public final class SmackConfiguration {
|
|||
private static final String SMACK_VERSION;
|
||||
private static final String DEFAULT_CONFIG_FILE = "classpath:org.jivesoftware.smack/smack-config.xml";
|
||||
|
||||
private static final Logger log = Logger.getLogger(SmackConfiguration.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(SmackConfiguration.class.getName());
|
||||
|
||||
private static int defaultPacketReplyTimeout = 5000;
|
||||
private static int packetCollectorSize = 5000;
|
||||
|
@ -72,7 +72,7 @@ public final class SmackConfiguration {
|
|||
is.read(buf);
|
||||
smackVersion = new String(buf, "UTF-8");
|
||||
} catch(Exception e) {
|
||||
log.log(Level.SEVERE, "Could not determine Smack version", e);
|
||||
LOGGER.log(Level.SEVERE, "Could not determine Smack version", e);
|
||||
smackVersion = "unkown";
|
||||
}
|
||||
SMACK_VERSION = smackVersion;
|
||||
|
@ -271,7 +271,7 @@ public final class SmackConfiguration {
|
|||
cfgFileStream.close();
|
||||
}
|
||||
catch (IOException e) {
|
||||
log.log(Level.SEVERE, "Error while closing config file input stream", e);
|
||||
LOGGER.log(Level.SEVERE, "Error while closing config file input stream", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ public final class SmackConfiguration {
|
|||
name = parser.getName();
|
||||
if (eventType == XmlPullParser.START_TAG && "className".equals(name)) {
|
||||
if (disabledSmackClasses.contains(name)) {
|
||||
log.info("Not loading disabled Smack class " + name);
|
||||
LOGGER.info("Not loading disabled Smack class " + name);
|
||||
}
|
||||
else {
|
||||
String classToLoad = parser.nextText();
|
||||
|
@ -316,7 +316,7 @@ public final class SmackConfiguration {
|
|||
else {
|
||||
logLevel = Level.WARNING;
|
||||
}
|
||||
log.log(logLevel, "A startup class [" + className
|
||||
LOGGER.log(logLevel, "A startup class [" + className
|
||||
+ "] specified in smack-config.xml could not be loaded: ");
|
||||
if (!optional)
|
||||
throw cnfe;
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.jivesoftware.smack.util.FileUtils;
|
|||
*/
|
||||
public class LoggingInitializer implements SmackInitializer {
|
||||
|
||||
private static Logger log = Logger.getLogger(LoggingInitializer.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(LoggingInitializer.class.getName());
|
||||
|
||||
private List<Exception> exceptions = new LinkedList<Exception>();
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class LoggingInitializer implements SmackInitializer {
|
|||
LogManager.getLogManager().readConfiguration(FileUtils.getStreamForUrl("classpath:org.jivesofware.smack/jul.properties", null));
|
||||
}
|
||||
catch (Exception e) {
|
||||
log .log(Level.WARNING, "Could not initialize Java Logging from default file.", e);
|
||||
LOGGER.log(Level.WARNING, "Could not initialize Java Logging from default file.", e);
|
||||
exceptions.add(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.jivesoftware.smack.util.FileUtils;
|
|||
*
|
||||
*/
|
||||
public abstract class UrlProviderFileInitializer implements SmackInitializer {
|
||||
private static final Logger log = Logger.getLogger(UrlProviderFileInitializer.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(UrlProviderFileInitializer.class.getName());
|
||||
|
||||
private List<Exception> exceptions = new LinkedList<Exception>();
|
||||
|
||||
|
@ -47,18 +47,18 @@ public abstract class UrlProviderFileInitializer implements SmackInitializer {
|
|||
InputStream is = FileUtils.getStreamForUrl(filePath, getClassLoader());
|
||||
|
||||
if (is != null) {
|
||||
log.log(Level.INFO, "Loading providers for file [" + filePath + "]");
|
||||
LOGGER.log(Level.INFO, "Loading providers for file [" + filePath + "]");
|
||||
ProviderFileLoader pfl = new ProviderFileLoader(is);
|
||||
ProviderManager.getInstance().addLoader(pfl);
|
||||
exceptions.addAll(pfl.getLoadingExceptions());
|
||||
}
|
||||
else {
|
||||
log.log(Level.WARNING, "No input stream created for " + filePath);
|
||||
LOGGER.log(Level.WARNING, "No input stream created for " + filePath);
|
||||
exceptions.add(new IOException("No input stream created for " + filePath));
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.log(Level.SEVERE, "Error trying to load provider file " + filePath, e);
|
||||
LOGGER.log(Level.SEVERE, "Error trying to load provider file " + filePath, e);
|
||||
exceptions.add(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ import java.util.logging.Logger;
|
|||
* @author Matt Tucker
|
||||
*/
|
||||
public abstract class Packet {
|
||||
private static Logger log = Logger.getLogger(Packet.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(Packet.class.getName());
|
||||
|
||||
protected static final String DEFAULT_LANGUAGE =
|
||||
java.util.Locale.getDefault().getLanguage().toLowerCase();
|
||||
|
@ -411,7 +411,7 @@ public abstract class Packet {
|
|||
buf.append(encodedVal).append("</value>");
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.log(Level.SEVERE, "Error encoding java object", e);
|
||||
LOGGER.log(Level.SEVERE, "Error encoding java object", e);
|
||||
}
|
||||
finally {
|
||||
if (out != null) {
|
||||
|
|
|
@ -27,11 +27,11 @@ import java.util.logging.Logger;
|
|||
*
|
||||
*/
|
||||
public class ExceptionLoggingCallback extends ParsingExceptionCallback {
|
||||
private static Logger log = Logger.getLogger(ExceptionLoggingCallback.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ExceptionLoggingCallback.class.getName());
|
||||
|
||||
@Override
|
||||
public void handleUnparsablePacket(UnparsablePacket unparsed) throws Exception {
|
||||
log.log(Level.SEVERE, "Smack message parsing exception: ", unparsed.getParsingException());
|
||||
log.severe("Unparsed content: " + unparsed.getContent());
|
||||
LOGGER.log(Level.SEVERE, "Smack message parsing exception: ", unparsed.getParsingException());
|
||||
LOGGER.severe("Unparsed content: " + unparsed.getContent());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
*
|
||||
*/
|
||||
public class ProviderFileLoader implements ProviderLoader {
|
||||
private final static Logger log = Logger.getLogger(ProviderFileLoader.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ProviderFileLoader.class.getName());
|
||||
|
||||
private Collection<IQProviderInfo> iqProviders;
|
||||
private Collection<ExtensionProviderInfo> extProviders;
|
||||
|
@ -135,13 +135,13 @@ public class ProviderFileLoader implements ProviderLoader {
|
|||
}
|
||||
}
|
||||
catch (ClassNotFoundException cnfe) {
|
||||
log.log(Level.SEVERE, "Could not find provider class", cnfe);
|
||||
LOGGER.log(Level.SEVERE, "Could not find provider class", cnfe);
|
||||
exceptions.add(cnfe);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IllegalArgumentException illExc) {
|
||||
log.log(Level.SEVERE, "Invalid provider type found [" + typeName + "] when expecting iqProvider or extensionProvider", illExc);
|
||||
LOGGER.log(Level.SEVERE, "Invalid provider type found [" + typeName + "] when expecting iqProvider or extensionProvider", illExc);
|
||||
exceptions.add(illExc);
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ public class ProviderFileLoader implements ProviderLoader {
|
|||
while (eventType != XmlPullParser.END_DOCUMENT);
|
||||
}
|
||||
catch (Exception e){
|
||||
log.log(Level.SEVERE, "Unknown error occurred while parsing provider file", e);
|
||||
LOGGER.log(Level.SEVERE, "Unknown error occurred while parsing provider file", e);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.logging.Logger;
|
|||
*/
|
||||
public class Base64
|
||||
{
|
||||
private static Logger log = Logger.getLogger(Base64.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(Base64.class.getName());
|
||||
|
||||
/* ******** P U B L I C F I E L D S ******** */
|
||||
|
||||
|
@ -494,7 +494,7 @@ public class Base64
|
|||
} // end try
|
||||
catch( java.io.IOException e )
|
||||
{
|
||||
log.log(Level.SEVERE, "Error encoding object", e);
|
||||
LOGGER.log(Level.SEVERE, "Error encoding object", e);
|
||||
return null;
|
||||
} // end catch
|
||||
finally
|
||||
|
@ -623,7 +623,7 @@ public class Base64
|
|||
} // end try
|
||||
catch( java.io.IOException e )
|
||||
{
|
||||
log.log(Level.SEVERE, "Error encoding bytes", e);
|
||||
LOGGER.log(Level.SEVERE, "Error encoding bytes", e);
|
||||
return null;
|
||||
} // end catch
|
||||
finally
|
||||
|
@ -778,11 +778,11 @@ public class Base64
|
|||
|
||||
return 3;
|
||||
}catch( Exception e){
|
||||
log.log(Level.SEVERE, e.getMessage(), e);
|
||||
log.severe(""+source[srcOffset]+ ": " + ( DECODABET[ source[ srcOffset ] ] ) );
|
||||
log.severe(""+source[srcOffset+1]+ ": " + ( DECODABET[ source[ srcOffset + 1 ] ] ) );
|
||||
log.severe(""+source[srcOffset+2]+ ": " + ( DECODABET[ source[ srcOffset + 2 ] ] ) );
|
||||
log.severe(""+source[srcOffset+3]+ ": " + ( DECODABET[ source[ srcOffset + 3 ] ] ) );
|
||||
LOGGER.log(Level.SEVERE, e.getMessage(), e);
|
||||
LOGGER.severe(""+source[srcOffset]+ ": " + ( DECODABET[ source[ srcOffset ] ] ) );
|
||||
LOGGER.severe(""+source[srcOffset+1]+ ": " + ( DECODABET[ source[ srcOffset + 1 ] ] ) );
|
||||
LOGGER.severe(""+source[srcOffset+2]+ ": " + ( DECODABET[ source[ srcOffset + 2 ] ] ) );
|
||||
LOGGER.severe(""+source[srcOffset+3]+ ": " + ( DECODABET[ source[ srcOffset + 3 ] ] ) );
|
||||
return -1;
|
||||
} // end catch
|
||||
}
|
||||
|
@ -840,7 +840,7 @@ public class Base64
|
|||
} // end if: white space, equals sign or better
|
||||
else
|
||||
{
|
||||
log.warning("Bad Base64 input character at " + i + ": " + source[i] + "(decimal)");
|
||||
LOGGER.warning("Bad Base64 input character at " + i + ": " + source[i] + "(decimal)");
|
||||
return null;
|
||||
} // end else:
|
||||
} // each input character
|
||||
|
@ -968,12 +968,12 @@ public class Base64
|
|||
} // end try
|
||||
catch( java.io.IOException e )
|
||||
{
|
||||
log.log(Level.SEVERE, "Error reading object", e);
|
||||
LOGGER.log(Level.SEVERE, "Error reading object", e);
|
||||
obj = null;
|
||||
} // end catch
|
||||
catch( java.lang.ClassNotFoundException e )
|
||||
{
|
||||
log.log(Level.SEVERE, "Class not found for encoded object", e);
|
||||
LOGGER.log(Level.SEVERE, "Class not found for encoded object", e);
|
||||
obj = null;
|
||||
} // end catch
|
||||
finally
|
||||
|
@ -1080,7 +1080,7 @@ public class Base64
|
|||
// Check for size of file
|
||||
if( file.length() > Integer.MAX_VALUE )
|
||||
{
|
||||
log.warning("File is too big for this convenience method (" + file.length() + " bytes).");
|
||||
LOGGER.warning("File is too big for this convenience method (" + file.length() + " bytes).");
|
||||
return null;
|
||||
} // end if: file too big for int index
|
||||
buffer = new byte[ (int)file.length() ];
|
||||
|
@ -1101,7 +1101,7 @@ public class Base64
|
|||
} // end try
|
||||
catch( java.io.IOException e )
|
||||
{
|
||||
log.log(Level.SEVERE, "Error decoding from file " + filename, e);
|
||||
LOGGER.log(Level.SEVERE, "Error decoding from file " + filename, e);
|
||||
} // end catch: IOException
|
||||
finally
|
||||
{
|
||||
|
@ -1149,7 +1149,7 @@ public class Base64
|
|||
} // end try
|
||||
catch( java.io.IOException e )
|
||||
{
|
||||
log.log(Level.SEVERE, "Error encoding from file " + filename, e);
|
||||
LOGGER.log(Level.SEVERE, "Error encoding from file " + filename, e);
|
||||
} // end catch: IOException
|
||||
finally
|
||||
{
|
||||
|
@ -1176,7 +1176,7 @@ public class Base64
|
|||
out.write( encoded.getBytes("US-ASCII") ); // Strict, 7-bit output.
|
||||
} // end try
|
||||
catch( java.io.IOException ex ) {
|
||||
log.log(Level.SEVERE, "Error encoding file " + infile, ex);
|
||||
LOGGER.log(Level.SEVERE, "Error encoding file " + infile, ex);
|
||||
} // end catch
|
||||
finally {
|
||||
try { out.close(); }
|
||||
|
@ -1202,7 +1202,7 @@ public class Base64
|
|||
out.write( decoded );
|
||||
} // end try
|
||||
catch( java.io.IOException ex ) {
|
||||
log.log(Level.SEVERE, "Error decoding file " + infile, ex);
|
||||
LOGGER.log(Level.SEVERE, "Error decoding file " + infile, ex);
|
||||
} // end catch
|
||||
finally {
|
||||
try { out.close(); }
|
||||
|
|
|
@ -47,7 +47,7 @@ import java.util.logging.Logger;
|
|||
* @author Matt Tucker
|
||||
*/
|
||||
public class Cache<K, V> implements Map<K, V> {
|
||||
private static Logger log = Logger.getLogger(Cache.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(Cache.class.getName());
|
||||
/**
|
||||
* The map the keys and values are stored in.
|
||||
*/
|
||||
|
@ -382,7 +382,7 @@ public class Cache<K, V> implements Map<K, V> {
|
|||
|
||||
while (expireTime > node.timestamp) {
|
||||
if (remove(node.object, true) == null) {
|
||||
log.warning("Error attempting to remove(" + node.object.toString() + ") - cacheObject not found in cache!");
|
||||
LOGGER.warning("Error attempting to remove(" + node.object.toString() + ") - cacheObject not found in cache!");
|
||||
// remove from the ageList
|
||||
node.remove();
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ public class Cache<K, V> implements Map<K, V> {
|
|||
for (int i=map.size(); i>desiredSize; i--) {
|
||||
// Get the key and invoke the remove method on it.
|
||||
if (remove(lastAccessedList.getLast().object, true) == null) {
|
||||
log.warning("Error attempting to cullCache with remove(" + lastAccessedList.getLast().object.toString() + ") - cacheObject not found in cache!");
|
||||
LOGGER.warning("Error attempting to cullCache with remove(" + lastAccessedList.getLast().object.toString() + ") - cacheObject not found in cache!");
|
||||
lastAccessedList.getLast().remove();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class PacketParserUtils {
|
||||
private static Logger logger = Logger.getLogger(PacketParserUtils.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(PacketParserUtils.class.getName());
|
||||
|
||||
/**
|
||||
* Namespace used to store packet properties.
|
||||
|
@ -197,7 +197,7 @@ public class PacketParserUtils {
|
|||
type = Presence.Type.valueOf(typeString);
|
||||
}
|
||||
catch (IllegalArgumentException iae) {
|
||||
logger.warning("Found invalid presence type " + typeString);
|
||||
LOGGER.warning("Found invalid presence type " + typeString);
|
||||
}
|
||||
}
|
||||
Presence presence = new Presence(type);
|
||||
|
@ -241,7 +241,7 @@ public class PacketParserUtils {
|
|||
presence.setMode(Presence.Mode.valueOf(modeText));
|
||||
}
|
||||
catch (IllegalArgumentException iae) {
|
||||
logger.warning("Found invalid presence mode " + modeText);
|
||||
LOGGER.warning("Found invalid presence mode " + modeText);
|
||||
}
|
||||
}
|
||||
else if (elementName.equals("error")) {
|
||||
|
@ -262,7 +262,7 @@ public class PacketParserUtils {
|
|||
presence.addExtension(PacketParserUtils.parsePacketExtension(elementName, namespace, parser));
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.warning("Failed to parse extension packet in Presence packet.");
|
||||
LOGGER.warning("Failed to parse extension packet in Presence packet.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -642,7 +642,7 @@ public class PacketParserUtils {
|
|||
value = in.readObject();
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "Error parsing java object", e);
|
||||
LOGGER.log(Level.SEVERE, "Error parsing java object", e);
|
||||
}
|
||||
}
|
||||
if (name != null && value != null) {
|
||||
|
@ -785,7 +785,7 @@ public class PacketParserUtils {
|
|||
}
|
||||
}
|
||||
catch (IllegalArgumentException iae) {
|
||||
logger.log(Level.SEVERE, "Could not find error type for " + type.toUpperCase(), iae);
|
||||
LOGGER.log(Level.SEVERE, "Could not find error type for " + type.toUpperCase(), iae);
|
||||
}
|
||||
return new XMPPError(Integer.parseInt(errorCode), errorType, condition, message, extensions);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ import java.util.regex.Pattern;
|
|||
* A collection of utility methods for String objects.
|
||||
*/
|
||||
public class StringUtils {
|
||||
private static Logger log = Logger.getLogger(StringUtils.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(StringUtils.class.getName());
|
||||
|
||||
/**
|
||||
* Date format as defined in XEP-0082 - XMPP Date and Time Profiles. The time zone is set to
|
||||
|
@ -661,7 +661,7 @@ public class StringUtils {
|
|||
digest = MessageDigest.getInstance("SHA-1");
|
||||
}
|
||||
catch (NoSuchAlgorithmException nsae) {
|
||||
log.log(Level.SEVERE, "Failed to load the SHA-1 MessageDigest. Smack will be unable to function normally.", nsae);
|
||||
LOGGER.log(Level.SEVERE, "Failed to load the SHA-1 MessageDigest. Smack will be unable to function normally.", nsae);
|
||||
}
|
||||
}
|
||||
// Now, compute hash.
|
||||
|
@ -669,7 +669,7 @@ public class StringUtils {
|
|||
digest.update(data.getBytes("UTF-8"));
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
log.log(Level.SEVERE, "Error computing hash", e);
|
||||
LOGGER.log(Level.SEVERE, "Error computing hash", e);
|
||||
}
|
||||
return encodeHex(digest.digest());
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ import java.util.logging.Logger;
|
|||
*/
|
||||
public class EnhancedDebugger implements SmackDebugger {
|
||||
|
||||
private static Logger log = Logger.getLogger(EnhancedDebugger.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(EnhancedDebugger.class.getName());
|
||||
|
||||
private static final String NEWLINE = "\n";
|
||||
|
||||
|
@ -428,7 +428,7 @@ public class EnhancedDebugger implements SmackDebugger {
|
|||
receivedText.replaceRange("", 0, receivedText.getLineEndOffset(0));
|
||||
}
|
||||
catch (BadLocationException e) {
|
||||
log.log(Level.SEVERE, "Error with line offset, MAX_TABLE_ROWS is set too low: " + EnhancedDebuggerWindow.MAX_TABLE_ROWS, e);
|
||||
LOGGER.log(Level.SEVERE, "Error with line offset, MAX_TABLE_ROWS is set too low: " + EnhancedDebuggerWindow.MAX_TABLE_ROWS, e);
|
||||
}
|
||||
}
|
||||
receivedText.append(str.substring(0, index + 1));
|
||||
|
@ -463,7 +463,7 @@ public class EnhancedDebugger implements SmackDebugger {
|
|||
sentText.replaceRange("", 0, sentText.getLineEndOffset(0));
|
||||
}
|
||||
catch (BadLocationException e) {
|
||||
log.log(Level.SEVERE, "Error with line offset, MAX_TABLE_ROWS is set too low: " + EnhancedDebuggerWindow.MAX_TABLE_ROWS, e);
|
||||
LOGGER.log(Level.SEVERE, "Error with line offset, MAX_TABLE_ROWS is set too low: " + EnhancedDebuggerWindow.MAX_TABLE_ROWS, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -896,10 +896,10 @@ public class EnhancedDebugger implements SmackDebugger {
|
|||
|
||||
}
|
||||
catch (TransformerConfigurationException tce) {
|
||||
log.log(Level.SEVERE, "Transformer Factory error", tce);
|
||||
LOGGER.log(Level.SEVERE, "Transformer Factory error", tce);
|
||||
}
|
||||
catch (TransformerException te) {
|
||||
log.log(Level.SEVERE, "Transformation error", te);
|
||||
LOGGER.log(Level.SEVERE, "Transformation error", te);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.util.logging.Logger;
|
|||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class MultipleRecipientManager {
|
||||
private static Logger log = Logger.getLogger(MultipleRecipientManager.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(MultipleRecipientManager.class.getName());
|
||||
|
||||
/**
|
||||
* Create a cache to hold the 100 most recently accessed elements for a period of
|
||||
|
@ -315,7 +315,7 @@ public class MultipleRecipientManager {
|
|||
services.put(serviceName, serviceAddress == null ? "" : serviceAddress);
|
||||
}
|
||||
catch (XMPPException e) {
|
||||
log.log(Level.SEVERE, "Error occurred retrieving multiple recipients service", e);
|
||||
LOGGER.log(Level.SEVERE, "Error occurred retrieving multiple recipients service", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ import org.jivesoftware.smack.XMPPException;
|
|||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5Proxy {
|
||||
private static Logger log = Logger.getLogger(Socks5Proxy.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(Socks5Proxy.class.getName());
|
||||
|
||||
/* SOCKS5 proxy singleton */
|
||||
private static Socks5Proxy socks5Server;
|
||||
|
@ -196,7 +196,7 @@ public class Socks5Proxy {
|
|||
}
|
||||
catch (IOException e) {
|
||||
// couldn't setup server
|
||||
log.log(Level.SEVERE, "couldn't setup local SOCKS5 proxy on port " + getLocalSocks5ProxyPort(), e);
|
||||
LOGGER.log(Level.SEVERE, "couldn't setup local SOCKS5 proxy on port " + getLocalSocks5ProxyPort(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
*
|
||||
*/
|
||||
public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache {
|
||||
private static Logger log = Logger.getLogger(SimpleDirectoryPersistentCache.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(SimpleDirectoryPersistentCache.class.getName());
|
||||
|
||||
private File cacheDir;
|
||||
private StringEncoder filenameEncoder;
|
||||
|
@ -94,7 +94,7 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
if (nodeFile.createNewFile())
|
||||
writeInfoToFile(nodeFile, info);
|
||||
} catch (IOException e) {
|
||||
log.log(Level.SEVERE, "Failed to write disco info to file", e);
|
||||
LOGGER.log(Level.SEVERE, "Failed to write disco info to file", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
|
||||
parser.setInput(reader);
|
||||
} catch (XmlPullParserException xppe) {
|
||||
log.log(Level.SEVERE, "Exception initializing parser", xppe);
|
||||
LOGGER.log(Level.SEVERE, "Exception initializing parser", xppe);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ import org.jivesoftware.smackx.xdata.Form;
|
|||
* @author Gaston Dombiak, Larry Kirschner
|
||||
*/
|
||||
public class MultiUserChat {
|
||||
private static Logger log = Logger.getLogger(MultiUserChat.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(MultiUserChat.class.getName());
|
||||
|
||||
private final static String discoNamespace = "http://jabber.org/protocol/muc";
|
||||
private final static String discoNode = "http://jabber.org/protocol/muc#rooms";
|
||||
|
@ -183,7 +183,7 @@ public class MultiUserChat {
|
|||
return result.containsFeature(discoNamespace);
|
||||
}
|
||||
catch (XMPPException e) {
|
||||
log.log(Level.SEVERE, "Error checking user [" + user + "] for MUC support", e);
|
||||
LOGGER.log(Level.SEVERE, "Error checking user [" + user + "] for MUC support", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ public class MultiUserChat {
|
|||
return answer.iterator();
|
||||
}
|
||||
catch (XMPPException e) {
|
||||
log.log(Level.SEVERE, "Error getting joined rooms for user [" + user + "]", e);
|
||||
LOGGER.log(Level.SEVERE, "Error getting joined rooms for user [" + user + "]", e);
|
||||
// Return an iterator on an empty collection
|
||||
return new ArrayList<String>().iterator();
|
||||
}
|
||||
|
@ -870,7 +870,7 @@ public class MultiUserChat {
|
|||
}
|
||||
}
|
||||
catch (XMPPException e) {
|
||||
log.log(Level.SEVERE, "Error retrieving room nickname", e);
|
||||
LOGGER.log(Level.SEVERE, "Error retrieving room nickname", e);
|
||||
}
|
||||
// If no Identity was found then the user does not have a reserved room nickname
|
||||
return null;
|
||||
|
@ -1824,11 +1824,11 @@ public class MultiUserChat {
|
|||
method.invoke(listener, params);
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
log.log(Level.SEVERE, "Failed to invoke method on UserStatusListener", e);
|
||||
LOGGER.log(Level.SEVERE, "Failed to invoke method on UserStatusListener", e);
|
||||
} catch (InvocationTargetException e) {
|
||||
log.log(Level.SEVERE, "Failed to invoke method on UserStatusListener", e);
|
||||
LOGGER.log(Level.SEVERE, "Failed to invoke method on UserStatusListener", e);
|
||||
} catch (IllegalAccessException e) {
|
||||
log.log(Level.SEVERE, "Failed to invoke method on UserStatusListener", e);
|
||||
LOGGER.log(Level.SEVERE, "Failed to invoke method on UserStatusListener", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1875,11 +1875,11 @@ public class MultiUserChat {
|
|||
method.invoke(listener, params.toArray());
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
log.log(Level.SEVERE, "Failed to invoke method on ParticipantStatusListener", e);
|
||||
LOGGER.log(Level.SEVERE, "Failed to invoke method on ParticipantStatusListener", e);
|
||||
} catch (InvocationTargetException e) {
|
||||
log.log(Level.SEVERE, "Failed to invoke method on ParticipantStatusListener", e);
|
||||
LOGGER.log(Level.SEVERE, "Failed to invoke method on ParticipantStatusListener", e);
|
||||
} catch (IllegalAccessException e) {
|
||||
log.log(Level.SEVERE, "Failed to invoke method on ParticipantStatusListener", e);
|
||||
LOGGER.log(Level.SEVERE, "Failed to invoke method on ParticipantStatusListener", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
*
|
||||
*/
|
||||
public class StreamInitiationProvider implements IQProvider {
|
||||
private static Logger log = Logger.getLogger(StreamInitiationProvider.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(StreamInitiationProvider.class.getName());
|
||||
|
||||
public IQ parseIQ(final XmlPullParser parser) throws Exception {
|
||||
boolean done = false;
|
||||
|
@ -91,7 +91,7 @@ public class StreamInitiationProvider implements IQProvider {
|
|||
fileSize = Long.parseLong(size);
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
log.log(Level.SEVERE, "Failed to parse file size from " + fileSize, e);
|
||||
LOGGER.log(Level.SEVERE, "Failed to parse file size from " + fileSize, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ import java.util.logging.Logger;
|
|||
* @author Matt Tucker
|
||||
*/
|
||||
public class Time extends IQ {
|
||||
private static Logger log = Logger.getLogger(Time.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(Time.class.getName());
|
||||
|
||||
private static SimpleDateFormat utcFormat = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
|
||||
private static DateFormat displayFormat = DateFormat.getDateTimeInstance();
|
||||
|
@ -109,7 +109,7 @@ public class Time extends IQ {
|
|||
date = cal.getTime();
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.log(Level.SEVERE, "Error getting local time", e);
|
||||
LOGGER.log(Level.SEVERE, "Error getting local time", e);
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
* @author Kirill Maximov (kir@maxkir.com)
|
||||
*/
|
||||
public class VCard extends IQ {
|
||||
private static Logger log = Logger.getLogger(VCard.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(VCard.class.getName());
|
||||
|
||||
private static final String DEFAULT_MIME_TYPE = "image/jpeg";
|
||||
|
||||
|
@ -328,7 +328,7 @@ public class VCard extends IQ {
|
|||
bytes = getBytes(avatarURL);
|
||||
}
|
||||
catch (IOException e) {
|
||||
log.log(Level.SEVERE, "Error getting bytes from URL: " + avatarURL, e);
|
||||
LOGGER.log(Level.SEVERE, "Error getting bytes from URL: " + avatarURL, e);
|
||||
}
|
||||
|
||||
setAvatar(bytes);
|
||||
|
@ -485,7 +485,7 @@ public class VCard extends IQ {
|
|||
digest = MessageDigest.getInstance("SHA-1");
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
log.log(Level.SEVERE, "Failed to get message digest", e);
|
||||
LOGGER.log(Level.SEVERE, "Failed to get message digest", e);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.util.logging.Logger;
|
|||
* @author Derek DeMoro
|
||||
*/
|
||||
public class VCardProvider implements IQProvider {
|
||||
private static Logger log = Logger.getLogger(VCardProvider.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(VCardProvider.class.getName());
|
||||
|
||||
private static final String PREFERRED_ENCODING = "UTF-8";
|
||||
|
||||
|
@ -72,10 +72,10 @@ public class VCardProvider implements IQProvider {
|
|||
}
|
||||
}
|
||||
catch (XmlPullParserException e) {
|
||||
log.log(Level.SEVERE, "Exception parsing VCard", e);
|
||||
LOGGER.log(Level.SEVERE, "Exception parsing VCard", e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
log.log(Level.SEVERE, "Exception parsing VCard", e);
|
||||
LOGGER.log(Level.SEVERE, "Exception parsing VCard", e);
|
||||
}
|
||||
|
||||
String xmlText = sb.toString();
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.jivesoftware.smackx.xevent.packet.MessageEvent;
|
|||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class MessageEventManager {
|
||||
private static Logger log = Logger.getLogger(MessageEventManager.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(MessageEventManager.class.getName());
|
||||
|
||||
private List<MessageEventNotificationListener> messageEventNotificationListeners = new ArrayList<MessageEventNotificationListener>();
|
||||
private List<MessageEventRequestListener> messageEventRequestListeners = new ArrayList<MessageEventRequestListener>();
|
||||
|
@ -157,7 +157,7 @@ public class MessageEventManager {
|
|||
method.invoke(listeners[i], new Object[] { from, packetID, this });
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.log(Level.SEVERE, "Error while invoking MessageEventRequestListener", e);
|
||||
LOGGER.log(Level.SEVERE, "Error while invoking MessageEventRequestListener", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ public class MessageEventManager {
|
|||
method.invoke(listeners[i], new Object[] { from, packetID });
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.log(Level.SEVERE, "Error while invoking MessageEventNotificationListener", e);
|
||||
LOGGER.log(Level.SEVERE, "Error while invoking MessageEventNotificationListener", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.logging.Logger;
|
|||
*/
|
||||
public class XHTMLManager {
|
||||
|
||||
private static Logger log = Logger.getLogger(XHTMLManager.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(XHTMLManager.class.getName());
|
||||
|
||||
private final static String namespace = "http://jabber.org/protocol/xhtml-im";
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class XHTMLManager {
|
|||
return result.containsFeature(namespace);
|
||||
}
|
||||
catch (XMPPException e) {
|
||||
log.log(Level.SEVERE, "Error checking if service is available", e);
|
||||
LOGGER.log(Level.SEVERE, "Error checking if service is available", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ import java.util.logging.Logger;
|
|||
* @see AgentSession#getAgentRoster()
|
||||
*/
|
||||
public class AgentRoster {
|
||||
private static Logger log = Logger.getLogger(AgentRoster.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(AgentRoster.class.getName());
|
||||
private static final int EVENT_AGENT_ADDED = 0;
|
||||
private static final int EVENT_AGENT_REMOVED = 1;
|
||||
private static final int EVENT_PRESENCE_CHANGED = 2;
|
||||
|
@ -283,7 +283,7 @@ public class AgentRoster {
|
|||
String from = presence.getFrom();
|
||||
if (from == null) {
|
||||
// TODO Check if we need to ignore these presences or this is a server bug?
|
||||
log.warning("Presence with no FROM: " + presence.toXML());
|
||||
LOGGER.warning("Presence with no FROM: " + presence.toXML());
|
||||
return;
|
||||
}
|
||||
String key = getPresenceMapKey(from);
|
||||
|
|
|
@ -53,7 +53,7 @@ import java.util.logging.Logger;
|
|||
* @author Derek DeMoro
|
||||
*/
|
||||
public class AgentSession {
|
||||
private static Logger log = Logger.getLogger(AgentSession.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(AgentSession.class.getName());
|
||||
|
||||
private Connection connection;
|
||||
|
||||
|
@ -119,7 +119,7 @@ public class AgentSession {
|
|||
handlePacket(packet);
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.log(Level.SEVERE, "Error processing packet", e);
|
||||
LOGGER.log(Level.SEVERE, "Error processing packet", e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.util.logging.Logger;
|
|||
* currently in a queue.
|
||||
*/
|
||||
public class QueueDetails implements PacketExtension {
|
||||
private static Logger log = Logger.getLogger(QueueDetails.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(QueueDetails.class.getName());
|
||||
|
||||
/**
|
||||
* Element name of the packet extension.
|
||||
|
@ -178,7 +178,7 @@ public class QueueDetails implements PacketExtension {
|
|||
}
|
||||
else if( parser.getName().equals( "waitTime" ) ) {
|
||||
Date wait = dateFormat.parse(parser.nextText());
|
||||
log.fine(wait.toString());
|
||||
LOGGER.fine(wait.toString());
|
||||
}
|
||||
|
||||
eventType = parser.next();
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.logging.Logger;
|
|||
* @author loki der quaeler
|
||||
*/
|
||||
public class ListenerEventDispatcher implements Runnable {
|
||||
private static Logger log = Logger.getLogger(ListenerEventDispatcher.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ListenerEventDispatcher.class.getName());
|
||||
|
||||
protected transient ArrayList<TripletContainer> triplets;
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class ListenerEventDispatcher implements Runnable {
|
|||
try {
|
||||
tc.getListenerMethod().invoke(tc.getListenerInstance(), tc.getMethodArguments());
|
||||
} catch (Exception e) {
|
||||
log.log(Level.SEVERE, "Exception dispatching an event", e);
|
||||
LOGGER.log(Level.SEVERE, "Exception dispatching an event", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue