You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by fl...@apache.org on 2011/09/20 22:07:23 UTC

svn commit: r1173327 - in /incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH: ./ doc/eclipse/ src/com/ecyrd/jspwiki/attachment/ src/com/ecyrd/jspwiki/content/ src/com/ecyrd/jspwiki/xmlrpc/

Author: florianh
Date: Tue Sep 20 20:07:23 2011
New Revision: 1173327

URL: http://svn.apache.org/viewvc?rev=1173327&view=rev
Log:
* modified jspwiki-checkstyle.xml to be compatible with CheckStyle 5.x
* corrected a few things CheckStyle was nagging about

Modified:
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.project
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/eclipse/jspwiki-checkstyle.xml
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/AbstractRPCHandler.java

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.project
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.project?rev=1173327&r1=1173326&r2=1173327&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.project (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/.project Tue Sep 20 20:07:23 2011
@@ -11,14 +11,14 @@
 			</arguments>
 		</buildCommand>
 		<buildCommand>
-			<name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
+			<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
 			<arguments>
 			</arguments>
 		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
 		<nature>net.sourceforge.metrics.nature</nature>
+		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
 	</natures>
 </projectDescription>

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog?rev=1173327&r1=1173326&r2=1173327&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog Tue Sep 20 20:07:23 2011
@@ -1,3 +1,9 @@
+2011-09-20  Florian Holeczek <fl...@apache.org>
+
+        * no version bump
+        * modified jspwiki-checkstyle.xml to be compatible with CheckStyle 5.x
+        * corrected a few things CheckStyle was nagging about
+
 2011-09-20  Harry Metske <me...@apache.org>
 
         * 2.8.5-svn-9

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/eclipse/jspwiki-checkstyle.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/eclipse/jspwiki-checkstyle.xml?rev=1173327&r1=1173326&r2=1173327&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/eclipse/jspwiki-checkstyle.xml (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/doc/eclipse/jspwiki-checkstyle.xml Tue Sep 20 20:07:23 2011
@@ -1,8 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-    This configuration file was written by the eclipse-cs plugin configuration editor
--->
-<!--
     Checkstyle-Configuration: JSPWiki Coding Style
     Description: none
 -->
@@ -10,12 +7,12 @@
 <module name="Checker">
     <property name="severity" value="warning"/>
     <module name="TreeWalker">
+        <!-- Fields should always start with "m_" -->
         <module name="MemberName">
-            <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Fields should always start with &quot;m_&quot;"/>
             <property name="format" value="^m_[a-z][a-zA-Z0-9]*$"/>
         </module>
+        <!-- Static variables shall start with "c_" (except for "log") -->
         <module name="StaticVariableName">
-            <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Static variables shall start with &quot;c_&quot; (except for &quot;log&quot;)"/>
             <property name="format" value="^log$|^c_[a-z][a-zA-Z0-9]*$"/>
         </module>
         <module name="LeftCurly">
@@ -24,7 +21,9 @@
         <module name="RightCurly">
             <property name="option" value="alone"/>
         </module>
-        <module name="AvoidNestedBlocks"/>
+        <module name="AvoidNestedBlocks">
+            <property name="severity" value="ignore"/>
+        </module>
         <module name="ConstantName">
             <property name="format" value="^log|[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
         </module>
@@ -33,17 +32,12 @@
         <module name="ParameterName"/>
         <module name="TypeName"/>
         <module name="LocalVariableName"/>
-        <module name="TabCharacter">
-            <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Tabs are evil"/>
-        </module>
         <module name="ModifierOrder"/>
         <module name="CovariantEquals"/>
         <module name="DefaultComesLast"/>
         <module name="DoubleCheckedLocking"/>
         <module name="EqualsHashCode"/>
-        <module name="ExplicitInitialization">
-            <property name="severity" value="ignore"/>
-        </module>
+        <module name="ExplicitInitialization"/>
         <module name="FallThrough"/>
         <module name="HiddenField"/>
         <module name="IllegalInstantiation"/>
@@ -80,11 +74,9 @@
             <property name="excludedClasses" value="^.*Release$"/>
         </module>
         <module name="UpperEll"/>
-        <module name="j2ee.FinalStatic"/>
-        <module name="RequiredRegexp">
-            <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="No ASF preamble"/>
-            <property name="format" value="^.*Licensed to the Apache Software Foundation.*$"/>
-        </module>
+        <!-- This is not supported anymore by Checkstyle 5.x. Isn't really needed anyway, so commenting it out.
+            <module name="j2ee.FinalStatic"/>
+        -->
         <module name="JavadocType">
             <property name="scope" value="package"/>
         </module>
@@ -94,12 +86,19 @@
         <module name="JavadocMethod">
             <property name="scope" value="protected"/>
         </module>
-        <module name="GenericIllegalRegexp">
-            <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="@author tags should not be used"/>
-            <property name="severity" value="info"/>
-            <property name="format" value="^.*@author.*$"/>
-        </module>
     </module>
+    <!-- @author tags should not be used -->
+    <module name="RegexpSingleline">
+        <property name="format" value="^.*@author.*$"/>
+    </module>
+    <!-- Ensure ASF preamble -->
+    <module name="RegexpMultiline">
+        <property name="format" value="Licensed to the Apache Software Foundation"/>
+        <property name="minimum" value="1"/>
+        <property name="maximum" value="5"/>
+    </module>
+    <module name="FileTabCharacter"/>
     <module name="NewlineAtEndOfFile"/>
-    <module name="PackageHtml"/>
+    <!-- Every Java package should have its Javadoc file -->    
+    <module name="JavadocPackage"/>
 </module>

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java?rev=1173327&r1=1173326&r2=1173327&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java Tue Sep 20 20:07:23 2011
@@ -618,8 +618,8 @@ public class AttachmentManager
         // If file name ends with .jsp or .jspf, the user is being naughty!
         if( filename.toLowerCase().endsWith( ".jsp" ) || filename.toLowerCase().endsWith(".jspf") )
         {
-            log.info( "Attempt to upload a file with a .jsp/.jspf extension.  In certain cases this" +
-            		" can trigger unwanted security side effects, so we're preventing it." );
+            log.info( "Attempt to upload a file with a .jsp/.jspf extension.  In certain cases this " +
+                      "can trigger unwanted security side effects, so we're preventing it." );
             //
             // the caller should catch the exception and use the exception text as an i18n key
             throw new WikiException(  "attach.unwanted.file"  );

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java?rev=1173327&r1=1173326&r2=1173327&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java Tue Sep 20 20:07:23 2011
@@ -810,9 +810,12 @@ public class AttachmentServlet
                 att.setAttribute( WikiPage.CHANGENOTE, changenote );
             }
             
-            try {
-            m_engine.getAttachmentManager().storeAttachment( att, data );
-            } catch (ProviderException pe) {
+            try
+            {
+                m_engine.getAttachmentManager().storeAttachment( att, data );
+            }
+            catch( ProviderException pe )
+            {
                 // this is a kludge, the exception that is caught here contains the i18n key
                 // here we have the context available, so we can internationalize it properly :
                 throw new ProviderException( context.getBundle( InternationalizationManager.CORE_BUNDLE ).getString( pe.getMessage() ) );

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java?rev=1173327&r1=1173326&r2=1173327&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/content/Exporter.java Tue Sep 20 20:07:23 2011
@@ -375,7 +375,7 @@ public class Exporter
         exportPageFooter();  
     }
     
-    private static final String getParam(String s[], String p, String defaultParam)
+    private static final String getParam(String[] s, String p, String defaultParam)
     {
         if( s.length < 2 ) return defaultParam;
         

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/AbstractRPCHandler.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/AbstractRPCHandler.java?rev=1173327&r1=1173326&r2=1173327&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/AbstractRPCHandler.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/xmlrpc/AbstractRPCHandler.java Tue Sep 20 20:07:23 2011
@@ -86,9 +86,8 @@ public abstract class AbstractRPCHandler
         // Transform UTC into local time.
         Calendar cal = Calendar.getInstance();
         cal.setTime( since );
-        cal.add( Calendar.MILLISECOND, 
-                 (cal.get( Calendar.ZONE_OFFSET ) + 
-                  (cal.getTimeZone().inDaylightTime( since ) ? cal.get( Calendar.DST_OFFSET ) : 0 )) );
+        cal.add( Calendar.MILLISECOND, cal.get( Calendar.ZONE_OFFSET ) + 
+                  (cal.getTimeZone().inDaylightTime( since ) ? cal.get( Calendar.DST_OFFSET ) : 0 ) );
 
         for( Iterator i = pages.iterator(); i.hasNext(); )
         {