merge
authorDa Risk <darisk972@gmail.com>
Sun, 26 Dec 2010 17:53:23 +0100
changeset 834 84cc7ee4b067
parent 833 8005cd552571 (current diff)
parent 832 696b2880c994 (diff)
child 835 0d5d1d7735ca
merge
--- a/AndroidManifest.xml	Sun Dec 26 17:51:12 2010 +0100
+++ b/AndroidManifest.xml	Sun Dec 26 17:53:23 2010 +0100
@@ -87,11 +87,12 @@
 	</application>
 	<permission android:permissionGroup="android.permission-group.NETWORK"
 		android:label="BeemService" android:description="@string/BeemServiceDescription"
-		android:name="com.beem.project.beem.BEEM_SERVICE"></permission>
-	<uses-permission android:name="android.permission.INTERNET"></uses-permission>
-	<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
-	<uses-permission android:name="com.beem.project.beem.BEEM_SERVICE"></uses-permission>
-	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
+		android:name="com.beem.project.beem.BEEM_SERVICE"/>
+	<uses-permission android:name="android.permission.INTERNET"/>
+	<uses-permission android:name="android.permission.VIBRATE"/>
+	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+	<uses-permission android:name="com.beem.project.beem.BEEM_SERVICE"/>
 	<uses-sdk android:minSdkVersion="3" />
 	<supports-screens android:largeScreens="true"
 		android:normalScreens="true" android:smallScreens="true" android:anyDensity="true" />
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/res/drawable/avatar_status.xml	Sun Dec 26 17:53:23 2010 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Layer Level list drawable for Avatar and status icon
+    See src/com/beem/project/beem/utils/Status.java
+    for level values to change the status.
+    The status icon must be resized using method
+    LayerDrawable.setLayerInset();
+    The drawable with id @id/avatar must be replace by the real
+    avatar using the method LayerDrawable.setDrawableByLayerId()
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/avatar">
+	<shape/>
+    </item>
+    <item android:drawable="@drawable/status_icon" />
+</layer-list>
--- a/res/layout/chat.xml	Sun Dec 26 17:51:12 2010 +0100
+++ b/res/layout/chat.xml	Sun Dec 26 17:53:23 2010 +0100
@@ -7,9 +7,10 @@
 		android:orientation="horizontal" android:gravity="center_vertical"
 		android:background="#222222" android:padding="4px">
 		<ImageView android:id="@+id/chat_contact_status_icon"
-			android:src="@drawable/status_icon"
-			android:adjustViewBounds="true" android:layout_width="wrap_content"
-			android:layout_height="wrap_content" android:gravity="center_vertical" />
+			android:src="@drawable/avatar_status"
+			android:layout_width="48dip"
+			android:layout_height="48dip"
+			/>
 		<LinearLayout android:orientation="vertical"
 			android:layout_width="fill_parent" android:layout_height="wrap_content"
 			android:paddingLeft="15sp">
--- a/src/com/beem/project/beem/BeemService.java	Sun Dec 26 17:51:12 2010 +0100
+++ b/src/com/beem/project/beem/BeemService.java	Sun Dec 26 17:53:23 2010 +0100
@@ -154,7 +154,7 @@
 	    || mSettings.getBoolean("settings_key_gmail", false)) {
 	    mConnectionConfiguration.setSecurityMode(SecurityMode.required);
 	}
-	mConnectionConfiguration.setDebuggerEnabled(true);
+	mConnectionConfiguration.setDebuggerEnabled(false);
 	mConnectionConfiguration.setSendPresence(true);
 	// maybe not the universal path, but it works on most devices (Samsung Galaxy, Google Nexus One)
 	mConnectionConfiguration.setTruststoreType("BKS");
--- a/src/com/beem/project/beem/ui/Chat.java	Sun Dec 26 17:51:12 2010 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java	Sun Dec 26 17:53:23 2010 +0100
@@ -61,6 +61,8 @@
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.graphics.Color;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.LayerDrawable;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
@@ -83,6 +85,8 @@
 import android.widget.ListView;
 import android.widget.TextView;
 
+import java.io.ByteArrayInputStream;
+
 import com.beem.project.beem.R;
 import com.beem.project.beem.service.Contact;
 import com.beem.project.beem.service.Message;
@@ -121,6 +125,7 @@
     private ListView mMessagesListView;
     private EditText mInputField;
     private Button mSendButton;
