Commit 7b220ad8 authored by Grigory Fedorov's avatar Grigory Fedorov

Android Studio clean up code tool run.

parent e56eb4d4
...@@ -38,8 +38,6 @@ public class LogManager implements OnLoadListener { ...@@ -38,8 +38,6 @@ public class LogManager implements OnLoadListener {
log = debugable && SettingsManager.debugLog(); log = debugable && SettingsManager.debugLog();
} }
;
private final static LogManager instance; private final static LogManager instance;
static { static {
......
...@@ -26,5 +26,5 @@ public interface OnCloseListener extends BaseManagerInterface { ...@@ -26,5 +26,5 @@ public interface OnCloseListener extends BaseManagerInterface {
* <p/> * <p/>
* This function will be call from UI thread. * This function will be call from UI thread.
*/ */
public void onClose(); void onClose();
} }
...@@ -26,5 +26,5 @@ interface OnErrorListener extends BaseUIListener { ...@@ -26,5 +26,5 @@ interface OnErrorListener extends BaseUIListener {
* *
* @param resourceId String with error description. * @param resourceId String with error description.
*/ */
public void onError(int resourceId); void onError(int resourceId);
} }
...@@ -26,7 +26,7 @@ package com.xabber.android.data; ...@@ -26,7 +26,7 @@ package com.xabber.android.data;
*/ */
public interface OnTimerListener extends BaseManagerInterface { public interface OnTimerListener extends BaseManagerInterface {
public final static int DELAY = 1000; int DELAY = 1000;
/** /**
* Called after at least {@link #DELAY} milliseconds. * Called after at least {@link #DELAY} milliseconds.
......
...@@ -28,6 +28,6 @@ public interface OnUnloadListener extends BaseManagerInterface { ...@@ -28,6 +28,6 @@ public interface OnUnloadListener extends BaseManagerInterface {
* WILL BE CALLED FROM BACKGROUND THREAD. DON'T CHANGE OR ACCESS * WILL BE CALLED FROM BACKGROUND THREAD. DON'T CHANGE OR ACCESS
* APPLICATION'S DATA HERE! * APPLICATION'S DATA HERE!
*/ */
public void onUnload(); void onUnload();
} }
...@@ -54,6 +54,6 @@ public enum CommonState { ...@@ -54,6 +54,6 @@ public enum CommonState {
/** /**
* There is at least one account with received roster. * There is at least one account with received roster.
*/ */
online; online
} }
...@@ -29,7 +29,7 @@ interface OAuthProvider extends BaseManagerInterface { ...@@ -29,7 +29,7 @@ interface OAuthProvider extends BaseManagerInterface {
/** /**
* @return Supported protocol. * @return Supported protocol.
*/ */
public AccountProtocol getAccountProtocol(); AccountProtocol getAccountProtocol();
/** /**
* Gets refresh token using Request Access Token. * Gets refresh token using Request Access Token.
...@@ -40,7 +40,7 @@ interface OAuthProvider extends BaseManagerInterface { ...@@ -40,7 +40,7 @@ interface OAuthProvider extends BaseManagerInterface {
* @return refresh token or <code>null</code> if auth failed. * @return refresh token or <code>null</code> if auth failed.
* @throws NetworkException * @throws NetworkException
*/ */
public String requestRefreshToken(String code) throws NetworkException; String requestRefreshToken(String code) throws NetworkException;
/** /**
* Requests password renew from server based on refreshToken. * Requests password renew from server based on refreshToken.
...@@ -51,7 +51,7 @@ interface OAuthProvider extends BaseManagerInterface { ...@@ -51,7 +51,7 @@ interface OAuthProvider extends BaseManagerInterface {
* @return <code>null</code> on authorization fail. * @return <code>null</code> on authorization fail.
* @throws NetworkException * @throws NetworkException
*/ */
public OAuthResult requestAccessToken(String refreshToken) OAuthResult requestAccessToken(String refreshToken)
throws NetworkException; throws NetworkException;
/** /**
......
...@@ -30,5 +30,5 @@ public interface OnAccountChangedListener extends BaseUIListener { ...@@ -30,5 +30,5 @@ public interface OnAccountChangedListener extends BaseUIListener {
* *
* @param accounts * @param accounts
*/ */
public void onAccountsChanged(Collection<String> accounts); void onAccountsChanged(Collection<String> accounts);
} }
...@@ -472,7 +472,7 @@ public class ConnectionThread implements ...@@ -472,7 +472,7 @@ public class ConnectionThread implements
Throwable e1 = ((XMPPException) e).getWrappedThrowable(); Throwable e1 = ((XMPPException) e).getWrappedThrowable();
if (!(e1 instanceof SSLException)) if (!(e1 instanceof SSLException))
return; return;
Throwable e2 = ((SSLException) e1).getCause(); Throwable e2 = e1.getCause();
if (!(e2 instanceof CertificateException)) if (!(e2 instanceof CertificateException))
return; return;
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
......
...@@ -102,7 +102,7 @@ public class DNSManager { ...@@ -102,7 +102,7 @@ public class DNSManager {
} }
for (Resolver check : resolver.getResolvers()) for (Resolver check : resolver.getResolvers())
if (check instanceof SimpleResolver) { if (check instanceof SimpleResolver) {
((SimpleResolver) check).setTimeout(30); check.setTimeout(30);
} else { } else {
LogManager.i(this, "Not simple resolver!!!?" + check); LogManager.i(this, "Not simple resolver!!!?" + check);
} }
......
...@@ -25,6 +25,6 @@ public enum NetworkState { ...@@ -25,6 +25,6 @@ public enum NetworkState {
suspended, suspended,
unavailable; unavailable
} }
...@@ -81,9 +81,7 @@ public class Target implements Comparable<Target> { ...@@ -81,9 +81,7 @@ public class Target implements Comparable<Target> {
return false; return false;
if (priority != other.priority) if (priority != other.priority)
return false; return false;
if (weight != other.weight) return weight == other.weight;
return false;
return true;
} }
@Override @Override
......
...@@ -29,9 +29,9 @@ import android.provider.BaseColumns; ...@@ -29,9 +29,9 @@ import android.provider.BaseColumns;
*/ */
public abstract class AbstractAccountTable extends AbstractTable { public abstract class AbstractAccountTable extends AbstractTable {
public static interface Fields extends BaseColumns { public interface Fields extends BaseColumns {
public static final String ACCOUNT = "account"; String ACCOUNT = "account";
} }
......
...@@ -23,9 +23,9 @@ import android.database.Cursor; ...@@ -23,9 +23,9 @@ import android.database.Cursor;
*/ */
public abstract class AbstractEntityTable extends AbstractAccountTable { public abstract class AbstractEntityTable extends AbstractAccountTable {
public static interface Fields extends AbstractAccountTable.Fields { public interface Fields extends AbstractAccountTable.Fields {
public static final String USER = "user"; String USER = "user";
} }
......
...@@ -27,6 +27,6 @@ public enum MatchMode { ...@@ -27,6 +27,6 @@ public enum MatchMode {
bare, bare,
exect; exect
} }
...@@ -47,7 +47,7 @@ public enum ClientSoftware { ...@@ -47,7 +47,7 @@ public enum ClientSoftware {
private final static Pattern GTALK_NODE = Pattern private final static Pattern GTALK_NODE = Pattern
.compile("(?iu).*mail\\.google\\.com.*client.*"); .compile("(?iu).*mail\\.google\\.com.*client.*");
private ClientSoftware(String regularExpression) { ClientSoftware(String regularExpression) {
this.regularExpression = Pattern.compile(regularExpression); this.regularExpression = Pattern.compile(regularExpression);
} }
......
...@@ -30,6 +30,6 @@ public enum SessionState { ...@@ -30,6 +30,6 @@ public enum SessionState {
* Data form of type "form" with a "renegotiate" field whose value is "1" * Data form of type "form" with a "renegotiate" field whose value is "1"
* has been sent. * has been sent.
*/ */
renegotiation; renegotiation
} }
...@@ -31,7 +31,7 @@ public interface OnVCardListener extends BaseUIListener { ...@@ -31,7 +31,7 @@ public interface OnVCardListener extends BaseUIListener {
* @param bareAddress * @param bareAddress
* @param vCard * @param vCard
*/ */
public void onVCardReceived(String account, String bareAddress, VCard vCard); void onVCardReceived(String account, String bareAddress, VCard vCard);
/** /**
* Fail occurred on vCard response. * Fail occurred on vCard response.
...@@ -39,6 +39,6 @@ public interface OnVCardListener extends BaseUIListener { ...@@ -39,6 +39,6 @@ public interface OnVCardListener extends BaseUIListener {
* @param account * @param account
* @param bareAddress * @param bareAddress
*/ */
public void onVCardFailed(String account, String bareAddress); void onVCardFailed(String account, String bareAddress);
} }
...@@ -28,6 +28,6 @@ public interface OnChatChangedListener extends BaseUIListener { ...@@ -28,6 +28,6 @@ public interface OnChatChangedListener extends BaseUIListener {
* @param user * @param user
* @param incoming Whether new incoming message received. * @param incoming Whether new incoming message received.
*/ */
public void onChatChanged(String account, String user, boolean incoming); void onChatChanged(String account, String user, boolean incoming);
} }
...@@ -22,6 +22,6 @@ package com.xabber.android.data.notification; ...@@ -22,6 +22,6 @@ package com.xabber.android.data.notification;
*/ */
public interface AccountNotificationItem extends NotificationItem { public interface AccountNotificationItem extends NotificationItem {
public String getAccount(); String getAccount();
} }
...@@ -21,6 +21,6 @@ package com.xabber.android.data.notification; ...@@ -21,6 +21,6 @@ package com.xabber.android.data.notification;
*/ */
public interface EntityNotificationItem extends AccountNotificationItem { public interface EntityNotificationItem extends AccountNotificationItem {
public String getUser(); String getUser();
} }
...@@ -21,6 +21,6 @@ package com.xabber.android.data.roster; ...@@ -21,6 +21,6 @@ package com.xabber.android.data.roster;
*/ */
public interface Group { public interface Group {
public String getName(); String getName();
} }
...@@ -31,6 +31,6 @@ public interface OnContactChangedListener extends BaseUIListener { ...@@ -31,6 +31,6 @@ public interface OnContactChangedListener extends BaseUIListener {
* *
* @param entities * @param entities
*/ */
public void onContactsChanged(Collection<BaseEntity> entities); void onContactsChanged(Collection<BaseEntity> entities);
} }
...@@ -37,7 +37,7 @@ public interface OnRosterChangedListener extends BaseManagerInterface { ...@@ -37,7 +37,7 @@ public interface OnRosterChangedListener extends BaseManagerInterface {
* @param removedContacts * @param removedContacts
* @param removedGroups * @param removedGroups
*/ */
public void onRosterUpdate( void onRosterUpdate(
Collection<RosterGroup> addedGroups, Collection<RosterGroup> addedGroups,
Map<RosterContact, String> addedContacts, Map<RosterContact, String> addedContacts,
Map<RosterContact, String> renamedContacts, Map<RosterContact, String> renamedContacts,
...@@ -51,14 +51,14 @@ public interface OnRosterChangedListener extends BaseManagerInterface { ...@@ -51,14 +51,14 @@ public interface OnRosterChangedListener extends BaseManagerInterface {
* *
* @param rosterContact * @param rosterContact
*/ */
public void onPresenceChanged(Collection<RosterContact> rosterContact); void onPresenceChanged(Collection<RosterContact> rosterContact);
/** /**
* Contact's structured name has been changed. * Contact's structured name has been changed.
* *
* @param rosterContact * @param rosterContact
*/ */
public void onContactStructuredInfoChanged(RosterContact rosterContact, void onContactStructuredInfoChanged(RosterContact rosterContact,
StructuredName structuredName); StructuredName structuredName);
} }
...@@ -34,7 +34,7 @@ public class ConnectivityReceiver extends BroadcastReceiver { ...@@ -34,7 +34,7 @@ public class ConnectivityReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (!ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) if (!ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction()))
return; return;
NetworkInfo networkInfo = (NetworkInfo) intent NetworkInfo networkInfo = intent
.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO); .getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
if (networkInfo == null) { if (networkInfo == null) {
LogManager.e(this, "NO INFO"); LogManager.e(this, "NO INFO");
......
...@@ -166,7 +166,7 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter { ...@@ -166,7 +166,7 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter {
} }
public interface FinishUpdateListener { public interface FinishUpdateListener {
public void onChatViewAdapterFinishUpdate(); void onChatViewAdapterFinishUpdate();
} }
public ArrayList<AbstractChat> getActiveChats() { public ArrayList<AbstractChat> getActiveChats() {
......
...@@ -66,7 +66,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragment ...@@ -66,7 +66,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragment
/** /**
* Possible operations. * Possible operations.
*/ */
private static enum Operation { private enum Operation {
save, discard, read save, discard, read
} }
......
...@@ -28,12 +28,12 @@ public interface Container extends Instance { ...@@ -28,12 +28,12 @@ public interface Container extends Instance {
/** /**
* @return XML element name. * @return XML element name.
*/ */
public String getElementName(); String getElementName();
/** /**
* @return XML namespace. * @return XML namespace.
*/ */
public String getNamespace(); String getNamespace();
/** /**
* Serializes an inner content of XML tag. * Serializes an inner content of XML tag.
...@@ -41,7 +41,7 @@ public interface Container extends Instance { ...@@ -41,7 +41,7 @@ public interface Container extends Instance {
* @param serializer * @param serializer
* @throws IOException * @throws IOException
*/ */
public abstract void serializeContent(XmlSerializer serializer) void serializeContent(XmlSerializer serializer)
throws IOException; throws IOException;
} }
...@@ -32,7 +32,7 @@ public interface Instance { ...@@ -32,7 +32,7 @@ public interface Instance {
* @return Whether parsed instance has valid values (e.g. required field are * @return Whether parsed instance has valid values (e.g. required field are
* not <code>null</code>). * not <code>null</code>).
*/ */
public boolean isValid(); boolean isValid();
/** /**
* Serializes an instance into XML using serializer. * Serializes an instance into XML using serializer.
...@@ -40,6 +40,6 @@ public interface Instance { ...@@ -40,6 +40,6 @@ public interface Instance {
* @param serializer * @param serializer
* @throws IOException * @throws IOException
*/ */
public void serialize(XmlSerializer serializer) throws IOException; void serialize(XmlSerializer serializer) throws IOException;
} }
...@@ -132,7 +132,7 @@ public class ProviderUtils { ...@@ -132,7 +132,7 @@ public class ProviderUtils {
* @throws Exception * @throws Exception
*/ */
public static String parseText(XmlPullParser parser, int maximum) public static String parseText(XmlPullParser parser, int maximum)
throws OverflowReceiverBufferException, Exception { throws Exception {
final StringBuilder text = new StringBuilder(); final StringBuilder text = new StringBuilder();
int inner = 1; int inner = 1;
boolean overflow = false; boolean overflow = false;
...@@ -179,7 +179,7 @@ public class ProviderUtils { ...@@ -179,7 +179,7 @@ public class ProviderUtils {
* @throws Exception * @throws Exception
*/ */
public static void skipTag(XmlPullParser parser) public static void skipTag(XmlPullParser parser)
throws IllegalStateException, Exception { throws Exception {
LinkedList<String> tags = new LinkedList<String>(); LinkedList<String> tags = new LinkedList<String>();
tags.add(parser.getName()); tags.add(parser.getName());
while (!tags.isEmpty()) { while (!tags.isEmpty()) {
......
...@@ -23,12 +23,12 @@ import java.util.Date; ...@@ -23,12 +23,12 @@ import java.util.Date;
*/ */
public interface CollectionHeader { public interface CollectionHeader {
public Date getStart(); Date getStart();
public String getStartString(); String getStartString();
public Integer getVersion(); Integer getVersion();
public String getWith(); String getWith();
} }
...@@ -62,7 +62,7 @@ public enum OtrMode { ...@@ -62,7 +62,7 @@ public enum OtrMode {
private final LoggingValue[] loggingValues; private final LoggingValue[] loggingValues;
private OtrMode(LoggingValue[] loggingValues) { OtrMode(LoggingValue[] loggingValues) {
this.loggingValues = loggingValues; this.loggingValues = loggingValues;
} }
......
...@@ -47,7 +47,7 @@ public enum SaveMode { ...@@ -47,7 +47,7 @@ public enum SaveMode {
private String value; private String value;
private SaveMode(String name) { SaveMode(String name) {
this.value = name; this.value = name;
} }
......
...@@ -37,7 +37,7 @@ public enum DisclosureValue { ...@@ -37,7 +37,7 @@ public enum DisclosureValue {
private final String label; private final String label;
private DisclosureValue(String label) { DisclosureValue(String label) {
this.label = label; this.label = label;
} }
......
...@@ -33,7 +33,7 @@ public enum LoggingValue { ...@@ -33,7 +33,7 @@ public enum LoggingValue {
private final String label; private final String label;
private LoggingValue(String label) { LoggingValue(String label) {
this.label = label; this.label = label;
} }
......
...@@ -35,7 +35,7 @@ public enum SecurityValue { ...@@ -35,7 +35,7 @@ public enum SecurityValue {
private final String label; private final String label;
private SecurityValue(String label) { SecurityValue(String label) {
this.label = label; this.label = label;
} }
......
...@@ -28,6 +28,6 @@ public enum AddressProperty { ...@@ -28,6 +28,6 @@ public enum AddressProperty {
PCODE, PCODE,
CTRY; CTRY
} }
...@@ -20,6 +20,6 @@ public enum Classification { ...@@ -20,6 +20,6 @@ public enum Classification {
PRIVATE, PRIVATE,
CONFIDENTIAL; CONFIDENTIAL
} }
...@@ -24,6 +24,6 @@ public enum EmailType { ...@@ -24,6 +24,6 @@ public enum EmailType {
X400, X400,
PREF; PREF
} }
...@@ -18,6 +18,6 @@ import com.xabber.xmpp.Instance; ...@@ -18,6 +18,6 @@ import com.xabber.xmpp.Instance;
public interface Logo extends Instance { public interface Logo extends Instance {
public static final String ELEMENT_NAME = "LOGO"; String ELEMENT_NAME = "LOGO";
} }
...@@ -24,6 +24,6 @@ public enum NameProperty { ...@@ -24,6 +24,6 @@ public enum NameProperty {
PREFIX, PREFIX,
SUFFIX; SUFFIX
} }
...@@ -18,6 +18,6 @@ import com.xabber.xmpp.Instance; ...@@ -18,6 +18,6 @@ import com.xabber.xmpp.Instance;
public interface Photo extends Instance { public interface Photo extends Instance {
public static final String ELEMENT_NAME = "PHOTO"; String ELEMENT_NAME = "PHOTO";
} }
...@@ -18,6 +18,6 @@ import com.xabber.xmpp.Instance; ...@@ -18,6 +18,6 @@ import com.xabber.xmpp.Instance;
public interface Sound extends Instance { public interface Sound extends Instance {
public static final String ELEMENT_NAME = "SOUND"; String ELEMENT_NAME = "SOUND";
} }
...@@ -40,6 +40,6 @@ public enum TelephoneType { ...@@ -40,6 +40,6 @@ public enum TelephoneType {
PCS, PCS,
PREF; PREF
} }
...@@ -48,7 +48,7 @@ public enum VCardProperty { ...@@ -48,7 +48,7 @@ public enum VCardProperty {
private final String name; private final String name;
private VCardProperty() { VCardProperty() {
name = super.toString().replace('_', '-'); name = super.toString().replace('_', '-');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment