Checkstyle rules
authordarisk@kaaliyah
Mon, 10 Aug 2009 07:17:15 +0200
changeset 349 84d45a88699f
parent 348 bf5fcec4bbfc
child 350 5bb849b49099
Checkstyle rules
src/com/beem/project/beem/service/Contact.java
src/com/beem/project/beem/service/RosterAdapter.java
src/com/beem/project/beem/ui/AddContact.java
src/com/beem/project/beem/ui/ContactList.java
src/com/beem/project/beem/ui/CreateAccount.java
src/com/beem/project/beem/ui/EditSettings.java
src/com/beem/project/beem/ui/Login.java
--- a/src/com/beem/project/beem/service/Contact.java	Mon Aug 10 06:46:02 2009 +0200
+++ b/src/com/beem/project/beem/service/Contact.java	Mon Aug 10 07:17:15 2009 +0200
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package com.beem.project.beem.service;
 
@@ -22,7 +22,7 @@
  * @author darisk
  */
 public class Contact implements Parcelable {
-   
+
     private int mID;
     private int mStatus;
     private String mJID;
@@ -34,7 +34,7 @@
     /**
      * Parcelable.Creator needs by Android.
      */
-    public final static Parcelable.Creator<Contact> CREATOR = new Parcelable.Creator<Contact>() {
+    public static final Parcelable.Creator<Contact> CREATOR = new Parcelable.Creator<Contact>() {
 
 	@Override
 	public Contact createFromParcel(Parcel source) {
@@ -91,7 +91,7 @@
      * @throws IllegalArgumentException
      *             if it is not a xmpp uri
      */
-    public Contact(Uri uri) {
+    public Contact(final Uri uri) {
 	if (!"xmpp".equals(uri.getScheme()))
 	    throw new IllegalArgumentException();
 	mJID = uri.getSchemeSpecificPart();
@@ -107,6 +107,10 @@
 	    mGroups.add(group);
     }
 
+    /**
+     * Remove the contact from a group.
+     * @param group the group to delete the contact from.
+     */
     public void delGroup(String group) {
 	mGroups.remove(group);
     }
@@ -180,6 +184,7 @@
     }
 
     /**
+     * Get the name of the contact.
      * @return the mName
      */
     public String getName() {
@@ -252,6 +257,7 @@
     }
 
     /**
+     * Set the name of the contact.
      * @param name
      *            the mName to set
      */
--- a/src/com/beem/project/beem/service/RosterAdapter.java	Mon Aug 10 06:46:02 2009 +0200
+++ b/src/com/beem/project/beem/service/RosterAdapter.java	Mon Aug 10 07:17:15 2009 +0200
@@ -109,6 +109,7 @@
 	    mAdaptee.createGroup(groupname);
 	} catch (IllegalArgumentException e) {
 	    //pas grave, plus simple a gerer comme ca.
+	    ;
 	}
     }
 
@@ -127,7 +128,7 @@
      */
     @Override
     public List<Contact> getContactList() throws RemoteException {
-	List<Contact> coList= new ArrayList<Contact> (mAdaptee.getEntries().size());
+	List<Contact> coList = new ArrayList<Contact> mAdaptee.getEntries().size();
 	for (RosterEntry entry : mAdaptee.getEntries()) {
 	    coList.add(getContactFromRosterEntry(entry));
 	}
@@ -169,6 +170,9 @@
 	return new PresenceAdapter(mAdaptee.getPresence(jid));
     }
 
+    /**
+     * Get a contact from a RosterEntry.
+     */
     private Contact getContactFromRosterEntry(RosterEntry entry) {
 	String user = StringUtils.parseBareAddress(entry.getUser());
 	Contact c = new Contact(user);
--- a/src/com/beem/project/beem/ui/AddContact.java	Mon Aug 10 06:46:02 2009 +0200
+++ b/src/com/beem/project/beem/ui/AddContact.java	Mon Aug 10 07:17:15 2009 +0200
@@ -35,6 +35,11 @@
     private IXmppFacade mXmppFacade;
     private final ServiceConnection mServConn = new BeemServiceConnection();
 
+    /**
+     * Constructor.
+     */
+    public AddContact() { }
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
 	super.onCreate(savedInstanceState);
@@ -50,8 +55,16 @@
 	unbindService(mServConn);
     }
 
+    /**
+     * The ServiceConnection used to connect to the Beem service.
+     */
     private class BeemServiceConnection implements ServiceConnection {
 
+	/**
+	 * Constructor.
+	 */
+	public BeemServiceConnection() { }
+
 	@Override
 	public void onServiceConnected(ComponentName name, IBinder service) {
 	    mXmppFacade = IXmppFacade.Stub.asInterface(service);
@@ -63,6 +76,10 @@
 	}
     }
 
+    /**
+     * Get the text of a widget.
+     * @param id the id of the widget.
+     */
     private String getWidgetText(int id) {
 	EditText widget = (EditText) this.findViewById(id);
 	return widget.getText().toString();
@@ -92,7 +109,8 @@
 		if (mXmppFacade != null) {
 		    if (mXmppFacade.getRoster().getContact(login) != null)
 			mGroup.addAll(mXmppFacade.getRoster().getContact(login).getGroups());
-		    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;
--- a/src/com/beem/project/beem/ui/ContactList.java	Mon Aug 10 06:46:02 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java	Mon Aug 10 07:17:15 2009 +0200
@@ -41,6 +41,9 @@
 import com.beem.project.beem.service.aidl.IXmppFacade;
 import com.beem.project.beem.utils.Status;
 
+/**
+ * The contact list activity displays the roster of the user.
+ */
 public class ContactList extends ExpandableListActivity {
 
     public static final String DEFAULT_GROUP = "Default";
@@ -268,6 +271,9 @@
 
 	    private final Contact mContact;
 
+	    /**
+	     * Constructor.
+	     */
 	    public MyOnClickListener(Contact contact) {
 		mContact = contact;
 	    }
@@ -286,11 +292,17 @@
 	    private final Contact mContact;
 	    private final String mGroup;
 
+	    /**
+	     * Constructor.
+	     */
 	    public MyOnLongClickListener(Contact contact, String group) {
 		mContact = contact;
 		mGroup = group;
 	    }
 
+	    /**
+	     * @{inheritDoc}
+	     */
 	    @Override
 	    public boolean onLongClick(View v) {
 		createDialog(mContact, mGroup);
@@ -300,6 +312,9 @@
 
 	private final List<DataSetObserver> mObservers;
 
+	/**
+	 * Constructor.
+	 */
 	public MyExpandableListAdapter() {
 	    mObservers = new ArrayList<DataSetObserver>();
 	}
@@ -501,9 +516,16 @@
 	}
     }
 
+    /**
+     * The service connection used to connect to the Beem service.
+     */
     private class BeemServiceConnection implements ServiceConnection {
 	private BeemRosterListener mBeemRosterListener = new BeemRosterListener();
 
+	/**
+	 * Constructor.
+	 */
+	public BeemServiceConnection() { }
 	@Override
 	public void onServiceConnected(ComponentName name, IBinder service) {
 	    mXmppFacade = IXmppFacade.Stub.asInterface(service);
--- a/src/com/beem/project/beem/ui/CreateAccount.java	Mon Aug 10 06:46:02 2009 +0200
+++ b/src/com/beem/project/beem/ui/CreateAccount.java	Mon Aug 10 07:17:15 2009 +0200
@@ -39,6 +39,11 @@
     private Button mCreateAccountButton;
 
     /**
+     * Constructor.
+     */
+    public CreateAccount() { }
+
+    /**
      * {@inheritDoc}
      */
     @Override
@@ -50,7 +55,9 @@
     }
 
     /**
-     * Create an account on the XMPP server specified in settings
+     * Create an account on the XMPP server specified in settings.
+     * @param username the username of the account.
+     * @param password the password of the account.
      */
     private boolean createAccount(String username, String password) {
 	XMPPConnection xmppConnection = null;
@@ -82,7 +89,7 @@
     }
 
     /**
-     * Create a dialog containing an error message
+     * Create a dialog containing an error message.
      * @param errMsg the error message
      */
     private void createErrorDialog(String errMsg) {
@@ -101,7 +108,7 @@
     }
 
     /**
-     * Retrive proxy informations from the preferences
+     * Retrive proxy informations from the preferences.
      * @return Registered proxy informations
      */
     private ProxyInfo getRegisteredProxy() {
@@ -172,7 +179,7 @@
     }
 
     /**
-     * Retrieve xmpp server from the preferences
+     * Retrieve xmpp server from the preferences.
      * @return Registered xmpp server
      */
     private String getXMPPServer() {
@@ -182,15 +189,15 @@
     }
 
     /**
-     * Retrieve TLS use from the preferences
+     * Retrieve TLS use from the preferences.
      * @return Registered TLS use
      */
     private boolean getRegisteredXMPPTLSUse() {
-	return (mSettings.getBoolean(getString(R.string.settings_key_xmpp_tls_use), DEFAULT_BOOLEAN_VALUE));
+	return mSettings.getBoolean(getString(R.string.settings_key_xmpp_tls_use), DEFAULT_BOOLEAN_VALUE);
     }
 
     /**
-     * Check if the fields password and confirm password match
+     * Check if the fields password and confirm password match.
      * @return return true if password & confirm password fields match, else false