jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1505020 - in /incubator/jspwiki/trunk: ./ jspwiki-it-tests/ jspwiki-site/src/site/trunk/content/jspwiki/development/ jspwiki-site/src/site/trunk/templates/ jspwiki-war/ jspwiki-war/src/main/filters/ jspwiki-war/src/main/java/org/apache/wik...
Date Fri, 19 Jul 2013 21:06:27 GMT
Author: gmazza
Date: Fri Jul 19 21:06:26 2013
New Revision: 1505020

URL: http://svn.apache.org/r1505020
Log:
Dependency updates, sonar fixed as explained in ChangeLog

Added:
    incubator/jspwiki/trunk/jspwiki-war/src/main/filters/filters.properties
      - copied unchanged from r1504928, incubator/jspwiki/trunk/jspwiki-war/src/test/filters/filters.properties
Removed:
    incubator/jspwiki/trunk/jspwiki-war/src/test/filters/filters.properties
Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/jspwiki-it-tests/pom.xml
    incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/content/jspwiki/development/changelog.mdtext
    incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/templates/release.mdtext
    incubator/jspwiki/trunk/jspwiki-war/pom.xml
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/forms/FormClose.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSThread.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/tags/ParamTag.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/PageCommand.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/HttpUtil.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/comparators/HumanComparator.java
    incubator/jspwiki/trunk/pom.xml

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Fri Jul 19 21:06:26 2013
@@ -1,3 +1,14 @@
+2013-07-19  Glen Mazza (gmazza AT apache DOT org)
+
+       * 2.10.0-svn-22
+
+       * Updated some dependencies and plugins based on results from mvn versions:display-[plugin|dependency]-updates
(see base pom.xml)
+
+       * Various Sonar fixes (if cases without braces, trailing-line comments, etc.)
+
+       * Moved filter file (back) from jspwiki-war/src/test/filters to src/main/filters as
I
+         realized filtering is used in the webapp/WEB-INF folder in the main branch.
+
 2013-07-18  Glen Mazza (gmazza AT apache DOT org)
 
        * 2.10.0-svn-21

Modified: incubator/jspwiki/trunk/jspwiki-it-tests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-it-tests/pom.xml?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-it-tests/pom.xml (original)
+++ incubator/jspwiki/trunk/jspwiki-it-tests/pom.xml Fri Jul 19 21:06:26 2013
@@ -59,6 +59,7 @@
         <plugins>
           <plugin><!-- this enables tests reuse [2/2] -->
             <artifactId>maven-war-plugin</artifactId>
+            <version>2.4</version>
             <configuration>
               <webResources>
                 <resource>
@@ -116,6 +117,7 @@
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>selenium-maven-plugin</artifactId>
+            <version>2.3</version>
             <configuration>
               <browser>*googlechrome</browser>
               <!-- <browser>*firefox</browser> -->
@@ -138,6 +140,7 @@
           <plugin>
             <groupId>org.apache.tomcat.maven</groupId>
             <artifactId>tomcat7-maven-plugin</artifactId>
+            <version>2.1</version>
             <executions>
               <execution>
                 <id>tomcat-run</id>

Modified: incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/content/jspwiki/development/changelog.mdtext
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/content/jspwiki/development/changelog.mdtext?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/content/jspwiki/development/changelog.mdtext
(original)
+++ incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/content/jspwiki/development/changelog.mdtext
Fri Jul 19 21:06:26 2013
@@ -1,5 +1,23 @@
 Title: Changelog
 
+#### 2013-07-18  Glen Mazza (gmazza AT apache DOT org)
+
+* 2.10.0-svn-21
+
+* Some Sonar fixes on trailing comments
+
+* Combined our two maven-war-plugin definitions in jspwiki-war, added a Maven 3 requirement
to the base POM
+  so we can run mvn versions:display-[plugin|dependency]-updates
+
+* Tightened up SearchManagerTest, now deleting page created after each test (was failing
on Jenkins although
+  for some reason still working fine on my computer).
+
+#### 2013-07-18  Glen Mazza (gmazza AT apache DOT org)
+
+* 2.10.0-svn-20
+
+* Some Sonar fixes on minor matters.
+
 #### 2013-07-15  Glen Mazza (gmazza AT apache DOT org)
 
 * 2.10.0-svn-19

