jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jalka...@apache.org
Subject svn commit: r653318 [1/2] - in /incubator/jspwiki/trunk: doc/eclipse/ src/com/ecyrd/jspwiki/ src/com/ecyrd/jspwiki/attachment/ src/com/ecyrd/jspwiki/auth/acl/ src/com/ecyrd/jspwiki/auth/authorize/ src/com/ecyrd/jspwiki/auth/permissions/ src/com/ecyrd/j...
Date Mon, 05 May 2008 06:59:35 GMT
Author: jalkanen
Date: Sun May  4 23:59:35 2008
New Revision: 653318

URL: http://svn.apache.org/viewvc?rev=653318&view=rev
Log:
Removed CheckStyle warnings.

Modified:
    incubator/jspwiki/trunk/doc/eclipse/jspwiki-checkstyle.xml
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/TextUtil.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclEntryImpl.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclImpl.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/AllPermission.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/FilterManager.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/ProfanityFilter.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/i18n/InternationalizationManager.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/CurrentTimePlugin.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/AbstractFileProvider.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/RSSImageLinkTag.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/AdminBeanManager.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java
    incubator/jspwiki/trunk/tests/stress/MassiveRepositoryTest.java

Modified: incubator/jspwiki/trunk/doc/eclipse/jspwiki-checkstyle.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/doc/eclipse/jspwiki-checkstyle.xml?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/doc/eclipse/jspwiki-checkstyle.xml (original)
+++ incubator/jspwiki/trunk/doc/eclipse/jspwiki-checkstyle.xml Sun May  4 23:59:35 2008
@@ -64,9 +64,6 @@
         <module name="ParameterAssignment">
             <property name="severity" value="ignore"/>
         </module>
-        <module name="RedundantThrows">
-            <property name="allowUnchecked" value="true"/>
-        </module>
         <module name="StringLiteralEquality"/>
         <module name="SuperClone"/>
         <module name="SuperFinalize"/>

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ReferenceManager.java Sun May  4 23:59:35 2008
@@ -29,8 +29,6 @@
 import org.apache.log4j.Logger;
 
 import com.ecyrd.jspwiki.attachment.Attachment;
