1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-21 22:02:06 +01:00

Enable ModifierOrder checkstyle check

Fixes SMACK-812
This commit is contained in:
Florian Schmaus 2018-03-29 12:35:11 +02:00
parent bd08f11c4a
commit a9ca1a0989
59 changed files with 134 additions and 133 deletions

View file

@ -74,6 +74,7 @@
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="RedundantModifier"/>
<module name="ModifierOrder"/>
<module name="UpperEll"/>
<module name="ArrayTypeStyle"/>
<module name="GenericWhitespace"/>

View file

@ -104,7 +104,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Counter to uniquely identify connections that are created.
*/
private final static AtomicInteger connectionCounter = new AtomicInteger(0);
private static final AtomicInteger connectionCounter = new AtomicInteger(0);
static {
// Ensure the SmackConfiguration class is loaded by calling a method in it.

View file

@ -502,7 +502,7 @@ public abstract class ConnectionConfiguration {
* @param <B> the builder type parameter.
* @param <C> the resulting connection configuration type parameter.
*/
public static abstract class Builder<B extends Builder<B, C>, C extends ConnectionConfiguration> {
public abstract static class Builder<B extends Builder<B, C>, C extends ConnectionConfiguration> {
private SecurityMode securityMode = SecurityMode.ifpossible;
private DnssecMode dnssecMode = DnssecMode.disabled;
private String keystorePath = System.getProperty("javax.net.ssl.keyStore");

View file

@ -56,7 +56,7 @@ public final class SmackConfiguration {
static Set<String> disabledSmackClasses = new HashSet<>();
final static List<XMPPInputOutputStream> compressionHandlers = new ArrayList<>(2);
static final List<XMPPInputOutputStream> compressionHandlers = new ArrayList<>(2);
static boolean smackInitialized = false;

View file

@ -195,7 +195,7 @@ public class SmackException extends Exception {
}
}
public static abstract class SecurityRequiredException extends SmackException {
public abstract static class SecurityRequiredException extends SmackException {
/**
*

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2017 Florian Schmaus
* Copyright 2017-2018 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -46,7 +46,7 @@ public abstract class SmackFuture<V, E extends Exception> implements Future<V>,
private ExceptionCallback<E> exceptionCallback;
@Override
public synchronized final boolean cancel(boolean mayInterruptIfRunning) {
public final synchronized boolean cancel(boolean mayInterruptIfRunning) {
if (isDone()) {
return false;
}
@ -61,12 +61,12 @@ public abstract class SmackFuture<V, E extends Exception> implements Future<V>,
}
@Override
public synchronized final boolean isCancelled() {
public final synchronized boolean isCancelled() {
return cancelled;
}
@Override
public synchronized final boolean isDone() {
public final synchronized boolean isDone() {
return result != null;
}
@ -98,7 +98,7 @@ public abstract class SmackFuture<V, E extends Exception> implements Future<V>,
}
@Override
public synchronized final V get() throws InterruptedException, ExecutionException {
public final synchronized V get() throws InterruptedException, ExecutionException {
while (result == null && exception == null && !cancelled) {
wait();
}
@ -106,7 +106,7 @@ public abstract class SmackFuture<V, E extends Exception> implements Future<V>,
return getOrThrowExecutionException();
}
public synchronized final V getOrThrow() throws E, InterruptedException {
public final synchronized V getOrThrow() throws E, InterruptedException {
while (result == null && exception == null && !cancelled) {
wait();
}
@ -124,7 +124,7 @@ public abstract class SmackFuture<V, E extends Exception> implements Future<V>,
}
@Override
public synchronized final V get(long timeout, TimeUnit unit)
public final synchronized V get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
final long deadline = System.currentTimeMillis() + unit.toMillis(timeout);
while (result != null && exception != null) {
@ -212,7 +212,7 @@ public abstract class SmackFuture<V, E extends Exception> implements Future<V>,
}
}
public static abstract class InternalProcessStanzaSmackFuture<V, E extends Exception> extends InternalSmackFuture<V, E>
public abstract static class InternalProcessStanzaSmackFuture<V, E extends Exception> extends InternalSmackFuture<V, E>
implements StanzaListener, ExceptionCallback<E> {
/**
@ -228,7 +228,7 @@ public abstract class SmackFuture<V, E extends Exception> implements Future<V>,
protected abstract void handleStanza(Stanza stanza);
@Override
public synchronized final void processException(E exception) {
public final synchronized void processException(E exception) {
if (!isNonFatalException(exception)) {
this.exception = exception;
this.notifyAll();
@ -241,7 +241,7 @@ public abstract class SmackFuture<V, E extends Exception> implements Future<V>,
* Wrapper method for {@link #handleStanza(Stanza)}. Note that this method is <code>synchronized</code>.
*/
@Override
public synchronized final void processStanza(Stanza stanza) {
public final synchronized void processStanza(Stanza stanza) {
handleStanza(stanza);
}
}
@ -252,7 +252,7 @@ public abstract class SmackFuture<V, E extends Exception> implements Future<V>,
*
* @param <V>
*/
public static abstract class SimpleInternalProcessStanzaSmackFuture<V, E extends Exception>
public abstract static class SimpleInternalProcessStanzaSmackFuture<V, E extends Exception>
extends InternalProcessStanzaSmackFuture<V, E> {
@Override
protected boolean isNonFatalException(E exception) {

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2014 Florian Schmaus
* Copyright 2014-2018 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -26,7 +26,7 @@ public class XMPPConnectionRegistry {
/**
* A set of listeners which will be invoked if a new connection is created.
*/
private final static Set<ConnectionCreationListener> connectionEstablishedListeners =
private static final Set<ConnectionCreationListener> connectionEstablishedListeners =
new CopyOnWriteArraySet<>();
/**

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2013-2014 Florian Schmaus
* Copyright 2013-2018 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -41,9 +41,9 @@ import java.util.zip.InflaterInputStream;
* @author Florian Schmaus
*/
public class Java7ZlibInputOutputStream extends XMPPInputOutputStream {
private final static Method method;
private final static boolean supported;
private final static int compressionLevel = Deflater.DEFAULT_COMPRESSION;
private static final Method method;
private static final boolean supported;
private static final int compressionLevel = Deflater.DEFAULT_COMPRESSION;
private static final int SYNC_FLUSH_INT = 2;
private static final int FULL_FLUSH_INT = 3;

View file

@ -30,7 +30,7 @@ import org.jxmpp.jid.Jid;
*/
public final class FromMatchesFilter extends AbstractFromToMatchesFilter {
public final static FromMatchesFilter MATCH_NO_FROM_SET = create(null);
public static final FromMatchesFilter MATCH_NO_FROM_SET = create(null);
/**
* Creates a filter matching on the "from" field. The from address must be the same as the

View file

@ -118,7 +118,7 @@ public class AbstractError {
}
}
public static abstract class Builder<B extends Builder<B>> {
public abstract static class Builder<B extends Builder<B>> {
protected String textNamespace;
protected Map<String, String> descriptiveTexts;
protected List<ExtensionElement> extensions;

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2014-2015 Florian Schmaus
* Copyright © 2014-2018 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -31,7 +31,7 @@ public class IntrospectionProvider{
// Unfortunately, we have to create two introspection providers, with the exactly the same code here
public static abstract class IQIntrospectionProvider<I extends IQ> extends IQProvider<I> {
public abstract static class IQIntrospectionProvider<I extends IQ> extends IQProvider<I> {
private final Class<I> elementClass;
protected IQIntrospectionProvider(Class<I> elementClass) {
@ -52,7 +52,7 @@ public class IntrospectionProvider{
}
}
public static abstract class PacketExtensionIntrospectionProvider<PE extends ExtensionElement> extends ExtensionElementProvider<PE> {
public abstract static class PacketExtensionIntrospectionProvider<PE extends ExtensionElement> extends ExtensionElementProvider<PE> {
private final Class<PE> elementClass;
protected PacketExtensionIntrospectionProvider(Class<PE> elementClass) {

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2014 Florian Schmaus
* Copyright 2014-2018 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -149,7 +149,7 @@ public class SaslStreamElements {
public static class Success implements Nonza {
public static final String ELEMENT = "success";
final private String data;
private final String data;
/**
* Construct a new SASL success stream element with optional additional data for the SASL layer.

View file

@ -60,7 +60,7 @@ public class Async {
* If the exception is an instance of {@link RuntimeException}, then it will be re-thrown, otherwise <b>it will be
* simply logged.</b>
*/
public static abstract class ThrowingRunnable implements Runnable {
public abstract static class ThrowingRunnable implements Runnable {
public static final Logger LOGGER = Logger.getLogger(ThrowingRunnable.class.getName());

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2003-2007 Jive Software, 2016-2017 Florian Schmaus.
* Copyright 2003-2007 Jive Software, 2016-2018 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -224,7 +224,7 @@ public class StringUtils {
* @deprecated use {@link org.jivesoftware.smack.util.SHA1#hex(String)} instead.
*/
@Deprecated
public synchronized static String hash(String data) {
public static synchronized String hash(String data) {
return org.jivesoftware.smack.util.SHA1.hex(data);
}

View file

@ -33,7 +33,7 @@ import org.xmlpull.v1.XmlPullParser;
public class ParsingExceptionTest {
private final static String EXTENSION2 =
private static final String EXTENSION2 =
"<extension2 xmlns='namespace'>" +
"<bar node='testNode'>" +
"<i id='testid1'>" +

View file

@ -27,7 +27,7 @@ import org.jivesoftware.smack.util.ParserUtils;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
final public class TestUtils {
public final class TestUtils {
private TestUtils() {
}

View file

@ -115,7 +115,7 @@ public final class EnhancedDebuggerWindow {
*
* @return the unique EnhancedDebuggerWindow instance
*/
public synchronized static EnhancedDebuggerWindow getInstance() {
public static synchronized EnhancedDebuggerWindow getInstance() {
if (instance == null) {
instance = new EnhancedDebuggerWindow();
}
@ -127,7 +127,7 @@ public final class EnhancedDebuggerWindow {
*
* @param debugger the new debugger to show in the debug window
*/
synchronized static void addDebugger(EnhancedDebugger debugger) {
static synchronized void addDebugger(EnhancedDebugger debugger) {
getInstance().showNewDebugger(debugger);
}
@ -156,7 +156,7 @@ public final class EnhancedDebuggerWindow {
* @param debugger the debugger whose connection logged in to the server
* @param user the user@host/resource that has just logged in
*/
synchronized static void userHasLogged(EnhancedDebugger debugger, String user) {
static synchronized void userHasLogged(EnhancedDebugger debugger, String user) {
int index = getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane);
getInstance().tabbedPane.setTitleAt(
index,
@ -171,7 +171,7 @@ public final class EnhancedDebuggerWindow {
*
* @param debugger the debugger whose connection was properly closed.
*/
synchronized static void connectionClosed(EnhancedDebugger debugger) {
static synchronized void connectionClosed(EnhancedDebugger debugger) {
getInstance().tabbedPane.setIconAt(
getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane),
connectionClosedIcon);
@ -183,7 +183,7 @@ public final class EnhancedDebuggerWindow {
* @param debugger the debugger whose connection was closed due to an exception.
* @param e the exception.
*/
synchronized static void connectionClosedOnError(EnhancedDebugger debugger, Exception e) {
static synchronized void connectionClosedOnError(EnhancedDebugger debugger, Exception e) {
int index = getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane);
getInstance().tabbedPane.setToolTipTextAt(
index,
@ -193,7 +193,7 @@ public final class EnhancedDebuggerWindow {
connectionClosedOnErrorIcon);
}
synchronized static void connectionEstablished(EnhancedDebugger debugger) {
static synchronized void connectionEstablished(EnhancedDebugger debugger) {
getInstance().tabbedPane.setIconAt(
getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane),
connectionActiveIcon);

View file

@ -97,7 +97,7 @@ public abstract class AbstractHttpOverXmpp extends IQ {
* @param <B> the builder type parameter.
* @param <C> the resulting HttpOverXmpp IQ
*/
public static abstract class Builder<B extends Builder<B, C>, C extends AbstractHttpOverXmpp> {
public abstract static class Builder<B extends Builder<B, C>, C extends AbstractHttpOverXmpp> {
private HeadersExtension headers;
private Data data;

View file

@ -552,7 +552,7 @@ public final class MamManager extends Manager {
* MAM query result class.
*
*/
public final static class MamQueryResult {
public static final class MamQueryResult {
public final List<Forwarded> forwardedMessages;
public final MamFinIQ mamFin;
private final String node;
@ -662,7 +662,7 @@ public final class MamManager extends Manager {
* MAM preferences result class.
*
*/
public final static class MamPrefsResult {
public static final class MamPrefsResult {
public final MamPrefsIQ mamPrefs;
public final DataForm form;

View file

@ -585,7 +585,7 @@ public class TestEvents extends SmackTestCase
}
}
static private LeafNode getPubnode(PubSubManager manager, String id, boolean persistItems, boolean deliverPayload)
private static LeafNode getPubnode(PubSubManager manager, String id, boolean persistItems, boolean deliverPayload)
throws XMPPException
{
ConfigureForm form = new ConfigureForm(FormType.submit);

View file

@ -29,7 +29,7 @@ import org.jivesoftware.smackx.pubsub.PubSubManager;
* @author Robin Collier
*
*/
abstract public class PubSubTestCase extends SmackTestCase
public abstract class PubSubTestCase extends SmackTestCase
{
private PubSubManager[] manager;

View file

@ -57,7 +57,7 @@ public class AMPManager {
* @param connection the connection where the service will be enabled or disabled
* @param enabled indicates if the service will be enabled or disabled
*/
public synchronized static void setServiceEnabled(XMPPConnection connection, boolean enabled) {
public static synchronized void setServiceEnabled(XMPPConnection connection, boolean enabled) {
if (isServiceEnabled(connection) == enabled)
return;

View file

@ -60,7 +60,7 @@ public final class BookmarkManager {
* exist it is created.
* @throws IllegalArgumentException when the connection is null.
*/
public synchronized static BookmarkManager getBookmarkManager(XMPPConnection connection)
public static synchronized BookmarkManager getBookmarkManager(XMPPConnection connection)
{
BookmarkManager manager = bookmarkManagerMap.get(connection);
if (manager == null) {

View file

@ -139,10 +139,10 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
private static final String SESSION_ID_PREFIX = "jibb_";
/* random generator to create session IDs */
private final static Random randomGenerator = new Random();
private static final Random randomGenerator = new Random();
/* stores one InBandBytestreamManager for each XMPP connection */
private final static Map<XMPPConnection, InBandBytestreamManager> managers = new WeakHashMap<>();
private static final Map<XMPPConnection, InBandBytestreamManager> managers = new WeakHashMap<>();
/*
* assigns a user to a listener that is informed if an In-Band Bytestream request for this user

View file

@ -32,7 +32,7 @@ public class DataPacketExtension implements ExtensionElement {
/**
* The element name of the data stanza(/packet) extension.
*/
public final static String ELEMENT = "data";
public static final String ELEMENT = "data";
/**
* The XMPP namespace of the In-Band Bytestream.

View file

@ -113,10 +113,10 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
private static final String SESSION_ID_PREFIX = "js5_";
/* random generator to create session IDs */
private final static Random randomGenerator = new Random();
private static final Random randomGenerator = new Random();
/* stores one Socks5BytestreamManager for each XMPP connection */
private final static Map<XMPPConnection, Socks5BytestreamManager> managers = new WeakHashMap<>();
private static final Map<XMPPConnection, Socks5BytestreamManager> managers = new WeakHashMap<>();
/*
* assigns a user to a listener that is informed if a bytestream request for this user is

View file

@ -55,7 +55,7 @@ public final class GeoLocationManager extends Manager {
* @param connection The connection the manager is attached to.
* @return The new or existing manager.
*/
public synchronized static GeoLocationManager getInstanceFor(XMPPConnection connection) {
public static synchronized GeoLocationManager getInstanceFor(XMPPConnection connection) {
GeoLocationManager geoLocationManager = INSTANCES.get(connection);
if (geoLocationManager == null) {
geoLocationManager = new GeoLocationManager(connection);

View file

@ -24,7 +24,7 @@ import org.jivesoftware.smackx.jingle.element.JingleContentTransportInfo;
*/
public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo {
public static abstract class JingleS5BCandidateTransportInfo extends JingleS5BTransportInfo {
public abstract static class JingleS5BCandidateTransportInfo extends JingleS5BTransportInfo {
public static final String ATTR_CID = "cid";
private final String candidateId;

View file

@ -78,7 +78,7 @@ import org.jxmpp.jid.parts.Resourcepart;
* @see <a href="http://xmpp.org/extensions/xep-0045.html">XEP-0045: Multi-User Chat</a>
*/
public final class MultiUserChatManager extends Manager {
private final static String DISCO_NODE = MUCInitialPresence.NAMESPACE + "#rooms";
private static final String DISCO_NODE = MUCInitialPresence.NAMESPACE + "#rooms";
private static final Logger LOGGER = Logger.getLogger(MultiUserChatManager.class.getName());

View file

@ -62,7 +62,7 @@ public class OfflineMessageManager {
private static final Logger LOGGER = Logger.getLogger(OfflineMessageManager.class.getName());
private final static String namespace = "http://jabber.org/protocol/offline";
private static final String namespace = "http://jabber.org/protocol/offline";
private final XMPPConnection connection;

View file

@ -85,7 +85,7 @@ public final class PingManager extends Manager {
* The connection the manager is attached to.
* @return The new or existing manager.
*/
public synchronized static PingManager getInstanceFor(XMPPConnection connection) {
public static synchronized PingManager getInstanceFor(XMPPConnection connection) {
PingManager pingManager = INSTANCES.get(connection);
if (pingManager == null) {
pingManager = new PingManager(connection);

View file

@ -678,7 +678,7 @@ public class ConfigureForm extends Form
return result.toString();
}
static private boolean parseBoolean(String fieldValue)
private static boolean parseBoolean(String fieldValue)
{
return ("1".equals(fieldValue) || "true".equals(fieldValue));
}

View file

@ -44,7 +44,7 @@ import org.jivesoftware.smackx.shim.packet.Header;
import org.jivesoftware.smackx.shim.packet.HeadersExtension;
import org.jivesoftware.smackx.xdata.Form;
abstract public class Node
public abstract class Node
{
protected final PubSubManager pubSubManager;
protected final String id;

View file

@ -16,7 +16,7 @@
*/
package org.jivesoftware.smackx.pubsub;
abstract public class NodeEvent
public abstract class NodeEvent
{
private String nodeId;

View file

@ -209,7 +209,7 @@ public class SubscribeForm extends Form
}
static private boolean parseBoolean(String fieldValue)
private static boolean parseBoolean(String fieldValue)
{
return ("1".equals(fieldValue) || "true".equals(fieldValue));
}

View file

@ -90,7 +90,7 @@ public enum SubscribeOptionFields
return "pubsub#" + toString();
}
static public SubscribeOptionFields valueOfFromElement(String elementName)
public static SubscribeOptionFields valueOfFromElement(String elementName)
{
String portion = elementName.substring(elementName.lastIndexOf('#' + 1));

View file

@ -24,7 +24,7 @@ import java.util.List;
*
* @author Robin Collier
*/
abstract public class SubscriptionEvent extends NodeEvent
public abstract class SubscriptionEvent extends NodeEvent
{
private List<String> subIds = Collections.emptyList();

View file

@ -56,7 +56,7 @@ public final class EntityTimeManager extends Manager {
EntityTimeManager.autoEnable = autoEnable;
}
public synchronized static EntityTimeManager getInstanceFor(XMPPConnection connection) {
public static synchronized EntityTimeManager getInstanceFor(XMPPConnection connection) {
EntityTimeManager entityTimeManager = INSTANCES.get(connection);
if (entityTimeManager == null) {
entityTimeManager = new EntityTimeManager(connection);

View file

@ -101,7 +101,7 @@ public class XHTMLManager {
* @param connection the connection where the service will be enabled or disabled
* @param enabled indicates if the service will be enabled or disabled
*/
public synchronized static void setServiceEnabled(XMPPConnection connection, boolean enabled) {
public static synchronized void setServiceEnabled(XMPPConnection connection, boolean enabled) {
if (isServiceEnabled(connection) == enabled)
return;

View file

@ -249,8 +249,8 @@ public class VCardTest extends InitExtensions {
assertEquals("kir max", vCard.getField("FN"));
}
private final static String MIME_TYPE = "testtype";
private final static String VCARD_XML = "<vCard xmlns='vcard-temp'><PHOTO><BINVAL>" + getAvatarEncoded()
private static final String MIME_TYPE = "testtype";
private static final String VCARD_XML = "<vCard xmlns='vcard-temp'><PHOTO><BINVAL>" + getAvatarEncoded()
+ "</BINVAL><TYPE>" + MIME_TYPE + "</TYPE></PHOTO></vCard>";
@Test

View file

@ -45,7 +45,7 @@ import org.jxmpp.jid.BareJid;
public final class RosterEntry extends Manager {
private RosterPacket.Item item;
final private Roster roster;
private final Roster roster;
/**
* Creates a new roster entry.

View file

@ -38,22 +38,22 @@ public final class Base64
/* ******** P U B L I C F I E L D S ******** */
/** No options specified. Value is zero. */
public final static int NO_OPTIONS = 0;
public static final int NO_OPTIONS = 0;
/** Specify encoding. */
public final static int ENCODE = 1;
public static final int ENCODE = 1;
/** Specify decoding. */
public final static int DECODE = 0;
public static final int DECODE = 0;
/** Specify that data should be gzip-compressed. */
public final static int GZIP = 2;
public static final int GZIP = 2;
/** Don't break lines when encoding (violates strict Base64 specification). */
public final static int DONT_BREAK_LINES = 8;
public static final int DONT_BREAK_LINES = 8;
/**
* Encode using Base64-like encoding that is URL- and Filename-safe as described
@ -63,47 +63,47 @@ public final class Base64
* or at the very least should not be called Base64 without also specifying that is
* was encoded using the URL- and Filename-safe dialect.
*/
public final static int URL_SAFE = 16;
public static final int URL_SAFE = 16;
/**
* Encode using the special "ordered" dialect of Base64 described here:
* <a href="http://www.faqs.org/qa/rfcc-1940.html">http://www.faqs.org/qa/rfcc-1940.html</a>.
*/
public final static int ORDERED = 32;
public static final int ORDERED = 32;
/* ******** P R I V A T E F I E L D S ******** */
/** Maximum line length (76) of Base64 output. */
private final static int MAX_LINE_LENGTH = 76;
private static final int MAX_LINE_LENGTH = 76;
/** The equals sign (=) as a byte. */
private final static byte EQUALS_SIGN = (byte)'=';
private static final byte EQUALS_SIGN = (byte)'=';
/** The new line character (\n) as a byte. */
private final static byte NEW_LINE = (byte)'\n';
private static final byte NEW_LINE = (byte)'\n';
/** Preferred encoding. */
private final static String PREFERRED_ENCODING = "UTF-8";
private static final String PREFERRED_ENCODING = "UTF-8";
// I think I end up not using the BAD_ENCODING indicator.
// private final static byte BAD_ENCODING = -9; // Indicates error in encoding
private final static byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
private final static byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
// private static final byte BAD_ENCODING = -9; // Indicates error in encoding
private static final byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
private static final byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
/* ******** S T A N D A R D B A S E 6 4 A L P H A B E T ******** */
/** The 64 valid Base64 values. */
// private final static byte[] ALPHABET;
// private static final byte[] ALPHABET;
/* Host platform me be something funny like EBCDIC, so we hardcode these values. */
private final static byte[] _STANDARD_ALPHABET =
private static final byte[] _STANDARD_ALPHABET =
{
(byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G',
(byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N',
@ -122,7 +122,7 @@ public final class Base64
* Translates a Base64 value to either its 6-bit reconstruction value
* or a negative number indicating some other meaning.
**/
private final static byte[] _STANDARD_DECODABET =
private static final byte[] _STANDARD_DECODABET =
{
-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
-5,-5, // Whitespace: Tab and Linefeed
@ -165,7 +165,7 @@ public final class Base64
* <a href="http://www.faqs.org/rfcs/rfc3548.html">http://www.faqs.org/rfcs/rfc3548.html</a>.
* Notice that the last two bytes become "hyphen" and "underscore" instead of "plus" and "slash."
*/
private final static byte[] _URL_SAFE_ALPHABET =
private static final byte[] _URL_SAFE_ALPHABET =
{
(byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G',
(byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N',
@ -182,7 +182,7 @@ public final class Base64
/**
* Used in decoding URL- and Filename-safe dialects of Base64.
*/
private final static byte[] _URL_SAFE_DECODABET =
private static final byte[] _URL_SAFE_DECODABET =
{
-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
-5,-5, // Whitespace: Tab and Linefeed
@ -229,7 +229,7 @@ public final class Base64
* I don't get the point of this technique, but it is described here:
* <a href="http://www.faqs.org/qa/rfcc-1940.html">http://www.faqs.org/qa/rfcc-1940.html</a>.
*/
private final static byte[] _ORDERED_ALPHABET =
private static final byte[] _ORDERED_ALPHABET =
{
(byte)'-',
(byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4',
@ -248,7 +248,7 @@ public final class Base64
/**
* Used in decoding the "ordered" dialect of Base64.
*/
private final static byte[] _ORDERED_DECODABET =
private static final byte[] _ORDERED_DECODABET =
{
-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
-5,-5, // Whitespace: Tab and Linefeed

View file

@ -271,7 +271,7 @@ public class JingleManager implements JingleSessionListener {
* disabled
* @param enabled indicates if the service will be enabled or disabled
*/
public synchronized static void setServiceEnabled(XMPPConnection connection, boolean enabled) {
public static synchronized void setServiceEnabled(XMPPConnection connection, boolean enabled) {
if (isServiceEnabled(connection) == enabled) {
return;
}

View file

@ -42,7 +42,7 @@ public class JingleSessionStateActive extends JingleSessionState {
* A thread-safe means of getting the one instance of this class.
* @return The singleton instance of this class.
*/
public synchronized static JingleSessionState getInstance() {
public static synchronized JingleSessionState getInstance() {
if (INSTANCE == null) {
INSTANCE = new JingleSessionStateActive();
}

View file

@ -42,7 +42,7 @@ public class JingleSessionStateEnded extends JingleSessionState {
* A thread-safe means of getting the one instance of this class.
* @return The singleton instance of this class.
*/
public synchronized static JingleSessionState getInstance() {
public static synchronized JingleSessionState getInstance() {
if (INSTANCE == null) {
INSTANCE = new JingleSessionStateEnded();
}

View file

@ -42,7 +42,7 @@ public class JingleSessionStatePending extends JingleSessionState {
* A thread-safe means of getting the one instance of this class.
* @return The singleton instance of this class.
*/
public synchronized static JingleSessionState getInstance() {
public static synchronized JingleSessionState getInstance() {
if (INSTANCE == null) {
INSTANCE = new JingleSessionStatePending();
}

View file

@ -53,7 +53,7 @@ public class JingleSessionStateUnknown extends JingleSessionState {
* A thread-safe means of getting the one instance of this class.
* @return The singleton instance of this class.
*/
public synchronized static JingleSessionState getInstance() {
public static synchronized JingleSessionState getInstance() {
if (INSTANCE == null) {
INSTANCE = new JingleSessionStateUnknown();
}

View file

@ -54,7 +54,7 @@ public class ImageTransmitter implements Runnable {
private int maxI;
private int maxJ;
private ImageEncoder encoder;
public final static int KEYFRAME = 10;
public static final int KEYFRAME = 10;
public ImageTransmitter(DatagramSocket socket, InetAddress remoteHost, int remotePort, Rectangle area) {

View file

@ -34,7 +34,7 @@ public class OctTreeQuantizer implements Quantizer {
/**
* The greatest depth the tree is allowed to reach
*/
final static int MAX_LEVEL = 5;
static final int MAX_LEVEL = 5;
/**
* An Octree node.

View file

@ -26,27 +26,27 @@ import java.util.Random;
*/
public class PixelUtils {
public final static int REPLACE = 0;
public final static int NORMAL = 1;
public final static int MIN = 2;
public final static int MAX = 3;
public final static int ADD = 4;
public final static int SUBTRACT = 5;
public final static int DIFFERENCE = 6;
public final static int MULTIPLY = 7;
public final static int HUE = 8;
public final static int SATURATION = 9;
public final static int VALUE = 10;
public final static int COLOR = 11;
public final static int SCREEN = 12;
public final static int AVERAGE = 13;
public final static int OVERLAY = 14;
public final static int CLEAR = 15;
public final static int EXCHANGE = 16;
public final static int DISSOLVE = 17;
public final static int DST_IN = 18;
public final static int ALPHA = 19;
public final static int ALPHA_TO_GRAY = 20;
public static final int REPLACE = 0;
public static final int NORMAL = 1;
public static final int MIN = 2;
public static final int MAX = 3;
public static final int ADD = 4;
public static final int SUBTRACT = 5;
public static final int DIFFERENCE = 6;
public static final int MULTIPLY = 7;
public static final int HUE = 8;
public static final int SATURATION = 9;
public static final int VALUE = 10;
public static final int COLOR = 11;
public static final int SCREEN = 12;
public static final int AVERAGE = 13;
public static final int OVERLAY = 14;
public static final int CLEAR = 15;
public static final int EXCHANGE = 16;
public static final int DISSOLVE = 17;
public static final int DST_IN = 18;
public static final int ALPHA = 19;
public static final int ALPHA_TO_GRAY = 20;
private static Random randomGenerator = new Random();
@ -82,8 +82,8 @@ public class PixelUtils {
return Math.abs(r1 - r2) <= tolerance && Math.abs(g1 - g2) <= tolerance && Math.abs(b1 - b2) <= tolerance;
}
private final static float[] hsb1 = new float[3];//FIXME-not thread safe
private final static float[] hsb2 = new float[3];//FIXME-not thread safe
private static final float[] hsb1 = new float[3];//FIXME-not thread safe
private static final float[] hsb2 = new float[3];//FIXME-not thread safe
// Return rgb1 painted onto rgb2
public static int combinePixels(int rgb1, int rgb2, int op) {

View file

@ -32,7 +32,7 @@ public class QuantizeFilter extends WholeImageFilter {
/**
* Floyd-Steinberg dithering matrix.
*/
protected final static int[] matrix = {
protected static final int[] matrix = {
0, 0, 0,
0, 0, 7,
3, 5, 1,

View file

@ -77,7 +77,7 @@ public class HttpServer {
static class HttpRequestHandler implements Runnable {
final static String CRLF = "\r\n";
static final String CRLF = "\r\n";
Socket socket;
InputStream input;
OutputStream output;

View file

@ -50,7 +50,7 @@ public class STUNResolver extends TransportResolver {
private static final Logger LOGGER = Logger.getLogger(STUNResolver.class.getName());
// The filename where the STUN servers are stored.
public final static String STUNSERVERS_FILENAME = "META-INF/stun-config.xml";
public static final String STUNSERVERS_FILENAME = "META-INF/stun-config.xml";
// Current STUN server we are using
protected STUNService currentServer;

View file

@ -57,7 +57,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
// The time we give to the candidates check before we accept or decline the
// transport (in milliseconds)
public final static int CANDIDATES_ACCEPT_PERIOD = 4000;
public static final int CANDIDATES_ACCEPT_PERIOD = 4000;
// The session this negotiator belongs to
// private final JingleSession session;

View file

@ -183,7 +183,7 @@ public class JingleTransport implements ExtensionElement {
* @author Alvaro Saurin
* @see TransportCandidate
*/
public static abstract class JingleTransportCandidate {
public abstract static class JingleTransportCandidate {
public static final String NODENAME = "candidate";

View file

@ -61,7 +61,7 @@ public final class MessageEventManager extends Manager {
private final List<MessageEventNotificationListener> messageEventNotificationListeners = new CopyOnWriteArrayList<>();
private final List<MessageEventRequestListener> messageEventRequestListeners = new CopyOnWriteArrayList<>();
public synchronized static MessageEventManager getInstanceFor(XMPPConnection connection) {
public static synchronized MessageEventManager getInstanceFor(XMPPConnection connection) {
MessageEventManager messageEventManager = INSTANCES.get(connection);
if (messageEventManager == null) {
messageEventManager = new MessageEventManager(connection);

View file

@ -50,19 +50,19 @@ import org.jxmpp.jid.Jid;
*/
public class RosterExchangeManager {
public final static String NAMESPACE = "jabber:x:roster";
public final static String ELEMENT = "x";
public static final String NAMESPACE = "jabber:x:roster";
public static final String ELEMENT = "x";
private final static Map<XMPPConnection, RosterExchangeManager> INSTANCES = new WeakHashMap<>();
private static final Map<XMPPConnection, RosterExchangeManager> INSTANCES = new WeakHashMap<>();
private final static StanzaFilter PACKET_FILTER = new StanzaExtensionFilter(ELEMENT, NAMESPACE);
private static final StanzaFilter PACKET_FILTER = new StanzaExtensionFilter(ELEMENT, NAMESPACE);
private final Set<RosterExchangeListener> rosterExchangeListeners = Collections.synchronizedSet(new HashSet<RosterExchangeListener>());
private final WeakReference<XMPPConnection> weakRefConnection;
private final StanzaListener packetListener;
public synchronized static RosterExchangeManager getInstanceFor(XMPPConnection connection) {
public static synchronized RosterExchangeManager getInstanceFor(XMPPConnection connection) {
RosterExchangeManager rosterExchangeManager = INSTANCES.get(connection);
if (rosterExchangeManager == null) {
rosterExchangeManager = new RosterExchangeManager(connection);

View file

@ -146,7 +146,7 @@ public final class OmemoManager extends Manager {
* @param deviceId deviceId of the Manager. If the deviceId is null, a random id will be generated.
* @return an OmemoManager
*/
public synchronized static OmemoManager getInstanceFor(XMPPConnection connection, Integer deviceId) {
public static synchronized OmemoManager getInstanceFor(XMPPConnection connection, Integer deviceId) {
WeakHashMap<Integer,OmemoManager> managersOfConnection = INSTANCES.get(connection);
if (managersOfConnection == null) {
managersOfConnection = new WeakHashMap<>();
@ -173,7 +173,7 @@ public final class OmemoManager extends Manager {
* @param connection connection
* @return OmemoManager
*/
public synchronized static OmemoManager getInstanceFor(XMPPConnection connection) {
public static synchronized OmemoManager getInstanceFor(XMPPConnection connection) {
BareJid user;
if (connection.getUser() != null) {
user = connection.getUser().asBareJid();

View file

@ -54,7 +54,7 @@ public class StreamManagement {
}
}
private static abstract class AbstractEnable implements Nonza {
private abstract static class AbstractEnable implements Nonza {
/**
* Preferred maximum resumption time in seconds (optional).
@ -249,7 +249,7 @@ public class StreamManagement {
}
private static abstract class AbstractResume implements Nonza {
private abstract static class AbstractResume implements Nonza {
private final long handledCount;
private final String previd;