+    private LayerDrawable mAvatarStatusDrawable;
     private final Map<Integer, Bitmap> mStatusIconsMap = new HashMap<Integer, Bitmap>();
 
     private final List<MessageText> mListMessages = new ArrayList<MessageText>();
@@ -158,6 +163,8 @@
 	mContactStatusMsgTextView = (TextView) findViewById(R.id.chat_contact_status_msg);
 	mContactChatState = (TextView) findViewById(R.id.chat_contact_chat_state);
 	mContactStatusIcon = (ImageView) findViewById(R.id.chat_contact_status_icon);
+	mAvatarStatusDrawable = (LayerDrawable) mContactStatusIcon.getDrawable();
+	mAvatarStatusDrawable.setLayerInset(1, 36, 36, 0, 0);
 	mMessagesListView = (ListView) findViewById(R.id.chat_messages);
 	mMessagesListView.setAdapter(mMessagesListAdapter);
 	mInputField = (EditText) findViewById(R.id.chat_input);
@@ -562,10 +569,34 @@
      * Update the contact status icon.
      */
     private void updateContactStatusIcon() {
+	Drawable avatar = getAvatarDrawable(mContact.getAvatarId());
+	mAvatarStatusDrawable.setDrawableByLayerId(R.id.avatar, avatar);
 	mContactStatusIcon.setImageLevel(mContact.getStatus());
     }
 
     /**
+     * Get a Drawable containing the avatar icon.
+     *
+     * @param avatarId the avatar id to retrieve or null to get default
+     * @return a Drawable
+     */
+    private Drawable getAvatarDrawable(String avatarId) {
+	Drawable avatarDrawable = null;
+	try {
+	    byte[] avatar = mXmppFacade.getAvatar(avatarId);
+	    if (avatar != null) {
+		ByteArrayInputStream in = new ByteArrayInputStream(avatar);
+		avatarDrawable = Drawable.createFromStream(in, avatarId);
+	    }
+	} catch (RemoteException e) {
+	    Log.e(TAG, "Error while setting the avatar", e);
+	}
+	if (avatarDrawable == null)
+	    avatarDrawable = getResources().getDrawable(R.drawable.beem_launcher_icon_silver);
+	return avatarDrawable;
+    }
+
+    /**
      * Prepare the status icons map.
      */
     private void prepareIconsStatus() {
--- a/src/com/beem/project/beem/ui/ContactList.java	Sun Dec 26 17:51:12 2010 +0100
+++ b/src/com/beem/project/beem/ui/ContactList.java	Sun Dec 26 17:53:23 2010 +0100
@@ -60,7 +60,6 @@
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
 import android.content.SharedPreferences;
-import android.graphics.drawable.LevelListDrawable;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
@@ -87,6 +86,7 @@
 import android.widget.ListView;
 import android.widget.TextView;
 import android.graphics.drawable.Drawable;
+import android.graphics.drawable.LayerDrawable;
 
 import com.beem.project.beem.R;
 import com.beem.project.beem.service.Contact;
@@ -656,30 +656,41 @@
 	private void bindView(View view, Contact curContact) {
 	    if (curContact != null) {
 		TextView v = (TextView) view.findViewById(R.id.contactlistpseudo);
-		LevelListDrawable mStatusDrawable = (LevelListDrawable) getResources()
-		.getDrawable(R.drawable.status_icon);
-		mStatusDrawable.setLevel(curContact.getStatus());
-		v.setCompoundDrawablesWithIntrinsicBounds(mStatusDrawable, null, null, null);
 		v.setText(curContact.getName());
 		v = (TextView) view.findViewById(R.id.contactlistmsgperso);
 		v.setText(curContact.getMsgState());
-		Drawable d = null;
-		try {
-		    String avatarId = curContact.getAvatarId();
-		    byte[] avatar = mXmppFacade.getAvatar(avatarId);
-		    if (avatar != null) {
-			ByteArrayInputStream in = new ByteArrayInputStream(avatar);
-			d = Drawable.createFromStream(in, avatarId);
-		    }
-		} catch (RemoteException e) {
-		    Log.e(TAG, "Error while setting the avatar", e);
+		ImageView img = (ImageView) view.findViewById(R.id.avatar);
+		String avatarId = curContact.getAvatarId();
+		int contactStatus = curContact.getStatus();
+		Drawable avatar = getAvatarStatusDrawable(curContact.getAvatarId());
+		img.setImageDrawable(avatar);
+		img.setImageLevel(contactStatus);
+	    }
+	}
+
+	/**
+	 * Get a LayerDrawable containing the avatar and the status icon.
+	 * The status icon will change with the level of the drawable.
+	 * @param avatarId the avatar id to retrieve or null to get default
+	 * @return a LayerDrawable
+	 */
+	private Drawable getAvatarStatusDrawable(String avatarId) {
+	    Drawable avatarDrawable = null;
+	    try {
+		byte[] avatar = mXmppFacade.getAvatar(avatarId);
+		if (avatar != null) {
+		    ByteArrayInputStream in = new ByteArrayInputStream(avatar);
+		    avatarDrawable = Drawable.createFromStream(in, avatarId);
 		}
-		ImageView img = (ImageView) view.findViewById(R.id.avatar);
-		if (d != null)
-		    img.setImageDrawable(d);
-		else
-		    img.setImageResource(R.drawable.beem_launcher_icon_silver);
+	    } catch (RemoteException e) {
+		Log.e(TAG, "Error while setting the avatar", e);
 	    }
+	    if (avatarDrawable == null)
+		avatarDrawable = getResources().getDrawable(R.drawable.beem_launcher_icon_silver);
+	    LayerDrawable ld = (LayerDrawable) getResources().getDrawable(R.drawable.avatar_status);
+	    ld.setLayerInset(1, 36, 36, 0, 0);
+	    ld.setDrawableByLayerId(R.id.avatar, avatarDrawable);
+	    return ld;
 	}
 
 	/**
--- a/tools/checkstyle.xml	Sun Dec 26 17:51:12 2010 +0100
+++ b/tools/checkstyle.xml	Sun Dec 26 17:53:23 2010 +0100
@@ -1,208 +1,341 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
 
 <!--
-    This configuration file was written by the eclipse-cs plugin configuration editor
+
+  Checkstyle configuration that checks the sun coding conventions from:
+
+  - the Java Language Specification at
+  http://java.sun.com/docs/books/jls/second_edition/html/index.html
+
+  - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
+
+  - the Javadoc guidelines at
+  http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
+
+  - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
+
+  - some best practices
+
+  Checkstyle is very configurable. Be sure to read the documentation at
+  http://checkstyle.sf.net (or in your downloaded distribution).
+
+  Most Checks are configurable, be sure to consult the documentation.
+
+  To completely disable a check, just comment it out or delete it from the file.
+
+  Finally, it is worth reading the documentation.
+
 -->
-<!--
-    Checkstyle-Configuration: Beem Checks
-    Description: none
--->
+
 <module name="Checker">
-  <property name="severity" value="warning"/>
-  <property name="basedir" value="/home/beem/"/>
-  <module name="TreeWalker">
-    <module name="JavadocMethod">
-      <property name="severity" value="error"/>
-      <property name="allowUndeclaredRTE" value="true"/>
-    </module>
-    <module name="JavadocType">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="JavadocVariable">
-      <property name="severity" value="error"/>
-      <property name="scope" value="package"/>
-    </module>
-    <module name="JavadocStyle">
-      <property name="severity" value="error"/>
-      <property name="checkEmptyJavadoc" value="true"/>
-    </module>
-    <module name="ConstantName"/>
-    <module name="LocalFinalVariableName"/>
-    <module name="LocalVariableName"/>
-    <module name="MemberName">
-      <property name="severity" value="error"/>
-      <property name="format" value="^m[A-Z][a-zA-Z0-9]*$"/>
-    </module>
-    <module name="MethodName"/>
-    <module name="PackageName"/>
-    <module name="ParameterName"/>
-    <module name="StaticVariableName"/>
-    <module name="TypeName"/>
-    <module name="AvoidStarImport"/>
-    <module name="IllegalImport"/>
-    <module name="RedundantImport"/>
-    <module name="UnusedImports">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="AvoidStaticImport">
-      <property name="excludes" value="*"/>
-    </module>
-    <module name="LineLength">
-      <property name="max" value="120"/>
+  <!--
+        If you set the basedir property below, then all reported file
+        names will be relative to the specified directory. See
+        http://checkstyle.sourceforge.net/5.x/config.html#Checker
+-->
+    <property name="basedir" value="/home/beem/" default="."/>
+
+    <property name="severity" value="warning"/>
+
+    <!-- Checks that a package-info.java file exists for each package.     -->
+    <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
+    <module name="JavadocPackage">
+	<property name="allowLegacy" value="true"/>
     </module>
-    <module name="MethodLength"/>
-    <module name="ParameterNumber"/>
-    <module name="AnonInnerLength">
-      <property name="max" value="60"/>
-    </module>
-    <module name="EmptyForIteratorPad"/>
-    <module name="GenericWhitespace">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="MethodParamPad">
-      <property name="severity" value="error"/>
+
+    <!-- Checks whether files end with a new line.                        -->
+    <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+    <module name="NewlineAtEndOfFile">
+	<property name="severity" value="error"/>
     </module>
-    <module name="NoWhitespaceAfter">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="NoWhitespaceBefore">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="OperatorWrap"/>
-    <module name="ParenPad">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="TypecastParenPad">
-      <property name="severity" value="error"/>
+
+    <!-- Checks that property files contain the same keys.         -->
+    <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+    <module name="Translation">
+	<property name="severity" value="error"/>
     </module>
-    <module name="WhitespaceAfter">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="WhitespaceAround">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="ModifierOrder">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="RedundantModifier">
-      <property name="severity" value="error"/>
+
+    <!-- Checks for Size Violations.                    -->
+    <!-- See http://checkstyle.sf.net/config_sizes.html -->
+    <module name="FileLength"/>
+
+    <!-- Checks for whitespace                               -->
+    <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+    <!-- we want tab
+    <module name="FileTabCharacter"/>
+    -->
+
+    <!-- Miscellaneous other checks.                   -->
+    <!-- See http://checkstyle.sf.net/config_misc.html -->
+    <module name="RegexpSingleline">
+	<property name="severity" value="error"/>
+	<property name="format" value="\s+$"/>
+	<property name="minimum" value="0"/>
+	<property name="maximum" value="0"/>
+	<property name="message" value="Line has trailing spaces."/>
     </module>
-    <module name="AvoidNestedBlocks"/>
-    <module name="EmptyBlock"/>
-    <module name="LeftCurly">
-      <property name="severity" value="error"/>
+
+    <!-- This rules is desactivated because it is too stupid.
+	It also compare the Header of the file.
+    <module name="StrictDuplicateCode">
+	<property name="min" value="25" />
     </module>
-    <module name="RightCurly">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="AnnotationUseStyle">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="MissingDeprecated">
-      <property name="severity" value="error"/>
+    -->
+
+    <!-- Header file -->
+    <module name="RegexpHeader">
+	<property name="headerFile" value="${basedir}/tools/JavaHeaderCheck.regex"/>
+	<property name="multiLines" value="5, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38"/>
+	<property name="severity" value="error" />
     </module>
-    <module name="MissingOverride">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="CovariantEquals"/>
-    <module name="AvoidInlineConditionals"/>
-    <module name="InnerAssignment"/>
-    <module name="DoubleCheckedLocking"/>
-    <module name="EmptyStatement"/>
-    <module name="EqualsHashCode">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="HiddenField">
-      <property name="ignoreConstructorParameter" value="true"/>
-      <property name="ignoreSetter" value="true"/>
-      <property name="ignoreAbstractMethods" value="true"/>
-    </module>
-    <module name="IllegalInstantiation"/>
-    <module name="InnerAssignment">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="MagicNumber"/>
-    <module name="MissingSwitchDefault">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="RedundantThrows"/>
-    <module name="SimplifyBooleanExpression">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="SimplifyBooleanReturn">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="StringLiteralEquality">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="IllegalCatch"/>
-    <module name="IllegalThrows"/>
-    <module name="IllegalType"/>
-    <module name="PackageDeclaration"/>
-    <module name="JUnitTestCase"/>
-    <module name="DeclarationOrder">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="ExplicitInitialization"/>
-    <module name="DefaultComesLast"/>
-    <module name="MissingCtor"/>
-    <module name="FallThrough"/>
-    <module name="MultipleStringLiterals">
-      <property name="allowedDuplicates" value="2"/>
+
+    <module name="TreeWalker">
+
+	<!-- Checks for Javadoc comments.                     -->
+	<!-- See http://checkstyle.sf.net/config_javadoc.html -->
+	<module name="JavadocMethod">
+	    <property name="allowUndeclaredRTE" value="true"/>
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="JavadocType">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="JavadocVariable">
+	    <property name="scope" value="package" />
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="JavadocStyle">
+	    <property name="checkEmptyJavadoc" value="true"/>
+	    <property name="severity" value="error"/>
+	</module>
+
+
+	<!-- Checks for Naming Conventions.                  -->
+	<!-- See http://checkstyle.sf.net/config_naming.html -->
+	<module name="ConstantName"/>
+	<module name="LocalFinalVariableName"/>
+	<module name="LocalVariableName"/>
+	<module name="MemberName">
+	    <property  name="format" value="^m[A-Z][a-zA-Z0-9]*$"/>
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="MethodName"/>
+	<module name="PackageName"/>
+	<module name="ParameterName"/>
+	<module name="StaticVariableName"/>
+	<module name="TypeName"/>
+
+
+	<!-- Checks for Headers                                -->
+	<!-- See http://checkstyle.sf.net/config_header.html   -->
+	<!-- <module name="Header">                            -->
+	<!-- The follow property value demonstrates the ability     -->
+	<!-- to have access to ANT properties. In this case it uses -->
+	<!-- the ${basedir} property to allow Checkstyle to be run  -->
+	<!-- from any directory within a project. See property      -->
+	<!-- expansion,                                             -->
+	<!-- http://checkstyle.sf.net/config.html#properties        -->
+	<!-- <property                                              -->
+	<!--     name="headerFile"                                  -->
+	<!--     value="${basedir}/java.header"/>                   -->
+	<!-- </module> -->
+
+	<!-- Checks for imports                              -->
+	<!-- See http://checkstyle.sf.net/config_import.html -->
+	<module name="AvoidStarImport"/>
+	<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+	<module name="RedundantImport"/>
+	<module name="UnusedImports">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="AvoidStaticImport">
+	    <property name="excludes" value="*"/>
+	</module>
+
+
+	<!-- Checks for Size Violations.                    -->
+	<!-- See http://checkstyle.sf.net/config_sizes.html -->
+	<module name="LineLength">
+	    <property name="max" value="120" />
+	</module>
+	<module name="MethodLength"/>
+	<module name="ParameterNumber"/>
+	<module name="AnonInnerLength">
+	    <property name="max" value="60" />
+	</module>
+
+
+	<!-- Checks for whitespace                               -->
+	<!-- See http://checkstyle.sf.net/config_whitespace.html -->
+	<module name="EmptyForIteratorPad"/>
+	<module name="GenericWhitespace">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="MethodParamPad">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="NoWhitespaceAfter">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="NoWhitespaceBefore">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="OperatorWrap"/>
+	<module name="ParenPad">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="TypecastParenPad">
+	    <property name="severity" value="error"/>
+	</module>
+	<!-- We want mixed tabulation
+	  <module name="TabCharacter"/> 
+	  -->
+	<module name="WhitespaceAfter">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="WhitespaceAround">
+	    <property name="severity" value="error"/>
+	</module>
+
+
+	<!-- Modifier Checks                                    -->
+	<!-- See http://checkstyle.sf.net/config_modifiers.html -->
+	<module name="ModifierOrder">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="RedundantModifier">
+	    <property name="severity" value="error"/>
+	</module>
+
+
+	<!-- Checks for blocks. You know, those {}'s         -->
+	<!-- See http://checkstyle.sf.net/config_blocks.html -->
+	<module name="AvoidNestedBlocks"/>
+	<module name="EmptyBlock"/>
+	<module name="LeftCurly">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="RightCurly">
+	    <property name="severity" value="error"/>
+	</module>
+	<!--
+	  <module name="NeedBraces"/>
+	  -->
+
+	<!-- Check for annotations 
+	http://checkstyle.sourceforge.net/config_annotation.html#MissingDeprecated
+	-->
+	<module name="AnnotationUseStyle">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="MissingDeprecated">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="MissingOverride">
+	    <property name="severity" value="error"/>
+	</module>
+
+	<!-- Checks for common coding problems               -->
+	<!-- See http://checkstyle.sf.net/config_coding.html -->
+	<module name="CovariantEquals"/>
+	<module name="AvoidInlineConditionals"/>
+	<module name="InnerAssignment" />
+	<module name="DoubleCheckedLocking"/>    <!-- MY FAVOURITE -->
+	<module name="EmptyStatement"/>
+	<module name="EqualsHashCode">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="HiddenField">
+	    <property name="ignoreConstructorParameter" value="true"/>
+	    <property name="ignoreAbstractMethods" value="true"/>
+	    <property name="ignoreSetter" value="true"/>
+	</module>
+	<module name="IllegalInstantiation"/>
+	<module name="InnerAssignment">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="MagicNumber"/>
+	<module name="MissingSwitchDefault">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="RedundantThrows"/>
+	<module name="SimplifyBooleanExpression">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="SimplifyBooleanReturn">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="StringLiteralEquality">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="IllegalCatch"/>
+	<module name="IllegalThrows"/>
+	<module name="IllegalType"/>
+	<module name="PackageDeclaration"/>
+	<module name="JUnitTestCase"/>
+	<module name="DeclarationOrder">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="ExplicitInitialization"/>
+	<module name="DefaultComesLast"/>
+	<module name="MissingCtor"/>
+	<module name="FallThrough"/>
+	<module name="MultipleStringLiterals">
+	    <property name="allowedDuplicates" value="2"/>
+	</module>
+	<module name="MultipleVariableDeclarations"/>
+	<module name="UnnecessaryParentheses"/>
+	<module name="ParameterAssignment"/>
+	<module name="EqualsAvoidNull">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="NoClone"/>
+	<module name="NoFinalizer"/>
+	<module name="SuperClone"/>
+	<module name="SuperFinalize"/>
+	<module name="ModifiedControlVariable">
+	    <property name="severity" value="error"/>
+	</module>
+	<module name="ReturnCount">
+	    <property name="max" value="3"/>
+	</module>
+
+	<!-- Checks for class design                         -->
+	<!-- See http://checkstyle.sf.net/config_design.html -->
+	<!-- 
+	  <module name="DesignForExtension"/>
+	  -->
+	<module name="FinalClass"/>
+	<module name="HideUtilityClassConstructor"/>
+	<!-- 
+	<module name="InterfaceIsType"/>
+	-->
+	<module name="VisibilityModifier"/>
+	<module name="MutableException"/>
+	<module name="ThrowsCount">
+	    <property name="max" value="2" />
+	</module>
+
+
+	<!-- Miscellaneous other checks.                   -->
+	<!-- See http://checkstyle.sf.net/config_misc.html -->
+	<module name="ArrayTypeStyle"/>
+	<module name="FinalParameters">
+	    <property name="tokens" value="CTOR_DEF"/>
+	</module>
+	<module name="Indentation"/>
+
+	<module name="TodoComment"/>
+	<module name="UpperEll"/>
+
+	<module name="BooleanExpressionComplexity"/>
+	<module name="UpperEll"/>
+
+	<module name="ArrayTypeStyle"/>
+
     </module>
-    <module name="MultipleVariableDeclarations"/>
-    <module name="UnnecessaryParentheses"/>
-    <module name="ParameterAssignment"/>
-    <module name="EqualsAvoidNull">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="NoClone"/>
-    <module name="NoFinalizer"/>
-    <module name="SuperClone"/>
-    <module name="SuperFinalize"/>
-    <module name="ModifiedControlVariable">
-      <property name="severity" value="error"/>
-    </module>
-    <module name="ReturnCount">
-      <property name="max" value="3"/>
-    </module>
-    <module name="FinalClass"/>
-    <module name="HideUtilityClassConstructor"/>
-    <module name="VisibilityModifier"/>
-    <module name="MutableException"/>
-    <module name="ThrowsCount">
-      <property name="max" value="2"/>
-    </module>
-    <module name="ArrayTypeStyle"/>
-    <module name="FinalParameters">
-      <property name="tokens" value="CTOR_DEF"/>
-    </module>
-    <module name="Indentation"/>
-    <module name="TodoComment"/>
-    <module name="UpperEll"/>
-    <module name="BooleanExpressionComplexity"/>
-    <module name="UpperEll"/>
-    <module name="ArrayTypeStyle"/>
-  </module>
-  <module name="JavadocPackage">
-    <property name="allowLegacy" value="true"/>
-  </module>
-  <module name="NewlineAtEndOfFile">
-    <property name="severity" value="error"/>
-  </module>
-  <module name="Translation">
-    <property name="severity" value="error"/>
-  </module>
-  <module name="FileLength"/>
-  <module name="RegexpSingleline">
-    <property name="severity" value="error"/>
-    <property name="format" value="\s+$"/>
-    <property name="message" value="Line has trailing spaces."/>
-  </module>
-  <module name="RegexpHeader">
-    <property name="severity" value="error"/>
-    <property name="headerFile" value="${basedir}/tools/JavaHeaderCheck.regex"/>
-    <property name="multiLines" value="5, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38"/>
-  </module>
+
 </module>