diff --git a/documentation/debugging.md b/documentation/debugging.md index 7cecb8542..e5bf0df36 100644 --- a/documentation/debugging.md +++ b/documentation/debugging.md @@ -11,7 +11,7 @@ Debugging mode can be enabled in two different ways: 1. Add the following line of code **before** creating new connections: -`XMPPConnection.DEBUG_ENABLED = true;` +`SmackConfiguration.DEBUG = true;` 2. Set the Java system property `smack.debugEnabled` to true. The system property can be set on the command line such as: @@ -21,7 +21,7 @@ If you wish to explicitly disable debug mode in your application, including using the command-line parameter, add the following line to your application before opening new connections: -`XMPPConnection.DEBUG_ENABLED = false;` +`SmackConfiguration.DEBUG = false;` Smack uses the following logic to decide the debugger console to use: diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java index 2a9cc10dd..99eb1d56d 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java @@ -515,7 +515,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection { // If debugging is enabled, change the the debug window title to include the // name we are now logged-in as. - // If DEBUG_ENABLED was set to true AFTER the connection was created the debugger + // If DEBUG was set to true AFTER the connection was created the debugger // will be null if (config.isDebuggerEnabled() && debugger != null) { debugger.userHasLogged(user); diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java index f8d4e9a6b..e39499a2e 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java @@ -35,7 +35,7 @@ public abstract class ConnectionConfiguration { static { // Ensure that Smack is initialized when ConnectionConfiguration is used, or otherwise e.g. - // SmackConfiguration.DEBUG_ENABLED may not be initialized yet. + // SmackConfiguration.DEBUG may not be initialized yet. SmackConfiguration.getVersion(); } @@ -226,7 +226,7 @@ public abstract class ConnectionConfiguration { /** * Returns true if the new connection about to be establish is going to be debugged. By - * default the value of {@link SmackConfiguration#DEBUG_ENABLED} is used. + * default the value of {@link SmackConfiguration#DEBUG} is used. * * @return true if the new connection about to be establish is going to be debugged. */ @@ -399,7 +399,7 @@ public abstract class ConnectionConfiguration { private RosterStore rosterStore; private ProxyInfo proxy; private CallbackHandler callbackHandler; - private boolean debuggerEnabled = SmackConfiguration.DEBUG_ENABLED; + private boolean debuggerEnabled = SmackConfiguration.DEBUG; private SocketFactory socketFactory; private String serviceName; private String host; @@ -634,7 +634,7 @@ public abstract class ConnectionConfiguration { /** * Sets if the new connection about to be establish is going to be debugged. By - * default the value of {@link SmackConfiguration#DEBUG_ENABLED} is used. + * default the value of {@link SmackConfiguration#DEBUG} is used. * * @param debuggerEnabled if the new connection about to be establish is going to be debugged. * @return a reference to this builder. diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java b/smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java index aacf7ac6d..9a22054bb 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java @@ -77,7 +77,7 @@ public final class SmackConfiguration { * property smack.debugEnabled to true. The system property can be set on the * command line such as "java SomeApp -Dsmack.debugEnabled=true". */ - public static boolean DEBUG_ENABLED = false; + public static boolean DEBUG = false; /** * The default parsing exception callback is {@link ExceptionThrowingCallback} which will diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SmackInitialization.java b/smack-core/src/main/java/org/jivesoftware/smack/SmackInitialization.java index b2b065612..116a0bfcb 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/SmackInitialization.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/SmackInitialization.java @@ -55,7 +55,7 @@ public final class SmackInitialization { * So far this means that: * 1) a set of classes will be loaded in order to execute their static init block * 2) retrieve and set the current Smack release - * 3) set DEBUG_ENABLED + * 3) set DEBUG */ static { String smackVersion; @@ -127,10 +127,10 @@ public final class SmackInitialization { // Use try block since we may not have permission to get a system // property (for example, when an applet). try { - // Only overwrite DEBUG_ENABLED if it is set via the 'smack.debugEnabled' property. To prevent DEBUG_ENABLED + // Only overwrite DEBUG if it is set via the 'smack.debugEnabled' property. To prevent DEBUG_ENABLED // = true, which could be set e.g. via a static block from user code, from being overwritten by the property not set if (Boolean.getBoolean("smack.debugEnabled")) { - SmackConfiguration.DEBUG_ENABLED = true; + SmackConfiguration.DEBUG = true; } } catch (Exception e) { diff --git a/smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java b/smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java index 8dbd8eec5..290031b9f 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java @@ -153,7 +153,7 @@ public class DummyConnection extends AbstractXMPPConnection { @Override public void send(PlainStreamElement element) { - if (SmackConfiguration.DEBUG_ENABLED) { + if (SmackConfiguration.DEBUG) { System.out.println("[SEND]: " + element.toXML()); } queue.add(element); @@ -161,7 +161,7 @@ public class DummyConnection extends AbstractXMPPConnection { @Override protected void sendPacketInternal(Packet packet) { - if (SmackConfiguration.DEBUG_ENABLED) { + if (SmackConfiguration.DEBUG) { System.out.println("[SEND]: " + packet.toXML()); } queue.add(packet); @@ -213,7 +213,7 @@ public class DummyConnection extends AbstractXMPPConnection { * @param packet the packet to process. */ public void processPacket(Packet packet) { - if (SmackConfiguration.DEBUG_ENABLED) { + if (SmackConfiguration.DEBUG) { System.out.println("[RECV]: " + packet.toXML()); } diff --git a/smack-core/src/test/java/org/jivesoftware/smack/RosterTest.java b/smack-core/src/test/java/org/jivesoftware/smack/RosterTest.java index 97e1b7a1a..ad8f56b67 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/RosterTest.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/RosterTest.java @@ -63,7 +63,7 @@ public class RosterTest { @Before public void setUp() throws Exception { // Uncomment this to enable debug output - //XMPPConnection.DEBUG_ENABLED = true; + //SmackConfiguration.DEBUG = true; connection = new DummyConnection(); connection.connect(); @@ -708,7 +708,7 @@ public class RosterTest { public synchronized void entriesAdded(Collection addresses) { addressesAdded.addAll(addresses); - if (SmackConfiguration.DEBUG_ENABLED) { + if (SmackConfiguration.DEBUG) { for (String address : addresses) { System.out.println("Roster entry for " + address + " added."); } @@ -718,7 +718,7 @@ public class RosterTest { public synchronized void entriesDeleted(Collection addresses) { addressesDeleted.addAll(addresses); - if (SmackConfiguration.DEBUG_ENABLED) { + if (SmackConfiguration.DEBUG) { for (String address : addresses) { System.out.println("Roster entry for " + address + " deleted."); } @@ -728,7 +728,7 @@ public class RosterTest { public synchronized void entriesUpdated(Collection addresses) { addressesUpdated.addAll(addresses); - if (SmackConfiguration.DEBUG_ENABLED) { + if (SmackConfiguration.DEBUG) { for (String address : addresses) { System.out.println("Roster entry for " + address + " updated."); } @@ -737,7 +737,7 @@ public class RosterTest { } public void presenceChanged(Presence presence) { - if (SmackConfiguration.DEBUG_ENABLED) { + if (SmackConfiguration.DEBUG) { System.out.println("Roster presence changed: " + presence.toXML()); } reportInvoked(); diff --git a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java index 9d19b8280..cdc36a3d6 100644 --- a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java +++ b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java @@ -1797,7 +1797,7 @@ public class MultiUserChatTest extends SmackTestCase { } protected void setUp() throws Exception { - //TCPConnection.DEBUG_ENABLED = false; + //SmackConfiguration.DEBUG = false; super.setUp(); room = "fruta124@" + getMUCDomain(); try { diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiatorTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiatorTest.java index d1842748b..9dbf2bf7b 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiatorTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiatorTest.java @@ -32,7 +32,7 @@ public class FileTransferNegotiatorTest { @Before public void setUp() throws Exception { // Uncomment this to enable debug output - // XMPPConnection.DEBUG_ENABLED = true; + // SmackConfiguration.DEBUG = true; connection = new DummyConnection(); connection.connect(); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/pubsub/ItemValidationTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/pubsub/ItemValidationTest.java index 3784b8eee..edaf94976 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/pubsub/ItemValidationTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/pubsub/ItemValidationTest.java @@ -43,7 +43,7 @@ public class ItemValidationTest extends InitExtensions { public void setUp() throws Exception { // Uncomment this to enable debug output - // XMPPConnection.DEBUG_ENABLED = true; + // SmackConfiguration.DEBUG = true; connection = new ThreadedDummyConnection(); connection.connect(); diff --git a/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleManagerTest.java b/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleManagerTest.java index a31b6a4c7..3c8811187 100644 --- a/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleManagerTest.java +++ b/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleManagerTest.java @@ -685,7 +685,7 @@ public class JingleManagerTest extends SmackTestCase { XMPPTCPConnection x0 = getConnection(0); XMPPTCPConnection x1 = getConnection(1); - XMPPTCPConnection.DEBUG_ENABLED = true; + XMPPSmackConfiguration.DEBUG = true; FixedResolver tr0 = new FixedResolver("127.0.0.1", 20080); FixedTransportManager ftm0 = new FixedTransportManager(tr0); diff --git a/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleMediaTest.java b/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleMediaTest.java index e8217a32f..4b12a785b 100644 --- a/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleMediaTest.java +++ b/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleMediaTest.java @@ -212,7 +212,7 @@ public class JingleMediaTest extends SmackTestCase { try { - //TCPConnection.DEBUG_ENABLED = true; + //SmackConfiguration.DEBUG = true; XMPPTCPConnection x0 = getConnection(0); XMPPTCPConnection x1 = getConnection(1); @@ -399,7 +399,7 @@ public class JingleMediaTest extends SmackTestCase { public void testCompleteWithBridgeB() { try { - //TCPConnection.DEBUG_ENABLED = true; + //SmackConfiguration.DEBUG = true; XMPPTCPConnection x0 = getConnection(0); XMPPTCPConnection x1 = getConnection(1);