Modified: incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/templates/release.mdtext
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/templates/release.mdtext?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/templates/release.mdtext (original)
+++ incubator/jspwiki/trunk/jspwiki-site/src/site/trunk/templates/release.mdtext Fri Jul 19
21:06:26 2013
@@ -1 +1 @@
-JSPWiki v2.10.0-svn-19
\ No newline at end of file
+JSPWiki v2.10.0-svn-21
\ No newline at end of file

Modified: incubator/jspwiki/trunk/jspwiki-war/pom.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/pom.xml?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/pom.xml (original)
+++ incubator/jspwiki/trunk/jspwiki-war/pom.xml Fri Jul 19 21:06:26 2013
@@ -181,17 +181,9 @@
     <finalName>JSPWiki</finalName>
     <!-- filtering: http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html
-->
     <filters>
-      <filter>src/test/filters/filters.properties</filter>
+      <filter>src/main/filters/filters.properties</filter>
     </filters>
     
-    <resources>
-      <resource>
-        <directory>src/main/resources</directory>
-        <!-- No filtering yet -->
-        <!--filtering>true</filtering-->
-      </resource>
-    </resources>
-    
     <testResources>
       <testResource>
         <directory>src/test/resources</directory>
@@ -305,7 +297,10 @@
       <plugin>
         <artifactId>maven-war-plugin</artifactId>
         <configuration>
-          <attachClasses>true</attachClasses>
+            <filters>
+                <filter>${pom.basedir}/src/main/filters/filters.properties</filter>
+            </filters>
+            <attachClasses>true</attachClasses>
           <webResources>
             <resource>
               <directory>src/main/webapp/WEB-INF</directory>

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java Fri Jul
19 21:06:26 2013
@@ -75,7 +75,7 @@ public final class Release
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "21";
+    public static final String     BUILD         = "22";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java
Fri Jul 19 21:06:26 2013
@@ -82,8 +82,6 @@ public class AttachmentServlet extends H
     /** Default expiry period is 1 day */
     protected static final long DEFAULT_EXPIRY = 1 * 24 * 60 * 60 * 1000;
 
-    private String m_tmpDir;
-
     /**
      *  The maximum size that an attachment can be.
      */
