checkstyle
authorDa Risk <darisk972@gmail.com>
Wed, 28 Oct 2009 20:36:02 +0100
changeset 474 dd6d3c09d0d1
parent 473 22d892b28048
child 475 3d7696ebe2cb
child 478 4e4c5257e3de
checkstyle
src/com/beem/project/beem/service/BeemChatManager.java
src/com/beem/project/beem/service/ChatAdapter.java
src/com/beem/project/beem/service/RosterAdapter.java
src/com/beem/project/beem/service/XmppConnectionAdapter.java
src/com/beem/project/beem/ui/AddContact.java
src/com/beem/project/beem/ui/ContactDialog.java
src/com/beem/project/beem/ui/ContactList.java
src/com/beem/project/beem/ui/CreateAccount.java
src/com/beem/project/beem/ui/GroupList.java
src/com/beem/project/beem/ui/SendIM.java
src/com/beem/project/beem/ui/Subscription.java
src/com/beem/project/beem/utils/BeemBroadcastReceiver.java
--- a/src/com/beem/project/beem/service/BeemChatManager.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/service/BeemChatManager.java	Wed Oct 28 20:36:02 2009 +0100
@@ -147,8 +147,10 @@
     private final ChatManager mAdaptee;
     private final Map<String, ChatAdapter> mChats = new HashMap<String, ChatAdapter>();
     private final ChatListener mChatListener = new ChatListener();
-    private final RemoteCallbackList<IChatManagerListener> mRemoteChatCreationListeners = new RemoteCallbackList<IChatManagerListener>();
-    private final RemoteCallbackList<IMessageListener> mRemoteMessageListeners = new RemoteCallbackList<IMessageListener>();
+    private final RemoteCallbackList<IChatManagerListener> mRemoteChatCreationListeners =
+	new RemoteCallbackList<IChatManagerListener>();
+    private final RemoteCallbackList<IMessageListener> mRemoteMessageListeners =
+	new RemoteCallbackList<IMessageListener>();
 
     private final BeemService mService;
 