-import com.ecyrd.jspwiki.auth.acl.Acl;
-import com.ecyrd.jspwiki.auth.acl.AclImpl;
 import com.ecyrd.jspwiki.event.WikiEvent;
 import com.ecyrd.jspwiki.event.WikiEventListener;
 import com.ecyrd.jspwiki.event.WikiEventUtils;

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/TextUtil.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/TextUtil.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/TextUtil.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/TextUtil.java Sun May  4 23:59:35 2008
@@ -348,18 +348,21 @@
     }
     
     /**
-     *  Replaces a string with an other string. Case unsensitive matching is used
+     *  Replaces a string with an other string. Case insensitive matching is used
      *
      *  @param orig Original string.  Null is safe.
      *  @param src  The string to find.
      *  @param dest The string to replace <I>src</I> with.
+     *  @return A string with all instances of src replaced with dest.
      */
     public static String replaceStringCaseUnsensitive( String orig, String src, String dest )
     {
         if( orig == null ) return null;
 
         StringBuffer res = new StringBuffer();
-        int start, end = 0, last = 0;
+        int start        = 0;
+        int end          = 0;
+        int last         = 0;
         
         String origCaseUnsn = orig.toLowerCase();
         String srcCaseUnsn = src.toLowerCase();

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java Sun May  4 23:59:35 2008
@@ -597,7 +597,8 @@
             upload.setProgressListener( pl );
             List<FileItem> items = upload.parseRequest( req );
             
-            String wikipage = null, changeNote = null;
+            String   wikipage   = null;
+            String   changeNote = null;
             FileItem actualFile = null;
             
             for( FileItem item : items )

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclEntryImpl.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclEntryImpl.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclEntryImpl.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclEntryImpl.java Sun May  4 23:59:35 2008
@@ -24,7 +24,6 @@
 import java.security.Permission;
 import java.security.Principal;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.Vector;
 
 import com.ecyrd.jspwiki.auth.permissions.PagePermission;

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclImpl.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclImpl.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclImpl.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/AclImpl.java Sun May  4 23:59:35 2008
@@ -24,7 +24,6 @@
 import java.security.Permission;
 import java.security.Principal;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.Vector;
 
 /**

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java Sun May  4 23:59:35 2008
@@ -39,70 +39,75 @@
 import com.ecyrd.jspwiki.auth.WikiSecurityException;
 
 /**
- * <p>Implementation of GroupDatabase that persists {@link Group}
- * objects to a JDBC DataSource, as might typically be provided by a web
- * container. This implementation looks up the JDBC DataSource using JNDI.
- * The JNDI name of the datasource, backing table and mapped columns used
- * by this class are configured via settings in <code>jspwiki.properties</code>.</p>
- * <p>Configurable properties are these:</p>
+ * <p>
+ * Implementation of GroupDatabase that persists {@link Group} objects to a JDBC
+ * DataSource, as might typically be provided by a web container. This
+ * implementation looks up the JDBC DataSource using JNDI. The JNDI name of the
+ * datasource, backing table and mapped columns used by this class are
+ * configured via settings in <code>jspwiki.properties</code>.
+ * </p>
+ * <p>
+ * Configurable properties are these:
+ * </p>
  * <table>
- *   <tr>
- *   <thead>
- *     <th>Property</th>
- *     <th>Default</th>
- *     <th>Definition</th>
- *   <thead>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.groupdatabase.datasource</code></td>
- *     <td><code>jdbc/GroupDatabase</code></td>
- *     <td>The JNDI name of the DataSource</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.groupdatabase.table</code></td>
- *     <td><code>groups</code></td>
- *     <td>The table that stores the groups</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.groupdatabase.membertable</code></td>
- *     <td><code>group_members</code></td>
- *     <td>The table that stores the names of group members</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.groupdatabase.created</code></td>
- *     <td><code>created</code></td>
- *     <td>The column containing the group's creation timestamp</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.groupdatabase.creator</code></td>
- *     <td><code>creator</code></td>
- *     <td>The column containing the group creator's name</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.groupdatabase.name</code></td>
- *     <td><code>name</code></td>
- *     <td>The column containing the group's name</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.groupdatabase.member</code></td>
- *     <td><code>member</code></td>
- *     <td>The column containing the group member's name</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.groupdatabase.modified</code></td>
- *     <td><code>modified</code></td>
- *     <td>The column containing the group's last-modified timestamp</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.groupdatabase.modifier</code></td>
- *     <td><code>modifier</code></td>
- *     <td>The column containing the name of the user who last modified the group</td>
- *   </tr>
+ * <tr> <thead>
+ * <th>Property</th>
+ * <th>Default</th>
+ * <th>Definition</th>
+ * <thead> </tr>
+ * <tr>
+ * <td><code>jspwiki.groupdatabase.datasource</code></td>
+ * <td><code>jdbc/GroupDatabase</code></td>
+ * <td>The JNDI name of the DataSource</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.groupdatabase.table</code></td>
+ * <td><code>groups</code></td>
+ * <td>The table that stores the groups</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.groupdatabase.membertable</code></td>
+ * <td><code>group_members</code></td>
+ * <td>The table that stores the names of group members</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.groupdatabase.created</code></td>
+ * <td><code>created</code></td>
+ * <td>The column containing the group's creation timestamp</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.groupdatabase.creator</code></td>
+ * <td><code>creator</code></td>
+ * <td>The column containing the group creator's name</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.groupdatabase.name</code></td>
+ * <td><code>name</code></td>
+ * <td>The column containing the group's name</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.groupdatabase.member</code></td>
+ * <td><code>member</code></td>
+ * <td>The column containing the group member's name</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.groupdatabase.modified</code></td>
+ * <td><code>modified</code></td>
+ * <td>The column containing the group's last-modified timestamp</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.groupdatabase.modifier</code></td>
+ * <td><code>modifier</code></td>
+ * <td>The column containing the name of the user who last modified the group</td>
+ * </tr>
  * </table>
- * <p>This class is typically used in conjunction with a web container's JNDI resource
- * factory. For example, Tomcat versions 4 and higher provide a basic JNDI factory
- * for registering DataSources. To give JSPWiki access to the JNDI resource named
- * by <code>jdbc/GroupDatabase</code>, you would declare the datasource resource similar to this:</p>
+ * <p>
+ * This class is typically used in conjunction with a web container's JNDI
+ * resource factory. For example, Tomcat versions 4 and higher provide a basic
+ * JNDI factory for registering DataSources. To give JSPWiki access to the JNDI
+ * resource named by <code>jdbc/GroupDatabase</code>, you would declare the
+ * datasource resource similar to this:
+ * </p>
  * <blockquote><code>&lt;Context ...&gt;<br/>
  *  &nbsp;&nbsp;...<br/>
  *  &nbsp;&nbsp;&lt;Resource name="jdbc/GroupDatabase" auth="Container"<br/>
@@ -111,106 +116,150 @@
  *  &nbsp;&nbsp;&nbsp;&nbsp;maxActive="8" maxIdle="4"/&gt;<br/>
  *  &nbsp;...<br/>
  * &lt;/Context&gt;</code></blockquote>
- * <p>JDBC driver JARs should be added to Tomcat's <code>common/lib</code> directory.
- * For more Tomcat 5.5 JNDI configuration examples,
- * see <a href="http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html">
- * http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html</a>.</p>
- * <p>JDBCGroupDatabase commits changes as transactions if the back-end database supports them.
- * If the database supports transactions, group changes are saved
- * to permanent storage only when the {@link #commit()} method is called. If the database does <em>not</em>
- * support transactions, then changes are made immediately (during the {@link #save(Group, Principal)}
- * method), and the {@linkplain #commit()} method no-ops. Thus, callers should always call the
- * {@linkplain #commit()} method after saving a profile to guarantee that changes are applied.</p>
+ * <p>
+ * JDBC driver JARs should be added to Tomcat's <code>common/lib</code>
+ * directory. For more Tomcat 5.5 JNDI configuration examples, see <a
+ * href="http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html">
+ * http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html</a>.
+ * </p>
+ * <p>
+ * JDBCGroupDatabase commits changes as transactions if the back-end database
+ * supports them. If the database supports transactions, group changes are saved
+ * to permanent storage only when the {@link #commit()} method is called. If the
+ * database does <em>not</em> support transactions, then changes are made
+ * immediately (during the {@link #save(Group, Principal)} method), and the
+ * {@linkplain #commit()} method no-ops. Thus, callers should always call the
+ * {@linkplain #commit()} method after saving a profile to guarantee that
+ * changes are applied.
+ * </p>
+ * 
  * @author Andrew R. Jaquith
  * @since 2.3
  */
 public class JDBCGroupDatabase implements GroupDatabase
 {
-     /** Default column name that stores the JNDI name of the DataSource. */
-    public static final String DEFAULT_GROUPDB_DATASOURCE   = "jdbc/GroupDatabase";
+    /** Default column name that stores the JNDI name of the DataSource. */
+    public static final String DEFAULT_GROUPDB_DATASOURCE = "jdbc/GroupDatabase";
+
     /** Default table name for the table that stores groups. */
-    public static final String DEFAULT_GROUPDB_TABLE        = "groups";
+    public static final String DEFAULT_GROUPDB_TABLE = "groups";
+
     /** Default column name that stores the names of group members. */
     public static final String DEFAULT_GROUPDB_MEMBER_TABLE = "group_members";
+
     /** Default column name that stores the the group creation timestamps. */
-    public static final String DEFAULT_GROUPDB_CREATED      = "created";
+    public static final String DEFAULT_GROUPDB_CREATED = "created";
+
     /** Default column name that stores group creator names. */
-    public static final String DEFAULT_GROUPDB_CREATOR      = "creator";
+    public static final String DEFAULT_GROUPDB_CREATOR = "creator";
+
     /** Default column name that stores the group names. */
-    public static final String DEFAULT_GROUPDB_NAME         = "name";
+    public static final String DEFAULT_GROUPDB_NAME = "name";
+
     /** Default column name that stores group member names. */
-    public static final String DEFAULT_GROUPDB_MEMBER       = "member";
+    public static final String DEFAULT_GROUPDB_MEMBER = "member";
+
     /** Default column name that stores group last-modified timestamps. */
-    public static final String DEFAULT_GROUPDB_MODIFIED     = "modified";
+    public static final String DEFAULT_GROUPDB_MODIFIED = "modified";
+
     /** Default column name that stores names of users who last modified groups. */
-    public static final String DEFAULT_GROUPDB_MODIFIER     = "modifier";
+    public static final String DEFAULT_GROUPDB_MODIFIER = "modifier";
 
     /** The JNDI name of the DataSource. */
-    public static final String PROP_GROUPDB_DATASOURCE   = "jspwiki.groupdatabase.datasource";
+    public static final String PROP_GROUPDB_DATASOURCE = "jspwiki.groupdatabase.datasource";
+
     /** The table that stores the groups. */
-    public static final String PROP_GROUPDB_TABLE        = "jspwiki.groupdatabase.table";
+    public static final String PROP_GROUPDB_TABLE = "jspwiki.groupdatabase.table";
+
     /** The table that stores the names of group members. */
     public static final String PROP_GROUPDB_MEMBER_TABLE = "jspwiki.groupdatabase.membertable";
+
     /** The column containing the group's creation timestamp. */
-    public static final String PROP_GROUPDB_CREATED      = "jspwiki.groupdatabase.created";
+    public static final String PROP_GROUPDB_CREATED = "jspwiki.groupdatabase.created";
+
     /** The column containing the group creator's name. */
-    public static final String PROP_GROUPDB_CREATOR      = "jspwiki.groupdatabase.creator";
+    public static final String PROP_GROUPDB_CREATOR = "jspwiki.groupdatabase.creator";
+
     /** The column containing the group's name. */
-    public static final String PROP_GROUPDB_NAME         = "jspwiki.groupdatabase.name";
+    public static final String PROP_GROUPDB_NAME = "jspwiki.groupdatabase.name";
+
     /** The column containing the group member's name. */
-    public static final String PROP_GROUPDB_MEMBER       = "jspwiki.groupdatabase.member";
+    public static final String PROP_GROUPDB_MEMBER = "jspwiki.groupdatabase.member";
+
     /** The column containing the group's last-modified timestamp. */
-    public static final String PROP_GROUPDB_MODIFIED     = "jspwiki.groupdatabase.modified";
+    public static final String PROP_GROUPDB_MODIFIED = "jspwiki.groupdatabase.modified";
+
     /** The column containing the name of the user who last modified the group. */
-    public static final String PROP_GROUPDB_MODIFIER     = "jspwiki.groupdatabase.modifier";
+    public static final String PROP_GROUPDB_MODIFIER = "jspwiki.groupdatabase.modifier";
 
-    protected static final Logger log                     = Logger.getLogger( JDBCGroupDatabase.class );
+    protected static final Logger log = Logger.getLogger( JDBCGroupDatabase.class );
 
     private DataSource m_ds = null;
+
     private String m_table = null;
+
     private String m_memberTable = null;
+
     private String m_created = null;
+
     private String m_creator = null;
+
     private String m_name = null;
+
     private String m_member = null;
+
     private String m_modified = null;
+
     private String m_modifier = null;
+
     private String m_findAll = null;
+
     private String m_findGroup = null;
+
     private String m_findMembers = null;
+
     private String m_insertGroup = null;
+
     private String m_insertGroupMembers = null;
+
     private String m_updateGroup = null;
+
     private String m_deleteGroup = null;
+
     private String m_deleteGroupMembers = null;
+
     private boolean m_supportsCommits = false;
+
     private WikiEngine m_engine = null;
 
     /**
      * No-op method that in previous versions of JSPWiki was intended to
      * atomically commit changes to the user database. Now, the
-     * {@link #save(Group, Principal)} and {@link #delete(Group)} methods
-     * are atomic themselves.
+     * {@link #save(Group, Principal)} and {@link #delete(Group)} methods are
+     * atomic themselves.
+     * 
      * @throws WikiSecurityException never...
      * @deprecated there is no need to call this method because the save and
-     * delete methods contain their own commit logic
+     *             delete methods contain their own commit logic
      */
     public void commit() throws WikiSecurityException
-    { }
+    {
+    }
 
     /**
      * Looks up and deletes a {@link Group} from the group database. If the
      * group database does not contain the supplied Group. this method throws a
-     * {@link NoSuchPrincipalException}. The method commits the results
-     * of the delete to persistent storage.
+     * {@link NoSuchPrincipalException}. The method commits the results of the
+     * delete to persistent storage.
+     * 
      * @param group the group to remove
      * @throws WikiSecurityException if the database does not contain the
-     * supplied group (thrown as {@link NoSuchPrincipalException}) or if
-     * the commit did not succeed
+     *             supplied group (thrown as {@link NoSuchPrincipalException})
+     *             or if the commit did not succeed
      */
     public void delete( Group group ) throws WikiSecurityException
     {
-        if ( !exists( group ) )
+        if( !exists( group ) )
         {
             throw new NoSuchPrincipalException( "Not in database: " + group.getName() );
         }
@@ -221,34 +270,40 @@
         {
             // Open the database connection
             conn = m_ds.getConnection();
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.setAutoCommit( false );
             }
 
             PreparedStatement ps = conn.prepareStatement( m_deleteGroup );
-            ps.setString( 1, groupName);
+            ps.setString( 1, groupName );
             ps.execute();
             ps.close();
-            
+
             ps = conn.prepareStatement( m_deleteGroupMembers );
-            ps.setString( 1, groupName);
+            ps.setString( 1, groupName );
             ps.execute();
             ps.close();
 
             // Commit and close connection
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.commit();
             }
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             throw new WikiSecurityException( "Could not delete group " + groupName + ": " + e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
     }
 
@@ -258,8 +313,10 @@
      * method will return a zero-length array. This method causes back-end
      * storage to load the entire set of group; thus, it should be called
      * infrequently (e.g., at initialization time).
+     * 
      * @return the wiki groups
-     * @throws WikiSecurityException if the groups cannot be returned by the back-end
+     * @throws WikiSecurityException if the groups cannot be returned by the
+     *             back-end
      */
     public Group[] groups() throws WikiSecurityException
     {
@@ -275,7 +332,7 @@
             while ( rs.next() )
             {
                 String groupName = rs.getString( m_name );
-                if ( groupName == null )
+                if( groupName == null )
                 {
                     log.warn( "Detected null group name in JDBCGroupDataBase. Check your group database." );
                 }
@@ -292,16 +349,22 @@
             }
             ps.close();
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             throw new WikiSecurityException( e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
 
-        return (Group[])groups.toArray( new Group[groups.size()] );
+        return (Group[]) groups.toArray( new Group[groups.size()] );
     }
 
     /**
@@ -309,15 +372,17 @@
      * fail, and throw an <code>IllegalArgumentException</code>, if the
      * proposed group is the same name as one of the built-in Roles: e.g.,
      * Admin, Authenticated, etc. The database is responsible for setting
-     * create/modify timestamps, upon a successful save, to the Group.
-     * The method commits the results of the delete to persistent storage.
+     * create/modify timestamps, upon a successful save, to the Group. The
+     * method commits the results of the delete to persistent storage.
+     * 
      * @param group the Group to save
      * @param modifier the user who saved the Group
-     * @throws WikiSecurityException if the Group could not be saved successfully
+     * @throws WikiSecurityException if the Group could not be saved
+     *             successfully
      */
     public void save( Group group, Principal modifier ) throws WikiSecurityException
     {
-        if ( group == null || modifier == null )
+        if( group == null || modifier == null )
         {
             throw new IllegalArgumentException( "Group or modifier cannot be null." );
         }
@@ -329,7 +394,7 @@
         {
             // Open the database connection
             conn = m_ds.getConnection();
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.setAutoCommit( false );
             }
@@ -337,7 +402,7 @@
             PreparedStatement ps;
             Timestamp ts = new Timestamp( System.currentTimeMillis() );
             Date modDate = new Date( ts.getTime() );
-            if ( !exists )
+            if( !exists )
             {
                 // Group is new: insert new group record
                 ps = conn.prepareStatement( m_insertGroup );
@@ -357,7 +422,7 @@
             {
                 // Modify existing group record
                 ps = conn.prepareStatement( m_updateGroup );
-                ps.setTimestamp( 1, ts);
+                ps.setTimestamp( 1, ts );
                 ps.setString( 2, modifier.getName() );
                 ps.setString( 3, group.getName() );
                 ps.execute();
@@ -374,11 +439,11 @@
             ps.setString( 1, group.getName() );
             ps.execute();
             ps.close();
-            
+
             // Insert group member records
             ps = conn.prepareStatement( m_insertGroupMembers );
             Principal[] members = group.members();
-            for ( int i = 0; i < members.length; i++ )
+            for( int i = 0; i < members.length; i++ )
             {
                 Principal member = members[i];
                 ps.setString( 1, group.getName() );
@@ -388,26 +453,34 @@
             ps.close();
 
             // Commit and close connection
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.commit();
             }
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             throw new WikiSecurityException( e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
     }
 
     /**
      * Initializes the group database based on values from a Properties object.
+     * 
      * @param engine the wiki engine
      * @param props the properties used to initialize the group database
-     * @throws WikiSecurityException if the database could not be initialized successfully
+     * @throws WikiSecurityException if the database could not be initialized
+     *             successfully
      * @throws NoRequiredPropertyException if a required property is not present
      */
     public void initialize( WikiEngine engine, Properties props ) throws NoRequiredPropertyException, WikiSecurityException
@@ -418,40 +491,30 @@
         try
         {
             Context initCtx = new InitialContext();
-            Context ctx = (Context) initCtx.lookup("java:comp/env");
+            Context ctx = (Context) initCtx.lookup( "java:comp/env" );
             m_ds = (DataSource) ctx.lookup( jndiName );
 
             // Prepare the SQL selectors
-            m_table       = props.getProperty( PROP_GROUPDB_TABLE, DEFAULT_GROUPDB_TABLE );
+            m_table = props.getProperty( PROP_GROUPDB_TABLE, DEFAULT_GROUPDB_TABLE );
             m_memberTable = props.getProperty( PROP_GROUPDB_MEMBER_TABLE, DEFAULT_GROUPDB_MEMBER_TABLE );
-            m_name        = props.getProperty( PROP_GROUPDB_NAME, DEFAULT_GROUPDB_NAME );
-            m_created     = props.getProperty( PROP_GROUPDB_CREATED, DEFAULT_GROUPDB_CREATED );
-            m_creator     = props.getProperty( PROP_GROUPDB_CREATOR, DEFAULT_GROUPDB_CREATOR );
-            m_modifier    = props.getProperty( PROP_GROUPDB_MODIFIER, DEFAULT_GROUPDB_MODIFIER );
-            m_modified    = props.getProperty( PROP_GROUPDB_MODIFIED, DEFAULT_GROUPDB_MODIFIED );
-            m_member      = props.getProperty( PROP_GROUPDB_MEMBER, DEFAULT_GROUPDB_MEMBER );
+            m_name = props.getProperty( PROP_GROUPDB_NAME, DEFAULT_GROUPDB_NAME );
+            m_created = props.getProperty( PROP_GROUPDB_CREATED, DEFAULT_GROUPDB_CREATED );
+            m_creator = props.getProperty( PROP_GROUPDB_CREATOR, DEFAULT_GROUPDB_CREATOR );
+            m_modifier = props.getProperty( PROP_GROUPDB_MODIFIER, DEFAULT_GROUPDB_MODIFIER );
+            m_modified = props.getProperty( PROP_GROUPDB_MODIFIED, DEFAULT_GROUPDB_MODIFIED );
+            m_member = props.getProperty( PROP_GROUPDB_MEMBER, DEFAULT_GROUPDB_MEMBER );
 
-            m_findAll     = "SELECT DISTINCT * FROM " + m_table;
-            m_findGroup   = "SELECT DISTINCT * FROM " + m_table + " WHERE " + m_name + "=?";
+            m_findAll = "SELECT DISTINCT * FROM " + m_table;
+            m_findGroup = "SELECT DISTINCT * FROM " + m_table + " WHERE " + m_name + "=?";
             m_findMembers = "SELECT * FROM " + m_memberTable + " WHERE " + m_name + "=?";
 
             // Prepare the group insert/update SQL
-            m_insertGroup = "INSERT INTO " + m_table + " ("
-                              + m_name + ","
-                              + m_modified + ","
-                              + m_modifier + ","
-                              + m_created + ","
-                              + m_creator
-                              + ") VALUES (?,?,?,?,?)";
-            m_updateGroup = "UPDATE " + m_table + " SET "
-                              + m_modified + "=?,"
-                              + m_modifier + "=? WHERE " + m_name + "=?";
+            m_insertGroup = "INSERT INTO " + m_table + " (" + m_name + "," + m_modified + "," + m_modifier + "," + m_created + ","
+                            + m_creator + ") VALUES (?,?,?,?,?)";
+            m_updateGroup = "UPDATE " + m_table + " SET " + m_modified + "=?," + m_modifier + "=? WHERE " + m_name + "=?";
 
             // Prepare the group member insert SQL
-            m_insertGroupMembers = "INSERT INTO " + m_memberTable + " ("
-                              + m_name + ","
-                              + m_member
-                              + ") VALUES (?,?)";
+            m_insertGroupMembers = "INSERT INTO " + m_memberTable + " (" + m_name + "," + m_member + ") VALUES (?,?)";
 
             // Prepare the group delete SQL
             m_deleteGroup = "DELETE FROM " + m_table + " WHERE " + m_name + "=?";
@@ -460,7 +523,8 @@
         catch( NamingException e )
         {
             log.error( "JDBCGroupDatabase initialization error: " + e.getMessage() );
-            throw new NoRequiredPropertyException( PROP_GROUPDB_DATASOURCE, "JDBCGroupDatabase initialization error: " + e.getMessage() );
+            throw new NoRequiredPropertyException( PROP_GROUPDB_DATASOURCE, "JDBCGroupDatabase initialization error: "
+                                                                            + e.getMessage() );
         }
 
         // Test connection by doing a quickie select
@@ -472,14 +536,21 @@
             ps.executeQuery();
             ps.close();
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             log.error( "JDBCGroupDatabase initialization error: " + e.getMessage() );
-            throw new NoRequiredPropertyException( PROP_GROUPDB_DATASOURCE, "JDBCGroupDatabase initialization error: " + e.getMessage() );
+            throw new NoRequiredPropertyException( PROP_GROUPDB_DATASOURCE, "JDBCGroupDatabase initialization error: "
+                                                                            + e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
         log.info( "JDBCGroupDatabase initialized from JNDI DataSource: " + jndiName );
 
@@ -488,26 +559,34 @@
         {
             conn = m_ds.getConnection();
             DatabaseMetaData dmd = conn.getMetaData();
-            if ( dmd.supportsTransactions() )
+            if( dmd.supportsTransactions() )
             {
                 m_supportsCommits = true;
                 conn.setAutoCommit( false );
-                log.info("JDBCGroupDatabase supports transactions. Good; we will use them." );
+                log.info( "JDBCGroupDatabase supports transactions. Good; we will use them." );
             }
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
-            log.warn("JDBCGroupDatabase warning: user database doesn't seem to support transactions. Reason: " + e.getMessage() );
-            throw new NoRequiredPropertyException( PROP_GROUPDB_DATASOURCE, "JDBCGroupDatabase initialization error: " + e.getMessage() );
+            log.warn( "JDBCGroupDatabase warning: user database doesn't seem to support transactions. Reason: " + e.getMessage() );
+            throw new NoRequiredPropertyException( PROP_GROUPDB_DATASOURCE, "JDBCGroupDatabase initialization error: "
+                                                                            + e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
     }
 
     /**
      * Returns <code>true</code> if the Group exists in back-end storage.
+     * 
      * @param group the Group to look for
      * @return the result of the search
      */
@@ -519,14 +598,16 @@
             findGroup( index );
             return true;
         }
-        catch ( NoSuchPrincipalException e )
+        catch( NoSuchPrincipalException e )
         {
             return false;
         }
     }
 
     /**
-     * Loads and returns a Group from the back-end database matching a supplied name.
+     * Loads and returns a Group from the back-end database matching a supplied
+     * name.
+     * 
      * @param index the name of the Group to find
      * @return the populated Group
      * @throws NoSuchPrincipalException if the Group cannot be found
@@ -548,7 +629,7 @@
             ResultSet rs = ps.executeQuery();
             while ( rs.next() )
             {
-                if ( group != null )
+                if( group != null )
                 {
                     unique = false;
                     break;
@@ -563,28 +644,35 @@
             }
             ps.close();
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             throw new NoSuchPrincipalException( e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
 
-        if ( !found )
+        if( !found )
         {
-            throw new NoSuchPrincipalException("Could not find group in database!");
+            throw new NoSuchPrincipalException( "Could not find group in database!" );
         }
-        if ( !unique )
+        if( !unique )
         {
-            throw new NoSuchPrincipalException("More than one group in database!");
+            throw new NoSuchPrincipalException( "More than one group in database!" );
         }
         return group;
     }
 
     /**
      * Fills a Group with members.
+     * 
      * @param group the group to populate
      * @return the populated Group
      */
@@ -602,7 +690,7 @@
             while ( rs.next() )
             {
                 String memberName = rs.getString( m_member );
-                if ( memberName != null )
+                if( memberName != null )
                 {
                     WikiPrincipal principal = new WikiPrincipal( memberName, WikiPrincipal.UNSPECIFIED );
                     group.add( principal );
@@ -610,13 +698,19 @@
             }
             ps.close();
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             // I guess that means there aren't any principals...
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
         return group;
     }

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/AllPermission.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/AllPermission.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/AllPermission.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/permissions/AllPermission.java Sun May  4 23:59:35 2008
@@ -60,6 +60,9 @@
     /**
      * Two AllPermission objects are considered equal if their wikis are equal.
      * @see java.lang.Object#equals(java.lang.Object)
+     * 
+     * @return {@inheritDoc}
+     * @param obj {@inheritDoc}
      */
     public final boolean equals( Object obj )
     {
@@ -74,6 +77,8 @@
     /**
      * No-op; always returns <code>null</code>
      * @see java.security.Permission#getActions()
+     *
+     * @return Always null.
      */
     public final String getActions()
     {
@@ -83,7 +88,7 @@
     /**
      * Returns the name of the wiki containing the page represented by this
      * permission; may return the wildcard string.
-     * @return the wiki
+     * @return The wiki
      */
     public final String getWiki()
     {
@@ -93,6 +98,8 @@
     /**
      * Returns the hash code for this WikiPermission.
      * @see java.lang.Object#hashCode()
+     * 
+     * @return {@inheritDoc}
      */
     public final int hashCode()
     {
@@ -142,6 +149,8 @@
     /**
      * Returns a new {@link AllPermissionCollection}.
      * @see java.security.Permission#newPermissionCollection()
+     * 
+     * @return {@inheritDoc}
      */
     public PermissionCollection newPermissionCollection()
     {
@@ -151,12 +160,19 @@
     /**
      * Prints a human-readable representation of this permission.
      * @see java.lang.Object#toString()
+     * @return {@inheritDoc}
      */
     public final String toString()
     {
         return "(\"" + this.getClass().getName() + "\",\"" + m_wiki + "\")";
     }
 
+    /**
+     *  Checks if the given permission is one of ours.
+     *  
+     *  @param permission Permission to check
+     *  @return true, if the permission is a JSPWiki permission; false otherwise.
+     */
     protected static final boolean isJSPWikiPermission( Permission permission )
     {
         return   permission instanceof WikiPermission ||

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java Sun May  4 23:59:35 2008
@@ -40,96 +40,103 @@
 import com.ecyrd.jspwiki.auth.WikiSecurityException;
 
 /**
- * <p>Implementation of UserDatabase that persists {@link DefaultUserProfile}
+ * <p>
+ * Implementation of UserDatabase that persists {@link DefaultUserProfile}
  * objects to a JDBC DataSource, as might typically be provided by a web
- * container. This implementation looks up the JDBC DataSource using JNDI.
- * The JNDI name of the datasource, backing table and mapped columns used
- * by this class are configured via settings in <code>jspwiki.properties</code>.</p>
- * <p>Configurable properties are these:</p>
+ * container. This implementation looks up the JDBC DataSource using JNDI. The
+ * JNDI name of the datasource, backing table and mapped columns used by this
+ * class are configured via settings in <code>jspwiki.properties</code>.
+ * </p>
+ * <p>
+ * Configurable properties are these:
+ * </p>
  * <table>
- *   <tr>
- *   <thead>
- *     <th>Property</th>
- *     <th>Default</th>
- *     <th>Definition</th>
- *   <thead>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.datasource</code></td>
- *     <td><code>jdbc/UserDatabase</code></td>
- *     <td>The JNDI name of the DataSource</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.table</code></td>
- *     <td><code>users</code></td>
- *     <td>The table that stores the user profiles</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.created</code></td>
- *     <td><code>created</code></td>
- *     <td>The column containing the profile's creation timestamp</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.email</code></td>
- *     <td><code>email</code></td>
- *     <td>The column containing the user's e-mail address</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.fullName</code></td>
- *     <td><code>full_name</code></td>
- *     <td>The column containing the user's full name</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.loginName</code></td>
- *     <td><code>login_name</code></td>
- *     <td>The column containing the user's login id</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.password</code></td>
- *     <td><code>password</code></td>
- *     <td>The column containing the user's password</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.modified</code></td>
- *     <td><code>modified</code></td>
- *     <td>The column containing the profile's last-modified timestamp</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.wikiName</code></td>
- *     <td><code>wiki_name</code></td>
- *     <td>The column containing the user's wiki name</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.roleTable</code></td>
- *     <td><code>roles</code></td>
- *     <td>The table that stores user roles. When a new user is created,
- *       a new record is inserted containing user's initial role. The
- *       table will have an ID column whose name and values correspond
- *       to the contents of the user table's login name column. It will
- *       also contain a role column (see next row).</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.role</code></td>
- *     <td><code>role</code></td>
- *     <td>The column in the role table that stores user roles. When a new user
- *       is created, this column will be populated with the value
- *       <code>Authenticated</code>. Once created, JDBCUserDatabase does not
- *       use this column again; it is provided strictly for the convenience
- *       of container-managed authentication services.</td>
- *   </tr>
- *   <tr>
- *     <td><code>jspwiki.userdatabase.hashPrefix</code></td>
- *     <td><code>true</code></td>
- *     <td>Whether or not to prepend a prefix for the hash algorithm, <em>e.g.</em>,
- *         <code>{SHA}</code>.</td>
- *   </tr>
+ * <tr> <thead>
+ * <th>Property</th>
+ * <th>Default</th>
+ * <th>Definition</th>
+ * <thead> </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.datasource</code></td>
+ * <td><code>jdbc/UserDatabase</code></td>
+ * <td>The JNDI name of the DataSource</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.table</code></td>
+ * <td><code>users</code></td>
+ * <td>The table that stores the user profiles</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.created</code></td>
+ * <td><code>created</code></td>
+ * <td>The column containing the profile's creation timestamp</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.email</code></td>
+ * <td><code>email</code></td>
+ * <td>The column containing the user's e-mail address</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.fullName</code></td>
+ * <td><code>full_name</code></td>
+ * <td>The column containing the user's full name</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.loginName</code></td>
+ * <td><code>login_name</code></td>
+ * <td>The column containing the user's login id</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.password</code></td>
+ * <td><code>password</code></td>
+ * <td>The column containing the user's password</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.modified</code></td>
+ * <td><code>modified</code></td>
+ * <td>The column containing the profile's last-modified timestamp</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.wikiName</code></td>
+ * <td><code>wiki_name</code></td>
+ * <td>The column containing the user's wiki name</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.roleTable</code></td>
+ * <td><code>roles</code></td>
+ * <td>The table that stores user roles. When a new user is created, a new
+ * record is inserted containing user's initial role. The table will have an ID
+ * column whose name and values correspond to the contents of the user table's
+ * login name column. It will also contain a role column (see next row).</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.role</code></td>
+ * <td><code>role</code></td>
+ * <td>The column in the role table that stores user roles. When a new user is
+ * created, this column will be populated with the value
+ * <code>Authenticated</code>. Once created, JDBCUserDatabase does not use
+ * this column again; it is provided strictly for the convenience of
+ * container-managed authentication services.</td>
+ * </tr>
+ * <tr>
+ * <td><code>jspwiki.userdatabase.hashPrefix</code></td>
+ * <td><code>true</code></td>
+ * <td>Whether or not to prepend a prefix for the hash algorithm, <em>e.g.</em>,
+ * <code>{SHA}</code>.</td>
+ * </tr>
  * </table>
- * <p>This class hashes passwords using SHA-1. All of the underying SQL commands used by this class are implemented using
- * prepared statements, so it is immune to SQL injection attacks.</p>
- * <p>This class is typically used in conjunction with a web container's JNDI resource
- * factory. For example, Tomcat versions 4 and higher provide a basic JNDI factory
- * for registering DataSources. To give JSPWiki access to the JNDI resource named
- * by <code></code>, you would declare the datasource resource similar to this:</p>
+ * <p>
+ * This class hashes passwords using SHA-1. All of the underying SQL commands
+ * used by this class are implemented using prepared statements, so it is immune
+ * to SQL injection attacks.
+ * </p>
+ * <p>
+ * This class is typically used in conjunction with a web container's JNDI
+ * resource factory. For example, Tomcat versions 4 and higher provide a basic
+ * JNDI factory for registering DataSources. To give JSPWiki access to the JNDI
+ * resource named by <code></code>, you would declare the datasource resource
+ * similar to this:
+ * </p>
  * <blockquote><code>&lt;Context ...&gt;<br/>
  *  &nbsp;&nbsp;...<br/>
  *  &nbsp;&nbsp;&lt;Resource name="jdbc/UserDatabase" auth="Container"<br/>
@@ -138,98 +145,133 @@
  *  &nbsp;&nbsp;&nbsp;&nbsp;maxActive="8" maxIdle="4"/&gt;<br/>
  *  &nbsp;...<br/>
  * &lt;/Context&gt;</code></blockquote>
- * <p>JDBC driver JARs should be added to Tomcat's <code>common/lib</code> directory.
- * For more Tomcat 5.5 JNDI configuration examples,
- * see <a href="http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html">
- * http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html</a>.</p>
- * <p>JDBCUserDatabase commits changes as transactions if the back-end database supports them.
- * If the database supports transactions, user profile changes are saved
- * to permanent storage only when the {@link #commit()} method is called. If the database does <em>not</em>
- * support transactions, then changes are made immediately (during the {@link #save(UserProfile)}
- * method), and the {@linkplain #commit()} method no-ops. Thus, callers should always call the
- * {@linkplain #commit()} method after saving a profile to guarantee that changes are applied.</p>
+ * <p>
+ * JDBC driver JARs should be added to Tomcat's <code>common/lib</code>
+ * directory. For more Tomcat 5.5 JNDI configuration examples, see <a
+ * href="http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html">
+ * http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html</a>.
+ * </p>
+ * <p>
+ * JDBCUserDatabase commits changes as transactions if the back-end database
+ * supports them. If the database supports transactions, user profile changes
+ * are saved to permanent storage only when the {@link #commit()} method is
+ * called. If the database does <em>not</em> support transactions, then
+ * changes are made immediately (during the {@link #save(UserProfile)} method),
+ * and the {@linkplain #commit()} method no-ops. Thus, callers should always
+ * call the {@linkplain #commit()} method after saving a profile to guarantee
+ * that changes are applied.
+ * </p>
+ * 
  * @author Andrew R. Jaquith
  * @since 2.3
- */public class JDBCUserDatabase extends AbstractUserDatabase
+ */
+public class JDBCUserDatabase extends AbstractUserDatabase
 {
 
     private static final String NOTHING = "";
 
-    public static final String DEFAULT_DB_CREATED    = "created";
+    public static final String DEFAULT_DB_CREATED = "created";
 
-    public static final String DEFAULT_DB_EMAIL      = "email";
+    public static final String DEFAULT_DB_EMAIL = "email";
 
-    public static final String DEFAULT_DB_FULL_NAME  = "full_name";
+    public static final String DEFAULT_DB_FULL_NAME = "full_name";
 
     public static final String DEFAULT_DB_HASH_PREFIX = "true";
 
-    public static final String DEFAULT_DB_JNDI_NAME  = "jdbc/UserDatabase";
+    public static final String DEFAULT_DB_JNDI_NAME = "jdbc/UserDatabase";
 
-    public static final String DEFAULT_DB_MODIFIED   = "modified";
+    public static final String DEFAULT_DB_MODIFIED = "modified";
 
-    public static final String DEFAULT_DB_ROLE       = "role";
+    public static final String DEFAULT_DB_ROLE = "role";
 
     public static final String DEFAULT_DB_ROLE_TABLE = "roles";
 
-    public static final String DEFAULT_DB_TABLE      = "users";
+    public static final String DEFAULT_DB_TABLE = "users";
 
     public static final String DEFAULT_DB_LOGIN_NAME = "login_name";
 
-    public static final String DEFAULT_DB_PASSWORD   = "password";
+    public static final String DEFAULT_DB_PASSWORD = "password";
 
-    public static final String DEFAULT_DB_WIKI_NAME  = "wiki_name";
+    public static final String DEFAULT_DB_WIKI_NAME = "wiki_name";
 
-    public static final String PROP_DB_CREATED       = "jspwiki.userdatabase.created";
+    public static final String PROP_DB_CREATED = "jspwiki.userdatabase.created";
 
-    public static final String PROP_DB_EMAIL         = "jspwiki.userdatabase.email";
+    public static final String PROP_DB_EMAIL = "jspwiki.userdatabase.email";
 
-    public static final String PROP_DB_FULL_NAME     = "jspwiki.userdatabase.fullName";
+    public static final String PROP_DB_FULL_NAME = "jspwiki.userdatabase.fullName";
 
-    public static final String PROP_DB_DATASOURCE    = "jspwiki.userdatabase.datasource";
+    public static final String PROP_DB_DATASOURCE = "jspwiki.userdatabase.datasource";
 
-    public static final String PROP_DB_HASH_PREFIX   = "jspwiki.userdatabase.hashPrefix";
+    public static final String PROP_DB_HASH_PREFIX = "jspwiki.userdatabase.hashPrefix";
 
-    public static final String PROP_DB_LOGIN_NAME    = "jspwiki.userdatabase.loginName";
+    public static final String PROP_DB_LOGIN_NAME = "jspwiki.userdatabase.loginName";
 
-    public static final String PROP_DB_MODIFIED      = "jspwiki.userdatabase.modified";
+    public static final String PROP_DB_MODIFIED = "jspwiki.userdatabase.modified";
 
-    public static final String PROP_DB_PASSWORD      = "jspwiki.userdatabase.password";
+    public static final String PROP_DB_PASSWORD = "jspwiki.userdatabase.password";
 
-    public static final String PROP_DB_ROLE          = "jspwiki.userdatabase.role";
+    public static final String PROP_DB_ROLE = "jspwiki.userdatabase.role";
 
-    public static final String PROP_DB_ROLE_TABLE    = "jspwiki.userdatabase.roleTable";
+    public static final String PROP_DB_ROLE_TABLE = "jspwiki.userdatabase.roleTable";
 
-    public static final String PROP_DB_TABLE         = "jspwiki.userdatabase.table";
+    public static final String PROP_DB_TABLE = "jspwiki.userdatabase.table";
 
-    public static final String PROP_DB_WIKI_NAME     = "jspwiki.userdatabase.wikiName";
+    public static final String PROP_DB_WIKI_NAME = "jspwiki.userdatabase.wikiName";
+
+    private DataSource m_ds = null;
 
-    private DataSource         m_ds                  = null;
     private String m_deleteUserByLoginName = null;
+
     private String m_deleteRoleByLoginName = null;
+
     private String m_findByEmail = null;
+
     private String m_findByFullName = null;
+
     private String m_findByLoginName = null;
+
     private String m_findByWikiName = null;
+
     private String m_renameProfile = null;
+
     private String m_renameRoles = null;
+
     private String m_updateProfile = null;
+
     private String m_findAll = null;
+
     private String m_findRoles = null;
+
     private String m_initialRole = "Authenticated";
+
     private String m_insertProfile = null;
+
     private String m_insertRole = null;
+
     private String m_userTable = null;
+
     private String m_email = null;
+
     private String m_fullName = null;
+
     private boolean m_hashPrefix = true;
+
     private String m_loginName = null;
+
     private String m_password = null;
+
     private String m_role = null;
+
     private String m_roleTable = null;
+
     private String m_wikiName = null;
+
     private String m_created = null;
+
     private String m_modified = null;
+
     private boolean m_sharedWithContainer = false;
+
     private boolean m_supportsCommits = false;
 
     /**
@@ -238,8 +280,9 @@
      * does not contain a user with a matching attribute, throws a
      * {@link NoSuchPrincipalException}. This method is intended to be atomic;
      * results cannot be partially committed. If the commit fails, it should
-     * roll back its state appropriately. Implementing classes that persist
-     * to the file system may wish to make this method <code>synchronized</code>.
+     * roll back its state appropriately. Implementing classes that persist to
+     * the file system may wish to make this method <code>synchronized</code>.
+     * 
      * @param loginName the login name of the user profile that shall be deleted
      */
     public void deleteByLoginName( String loginName ) throws NoSuchPrincipalException, WikiSecurityException
@@ -247,12 +290,12 @@
         // Get the existing user; if not found, throws NoSuchPrincipalException
         findByLoginName( loginName );
         Connection conn = null;
-        
+
         try
         {
             // Open the database connection
             conn = m_ds.getConnection();
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.setAutoCommit( false );
             }
@@ -260,29 +303,35 @@
             PreparedStatement ps;
             // Delete user record
             ps = conn.prepareStatement( m_deleteUserByLoginName );
-            ps.setString(1, loginName );
+            ps.setString( 1, loginName );
             ps.execute();
             ps.close();
 
             // Delete role record
             ps = conn.prepareStatement( m_deleteRoleByLoginName );
-            ps.setString(1, loginName );
+            ps.setString( 1, loginName );
             ps.execute();
             ps.close();
 
             // Commit and close connection
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.commit();
             }
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             throw new WikiSecurityException( e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
     }
 
@@ -319,10 +368,10 @@
     }
 
     /**
-     * Returns all WikiNames that are stored in the UserDatabase
-     * as an array of WikiPrincipal objects. If the database does not
-     * contain any profiles, this method will return a zero-length
-     * array.
+     * Returns all WikiNames that are stored in the UserDatabase as an array of
+     * WikiPrincipal objects. If the database does not contain any profiles,
+     * this method will return a zero-length array.
+     * 
      * @return the WikiNames
      */
     public Principal[] getWikiNames() throws WikiSecurityException
@@ -337,7 +386,7 @@
             while ( rs.next() )
             {
                 String wikiName = rs.getString( m_wikiName );
-                if ( wikiName == null )
+                if( wikiName == null )
                 {
                     log.warn( "Detected null wiki name in XMLUserDataBase. Check your user database." );
                 }
@@ -349,21 +398,27 @@
             }
             ps.close();
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             throw new WikiSecurityException( e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
 
-        return (Principal[])principals.toArray( new Principal[principals.size()] );
+        return (Principal[]) principals.toArray( new Principal[principals.size()] );
     }
 
     /**
      * @see com.ecyrd.jspwiki.auth.user.UserDatabase#initialize(com.ecyrd.jspwiki.WikiEngine,
-     * java.util.Properties)
+     *      java.util.Properties)
      */
     public void initialize( WikiEngine engine, Properties props ) throws NoRequiredPropertyException
     {
@@ -371,51 +426,37 @@
         try
         {
             Context initCtx = new InitialContext();
-            Context ctx = (Context) initCtx.lookup("java:comp/env");
+            Context ctx = (Context) initCtx.lookup( "java:comp/env" );
             m_ds = (DataSource) ctx.lookup( jndiName );
 
             // Prepare the SQL selectors
             m_userTable = props.getProperty( PROP_DB_TABLE, DEFAULT_DB_TABLE );
-            m_email     = props.getProperty( PROP_DB_EMAIL, DEFAULT_DB_EMAIL );
-            m_fullName  = props.getProperty( PROP_DB_FULL_NAME, DEFAULT_DB_FULL_NAME );
+            m_email = props.getProperty( PROP_DB_EMAIL, DEFAULT_DB_EMAIL );
+            m_fullName = props.getProperty( PROP_DB_FULL_NAME, DEFAULT_DB_FULL_NAME );
             m_hashPrefix = Boolean.valueOf( props.getProperty( PROP_DB_HASH_PREFIX, DEFAULT_DB_HASH_PREFIX ) ).booleanValue();
             m_loginName = props.getProperty( PROP_DB_LOGIN_NAME, DEFAULT_DB_LOGIN_NAME );
-            m_password  = props.getProperty( PROP_DB_PASSWORD, DEFAULT_DB_PASSWORD );
-            m_wikiName  = props.getProperty( PROP_DB_WIKI_NAME, DEFAULT_DB_WIKI_NAME );
-            m_created   = props.getProperty( PROP_DB_CREATED, DEFAULT_DB_CREATED );
-            m_modified  = props.getProperty( PROP_DB_MODIFIED, DEFAULT_DB_MODIFIED );
-
-            m_findAll         = "SELECT * FROM " + m_userTable;
-            m_findByEmail     = "SELECT * FROM " + m_userTable + " WHERE " + m_email + "=?";
-            m_findByFullName  = "SELECT * FROM " + m_userTable + " WHERE " + m_fullName + "=?";
+            m_password = props.getProperty( PROP_DB_PASSWORD, DEFAULT_DB_PASSWORD );
+            m_wikiName = props.getProperty( PROP_DB_WIKI_NAME, DEFAULT_DB_WIKI_NAME );
+            m_created = props.getProperty( PROP_DB_CREATED, DEFAULT_DB_CREATED );
+            m_modified = props.getProperty( PROP_DB_MODIFIED, DEFAULT_DB_MODIFIED );
+
+            m_findAll = "SELECT * FROM " + m_userTable;
+            m_findByEmail = "SELECT * FROM " + m_userTable + " WHERE " + m_email + "=?";
+            m_findByFullName = "SELECT * FROM " + m_userTable + " WHERE " + m_fullName + "=?";
             m_findByLoginName = "SELECT * FROM " + m_userTable + " WHERE " + m_loginName + "=?";
-            m_findByWikiName  = "SELECT * FROM " + m_userTable + " WHERE " + m_wikiName + "=?";
+            m_findByWikiName = "SELECT * FROM " + m_userTable + " WHERE " + m_wikiName + "=?";
 
             // Prepare the user isert/update SQL
-            m_insertProfile   = "INSERT INTO " + m_userTable + " ("
-                              + m_email + ","
-                              + m_fullName + ","
-                              + m_password + ","
-                              + m_wikiName + ","
-                              + m_modified + ","
-                              + m_loginName + ","
-                              + m_created
-                              + ") VALUES (?,?,?,?,?,?,?)";
-            m_updateProfile   = "UPDATE " + m_userTable + " SET "
-                              + m_email + "=?,"
-                              + m_fullName + "=?,"
-                              + m_password + "=?,"
-                              + m_wikiName + "=?,"
-                              + m_modified + "=? WHERE " + m_loginName + "=?";
+            m_insertProfile = "INSERT INTO " + m_userTable + " (" + m_email + "," + m_fullName + "," + m_password + ","
+                              + m_wikiName + "," + m_modified + "," + m_loginName + "," + m_created + ") VALUES (?,?,?,?,?,?,?)";
+            m_updateProfile = "UPDATE " + m_userTable + " SET " + m_email + "=?," + m_fullName + "=?," + m_password + "=?,"
+                              + m_wikiName + "=?," + m_modified + "=? WHERE " + m_loginName + "=?";
 
             // Prepare the role insert SQL
             m_roleTable = props.getProperty( PROP_DB_ROLE_TABLE, DEFAULT_DB_ROLE_TABLE );
             m_role = props.getProperty( PROP_DB_ROLE, DEFAULT_DB_ROLE );
-            m_insertRole      = "INSERT INTO " + m_roleTable + " ("
-                              + m_loginName + ","
-                              + m_role
-                              + ") VALUES (?,?)";
-            m_findRoles       = "SELECT * FROM " + m_roleTable + " WHERE " + m_loginName + "=?";
+            m_insertRole = "INSERT INTO " + m_roleTable + " (" + m_loginName + "," + m_role + ") VALUES (?,?)";
+            m_findRoles = "SELECT * FROM " + m_roleTable + " WHERE " + m_loginName + "=?";
 
             // Prepare the user delete SQL
             m_deleteUserByLoginName = "DELETE FROM " + m_userTable + " WHERE " + m_loginName + "=?";
@@ -424,11 +465,9 @@
             m_deleteRoleByLoginName = "DELETE FROM " + m_roleTable + " WHERE " + m_loginName + "=?";
 
             // Prepare the rename user/roles SQL
-            m_renameProfile   = "UPDATE " + m_userTable + " SET "
-                              + m_loginName + "=?,"
-                              + m_modified  + "=? WHERE " + m_loginName + "=?";
-            m_renameRoles     = "UPDATE " + m_roleTable + " SET "
-                              + m_loginName + "=? WHERE " + m_loginName + "=?";
+            m_renameProfile = "UPDATE " + m_userTable + " SET " + m_loginName + "=?," + m_modified + "=? WHERE " + m_loginName
+                              + "=?";
+            m_renameRoles = "UPDATE " + m_roleTable + " SET " + m_loginName + "=? WHERE " + m_loginName + "=?";
 
             // Set the "share users with container flag"
             m_sharedWithContainer = TextUtil.isPositive( props.getProperty( PROP_SHARED_WITH_CONTAINER, "false" ) );
@@ -448,14 +487,20 @@
             ps.executeQuery();
             ps.close();
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             log.error( "JDBCUserDatabase initialization error: " + e.getMessage() );
             throw new NoRequiredPropertyException( PROP_DB_DATASOURCE, "JDBCUserDatabase initialization error: " + e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
         log.info( "JDBCUserDatabase initialized from JNDI DataSource: " + jndiName );
 
@@ -464,28 +509,36 @@
         {
             conn = m_ds.getConnection();
             DatabaseMetaData dmd = conn.getMetaData();
-            if ( dmd.supportsTransactions() )
+            if( dmd.supportsTransactions() )
             {
                 m_supportsCommits = true;
                 conn.setAutoCommit( false );
-                log.info("JDBCUserDatabase supports transactions. Good; we will use them." );
+                log.info( "JDBCUserDatabase supports transactions. Good; we will use them." );
             }
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
-            log.warn("JDBCUserDatabase warning: user database doesn't seem to support transactions. Reason: " + e.getMessage() );
+            log.warn( "JDBCUserDatabase warning: user database doesn't seem to support transactions. Reason: " + e.getMessage() );
             throw new NoRequiredPropertyException( PROP_DB_DATASOURCE, "JDBCUserDatabase initialization error: " + e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
     }
 
     /**
      * Determines whether the user database shares user/password data with the
      * web container; returns <code>true</code> if the JSPWiki property
-     * <code>jspwiki.userdatabase.isSharedWithContainer</code> is <code>true</code>.
+     * <code>jspwiki.userdatabase.isSharedWithContainer</code> is
+     * <code>true</code>.
+     * 
      * @see com.ecyrd.jspwiki.auth.user.UserDatabase#isSharedWithContainer()
      */
     public boolean isSharedWithContainer()
@@ -496,8 +549,10 @@
     /**
      * @see com.ecyrd.jspwiki.auth.user.UserDatabase#rename(String, String)
      */
-    public void rename(String loginName, String newName)
-        throws NoSuchPrincipalException, DuplicateUserException, WikiSecurityException
+    public void rename( String loginName, String newName )
+                                                          throws NoSuchPrincipalException,
+                                                              DuplicateUserException,
+                                                              WikiSecurityException
     {
         // Get the existing user; if not found, throws NoSuchPrincipalException
         UserProfile profile = findByLoginName( loginName );
@@ -506,12 +561,12 @@
         try
         {
             UserProfile otherProfile = findByLoginName( newName );
-            if ( otherProfile != null )
+            if( otherProfile != null )
             {
                 throw new DuplicateUserException( "Cannot rename: the login name '" + newName + "' is already taken." );
             }
         }
-        catch ( NoSuchPrincipalException e )
+        catch( NoSuchPrincipalException e )
         {
             // Good! That means it's safe to save using the new name
         }
@@ -521,7 +576,7 @@
         {
             // Open the database connection
             conn = m_ds.getConnection();
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.setAutoCommit( false );
             }
@@ -549,18 +604,24 @@
             profile.setLastModified( modDate );
 
             // Commit and close connection
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.commit();
             }
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             throw new WikiSecurityException( e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
     }
 
@@ -577,28 +638,29 @@
         {
             existingProfile = findByLoginName( loginName );
         }
-        catch ( NoSuchPrincipalException e )
+        catch( NoSuchPrincipalException e )
         {
             // Existing profile will be null
         }
 
         // Get a clean password from the passed profile.
-        // Blank password is the same as null, which means we re-use the existing one.
+        // Blank password is the same as null, which means we re-use the
+        // existing one.
         String password = profile.getPassword();
-        String existingPassword = ( existingProfile == null ) ? null : existingProfile.getPassword();
-        if ( NOTHING.equals( password ) )
+        String existingPassword = (existingProfile == null) ? null : existingProfile.getPassword();
+        if( NOTHING.equals( password ) )
         {
             password = null;
         }
-        if ( password == null)
+        if( password == null )
         {
             password = existingPassword;
         }
 
         // If password changed, hash it before we save
-        if ( !password.equals( existingPassword ) )
+        if( !password.equals( existingPassword ) )
         {
-            password =  m_hashPrefix ? SHA_PREFIX + getHash( password ) : getHash( password );
+            password = m_hashPrefix ? SHA_PREFIX + getHash( password ) : getHash( password );
         }
 
         Connection conn = null;
@@ -606,29 +668,29 @@
         {
             // Open the database connection
             conn = m_ds.getConnection();
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.setAutoCommit( false );
             }
 
             Timestamp ts = new Timestamp( System.currentTimeMillis() );
             Date modDate = new Date( ts.getTime() );
-            if ( existingProfile == null )
+            if( existingProfile == null )
             {
                 // User is new: insert new user record
                 ps = conn.prepareStatement( m_insertProfile );
-                ps.setString(1, profile.getEmail() );
-                ps.setString(2, profile.getFullname() );
-                ps.setString(3, password );
-                ps.setString(4, profile.getWikiName() );
-                ps.setTimestamp(5, ts );
-                ps.setString(6, profile.getLoginName() );
-                ps.setTimestamp(7, ts );
+                ps.setString( 1, profile.getEmail() );
+                ps.setString( 2, profile.getFullname() );
+                ps.setString( 3, password );
+                ps.setString( 4, profile.getWikiName() );
+                ps.setTimestamp( 5, ts );
+                ps.setString( 6, profile.getLoginName() );
+                ps.setTimestamp( 7, ts );
                 ps.execute();
                 ps.close();
 
                 // Insert role record if no roles yet
-                if ( m_sharedWithContainer )
+                if( m_sharedWithContainer )
                 {
                     ps = conn.prepareStatement( m_findRoles );
                     ps.setString( 1, profile.getLoginName() );
@@ -639,7 +701,7 @@
                         roles++;
                     }
                     ps.close();
-                    if ( roles == 0 )
+                    if( roles == 0 )
                     {
                         ps = conn.prepareStatement( m_insertRole );
                         ps.setString( 1, profile.getLoginName() );
@@ -656,12 +718,12 @@
             {
                 // User exists: modify existing record
                 ps = conn.prepareStatement( m_updateProfile );
-                ps.setString(1, profile.getEmail() );
-                ps.setString(2, profile.getFullname() );
-                ps.setString(3, password );
-                ps.setString(4, profile.getWikiName() );
-                ps.setTimestamp(5, ts );
-                ps.setString(6, profile.getLoginName() );
+                ps.setString( 1, profile.getEmail() );
+                ps.setString( 2, profile.getFullname() );
+                ps.setString( 3, password );
+                ps.setString( 4, profile.getWikiName() );
+                ps.setTimestamp( 5, ts );
+                ps.setString( 6, profile.getLoginName() );
                 ps.execute();
                 ps.close();
             }
@@ -669,23 +731,28 @@
             profile.setLastModified( modDate );
 
             // Commit and close connection
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.commit();
             }
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             throw new WikiSecurityException( e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
     }
 
     /**
-     *
      * @param rs
      * @return
      * @throws SQLException
@@ -700,7 +767,7 @@
         {
             // Open the database connection
             conn = m_ds.getConnection();
-            if ( m_supportsCommits )
+            if( m_supportsCommits )
             {
                 conn.setAutoCommit( false );
             }
@@ -710,7 +777,7 @@
             ResultSet rs = ps.executeQuery();
             while ( rs.next() )
             {
-                if ( profile != null )
+                if( profile != null )
                 {
                     unique = false;
                     break;
@@ -718,30 +785,36 @@
                 profile = new DefaultUserProfile();
                 profile.setCreated( rs.getTimestamp( m_created ) );
                 profile.setEmail( rs.getString( m_email ) );
-                profile.setFullname( rs.getString( m_fullName) );
+                profile.setFullname( rs.getString( m_fullName ) );
                 profile.setLastModified( rs.getTimestamp( m_modified ) );
-                profile.setLoginName( rs.getString( m_loginName ) ) ;
+                profile.setLoginName( rs.getString( m_loginName ) );
                 profile.setPassword( rs.getString( m_password ) );
                 found = true;
             }
             ps.close();
         }
-        catch ( SQLException e )
+        catch( SQLException e )
         {
             throw new NoSuchPrincipalException( e.getMessage() );
         }
         finally
         {
-            try { conn.close(); } catch (Exception e) {}
+            try
+            {
+                conn.close();
+            }
+            catch( Exception e )
+            {
+            }
         }
 
-        if ( !found )
+        if( !found )
         {
-            throw new NoSuchPrincipalException("Could not find profile in database!");
+            throw new NoSuchPrincipalException( "Could not find profile in database!" );
         }
-        if ( !unique )
+        if( !unique )
         {
-            throw new NoSuchPrincipalException("More than one profile in database!");
+            throw new NoSuchPrincipalException( "More than one profile in database!" );
         }
         return profile;
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/FilterManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/FilterManager.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/FilterManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/FilterManager.java Sun May  4 23:59:35 2008
@@ -20,10 +20,10 @@
  */
 package com.ecyrd.jspwiki.filters;
 
-import java.io.InputStream;
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.File;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.*;
 
@@ -41,10 +41,8 @@
 import com.ecyrd.jspwiki.event.WikiPageEvent;
 import com.ecyrd.jspwiki.modules.ModuleManager;
 import com.ecyrd.jspwiki.modules.WikiModuleInfo;
-import com.ecyrd.jspwiki.plugin.PluginManager.WikiPluginInfo;
-
-import com.ecyrd.jspwiki.util.PriorityList;
 import com.ecyrd.jspwiki.util.ClassUtil;
+import com.ecyrd.jspwiki.util.PriorityList;
 
 
 /**
@@ -489,7 +487,7 @@
      * 
      *  @since 2.6.1
      */
-    private static class PageFilterInfo extends WikiModuleInfo
+    private static final class PageFilterInfo extends WikiModuleInfo
     {
         private PageFilterInfo( String name )
         {

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/ProfanityFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/ProfanityFilter.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/ProfanityFilter.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/filters/ProfanityFilter.java Sun May  4 23:59:35 2008
@@ -64,7 +64,8 @@
             String str;
             while ( ( str = br.readLine() ) != null ) 
             {
-                if( str.length() > 0 && !str.startsWith( "#" ) ) { // allow comments on profanities file
+                if( str.length() > 0 && !str.startsWith( "#" ) )
+                { // allow comments on profanities file
                     l_profs.add( str );
                 }
             }

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/i18n/InternationalizationManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/i18n/InternationalizationManager.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/i18n/InternationalizationManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/i18n/InternationalizationManager.java Sun May  4 23:59:35 2008
@@ -20,14 +20,11 @@
  */
 package com.ecyrd.jspwiki.i18n;
 
-import java.text.DateFormat;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
-import com.ecyrd.jspwiki.preferences.Preferences;
 
 /**
  *  Manages all internationalization in JSPWiki.

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java Sun May  4 23:59:35 2008
@@ -251,19 +251,22 @@
                 //
                 //  if we want to show the last modified date of the most recently change page, we keep a "high watermark" here:
                 WikiPage page = null;
-                if (m_lastModified) {
-                    page = m_engine.getPage(pageName);
-                    if (page!= null)
+                if( m_lastModified )
+                {
+                    page = m_engine.getPage( pageName );
+                    if( page != null )
                     {
                         Date lastModPage = page.getLastModified();
-                        if (log.isDebugEnabled()) {
-                            log.debug("lastModified Date of page " + pageName + " : " + m_dateLastModified);
+                        if( log.isDebugEnabled() )
+                        {
+                            log.debug( "lastModified Date of page " + pageName + " : " + m_dateLastModified );
                         }
-                        if (lastModPage.after(m_dateLastModified)){
-                            m_dateLastModified=lastModPage;
+                        if( lastModPage.after( m_dateLastModified ) )
+                        {
+                            m_dateLastModified = lastModPage;
                         }
                     }
-                        
+
                 }
             }
         }

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/CurrentTimePlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/CurrentTimePlugin.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/CurrentTimePlugin.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/plugin/CurrentTimePlugin.java Sun May  4 23:59:35 2008
@@ -20,14 +20,15 @@
  */
 package com.ecyrd.jspwiki.plugin;
 
-import org.apache.log4j.Logger;
-import com.ecyrd.jspwiki.*;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.preferences.Preferences;
 import com.ecyrd.jspwiki.preferences.Preferences.TimeFormat;
 
-import java.util.*;
-import java.text.SimpleDateFormat;
-
 /**
  *  Just displays the current date and time.
  *  The time format is exactly like in the java.text.SimpleDateFormat class.
@@ -38,7 +39,7 @@
 public class CurrentTimePlugin
     implements WikiPlugin
 {
-    private static Logger log = Logger.getLogger( CurrentTimePlugin.class );
+    // private static Logger log = Logger.getLogger( CurrentTimePlugin.class );
 
     public String execute( WikiContext context, Map params )
         throws PluginException

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/AbstractFileProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/AbstractFileProvider.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/AbstractFileProvider.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/AbstractFileProvider.java Sun May  4 23:59:35 2008
@@ -84,21 +84,23 @@
 
         if( !f.exists() )
         {
-            if (!f.mkdirs()) 
+            if( !f.mkdirs() )
             {
-              throw new IOException("Failed to create page directory "+f.getAbsolutePath()+" , please check property "+PROP_PAGEDIR);  
+                throw new IOException( "Failed to create page directory " + f.getAbsolutePath() + " , please check property "
+                                       + PROP_PAGEDIR );
             }
         }
-        else {
+        else
+        {
             if( !f.isDirectory() )
             {
-            throw new IOException("Page directory is not a directory: "+f.getAbsolutePath());
+                throw new IOException( "Page directory is not a directory: " + f.getAbsolutePath() );
             }
-            if (!f.canWrite()) 
+            if( !f.canWrite() )
             {
-                throw new IOException("Page directory is not writable: "+f.getAbsolutePath());    
-            }
+                throw new IOException( "Page directory is not writable: " + f.getAbsolutePath() );
             }
+        }
         
         m_engine = engine;
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/RSSImageLinkTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/RSSImageLinkTag.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/RSSImageLinkTag.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/RSSImageLinkTag.java Sun May  4 23:59:35 2008
@@ -24,7 +24,6 @@
 
 import javax.servlet.jsp.JspWriter;
 
-import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
 
 /**

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java Sun May  4 23:59:35 2008
@@ -22,15 +22,15 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.*;
-import java.util.jar.*;
 import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.jstl.core.Config;
-import javax.servlet.jsp.jstl.fmt.*;
+import javax.servlet.jsp.jstl.fmt.LocaleSupport;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/AdminBeanManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/AdminBeanManager.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/AdminBeanManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/AdminBeanManager.java Sun May  4 23:59:35 2008
@@ -28,7 +28,6 @@
 
 import javax.management.*;
 
-import org.apache.commons.lang.SystemUtils;
 import org.apache.log4j.Logger;
 
 import com.ecyrd.jspwiki.Release;

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java?rev=653318&r1=653317&r2=653318&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java Sun May  4 23:59:35 2008
@@ -25,8 +25,6 @@
 
 import javax.management.NotCompliantMBeanException;
 
-import org.apache.log4j.Logger;
-
 import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
 import com.ecyrd.jspwiki.WikiPage;
@@ -48,7 +46,7 @@
 
     public static final String[] METHODS = { "reload" };
 
-    private static Logger log = Logger.getLogger( SearchManagerBean.class );
+    // private static Logger log = Logger.getLogger( SearchManagerBean.class );
 
     private WikiBackgroundThread m_updater;
 



Mime
View raw message