@@ -110,10 +108,12 @@ public class AttachmentServlet extends H
     public void init( ServletConfig config )
         throws ServletException
     {
+        String tmpDir;
+
         m_engine         = WikiEngine.getInstance( config );
         Properties props = m_engine.getWikiProperties();
 
-        m_tmpDir         = m_engine.getWorkDir()+File.separator+"attach-tmp";
+        tmpDir         = m_engine.getWorkDir()+File.separator+"attach-tmp";
 
         m_maxSize        = TextUtil.getIntegerProperty( props,
                                                         AttachmentManager.PROP_MAXSIZE,
@@ -137,18 +137,18 @@ public class AttachmentServlet extends H
         else
             m_forbiddenPatterns = new String[0];
 
-        File f = new File( m_tmpDir );
+        File f = new File( tmpDir );
         if( !f.exists() )
         {
             f.mkdirs();
         }
         else if( !f.isDirectory() )
         {
-            log.fatal("A file already exists where the temporary dir is supposed to be: "+m_tmpDir+".
 Please remove it.");
+            log.fatal("A file already exists where the temporary dir is supposed to be: "+tmpDir+".
 Please remove it.");
         }
 
         log.debug( "UploadServlet initialized. Using " +
-                   m_tmpDir + " for temporary storage." );
+                   tmpDir + " for temporary storage." );
     }
 
     private boolean isTypeAllowed( String name )

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java
Fri Jul 19 21:06:26 2013
@@ -445,13 +445,11 @@ public final class UserManager
         email = InputValidator.isBlank( email ) ? null : email;
 
         // A special case if we have container authentication
-        if ( m_engine.getAuthenticationManager().isContainerAuthenticated() )
+        // If authenticated, login name is always taken from container
+        if ( m_engine.getAuthenticationManager().isContainerAuthenticated() &&
+                context.getWikiSession().isAuthenticated() )
         {
-            // If authenticated, login name is always taken from container
-            if ( context.getWikiSession().isAuthenticated() )
-            {
-                loginName = context.getWikiSession().getLoginPrincipal().getName();
-            }
+            loginName = context.getWikiSession().getLoginPrincipal().getName();
         }
 
         // Set the profile fields!

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java
Fri Jul 19 21:06:26 2013
@@ -193,10 +193,6 @@ public class JDBCGroupDatabase implement
 
     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;
@@ -483,6 +479,9 @@ public class JDBCGroupDatabase implement
      */
     public void initialize( WikiEngine engine, Properties props ) throws NoRequiredPropertyException,
WikiSecurityException
     {
+        String table;
+        String memberTable;
+
         m_engine = engine;
 
         String jndiName = props.getProperty( PROP_GROUPDB_DATASOURCE, DEFAULT_GROUPDB_DATASOURCE
);
@@ -493,8 +492,8 @@ public class JDBCGroupDatabase implement
             m_ds = (DataSource) ctx.lookup( jndiName );
 
             // Prepare the SQL selectors
-            m_table = props.getProperty( PROP_GROUPDB_TABLE, DEFAULT_GROUPDB_TABLE );
-            m_memberTable = props.getProperty( PROP_GROUPDB_MEMBER_TABLE, DEFAULT_GROUPDB_MEMBER_TABLE
);
+            table = props.getProperty( PROP_GROUPDB_TABLE, DEFAULT_GROUPDB_TABLE );
+            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
);
@@ -502,21 +501,21 @@ public class JDBCGroupDatabase implement
             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_findMembers = "SELECT * FROM " + m_memberTable + " WHERE " + m_name + "=?";
+            m_findAll = "SELECT DISTINCT * FROM " + table;
+            m_findGroup = "SELECT DISTINCT * FROM " + table + " WHERE " + m_name + "=?";
+            m_findMembers = "SELECT * FROM " + 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_insertGroup = "INSERT INTO " + 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_updateGroup = "UPDATE " + 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 " + memberTable + " (" + m_name + "," + m_member
+ ") VALUES (?,?)";
 
             // Prepare the group delete SQL
-            m_deleteGroup = "DELETE FROM " + m_table + " WHERE " + m_name + "=?";
-            m_deleteGroupMembers = "DELETE FROM " + m_memberTable + " WHERE " + m_name +
"=?";
+            m_deleteGroup = "DELETE FROM " + table + " WHERE " + m_name + "=?";
+            m_deleteGroupMembers = "DELETE FROM " + memberTable + " WHERE " + m_name + "=?";
         }
         catch( NamingException e )
         {

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
Fri Jul 19 21:06:26 2013
@@ -451,12 +451,9 @@ public class XMLGroupDatabase implements
 
         // Copy new file over old version
         File backup = new File( m_file.getAbsolutePath() + ".old" );
-        if ( backup.exists() )
+        if ( backup.exists() && !backup.delete())
         {
-            if ( !backup.delete() )
-            {
-                log.error( "Could not delete old group database backup: " + backup );
-            }
+            log.error( "Could not delete old group database backup: " + backup );
         }
         if ( !m_file.renameTo( backup ) )
         {

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java
Fri Jul 19 21:06:26 2013
@@ -270,14 +270,10 @@ public class JDBCUserDatabase extends Ab
 
     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_attributes = null;
 
     private String m_email = null;
@@ -290,10 +286,6 @@ public class JDBCUserDatabase extends Ab
 
     private String m_password = null;
 
-    private String m_role = null;
-
-    private String m_roleTable = null;
-
     private String m_uid = null;
     
     private String m_wikiName = null;
@@ -460,6 +452,10 @@ public class JDBCUserDatabase extends Ab
      */
     public void initialize( WikiEngine engine, Properties props ) throws NoRequiredPropertyException
     {
+        String userTable;
+        String role;
+        String roleTable;
+
         String jndiName = props.getProperty( PROP_DB_DATASOURCE, DEFAULT_DB_JNDI_NAME );
         try
         {
@@ -468,7 +464,7 @@ public class JDBCUserDatabase extends Ab
             m_ds = (DataSource) ctx.lookup( jndiName );
 
             // Prepare the SQL selectors
-            m_userTable = props.getProperty( PROP_DB_TABLE, DEFAULT_DB_TABLE );
+            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_lockExpiry = props.getProperty( PROP_DB_LOCK_EXPIRY, DEFAULT_DB_LOCK_EXPIRY
);
@@ -480,15 +476,15 @@ public class JDBCUserDatabase extends Ab
             m_modified = props.getProperty( PROP_DB_MODIFIED, DEFAULT_DB_MODIFIED );
             m_attributes = props.getProperty( PROP_DB_ATTRIBUTES, DEFAULT_DB_ATTRIBUTES );
 
-            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_findByUid = "SELECT * FROM " + m_userTable + " WHERE " + m_uid + "=?";
-            m_findByWikiName = "SELECT * FROM " + m_userTable + " WHERE " + m_wikiName +
"=?";
+            m_findAll = "SELECT * FROM " + userTable;
+            m_findByEmail = "SELECT * FROM " + userTable + " WHERE " + m_email + "=?";
+            m_findByFullName = "SELECT * FROM " + userTable + " WHERE " + m_fullName + "=?";
+            m_findByLoginName = "SELECT * FROM " + userTable + " WHERE " + m_loginName +
"=?";
+            m_findByUid = "SELECT * FROM " + userTable + " WHERE " + m_uid + "=?";
+            m_findByWikiName = "SELECT * FROM " + userTable + " WHERE " + m_wikiName + "=?";
 
             // The user insert SQL prepared statement
-            m_insertProfile = "INSERT INTO " + m_userTable + " ("
+            m_insertProfile = "INSERT INTO " + userTable + " ("
                               + m_uid + ","
                               + m_email + ","
                               + m_fullName + ","
@@ -501,7 +497,7 @@ public class JDBCUserDatabase extends Ab
                               + ") VALUES (?,?,?,?,?,?,?,?,?)";
             
             // The user update SQL prepared statement
-            m_updateProfile = "UPDATE " + m_userTable + " SET "
+            m_updateProfile = "UPDATE " + userTable + " SET "
                               + m_uid + "=?,"
                               + m_email + "=?,"
                               + m_fullName + "=?,"
@@ -514,21 +510,21 @@ public class JDBCUserDatabase extends Ab
                               + "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 + "=?";
+            roleTable = props.getProperty( PROP_DB_ROLE_TABLE, DEFAULT_DB_ROLE_TABLE );
+            role = props.getProperty( PROP_DB_ROLE, DEFAULT_DB_ROLE );
+            m_insertRole = "INSERT INTO " + roleTable + " (" + m_loginName + "," + role +
") VALUES (?,?)";
+            m_findRoles = "SELECT * FROM " + roleTable + " WHERE " + m_loginName + "=?";
 
             // Prepare the user delete SQL
-            m_deleteUserByLoginName = "DELETE FROM " + m_userTable + " WHERE " + m_loginName
+ "=?";
+            m_deleteUserByLoginName = "DELETE FROM " + userTable + " WHERE " + m_loginName
+ "=?";
 
             // Prepare the role delete SQL
-            m_deleteRoleByLoginName = "DELETE FROM " + m_roleTable + " WHERE " + m_loginName
+ "=?";
+            m_deleteRoleByLoginName = "DELETE FROM " + roleTable + " WHERE " + m_loginName
+ "=?";
 
             // Prepare the rename user/roles SQL
-            m_renameProfile = "UPDATE " + m_userTable + " SET " + m_loginName + "=?," + m_modified
+ "=? WHERE " + m_loginName
+            m_renameProfile = "UPDATE " + userTable + " SET " + m_loginName + "=?," + m_modified
+ "=? WHERE " + m_loginName
                               + "=?";
-            m_renameRoles = "UPDATE " + m_roleTable + " SET " + m_loginName + "=? WHERE "
+ m_loginName + "=?";
+            m_renameRoles = "UPDATE " + roleTable + " SET " + m_loginName + "=? WHERE " +
m_loginName + "=?";
         }
         catch( NamingException e )
         {
@@ -542,7 +538,6 @@ public class JDBCUserDatabase extends Ab
         {
             conn = m_ds.getConnection();
             PreparedStatement ps = conn.prepareStatement( m_findAll );
-            ps.executeQuery();
             ps.close();
         }
         catch( SQLException e )
@@ -675,10 +670,13 @@ public class JDBCUserDatabase extends Ab
      */
     public void save( UserProfile profile ) throws WikiSecurityException
     {
+        String initialRole = "Authenticated";
+
         // Figure out which prepared statement to use & execute it
         String loginName = profile.getLoginName();
         PreparedStatement ps = null;
         UserProfile existingProfile = null;
+
         try
         {
             existingProfile = findByLoginName( loginName );
@@ -758,7 +756,7 @@ public class JDBCUserDatabase extends Ab
                 {
                     ps = conn.prepareStatement( m_insertRole );
                     ps.setString( 1, profile.getLoginName() );
-                    ps.setString( 2, m_initialRole );
+                    ps.setString( 2, initialRole );
                     ps.execute();
                     ps.close();
                 }

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java
Fri Jul 19 21:06:26 2013
@@ -420,7 +420,7 @@ public final class DefaultFilterManager 
      * @param type      the WikiPageEvent type to be fired.
      * @param context   the WikiContext of the event.
      */
-    public final void fireEvent( int type, WikiContext context )
+    public void fireEvent( int type, WikiContext context )
     {
         if ( WikiEventManager.isListening(this) && WikiPageEvent.isValidType(type)
)
         {

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/forms/FormClose.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/forms/FormClose.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/forms/FormClose.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/forms/FormClose.java
Fri Jul 19 21:06:26 2013
@@ -48,13 +48,10 @@ public class FormClose
 
         // Don't render if no error and error-only-rendering is on.
         FormInfo info = getFormInfo( ctx );
-        if( info != null )
+        if( info != null && info.hide() )
         {
-            if( info.hide() )
-            {
-                ResourceBundle rb = Preferences.getBundle( ctx, WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE
);
-                return "<p>" + rb.getString( "formclose.noneedtoshow" ) + "</p>";
-            }
+            ResourceBundle rb = Preferences.getBundle( ctx, WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE
);
+            return "<p>" + rb.getString( "formclose.noneedtoshow" ) + "</p>";
         }
 
         // Get rid of remaining form data, so it doesn't mess up other forms.

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
Fri Jul 19 21:06:26 2013
@@ -1880,7 +1880,11 @@ public class JSPWikiMarkupParser
                 {
                     // Empty away all the rest of the dashes.
                     // Do not forget to return the first non-match back.
-                    while( (ch = nextToken()) == '-' );
+                    do
+                    {
+                        ch = nextToken();
+                    }
+                    while ( ch == '-' );
 
                     pushBack(ch);
                     startBlockLevel();

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSThread.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSThread.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSThread.java (original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSThread.java Fri
Jul 19 21:06:26 2013
@@ -36,7 +36,6 @@ public class RSSThread extends WikiBackg
     static Logger              log = Logger.getLogger( RSSThread.class );
         
     private final File m_rssFile;
-    private final int m_rssInterval;
     private final RSSGenerator m_generator;
         
     private WatchDog m_watchdog;
@@ -53,10 +52,9 @@ public class RSSThread extends WikiBackg
         super( engine, rssInterval );
         m_generator = engine.getRSSGenerator();
         m_rssFile = rssFile;
-        m_rssInterval = rssInterval;
         setName("JSPWiki RSS Generator");
         log.debug( "RSS file will be at "+m_rssFile.getAbsolutePath() );
-        log.debug( "RSS refresh interval (seconds): "+m_rssInterval );
+        log.debug( "RSS refresh interval (seconds): "+rssInterval );
     }
     
     /**

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/tags/ParamTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/tags/ParamTag.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/tags/ParamTag.java (original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/tags/ParamTag.java Fri
Jul 19 21:06:26 2013
@@ -75,8 +75,11 @@ public class ParamTag 
     public int doEndTag()
     {
         Tag t = null;
-        while( (t = getParent()) != null && !(t instanceof ParamHandler) )
-            ;
+        do
+        {
+            t = getParent();
+        } while (t != null && !(t instanceof ParamHandler));
+
         if( t != null )
         {
             String val = m_value;

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/PageCommand.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/PageCommand.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/PageCommand.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/PageCommand.java
Fri Jul 19 21:06:26 2013
@@ -126,7 +126,7 @@ public final class PageCommand extends A
     /**
      * @see org.apache.wiki.ui.Command#getName()
      */
-    public final String getName()
+    public String getName()
     {
         Object target = getTarget();
         if( target == null )
@@ -139,7 +139,7 @@ public final class PageCommand extends A
     /**
      * @see org.apache.wiki.ui.Command#requiredPermission()
      */
-    public final Permission requiredPermission()
+    public Permission requiredPermission()
     {
         return m_permission;
     }

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java
Fri Jul 19 21:06:26 2013
@@ -143,9 +143,10 @@ public class DefaultURLConstructor
     public static String getURLPattern( String context, String name )
         throws IllegalArgumentException
     {
-        if( context.equals(WikiContext.VIEW) )
+        if( context.equals(WikiContext.VIEW) && name == null)
         {
-            if( name == null ) return "%uWiki.jsp"; // FIXME
+            // FIXME
+            return "%uWiki.jsp";
         }
         
         // Find the action matching our pattern (could throw exception)

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/HttpUtil.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/HttpUtil.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/HttpUtil.java (original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/HttpUtil.java Fri
Jul 19 21:06:26 2013
@@ -129,12 +129,9 @@ public final class HttpUtil
                         
             String eTag = req.getHeader( "If-None-Match" );
             
-            if( eTag != null )
+            if( eTag != null && eTag.equals(thisTag) )
             {
-                if( eTag.equals(thisTag) )
-                {
-                    return true;
-                }
+                return true;
             }
             
             //

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/comparators/HumanComparator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/comparators/HumanComparator.java?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/comparators/HumanComparator.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/comparators/HumanComparator.java
Fri Jul 19 21:06:26 2013
@@ -23,7 +23,7 @@ import java.util.Comparator;
 
 /**
  * A comparator that sorts Strings using "human" ordering, including decimal
- * ordering. Only works for languages where every Character is lexigraphically
+ * ordering. Only works for languages where every character is lexigraphically
  * distinct and correctly unicode ordered (e.g. English). Other languages should use
  * <code>CollatedHumanComparator</code>. Pretty efficient but still slower than
  * String.compareTo().
@@ -80,18 +80,26 @@ public class HumanComparator implements 
     {
         // Some quick and easy checks
         if( str1 == str2 )
-            return 0; // they're identical, possibly both null
-        if( str1 == null )
-            return -1; // str1 is null and str2 isn't so str1 is smaller
-        if( str2 == null )
-            return 1; // str2 is null and str1 isn't so str1 is bigger
+        {
+            // they're identical, possibly both null
+            return 0;
+        } else if ( str1 == null )
+        {
+            // str1 is null and str2 isn't so str1 is smaller
+            return -1;
+        } else if ( str2 == null )
+        {
+            // str2 is null and str1 isn't so str1 is bigger
+            return 1;
+        }
 
         char[] s1 = str1.toCharArray();
         char[] s2 = str2.toCharArray();
         int len1 = s1.length;
         int len2 = s2.length;
         int idx = 0;
-        int caseComparison = 0; // Used to defer a case sensitive comparison
+        // caseComparison used to defer a case sensitive comparison
+        int caseComparison = 0;
 
         while ( idx < len1 && idx < len2 )
         {
@@ -105,16 +113,18 @@ public class HumanComparator implements 
             // If case makes a difference, note the difference the first time
             // it's encountered
             if( caseComparison == 0 && c1 != c2 && lc1 == lc2 )
+            {
                 if( Character.isLowerCase( c1 ) )
                     caseComparison = 1;
                 else if( Character.isLowerCase( c2 ) )
                     caseComparison = -1;
-
+            }
             // Do the rest of the tests in lower case
             c1 = lc1;
             c2 = lc2;
 
-            if( c1 != c2 || c1 == '0' ) // leading zeros are a special case
+            // leading zeros are a special case
+            if( c1 != c2 || c1 == '0' )
             {
                 // They might be different, now we can do a comparison
                 CharType type1 = mapCharTypes( c1 );
@@ -123,8 +133,10 @@ public class HumanComparator implements 
                 // Do the character class check
                 int result = compareCharTypes( type1, type2 );
                 if( result != 0 )
-                    return result; // different character classes so that's
-                // sufficient
+                {
+                    // different character classes so that's sufficient
+                    return result;
+                }
 
                 // If they're not digits, use character to character comparison
                 if( type1 != CharType.TYPE_DIGIT )
@@ -138,7 +150,10 @@ public class HumanComparator implements 
                 assert( type1 == CharType.TYPE_DIGIT && type2 == CharType.TYPE_DIGIT
);
                 result = compareDigits( s1, s2, idx - 1 );
                 if( result != 0 )
-                    return result; // Got a result so return it
+                {
+                    // Got a result so return it
+                    return result;
+                }
 
                 // No result yet, spin through the digits and continue trying
                 while ( idx < len1 && idx < len2 && Character.isDigit(
s1[idx] ) )
@@ -147,8 +162,13 @@ public class HumanComparator implements 
         }
 
         if( len1 == len2 )
-            return caseComparison; // identical so return any case dependency
-        return len1 - len2; // Shorter String is less
+        {
+            // identical so return any case dependency
+            return caseComparison;
+        }
+
+        // Shorter String is less
+        return len1 - len2;
     }
 
     /**
@@ -162,18 +182,31 @@ public class HumanComparator implements 
     private int compareCharTypes( CharType type1, CharType type2 )
     {
         if( type1 == type2 )
-            return 0; // Same type so equal
-        if( type1 == sortOrder[0] )
-            return -1; // t1 is the lowest order and t2 isn't so t1 must be less
-        if( type2 == sortOrder[0] )
-            return 1; // t2 is the lowest order and t1 isn't so t1 must be more
-        if( type1 == sortOrder[1] )
-            return -1; // t1 is the middle order and t2 isn't so t1 must be less
-        if( type2 == sortOrder[1] )
-            return 1; // t2 is the middle order and t1 isn't so t1 must be more
-        // Can't possible get here as that would mean they're both sortOrder[2]
-        assert( type1 != type2 );
-        return 0;
+        {
+            // Same type so equal
+            return 0;
+        } else if( type1 == sortOrder[0] )
+        {
+            // t1 is the lowest order and t2 isn't so t1 must be less
+            return -1;
+        } else if( type2 == sortOrder[0] )
+        {
+            // t2 is the lowest order and t1 isn't so t1 must be more
+            return 1;
+        } else if( type1 == sortOrder[1] )
+        {
+            // t1 is the middle order and t2 isn't so t1 must be less
+            return -1;
+        } else if( type2 == sortOrder[1] )
+        {
+            // t2 is the middle order and t1 isn't so t1 must be more
+            return 1;
+        } else
+        {
+            // Can't possibly get here as that would mean they're both sortOrder[2]
+            assert( type1 != type2 );
+            return 0;
+        }
     }
 
     /**
@@ -249,9 +282,13 @@ public class HumanComparator implements 
 
         // Sanity check the sort order
         if( sortOrder.length != 3 )
+        {
             throw new IllegalArgumentException( "There must be exactly three elements in
the sort order" );
+        }
         if( sortOrder[0] == sortOrder[1] || sortOrder[0] == sortOrder[2] || sortOrder[1]
== sortOrder[2] )
+        {
             throw new IllegalArgumentException( "The sort order must contain EXACTLY one
of each CharType" );
+        }
         this.sortOrder = sortOrder;
     }
 }

Modified: incubator/jspwiki/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/pom.xml?rev=1505020&r1=1505019&r2=1505020&view=diff
==============================================================================
--- incubator/jspwiki/trunk/pom.xml (original)
+++ incubator/jspwiki/trunk/pom.xml Fri Jul 19 21:06:26 2013
@@ -16,10 +16,7 @@
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
--->
-<project xmlns              = "http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi          = "http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <parent>
     <groupId>org.apache</groupId>
@@ -44,7 +41,7 @@
   </properties>
 
   <prerequisites>
-    <maven>3.0</maven>
+    <maven>3.0.4</maven>
   </prerequisites>
 
   <scm>
@@ -71,7 +68,7 @@
       <dependency>
         <groupId>commons-fileupload</groupId>
         <artifactId>commons-fileupload</artifactId>
-        <version>1.2.1</version>
+        <version>1.3</version>
       </dependency>
 
       <dependency>
@@ -101,7 +98,7 @@
       <dependency>
         <groupId>javax.mail</groupId>
         <artifactId>mail</artifactId>
-        <version>1.4</version>
+        <version>1.4.7</version>
       </dependency>
 
       <dependency>
@@ -125,7 +122,7 @@
       <dependency>
         <groupId>log4j</groupId>
         <artifactId>log4j</artifactId>
-        <version>1.2.14</version>
+        <version>1.2.17</version>
       </dependency>
 
       <dependency>
@@ -185,7 +182,7 @@
       <dependency>
         <groupId>oro</groupId>
         <artifactId>oro</artifactId>
-        <version>2.0.7</version>
+        <version>2.0.8</version>
       </dependency>
 
       <dependency>
@@ -242,7 +239,7 @@
       <dependency>
         <groupId>nekohtml</groupId>
         <artifactId>nekohtml</artifactId>
-        <version>0.9.4</version>
+        <version>0.9.5</version>
       </dependency>
 
     </dependencies>
@@ -318,7 +315,7 @@
 
         <plugin>
           <artifactId>maven-enforcer-plugin</artifactId>
-          <version>1.2</version>
+          <version>1.3.1</version>
           <configuration>
             <fail>true</fail>
             <rules>
@@ -375,7 +372,7 @@
             -doctitle "${project.name} ${project.version}"
             -link {project.organization.url}
             </additionalparam>
-            <bottom>Copyright &#169; {inceptionYear}-{currentYear} ${project.organization.name}.
All rights reserved.</bottom>
+            <bottom>Copyright © {inceptionYear}-{currentYear} ${project.organization.name}.
All rights reserved.</bottom>
             <doclet>org.jboss.apiviz.APIviz</doclet>
             <docletArtifact>
               <groupId>org.jboss.apiviz</groupId>
@@ -394,7 +391,7 @@
    
         <plugin>
           <artifactId>maven-project-info-reports-plugin</artifactId>
-          <version>2.6</version>
+          <version>2.7</version>
         </plugin>
         
         <plugin>
@@ -412,17 +409,17 @@
           
         <plugin>
           <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.14.1</version>
+          <version>2.15</version>
         </plugin>
           
         <plugin>
           <artifactId>maven-surefire-report-plugin</artifactId>
-          <version>2.14.1</version>
+          <version>2.15</version>
         </plugin>
    
         <plugin>
           <artifactId>maven-war-plugin</artifactId>
-          <version>2.3</version>
+          <version>2.4</version>
           <configuration>
             <archive>
               <manifest>
@@ -533,7 +530,7 @@
                     <versionRange>[1.3.2,)</versionRange>
                     <goals><goal>compress</goal></goals>
                   </pluginExecutionFilter>
-                  <action><ignore></ignore></action>
+                  <action><ignore/></action>
                 </pluginExecution>
                 <pluginExecution>
                   <pluginExecutionFilter>
@@ -542,7 +539,7 @@
                     <versionRange>[1.7,)</versionRange>
                     <goals><goal>run</goal></goals>
                   </pluginExecutionFilter>
-                  <action><ignore></ignore></action>
+                  <action><ignore/></action>
                 </pluginExecution>
                 <pluginExecution>
                   <pluginExecutionFilter>
@@ -551,7 +548,7 @@
                     <versionRange>[1.0.1,)</versionRange>
                     <goals><goal>jslint</goal></goals>
                   </pluginExecutionFilter>
-                  <action><ignore></ignore></action>
+                  <action><ignore/></action>
                 </pluginExecution>
               </pluginExecutions>
             </lifecycleMappingMetadata>



Mime
View raw message