--- a/src/com/beem/project/beem/service/ChatAdapter.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/service/ChatAdapter.java	Wed Oct 28 20:36:02 2009 +0100
@@ -16,14 +16,14 @@
  * @author darisk
  */
 public class ChatAdapter extends IChat.Stub {
+    private static final int HISTORY_MAX_SIZE = 50;
+
     private final Chat mAdaptee;
     private final Contact mParticipant;
     private String mState;
     private boolean mIsOpen;
     private final List<Message> mMessages;
 
-    private static final int HISTORY_MAX_SIZE = 50;
-
     /**
      * Constructor.
      * @param chat The chat to adapt
--- a/src/com/beem/project/beem/service/RosterAdapter.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/service/RosterAdapter.java	Wed Oct 28 20:36:02 2009 +0100
@@ -133,7 +133,7 @@
     @Override
     public List<String> getGroupsNames() throws RemoteException {
 	Collection<RosterGroup> groups = mAdaptee.getGroups();
-	ArrayList<String> result = new ArrayList<String>(groups.size());
+	List<String> result = new ArrayList<String>(groups.size());
 	for (RosterGroup rosterGroup : groups) {
 	    result.add(rosterGroup.getName());
 	}
--- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java	Wed Oct 28 20:36:02 2009 +0100
@@ -50,7 +50,8 @@
     private RosterAdapter mRoster;
     private PrivacyListManagerAdapter mPrivacyList;
     private final BeemService mService;
-    private final RemoteCallbackList<IBeemConnectionListener> mRemoteConnListeners = new RemoteCallbackList<IBeemConnectionListener>();
+    private final RemoteCallbackList<IBeemConnectionListener> mRemoteConnListeners =
+	new RemoteCallbackList<IBeemConnectionListener>();
 
     private final ConnexionListenerAdapter mConListener = new ConnexionListenerAdapter();
 
--- a/src/com/beem/project/beem/ui/AddContact.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/ui/AddContact.java	Wed Oct 28 20:36:02 2009 +0100
@@ -64,7 +64,7 @@
         super.onStart();
         this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -150,16 +150,16 @@
 		if (mXmppFacade != null) {
 		    if (mXmppFacade.getRoster().getContact(login) != null)
 			mGroup.addAll(mXmppFacade.getRoster().getContact(login).getGroups());
-		    if (mXmppFacade.getRoster().getContact(login) != null) { 
+		    if (mXmppFacade.getRoster().getContact(login) != null) {
 			Toast.makeText(AddContact.this, getString(R.string.AddCContactAlready), Toast.LENGTH_SHORT)
 			    .show();
 			return;
 		    }
-		    if (mXmppFacade.getRoster().addContact(login, alias, mGroup.toArray(new String[mGroup.size()])) == null) {
+		    if (mXmppFacade.getRoster()
+			    .addContact(login, alias, mGroup.toArray(new String[mGroup.size()])) == null) {
 			Toast.makeText(AddContact.this, getString(R.string.AddCContactAddedError), Toast.LENGTH_SHORT)
 			    .show();
 			return;
-			
 		    } else {
 			Toast.makeText(AddContact.this, getString(R.string.AddCContactAdded), Toast.LENGTH_SHORT)
 			    .show();
--- a/src/com/beem/project/beem/ui/ContactDialog.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/ui/ContactDialog.java	Wed Oct 28 20:36:02 2009 +0100
@@ -77,7 +77,7 @@
 	    try {
 		// TODO permettre a l'user de choisir a quel ressource il veut
 		// faire le call.
-		mXmppFacade.call(mContact.getJID() + "/psi");		
+		mXmppFacade.call(mContact.getJID() + "/psi");
 	    } catch (RemoteException e) {
 		e.printStackTrace();
 	    }
--- a/src/com/beem/project/beem/ui/ContactList.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/ui/ContactList.java	Wed Oct 28 20:36:02 2009 +0100
@@ -152,7 +152,7 @@
 	super.onStop();
 	if (mReceiver.isBinded())
 	    unbindService(mServConn);
-	    mReceiver.setBinded(false);
+	mReceiver.setBinded(false);
     }
 
     @Override
--- a/src/com/beem/project/beem/ui/CreateAccount.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/ui/CreateAccount.java	Wed Oct 28 20:36:02 2009 +0100
@@ -153,17 +153,23 @@
      * @return Registered proxy type
      */
     private ProxyInfo.ProxyType getRegisteredProxyType() {
+	ProxyInfo.ProxyType result;
 	switch (mSettings.getInt(getString(R.string.settings_key_proxy_type), DEFAULT_INT_VALUE)) {
 	    case 0:
-		return ProxyInfo.ProxyType.HTTP;
+		result = ProxyInfo.ProxyType.HTTP;
+		break;
 	    case 1:
-		return ProxyInfo.ProxyType.SOCKS4;
+		result = ProxyInfo.ProxyType.SOCKS4;
+		break;
 	    case 2:
 		Log.i(getString(R.string.create_account_tag), "SOCKS5 PROXY");
-		return ProxyInfo.ProxyType.SOCKS5;
+		result = ProxyInfo.ProxyType.SOCKS5;
+		break;
 	    default:
-		return ProxyInfo.ProxyType.NONE;
+		result =  ProxyInfo.ProxyType.NONE;
+	    	break;
 	}
+	return result;
     }
 
     /**
--- a/src/com/beem/project/beem/ui/GroupList.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/ui/GroupList.java	Wed Oct 28 20:36:02 2009 +0100
@@ -1,6 +1,7 @@
 package com.beem.project.beem.ui;
 
 import java.util.ArrayList;
+import java.util.List;
 
 import android.app.ListActivity;
 import android.content.ComponentName;
@@ -43,7 +44,7 @@
     private ArrayAdapter<String> mGroups;
     private Contact mContact;
     private TextView mText;
-    private final ArrayList<String> mStrings = new ArrayList<String>();
+    private final List<String> mStrings = new ArrayList<String>();
 
     static {
 	SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
@@ -89,7 +90,7 @@
     @Override
     protected void onPause() {
 	super.onPause();
-	if (mReceiver.isBinded()){
+	if (mReceiver.isBinded()) {
 	    unbindService(mServConn);
 	    mReceiver.setBinded(false);
 	}
@@ -133,6 +134,7 @@
 
 	@Override
 	public boolean onKey(View v, int keyCode, KeyEvent event) {
+	    boolean result = false;
 	    if (event.getAction() == KeyEvent.ACTION_DOWN) {
 		switch (keyCode) {
 		    case KeyEvent.KEYCODE_DPAD_CENTER:
@@ -142,12 +144,13 @@
 			String groupname = mText.getText().toString();
 			mGroups.add(groupname);
 			mText.setText(null);
-			return true;
+			result = true;
+			break;
 		    default:
-			return false;
+			result = false;
 		}
 	    }
-	    return false;
+	    return result;
 	}
 
     }
--- a/src/com/beem/project/beem/ui/SendIM.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/ui/SendIM.java	Wed Oct 28 20:36:02 2009 +0100
@@ -250,7 +250,7 @@
 	} catch (RemoteException e) {
 	    Log.d(TAG, "Error while closing chat", e);
 	}
-	if (mReceiver.isBinded()){
+	if (mReceiver.isBinded()) {
 	    unbindService(mServConn);
 	    mReceiver.setBinded(false);
 	}
@@ -274,7 +274,6 @@
 	}
     }
 
-   
     /**
      * The service connection used to connect with the BeemService.
      */
--- a/src/com/beem/project/beem/ui/Subscription.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/ui/Subscription.java	Wed Oct 28 20:36:02 2009 +0100
@@ -69,7 +69,7 @@
     @Override
     protected void onPause() {
 	super.onPause();
-	if (mReceiver.isBinded()){
+	if (mReceiver.isBinded()) {
 	    unbindService(mServConn);
 	    mReceiver.setBinded(false);
 	}
@@ -80,7 +80,7 @@
         super.onDestroy();
         this.unregisterReceiver(mReceiver);
     }
-    
+
     /**
      * Event simple click on buttons.
      */
--- a/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java	Wed Oct 28 20:17:42 2009 +0100
+++ b/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java	Wed Oct 28 20:36:02 2009 +0100
@@ -37,16 +37,16 @@
      */
     @Override
     public void onReceive(Context context, Intent intent) {
-	Log.d("Broadcast","onREceive");
+	Log.d("Broadcast", "onReceive");
 	if (mIsBinded)
 	    context.unbindService(mService);
 	setBinded(false);
 	// start activity if unexpected disconnection
-	if ( ! intent.getBooleanExtra("normally", false))
+	if (!intent.getBooleanExtra("normally", false))
 	    context.startActivity(new Intent(context, Login.class));
 	CharSequence message = intent.getCharSequenceExtra("message");
 	Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
-	if (context instanceof Activity){
+	if (context instanceof Activity) {
 	    Activity act = (Activity) context;
 	    act.finish();
 	}
@@ -54,6 +54,7 @@
 
     /**
      * service is binded.
+     * @param binded the state of the bind.
      */
     public void setBinded(boolean binded) {
 	mIsBinded = binded;