jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaqu...@apache.org
Subject svn commit: r765589 [1/2] - in /incubator/jspwiki/trunk: ./ src/WebContent/ src/WebContent/scripts/ src/WebContent/templates/default/ src/java/org/apache/wiki/ src/java/org/apache/wiki/action/ src/java/org/apache/wiki/api/ src/java/org/apache/wiki/auth...
Date Thu, 16 Apr 2009 12:04:34 GMT
Author: ajaquith
Date: Thu Apr 16 12:04:31 2009
New Revision: 765589

URL: http://svn.apache.org/viewvc?rev=765589&view=rev
Log:
Improved enhanced-for loops and generics throughout. Fixed some tag and Stripes errors that were preventing the WAR from running. RPC classes and search providers now propagate exceptions for page fetching and reindexing.

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/ReleaseNotes
    incubator/jspwiki/trunk/src/WebContent/Wiki.jsp
    incubator/jspwiki/trunk/src/WebContent/scripts/jspwiki-common.js
    incubator/jspwiki/trunk/src/WebContent/templates/default/DefaultLayout.jsp
    incubator/jspwiki/trunk/src/WebContent/templates/default/SearchBox.jsp
    incubator/jspwiki/trunk/src/WebContent/templates/default/commonheader.jsp
    incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/VariableManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/api/WikiEngine.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/UserManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/login/WebContainerLoginModule.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNotFoundException.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/diff/DifferenceManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/event/WikiEventManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/FilterManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/PingWeblogsComFilter.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/PersistentMapDecorator.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/PluginManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/providers/WikiPageProvider.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CleanTextRenderer.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CreoleRenderer.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/render/RenderingManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/render/WysiwygEditingRenderer.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/rpc/json/JSONRPCManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/AtomFeed.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS10Feed.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS20Feed.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSSGenerator.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/search/BasicSearchProvider.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/search/SearchManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/IfNoSearchResultsTag.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToParentTag.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToTag.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/PageTypeTag.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/ParentPageNameTag.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/DefaultWikiContext.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiInterceptor.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiRuntimeConfiguration.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/url/StripesURLConstructor.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/util/ClassUtil.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/util/PropertyReader.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TimedCounterList.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/util/WatchDog.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/AbstractRPCHandler.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java
    incubator/jspwiki/trunk/tests/java/com/foo/SamplePlugin3.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/ReferenceManagerTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJDBCDataSource.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJNDIContext.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/WikiContextFactoryTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/attachment/AttachmentManagerTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/JavaScriptPlugin.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/SamplePlugin.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/search/SearchManagerTest.java
    incubator/jspwiki/trunk/tests/java/stress/MassiveRepositoryTest.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Thu Apr 16 12:04:31 2009
@@ -1,3 +1,12 @@
+2009-04-16  Andrew Jaquith <ajaquith AT apache DOT org>
+
+        * 3.0.0-svn-102
+        
+        * Improved enhanced-for loops and generics throughout.
+        Fixed some tag and Stripes errors that were preventing the WAR
+        from running. RPC classes and search providers now propagate
+        exceptions for page fetching and reindexing.
+
 2009-04-13  Janne Jalkanen <jalkanen@apache.org>
 
         * 3.0.0-svn-101

Modified: incubator/jspwiki/trunk/ReleaseNotes
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ReleaseNotes?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ReleaseNotes (original)
+++ incubator/jspwiki/trunk/ReleaseNotes Thu Apr 16 12:04:31 2009
@@ -65,3 +65,11 @@
 information out of the page entirely, and into separate storage. However, we do not
 yet have a GUI for manipulating the ACL once it has been extracted. This will come
 later in the 3.0 development cycle. 
+
+* JCRPage implements the Attachment interface, in addition to WikiPage. This means that
+code snippets like "p instanceof Attachment" will NOT work reliably. You should instead
+use the WikiPage.isAttachment() method to test for this condition instead.
+
+* Dummy page names like "__PAGEHERE__" and "#$%" in JavaScript and JSPs have
+been replaced with "Main". They were throwing PageNotFoundExceptions. It's
+probable that Stripes will eliminate the need to do this, anyway.
\ No newline at end of file

Modified: incubator/jspwiki/trunk/src/WebContent/Wiki.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/Wiki.jsp?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/Wiki.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/Wiki.jsp Thu Apr 16 12:04:31 2009
@@ -5,7 +5,7 @@
 
   <%-- If wiki page is current, allow search engines to spider it --%>
   <wiki:CheckVersion mode="latest">
-    <s:layout-component name="head.meta.robots">
+    <s:layout-component name="headMetaRobots">
       <meta name="robots" content="index,follow" />
     </s:layout-component>
   </wiki:CheckVersion>

Modified: incubator/jspwiki/trunk/src/WebContent/scripts/jspwiki-common.js
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/scripts/jspwiki-common.js?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/scripts/jspwiki-common.js (original)
+++ incubator/jspwiki/trunk/src/WebContent/scripts/jspwiki-common.js Thu Apr 16 12:04:31 2009
@@ -1002,7 +1002,7 @@
 			s=encodeURIComponent(s);
 			if(clone && (s != p)) s += '&clone=' + p;
 
-			location.href = url.replace('__PAGEHERE__', s );
+			location.href = url.replace('Main', s );
 		};
 		
 		if(s!='') {

Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/DefaultLayout.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/DefaultLayout.jsp?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/DefaultLayout.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/DefaultLayout.jsp Thu Apr 16 12:04:31 2009
@@ -21,7 +21,7 @@
           jslocalizedstrings  : Localized scripts for JavaScript
                                 functions. Default=blank
           jsfunction          : JavaScript functions. Default=blank
-          head.meta.robots    : Search engine options. Default=noindex,nofollow
+          headMetaRobots      : Search engine options. Default=noindex,nofollow
           content             : The page contents. Default=blank
           
      2) DefaultLayout injects additional JSPs that are meant to be
@@ -113,7 +113,7 @@
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     <meta name="wikiContext" content='${wikiContext.requestContext}' />
     <meta name="wikiBaseUrl" content='<wiki:BaseURL/>' />
-    <meta name="wikiPageUrl" content='<wiki:Link format="url" page="#$%" />' />
+    <meta name="wikiPageUrl" content='<wiki:Link format="url" page="${wikiContext.page.name}" />' />
     <meta name="wikiEditUrl" content='<wiki:EditLink format="url" />' />
     <meta name="wikiJsonUrl" content='<%=  WikiContextFactory.findContext(pageContext).getURL( WikiContext.NONE, "JSON-RPC" ) %>' /><%--unusual pagename--%>
     <meta name="wikiPageName" content='<wiki:Variable var="pagename" />' /><%--pagename without blanks--%>
@@ -124,7 +124,7 @@
 
          Search engines: by default, page is not indexed or followed
     --%>
-    <s:layout-component name="head.meta.robots">
+    <s:layout-component name="headMetaRobots">
     <meta name="robots" content="noindex,nofollow" />
     </s:layout-component>
     <%--

Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/SearchBox.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/SearchBox.jsp?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/SearchBox.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/SearchBox.jsp Thu Apr 16 12:04:31 2009
@@ -23,16 +23,16 @@
   <div id="searchboxMenu" style='visibility:hidden;'>
     <div id="searchTools">
       <a href="#" id='quickView' class='action'
-      onclick="SearchBox.navigate( '<wiki:Link format="url" page="__PAGEHERE__"/>','<fmt:message key="sbox.view.title"/>' );"
+      onclick="SearchBox.navigate( '<wiki:Link format="url" page="Main"/>','<fmt:message key="sbox.view.title"/>' );"
         title="<fmt:message key="sbox.view.title"/>"><fmt:message key="sbox.view"/></a>
       <a href="#" id='quickEdit' class='action'
-      onclick="SearchBox.navigate( '<wiki:Link format="url" context="edit" page="__PAGEHERE__"/>','<fmt:message key="sbox.edit.title"/>' );"
+      onclick="SearchBox.navigate( '<wiki:Link format="url" context="edit" page="Main"/>','<fmt:message key="sbox.edit.title"/>' );"
         title="<fmt:message key="sbox.edit.title"/>"><fmt:message key="sbox.edit"/></a>
       <a href="#" id='quickClone' class='action'	
-      onclick="return SearchBox.navigate( '<wiki:Link format="url" page="__PAGEHERE__" context="edit" />', '<fmt:message key="sbox.clone.title"/>', true );"
+      onclick="return SearchBox.navigate( '<wiki:Link format="url" page="Main" context="edit" />', '<fmt:message key="sbox.clone.title"/>', true );"
         title="<fmt:message key="sbox.clone.title"/>"><fmt:message key="sbox.clone"/></a>
       <a href="#" id="advancedSearch" class='action'
-      onclick="SearchBox.navigate( '<wiki:BaseURL />Search.jsp?query=__PAGEHERE__','<wiki:Variable var="pagename"/>' )"
+      onclick="SearchBox.navigate( '<wiki:BaseURL />Search.jsp?query=Main','<wiki:Variable var="pagename"/>' )"
         title="<fmt:message key="sbox.find.title"/> [ f ]"><fmt:message key="sbox.find"/></a>
     </div>
     <div id="searchResult">

Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/commonheader.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/commonheader.jsp?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/commonheader.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/commonheader.jsp Thu Apr 16 12:04:31 2009
@@ -32,7 +32,7 @@
 <wiki:IncludeResources type="script" />
 <meta name="wikiContext" content='${wikiContext.requestContext}' />
 <meta name="wikiBaseUrl" content='<wiki:BaseURL/>' />
-<meta name="wikiPageUrl" content='<wiki:Link format="url" page="#$%" />' />
+<meta name="wikiPageUrl" content='<wiki:Link format="url" page="${wikiContext.page.name}" />' />
 <meta name="wikiEditUrl" content='<wiki:EditLink format="url" />' />
 <meta name="wikiJsonUrl" content='<%=  WikiContextFactory.findContext(pageContext).getURL( WikiContext.NONE, "JSON-RPC" ) %>' /><%--unusual pagename--%>
 <meta name="wikiPageName" content='<wiki:Variable var="pagename" />' /><%--pagename without blanks--%>

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java Thu Apr 16 12:04:31 2009
@@ -49,7 +49,7 @@
 
 public class JCRWikiPage
     implements Cloneable,
-               Comparable, WikiPage, Attachment
+               Comparable<Object>, WikiPage, Attachment
 {
     private static final long serialVersionUID = 1L;
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java Thu Apr 16 12:04:31 2009
@@ -34,6 +34,7 @@
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;
 import org.apache.wiki.modules.ModuleManager;
+import org.apache.wiki.modules.WikiModuleInfo;
 import org.apache.wiki.providers.ProviderException;
 import org.apache.wiki.providers.WikiPageProvider;
 
@@ -128,7 +129,7 @@
      *  @return A Collection of WikiPage objects.
      *  @throws ProviderException If the backend has problems.
      */
-    public Collection getAllPages()
+    public Collection<WikiPage> getAllPages()
         throws ProviderException
     {
         return m_engine.getContentManager().getAllPages(null);
@@ -242,7 +243,7 @@
      *          an empty list.
      *  @since 2.0.22.
      */
-    public List getActiveLocks()
+    public List<PageLock> getActiveLocks()
     {
         return m_engine.getContentManager().getActiveLocks();
     }
@@ -273,7 +274,7 @@
      *  @throws PageNotFoundException if the wiki page cannot be found
      *  @throws ProviderException If the repository fails.
      */
-    public List getVersionHistory( String pageName )
+    public List<WikiPage> getVersionHistory( String pageName )
         throws PageNotFoundException, ProviderException
     {
         return m_engine.getContentManager().getVersionHistory( WikiPath.valueOf( pageName ) );
@@ -366,7 +367,7 @@
      *  {@inheritDoc}
      */
     @Override
-    public Collection modules()
+    public Collection<WikiModuleInfo> modules()
     {
         // TODO Auto-generated method stub
         return null;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Thu Apr 16 12:04:31 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "101";
+    public static final String     BUILD         = "102";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/VariableManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/VariableManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/VariableManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/VariableManager.java Thu Apr 16 12:04:31 2009
@@ -467,10 +467,9 @@
         {
             StringBuilder res = new StringBuilder();
 
-            for( Iterator i = m_context.getEngine().getAllInterWikiLinks().iterator(); i.hasNext(); )
+            for( String link : m_context.getEngine().getAllInterWikiLinks() )
             {
                 if( res.length() > 0 ) res.append(", ");
-                String link = (String) i.next();
                 res.append( link );
                 res.append( " --> " );
                 res.append( m_context.getEngine().getInterWikiURL(link) );    
@@ -482,11 +481,9 @@
         {
             StringBuilder res = new StringBuilder();
 
-            for( Iterator i = m_context.getEngine().getAllInlinedImagePatterns().iterator(); i.hasNext(); )
+            for( String ptrn : m_context.getEngine().getAllInlinedImagePatterns() )
             {
                 if( res.length() > 0 ) res.append(", ");
-
-                String ptrn = (String) i.next();
                 res.append(ptrn);
             }
 
@@ -540,15 +537,14 @@
 
         public String getPagefilters()
         {
-            List filters = m_context.getEngine().getFilterManager().getFilterList();
+            List<PageFilter> filters = m_context.getEngine().getFilterManager().getFilterList();
             StringBuilder sb = new StringBuilder();
 
-            for (Iterator i = filters.iterator(); i.hasNext();)
+            for (PageFilter filter : filters )
             {
-                PageFilter pf = (PageFilter) i.next();
-                String f = pf.getClass().getName();
+                String f = filter.getClass().getName();
 
-                if( pf instanceof InternalModule )
+                if( filter instanceof InternalModule )
                     continue;
 
                 if( sb.length() > 0 )

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java Thu Apr 16 12:04:31 2009
@@ -542,7 +542,7 @@
             m_nameResolvers.add( m_specialPageResolver );
             m_nameResolvers.add( new EnglishPluralsPageNameResolver( this ) );
             
-            Class urlclass = ClassUtil.findClass( "org.apache.wiki.url",
+            Class<?> urlclass = ClassUtil.findClass( "org.apache.wiki.url",
                     TextUtil.getStringProperty( props, PROP_URLCONSTRUCTOR, "DefaultURLConstructor" ) );
             m_urlConstructor = (URLConstructor) urlclass.newInstance();
             m_urlConstructor.initialize( this, props );
@@ -1219,8 +1219,6 @@
      */
     public boolean pageExists( String page )
     {
-        WikiPage att = null;
-
         WikiPath name = WikiPath.valueOf(page);
         try
         {

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java Thu Apr 16 12:04:31 2009
@@ -31,7 +31,6 @@
 
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.auth.permissions.PagePermission;
 import org.apache.wiki.content.PageNotFoundException;
 import org.apache.wiki.log.Logger;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java Thu Apr 16 12:04:31 2009
@@ -23,7 +23,6 @@
 
 import java.security.Principal;
 import java.text.MessageFormat;
-import java.util.Locale;
 import java.util.ResourceBundle;
 
 import javax.mail.AuthenticationFailedException;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java Thu Apr 16 12:04:31 2009
@@ -168,7 +168,6 @@
         // Get the file name, size etc from the FileBean
         InputStream data = filebean.getInputStream();
         String filename = filebean.getFileName();
-        int contentLength = (int)filebean.getSize();
         
         // Cleanse the file name
         filename = AttachmentManager.cleanFileName( filename );

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java Thu Apr 16 12:04:31 2009
@@ -22,8 +22,6 @@
 package org.apache.wiki.action;
 
 import java.lang.reflect.Method;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
@@ -56,7 +54,6 @@
 import org.apache.wiki.ui.stripes.HandlerInfo;
 import org.apache.wiki.ui.stripes.WikiActionBeanContext;
 import org.apache.wiki.url.StripesURLConstructor;
-import org.apache.wiki.util.TextUtil;
 
 
 /**

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/api/WikiEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/api/WikiEngine.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/api/WikiEngine.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/api/WikiEngine.java Thu Apr 16 12:04:31 2009
@@ -57,5 +57,5 @@
      * 
      *  @return An immutable iterator instance.
      */
-    public Iterator getAllConfigParameters();
+    public Iterator<String> getAllConfigParameters();
 }

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/UserManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/UserManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/UserManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/UserManager.java Thu Apr 16 12:04:31 2009
@@ -369,7 +369,7 @@
                 AuthenticationManager mgr = m_engine.getAuthenticationManager();
                 if ( newProfile && !mgr.isContainerAuthenticated() )
                 {
-                    mgr.login( session, profile.getLoginName(), profile.getPassword() );
+                    mgr.login( session, null, profile.getLoginName(), profile.getPassword() );
                 }
             }
             catch ( LoginException e )

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/login/WebContainerLoginModule.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/login/WebContainerLoginModule.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/login/WebContainerLoginModule.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/login/WebContainerLoginModule.java Thu Apr 16 12:04:31 2009
@@ -22,8 +22,6 @@
 
 import java.io.IOException;
 import java.security.Principal;
-import java.util.HashSet;
-import java.util.Set;
 
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.UnsupportedCallbackException;
@@ -32,10 +30,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 
-import org.apache.wiki.auth.Authorizer;
 import org.apache.wiki.auth.WikiPrincipal;
-import org.apache.wiki.auth.authorize.Role;
-import org.apache.wiki.auth.authorize.WebAuthorizer;
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java Thu Apr 16 12:04:31 2009
@@ -329,6 +329,7 @@
     /**
      *  Shuts down the ContentManager in a good fashion.
      */
+    @SuppressWarnings("unchecked")
     public void shutdown()
     {
         release();

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNotFoundException.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNotFoundException.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNotFoundException.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNotFoundException.java Thu Apr 16 12:04:31 2009
@@ -20,8 +20,6 @@
  */
 package org.apache.wiki.content;
 
-import org.apache.wiki.providers.ProviderException;
-
 /**
  *  A particular kind of exception noting that the WikiPage or attachment 
  *  in question was not found.

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/diff/DifferenceManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/diff/DifferenceManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/diff/DifferenceManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/diff/DifferenceManager.java Thu Apr 16 12:04:31 2009
@@ -72,7 +72,7 @@
 
         try
         {
-            Class providerClass = ClassUtil.findClass( "org.apache.wiki.diff", providerClassName );
+            Class<?> providerClass = ClassUtil.findClass( "org.apache.wiki.diff", providerClassName );
             m_provider = (DiffProvider)providerClass.newInstance();
         }
         catch( ClassNotFoundException e )

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/event/WikiEventManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/event/WikiEventManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/event/WikiEventManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/event/WikiEventManager.java Thu Apr 16 12:04:31 2009
@@ -277,7 +277,7 @@
      * @return an unmodifiable Set containing the WikiEventListeners attached to the client
      * @throws java.lang.UnsupportedOperationException  if any attempt is made to modify the Set
      */
-    public static final Set getWikiEventListeners( Object client )
+    public static final Set<WikiEventListener> getWikiEventListeners( Object client )
         throws UnsupportedOperationException
     {
         WikiEventDelegate delegate = getInstance().getDelegateFor(client);
@@ -298,16 +298,14 @@
     {
         // get the Map.entry object for the entire Map, then check match on entry (listener)
         WikiEventManager mgr = getInstance();
-        Map sources = mgr.getDelegates();
+        Map<Object,WikiEventDelegate> sources = mgr.getDelegates();
         synchronized( sources )
         {
-            // get an iterator over the Map.Enty objects in the map
-            Iterator it = sources.entrySet().iterator();
-            while( it.hasNext() )
+            // Iterate over the Map.Enty objects in the map
+            for ( Map.Entry<Object, WikiEventDelegate> entry : sources.entrySet() )
             {
-                Map.Entry entry = (Map.Entry)it.next();
                 // the entry value is the delegate
-                WikiEventDelegate delegate = (WikiEventDelegate)entry.getValue();
+                WikiEventDelegate delegate = entry.getValue();
 
                 // now see if we can remove the listener from the delegate
                 // (delegate may be null because this is a weak reference)
@@ -357,7 +355,7 @@
     /**
      *  Return the client-to-delegate Map.
      */
-    private Map getDelegates()
+    private Map<Object,WikiEventDelegate> getDelegates()
     {
         return m_delegates;
     }
@@ -438,7 +436,7 @@
 
         private ArrayList<WeakReference<WikiEventListener>> m_listenerList = new ArrayList<WeakReference<WikiEventListener>>();
 
-        private Class  m_class  = null;
+        private Class<?>  m_class  = null;
 
         /**
          *  Constructor for an WikiEventDelegateImpl, provided
@@ -450,7 +448,7 @@
         {
             if( client instanceof Class )
             {
-                m_class = (Class)client;
+                m_class = (Class<?>)client;
             }
         }
 
@@ -458,7 +456,7 @@
          *  Returns the class of the client-less delegate, null if
          *  this delegate is attached to a client Object.
          */
-        protected Class getClientClass()
+        protected Class<?> getClientClass()
         {
             return m_class;
         }
@@ -472,16 +470,15 @@
          * @return an unmodifiable Set containing this delegate's WikiEventListeners
          * @throws java.lang.UnsupportedOperationException  if any attempt is made to modify the Set
          */
-        public Set getWikiEventListeners()
+        public Set<WikiEventListener> getWikiEventListeners()
         {
             synchronized( m_listenerList )
             {
                 TreeSet<WikiEventListener> set = new TreeSet<WikiEventListener>( new WikiEventListenerComparator() );
 
-                for( Iterator i = m_listenerList.iterator(); i.hasNext(); )
+                for( WeakReference<WikiEventListener> ref : m_listenerList )
                 {
-                    WikiEventListener l = (WikiEventListener) ((WeakReference)i.next()).get();
-
+                    WikiEventListener l = ref.get();
                     if( l != null )
                     {
                         set.add( l );
@@ -518,9 +515,9 @@
         {
             synchronized( m_listenerList )
             {
-                for( Iterator i = m_listenerList.iterator(); i.hasNext(); )
+                for( Iterator<WeakReference<WikiEventListener>> i = m_listenerList.iterator(); i.hasNext(); )
                 {
-                    WikiEventListener l = (WikiEventListener) ((WeakReference)i.next()).get();
+                    WikiEventListener l = i.next().get();
 
                     if( l == listener )
                     {
@@ -561,7 +558,7 @@
                 {
                     for( int i = 0; i < m_listenerList.size(); i++ )
                     {
-                        WikiEventListener listener = (WikiEventListener) ((WeakReference)m_listenerList.get(i)).get();
+                        WikiEventListener listener = m_listenerList.get(i).get();
 
                         if( listener != null )
                         {
@@ -580,7 +577,7 @@
                     {
                         for( int i = 0; i < m_listenerList.size(); i++ )
                         {
-                            WeakReference w = m_listenerList.get(i);
+                            WeakReference<WikiEventListener> w = m_listenerList.get(i);
 
                             if( w.get() == null ) m_listenerList.remove(i--);
                         }

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/FilterManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/FilterManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/FilterManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/FilterManager.java Thu Apr 16 12:04:31 2009
@@ -166,7 +166,7 @@
             
             int priority = 0; // FIXME: Currently fixed.
 
-            Class cl = ClassUtil.findClass( "org.apache.wiki.filters",
+            Class<?> cl = ClassUtil.findClass( "org.apache.wiki.filters",
                                             className );
 
             PageFilter filter = (PageFilter)cl.newInstance();
@@ -282,9 +282,9 @@
         
         XPath xpath = XPath.newInstance("/pagefilters/filter");
     
-        List nodes = xpath.selectNodes( doc );
+        List<?> nodes = xpath.selectNodes( doc );
         
-        for( Iterator i = nodes.iterator(); i.hasNext(); )
+        for( Iterator<?> i = nodes.iterator(); i.hasNext(); )
         {
             Element f = (Element) i.next();
             
@@ -292,9 +292,9 @@
 
             Properties props = new Properties();
             
-            List params = f.getChildren("param");
+            List<?> params = f.getChildren("param");
             
-            for( Iterator par = params.iterator(); par.hasNext(); )
+            for( Iterator<?> par = params.iterator(); par.hasNext(); )
             {
                 Element p = (Element) par.next();
                 
@@ -322,10 +322,8 @@
     {
         fireEvent( WikiPageEvent.PRE_TRANSLATE_BEGIN, context );
 
-        for( Iterator i = m_pageFilters.iterator(); i.hasNext(); )
+        for( PageFilter f : m_pageFilters )
         {
-            PageFilter f = (PageFilter) i.next();
-
             pageData = f.preTranslate( context, pageData );
         }
 
@@ -348,10 +346,8 @@
     {
         fireEvent( WikiPageEvent.POST_TRANSLATE_BEGIN, context );
 
-        for( Iterator i = m_pageFilters.iterator(); i.hasNext(); )
+        for( PageFilter f : m_pageFilters )
         {
-            PageFilter f = (PageFilter) i.next();
-
             htmlData = f.postTranslate( context, htmlData );
         }
 
@@ -374,10 +370,8 @@
     {
         fireEvent( WikiPageEvent.PRE_SAVE_BEGIN, context );
 
-        for( Iterator i = m_pageFilters.iterator(); i.hasNext(); )
+        for( PageFilter f : m_pageFilters )
         {
-            PageFilter f = (PageFilter) i.next();
-
             pageData = f.preSave( context, pageData );
         }
 
@@ -400,10 +394,8 @@
     {
         fireEvent( WikiPageEvent.POST_SAVE_BEGIN, context );
 
-        for( Iterator i = m_pageFilters.iterator(); i.hasNext(); )
+        for( PageFilter f : m_pageFilters )
         {
-            PageFilter f = (PageFilter) i.next();
-
             // log.info("POSTSAVE: "+f.toString() );
             f.postSave( context, pageData );
         }
@@ -429,10 +421,8 @@
      */
     public void destroy()
     {
-        for( Iterator i = m_pageFilters.iterator(); i.hasNext(); )
+        for( PageFilter f : m_pageFilters )
         {
-            PageFilter f = (PageFilter) i.next();
-
             f.destroy( m_engine );
         }        
     }

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/PingWeblogsComFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/PingWeblogsComFilter.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/PingWeblogsComFilter.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/PingWeblogsComFilter.java Thu Apr 16 12:04:31 2009
@@ -98,11 +98,12 @@
                                         log.error("Unable to execute weblogs.com ping to URL: "+url.toString(),ex);
                                     }
 
+                                    @SuppressWarnings("unchecked")
                                     public void handleResult( Object result,
                                                               URL url,
                                                               String method )
                                     {
-                                        Hashtable res = (Hashtable) result;
+                                        Hashtable<String,Object> res = (Hashtable<String,Object>) result;
 
                                         Boolean flerror = (Boolean)res.get("flerror");
                                         String  msg     = (String)res.get("message");

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java Thu Apr 16 12:04:31 2009
@@ -463,9 +463,9 @@
 
             long time = System.currentTimeMillis()-60*1000L; // 1 minute
 
-            for( Iterator i = m_lastModifications.iterator(); i.hasNext(); )
+            for( Iterator<Host> i = m_lastModifications.iterator(); i.hasNext(); )
             {
-                Host host = (Host)i.next();
+                Host host = i.next();
 
                 //
                 //  Check if this item is invalid
@@ -723,9 +723,9 @@
     {
         long now = System.currentTimeMillis();
 
-        for( Iterator i = m_temporaryBanList.iterator(); i.hasNext(); )
+        for( Iterator<Host> i = m_temporaryBanList.iterator(); i.hasNext(); )
         {
-            Host host = (Host)i.next();
+            Host host = i.next();
 
             if( host.getReleaseTime() < now )
             {
@@ -753,10 +753,8 @@
 
             long now = System.currentTimeMillis();
 
-            for( Iterator i = m_temporaryBanList.iterator(); i.hasNext(); )
+            for( Host host : m_temporaryBanList )
             {
-                Host host = (Host)i.next();
-
                 if( host.getAddress().equals(remote) )
                 {
                     long timeleft = (host.getReleaseTime() - now) / 1000L;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/PersistentMapDecorator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/PersistentMapDecorator.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/PersistentMapDecorator.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/PersistentMapDecorator.java Thu Apr 16 12:04:31 2009
@@ -31,18 +31,18 @@
  * 
  * @author Sebastian Baltes (sbaltes@gmx.com)
  */
-public class PersistentMapDecorator extends Properties
+public class PersistentMapDecorator<K,V> extends Properties
 {
     private static final long serialVersionUID = 0L;
     
-    private Map m_delegate;
+    private Map<K,V> m_delegate;
 
     /**
      *  Creates a new decorator for a given map.
      *  
      *  @param delegate The map to create a decorator for.
      */
-    public PersistentMapDecorator( Map delegate )
+    public PersistentMapDecorator( Map<K,V> delegate )
     {
         m_delegate = delegate;
     }
@@ -137,7 +137,7 @@
     @Override
     public Object put( Object arg0, Object arg1 )
     {
-        return m_delegate.put( arg0, arg1 );
+        return m_delegate.put( (K)arg0, (V)arg1 );
     }
 
     /**

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java Thu Apr 16 12:04:31 2009
@@ -26,7 +26,6 @@
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -141,7 +140,7 @@
                 // accomodate a FCKeditor bug with Firefox: when a link is removed, it becomes <span class="wikipage">text</span>.
                 boolean ignoredCssClass = cssClass != null && cssClass.matches( "wikipage|createpage|external|interwiki|attachment" );
 
-                Map styleProps = null;
+                Map<String,String> styleProps = null;
 
                 // Only get the styles if it's not a link element. Styles for link elements are
                 // handled as an AugmentedWikiLink instead.
@@ -152,8 +151,8 @@
 
                 if( styleProps != null )
                 {
-                    String fontFamily = (String)styleProps.get( "font-family" );
-                    String whiteSpace = (String)styleProps.get( "white-space" );
+                    String fontFamily = styleProps.get( "font-family" );
+                    String whiteSpace = styleProps.get( "white-space" );
                     if( fontFamily != null && ( fontFamily.indexOf( "monospace" ) >= 0
                             && whiteSpace != null && whiteSpace.indexOf( "pre" ) >= 0  ) )
                     {
@@ -162,8 +161,8 @@
                         monospace = true;
                     }
 
-                    String weight = (String)styleProps.remove( "font-weight" );
-                    String style = (String)styleProps.remove( "font-style" );
+                    String weight = styleProps.remove( "font-weight" );
+                    String style = styleProps.remove( "font-style" );
 
                     if( n.equals( "p" ) )
                     {
@@ -255,9 +254,8 @@
 
     private void printChildren( Element base ) throws IOException, JDOMException
     {
-        for( Iterator i = base.getContent().iterator(); i.hasNext(); )
+        for( Object c : base.getContent() )
         {
-            Object c = i.next();
             if( c instanceof Element )
             {
                 Element e = (Element)c;
@@ -396,7 +394,7 @@
                                     }
                                     else
                                     {
-                                        Map augmentedWikiLinkAttributes = getAugmentedWikiLinkAttributes( e );
+                                        Map<String,String> augmentedWikiLinkAttributes = getAugmentedWikiLinkAttributes( e );
 
                                         m_out.print( "[" );
                                         print( e );
@@ -730,9 +728,8 @@
         if( map.size() > 0 )
         {
             m_out.print( "[{Image src='" + src + "'" );
-            for( Iterator i = map.entrySet().iterator(); i.hasNext(); )
+            for( Map.Entry<Object,Object> entry : map.entrySet() )
             {
-                Map.Entry entry = (Map.Entry)i.next();
                 if( !entry.getValue().equals( "" ) )
                 {
                     m_out.print( " " + entry.getKey() + "='" + entry.getValue() + "'" );
@@ -751,12 +748,11 @@
         return s == null ? null : (s.replaceAll( "\\s", "" ).length() == 0 ? null : s);
     }
 
-    private String propsToStyleString( Map styleProps )
+    private String propsToStyleString( Map<String,String> styleProps )
     {
         StringBuilder style = new StringBuilder();
-        for( Iterator i = styleProps.entrySet().iterator(); i.hasNext(); )
+        for( Map.Entry<String, String>entry : styleProps.entrySet() )
         {
-            Map.Entry entry = (Map.Entry)i.next();
             style.append( " " ).append( entry.getKey() ).append( ": " ).append( entry.getValue() ).append( ";" );
         }
         return style.toString();
@@ -783,7 +779,7 @@
     /**
      *  Returns a Map containing the valid augmented wiki link attributes.
      */
-    private Map getAugmentedWikiLinkAttributes( Element a )
+    private Map<String,String> getAugmentedWikiLinkAttributes( Element a )
     {
         Map<String,String> attributesMap = new HashMap<String,String>();
 
@@ -878,15 +874,14 @@
     /**
      * Converts the entries in the map to a string for use in a wiki link.
      */
-    private String augmentedWikiLinkMapToString( Map attributesMap )
+    private String augmentedWikiLinkMapToString( Map<String,String> attributesMap )
     {
         StringBuilder sb = new StringBuilder();
 
-        for ( Iterator itr = attributesMap.entrySet().iterator(); itr.hasNext(); )
+        for ( Map.Entry<String, String> entry : attributesMap.entrySet() )
         {
-            Map.Entry entry = (Map.Entry)itr.next();
-            String attributeName = (String)entry.getKey();
-            String attributeValue = (String)entry.getValue();
+            String attributeName = entry.getKey();
+            String attributeValue = entry.getValue();
 
             sb.append( " " + attributeName + "='" + attributeValue + "'" );
         }
@@ -894,7 +889,7 @@
         return sb.toString().trim();
     }
 
-    private Map getStylePropertiesLowerCase( Element base ) throws IOException
+    private Map<String,String> getStylePropertiesLowerCase( Element base ) throws IOException
     {
         String n = base.getName().toLowerCase();
 
@@ -918,8 +913,6 @@
             }
         }
 
-
-
         if( n.equals( "font" ) )
         {
             String color = base.getAttributeValue( "color" );
@@ -972,8 +965,8 @@
         }
 
         style = style.replace( ';', '\n' ).toLowerCase();
-        LinkedHashMap m = new LinkedHashMap();
-        new PersistentMapDecorator( m ).load( new ByteArrayInputStream( style.getBytes() ) );
+        LinkedHashMap<String,String> m = new LinkedHashMap<String,String>();
+        new PersistentMapDecorator<String,String>( m ).load( new ByteArrayInputStream( style.getBytes() ) );
         return m;
     }
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/PluginManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/PluginManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/PluginManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/PluginManager.java Thu Apr 16 12:04:31 2009
@@ -277,7 +277,7 @@
     private Class<? extends WikiPlugin> findPluginClass( String classname )
         throws ClassNotFoundException
     {
-        return ClassUtil.findClass( m_searchPath, classname );
+        return (Class<WikiPlugin>)ClassUtil.findClass( m_searchPath, classname );
     }
 
     /**

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java Thu Apr 16 12:04:31 2009
@@ -29,7 +29,6 @@
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.PluginException;
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.i18n.InternationalizationManager;
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;
@@ -222,7 +221,8 @@
                 }
                 catch( ProviderException e )
                 {
-                    // FIXME: Not sure what should go here.
+                	// Rethrow any exceptions if isAttachment() fails.
+                    throw new PluginException( "Could not determine whether WikiPage " + pageref.getName() + " is an attachment.", e );
                 }
                 
                 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/providers/WikiPageProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/providers/WikiPageProvider.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/providers/WikiPageProvider.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/providers/WikiPageProvider.java Thu Apr 16 12:04:31 2009
@@ -65,7 +65,6 @@
      *  @param page The page name.
      *  @return true, if the page exists; false otherwise.
      */
-
     public boolean pageExists( String page );
 
     /**
@@ -78,7 +77,7 @@
      *  @param query An array of QueryItems to match
      *  @return A Collection of WikiPages.
      */
-    public Collection findPages( QueryItem[] query );
+    public Collection<WikiPage> findPages( QueryItem[] query );
 
     /**
      *  Returns info about the page.
@@ -98,8 +97,7 @@
      *  @return A collection of WikiPages
      *  @throws ProviderException If something goes wrong.
      */
-
-    public Collection getAllPages()
+    public Collection<WikiPage> getAllPages()
         throws ProviderException;
 
     /**
@@ -109,8 +107,7 @@
      *  @return A Collection of WikiPages
      *  @since 1.6.4
      */
-
-    public Collection getAllChangedSince( Date date );
+    public Collection<WikiPage> getAllChangedSince( Date date );
 
     /**
      *  Gets the number of pages.
@@ -119,7 +116,6 @@
      *  @throws ProviderException If something goes wrong
      *  @since 1.6.4
      */
-
     public int getPageCount()
         throws ProviderException;
 
@@ -131,8 +127,7 @@
      *  @return A collection of WikiPages.
      *  @throws ProviderException If something goes wrong.
      */
-
-    public List getVersionHistory( String page )
+    public List<WikiPage> getVersionHistory( String page )
         throws ProviderException;
 
     /**
@@ -144,7 +139,6 @@
      *  @return The content of the page, or null, if the page does not exist.
      *  @throws ProviderException If something goes wrong.
      */
-
     public String getPageText( String page, int version )
         throws ProviderException;
 
@@ -160,7 +154,6 @@
      *
      *  @throws ProviderException If the page cannot be removed for some reason.
      */
-
     public void deleteVersion( String pageName, int version )
         throws ProviderException;
 
@@ -185,7 +178,6 @@
      */
     public void deletePage( String pageName )
         throws ProviderException;
-
      
      /**
       * Move a page

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CleanTextRenderer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CleanTextRenderer.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CleanTextRenderer.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CleanTextRenderer.java Thu Apr 16 12:04:31 2009
@@ -21,7 +21,6 @@
 package org.apache.wiki.render;
 
 import java.io.IOException;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.wiki.WikiContext;
@@ -70,12 +69,10 @@
         {
             XPath xp = XPath.newInstance( ALL_TEXT_NODES );
         
-            List nodes = xp.selectNodes(m_document.getDocument());
+            List<?> nodes = xp.selectNodes(m_document.getDocument());
             
-            for( Iterator i = nodes.iterator(); i.hasNext(); )
+            for( Object el : nodes )
             {
-                Object el = i.next();
-                
                 if( el instanceof Text )
                 {
                     sb.append( ((Text)el).getValue() );

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CreoleRenderer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CreoleRenderer.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CreoleRenderer.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/render/CreoleRenderer.java Thu Apr 16 12:04:31 2009
@@ -152,7 +152,7 @@
         //
         //  Go through the children
         //
-        for( Iterator i = ce.getContent().iterator(); i.hasNext(); )
+        for( Iterator<?> i = ce.getContent().iterator(); i.hasNext(); )
         {
             Content c = (Content)i.next();
             

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/render/RenderingManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/render/RenderingManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/render/RenderingManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/render/RenderingManager.java Thu Apr 16 12:04:31 2009
@@ -93,7 +93,7 @@
     /**
      *
      */
-    private         Constructor m_rendererConstructor;
+    private         Constructor<?> m_rendererConstructor;
 
     /**
      *  Name of the WikiContext variable which is set to Boolean.TRUE or Boolean.FALSE
@@ -146,10 +146,10 @@
         {
             renderImplName = DEFAULT_RENDERER;
         }
-        Class[] rendererParams = { WikiContext.class, WikiDocument.class };
+        Class<?>[] rendererParams = { WikiContext.class, WikiDocument.class };
         try
         {
-            Class c = Class.forName( renderImplName );
+            Class<?> c = Class.forName( renderImplName );
             m_rendererConstructor = c.getConstructor( rendererParams );
         }
         catch( ClassNotFoundException e )
@@ -353,12 +353,10 @@
                     //
                     if( referringPages != null )
                     {
-                        Iterator i = referringPages.iterator();
-                        while (i.hasNext())
+                        for ( WikiPath path : referringPages )
                         {
-                            WikiPath page = (WikiPath) i.next();
-                            if( log.isDebugEnabled() ) log.debug( "Flushing " + page );
-                            m_documentCache.flushPattern( page.toString() );
+                            if( log.isDebugEnabled() ) log.debug( "Flushing " + path );
+                            m_documentCache.flushPattern( path.toString() );
                         }
                     }
                 }

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/render/WysiwygEditingRenderer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/render/WysiwygEditingRenderer.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/render/WysiwygEditingRenderer.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/render/WysiwygEditingRenderer.java Thu Apr 16 12:04:31 2009
@@ -22,7 +22,6 @@
 
 import java.io.IOException;
 import java.io.StringWriter;
-import java.util.Iterator;
 
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.htmltowiki.XHtmlToWikiConfig;
@@ -72,9 +71,8 @@
      */
     private void processChildren(Element baseElement)
     {
-        for( Iterator itr = baseElement.getChildren().iterator(); itr.hasNext(); )
+        for( Object childElement : baseElement.getChildren() )
         {
-            Object childElement = itr.next();
             if( childElement instanceof Element )
             {
                 Element element = (Element)childElement;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/rpc/json/JSONRPCManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/rpc/json/JSONRPCManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/rpc/json/JSONRPCManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/rpc/json/JSONRPCManager.java Thu Apr 16 12:04:31 2009
@@ -24,7 +24,6 @@
 import java.lang.reflect.Method;
 import java.security.Permission;
 import java.util.HashMap;
-import java.util.Iterator;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
@@ -201,10 +200,8 @@
                 
                 WikiEngine e = WikiEngine.getInstance( req.getSession().getServletContext(), null );
                
-                for( Iterator i = c_globalObjects.values().iterator(); i.hasNext(); )
+                for( CallbackContainer cc : c_globalObjects.values() )
                 {
-                    CallbackContainer cc = (CallbackContainer) i.next();
-                    
                     if( cc.m_object == instance )
                     {
                         canDo = e.getAuthorizationManager().checkPermission( WikiSession.getWikiSession(e, req), 
@@ -290,10 +287,8 @@
         
         bridge.registerCallback( acc, HttpServletRequest.class );
         
-        for( Iterator i = c_globalObjects.values().iterator(); i.hasNext(); )
+        for( CallbackContainer cc : c_globalObjects.values() )
         {
-            CallbackContainer cc = (CallbackContainer) i.next();
-       
             bridge.registerObject( cc.m_id, cc.m_object );
         }
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/AtomFeed.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/AtomFeed.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/AtomFeed.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/AtomFeed.java Thu Apr 16 12:04:31 2009
@@ -25,7 +25,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
-import java.util.Iterator;
 
 import javax.servlet.ServletContext;
 
@@ -81,7 +80,7 @@
         return e.getURL(); // FIXME: Not really a feed id!
     }
 
-    private Collection getItems()
+    private Collection<Element> getItems()
     {
         ArrayList<Element> list = new ArrayList<Element>();
 
@@ -91,18 +90,14 @@
         if( m_wikiContext.getHttpRequest() != null )
             servletContext = m_wikiContext.getHttpRequest().getSession().getServletContext();
 
-        for( Iterator i = m_entries.iterator(); i.hasNext(); )
+        for( Entry e : m_entries )
         {
-            Entry e = (Entry)i.next();
-
             WikiPage p = e.getPage();
-
             Element entryEl = getElement("entry");
 
             //
             //  Mandatory elements
             //
-
             entryEl.addContent( getElement("id").setText( getEntryID(e)) );
             entryEl.addContent( getElement("title").setAttribute("type","html").setText( e.getTitle() ));
             entryEl.addContent( getElement("updated").setText( DateFormatUtils.formatUTC(p.getLastModified(),
@@ -110,7 +105,6 @@
             //
             //  Optional elements
             //
-
             entryEl.addContent( getElement("author").addContent( getElement("name").setText( e.getAuthor() )));
             entryEl.addContent( getElement("link").setAttribute("rel","alternate").setAttribute("href",e.getURL()));
             entryEl.addContent( getElement("content").setAttribute("type","html").setText( e.getContent() ));
@@ -118,16 +112,15 @@
             //
             //  Check for enclosures
             //
-
             if( engine.getAttachmentManager().hasAttachments(p) && servletContext != null )
             {
                 try
                 {
-                    Collection c = engine.getAttachmentManager().listAttachments(p);
+                    Collection<WikiPage> c = engine.getAttachmentManager().listAttachments(p);
 
-                    for( Iterator a = c.iterator(); a.hasNext(); )
+                    for( WikiPage page : c )
                     {
-                        Attachment att = (Attachment) a.next();
+                        Attachment att = (Attachment) page;
 
                         Element attEl = getElement("link");
                         attEl.setAttribute( "rel","enclosure" );
@@ -162,10 +155,8 @@
 
         Date lastModified = new Date(0L);
 
-        for( Iterator i = m_entries.iterator(); i.hasNext(); )
+        for( Entry e : m_entries )
         {
-            Entry e = (Entry)i.next();
-
             if( e.getPage().getLastModified().after(lastModified) )
                 lastModified = e.getPage().getLastModified();
         }

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS10Feed.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS10Feed.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS10Feed.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS10Feed.java Thu Apr 16 12:04:31 2009
@@ -22,7 +22,6 @@
 
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
-import java.util.Iterator;
 
 import org.apache.ecs.xml.XML;
 import org.apache.wiki.WikiContext;
@@ -53,12 +52,9 @@
         
         XML rdfseq = new XML( "rdf:Seq" );
         
-        for( Iterator i = m_entries.iterator(); i.hasNext(); )
+        for( Entry e : m_entries )
         {
-            Entry e = (Entry)i.next();
-
             String url = e.getURL();
-
             rdfseq.addElement( new XML("rdf:li").addAttribute( "rdf:resource", url ) );
         }
         
@@ -73,10 +69,8 @@
         
         WikiEngine engine = m_wikiContext.getEngine();
         
-        for( Iterator i = m_entries.iterator(); i.hasNext(); )
+        for( Entry e : m_entries )
         {
-            Entry e = (Entry)i.next();
-            
             String url = e.getURL();
             
             XML item = new XML( "item" );

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS20Feed.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS20Feed.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS20Feed.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSS20Feed.java Thu Apr 16 12:04:31 2009
@@ -56,7 +56,7 @@
         super( context );
     }
 
-    private List getItems()
+    private List<Element> getItems()
     {
         ArrayList<Element> list = new ArrayList<Element>();
         SimpleDateFormat fmt = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'");
@@ -67,9 +67,8 @@
         if( m_wikiContext.getHttpRequest() != null )
             servletContext = m_wikiContext.getHttpRequest().getSession().getServletContext();
 
-        for( Iterator i = m_entries.iterator(); i.hasNext(); )
+        for( Entry e : m_entries )
         {
-            Entry e = (Entry)i.next();
             WikiPage p = e.getPage();
 
             String url = e.getURL();
@@ -90,11 +89,11 @@
             {
                 try
                 {
-                    Collection c = engine.getAttachmentManager().listAttachments(p);
+                    Collection<WikiPage> c = engine.getAttachmentManager().listAttachments(p);
 
-                    for( Iterator a = c.iterator(); a.hasNext(); )
+                    for( WikiPage page : c )
                     {
-                        Attachment att = (Attachment) a.next();
+                        Attachment att = (Attachment)page;
 
                         Element attEl = new Element("enclosure");
                         attEl.setAttribute( "url", engine.getURL(WikiContext.ATTACH, att.getName(), null, true ) );

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSSGenerator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSSGenerator.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSSGenerator.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/rss/RSSGenerator.java Thu Apr 16 12:04:31 2009
@@ -25,7 +25,6 @@
 import org.apache.wiki.*;
 import org.apache.wiki.api.WikiException;
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.auth.permissions.PagePermission;
 import org.apache.wiki.content.PageAlreadyExistsException;
 import org.apache.wiki.content.PageNotFoundException;
@@ -369,7 +368,7 @@
      * @throws ProviderException If the underlying provider failed.
      * @throws IllegalArgumentException If an illegal mode is given.
      */
-    public String generateFeed( WikiContext wikiContext, List changed, String mode, String type )
+    public String generateFeed( WikiContext wikiContext, List<WikiPage> changed, String mode, String type )
         throws ProviderException, IllegalArgumentException
     {
         Feed feed = null;
@@ -446,13 +445,13 @@
         feed.setChannelLanguage( m_channelLanguage );
         feed.setChannelDescription( m_channelDescription );
 
-        Collection changed = m_engine.getRecentChanges(wikiContext.getPage().getWiki());
+        Collection<WikiPage> changed = m_engine.getRecentChanges(wikiContext.getPage().getWiki());
 
         WikiSession session = WikiSession.guestSession( m_engine );
         int items = 0;
-        for( Iterator i = changed.iterator(); i.hasNext() && items < 15; items++ )
+        for( Iterator<WikiPage> i = changed.iterator(); i.hasNext() && items < 15; items++ )
         {
-            WikiPage page = (WikiPage) i.next();
+            WikiPage page = i.next();
 
             //
             //  Check if the anonymous user has view access to this page.

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/search/BasicSearchProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/search/BasicSearchProvider.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/search/BasicSearchProvider.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/search/BasicSearchProvider.java Thu Apr 16 12:04:31 2009
@@ -61,7 +61,7 @@
     /**
      *  {@inheritDoc}
      */
-    public void reindexPage(WikiPage page) {}
+    public void reindexPage(WikiPage page) throws ProviderException {}
 
     /**
      *  Parses a query into something that we can use.

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/search/SearchManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/search/SearchManager.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/search/SearchManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/search/SearchManager.java Thu Apr 16 12:04:31 2009
@@ -368,16 +368,9 @@
      *
      *   @param page The page.
      */
-    public void reindexPage(WikiPage page)
+    public void reindexPage(WikiPage page) throws ProviderException
     {
-        try
-        {
-            m_searchProvider.reindexPage(page);
-        }
-        catch( ProviderException e )
-        {
-            log.error( "Unable to index page", e );
-        }
+        m_searchProvider.reindexPage(page);
     }
 
     /**

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/IfNoSearchResultsTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/IfNoSearchResultsTag.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/IfNoSearchResultsTag.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/IfNoSearchResultsTag.java Thu Apr 16 12:04:31 2009
@@ -24,6 +24,8 @@
 import java.util.Collection;
 import javax.servlet.jsp.PageContext;
 
+import org.apache.wiki.search.SearchResult;
+
 /**
  *  If there have been no search results, then outputs the body text.
  *
@@ -34,10 +36,11 @@
 {
     private static final long serialVersionUID = 0L;
     
+    @SuppressWarnings("unchecked")
     public final int doWikiStartTag()
         throws IOException
     {
-        Collection list = (Collection)pageContext.getAttribute( "searchresults",
+        Collection<SearchResult> list = (Collection<SearchResult>)pageContext.getAttribute( "searchresults",
                                                                 PageContext.REQUEST_SCOPE );
         if( list == null || list.size() == 0 )
         {   

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java Thu Apr 16 12:04:31 2009
@@ -31,7 +31,6 @@
 
 import org.apache.wiki.*;
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.content.PageNotFoundException;
 import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.parser.JSPWikiMarkupParser;
@@ -315,19 +314,19 @@
         return url;
     }
 
-    private String addParamsForRecipient( String addTo, Map params )
+    private String addParamsForRecipient( String addTo, Map<String,String> params )
     {
         if( params == null || params.size() == 0 )
         {
             return addTo;
         }
         StringBuilder buf = new StringBuilder();
-        Iterator it = params.entrySet().iterator();
+        Iterator<Map.Entry<String,String>> it = params.entrySet().iterator();
         while( it.hasNext() )
         {
-            Map.Entry e = (Map.Entry) it.next();
-            String n = (String)e.getKey();
-            String v = (String)e.getValue();
+            Map.Entry<String,String> e = it.next();
+            String n = e.getKey();
+            String v = e.getValue();
             buf.append( n );
             buf.append( "=" );
             buf.append( v );

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToParentTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToParentTag.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToParentTag.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToParentTag.java Thu Apr 16 12:04:31 2009
@@ -24,7 +24,6 @@
 
 import org.apache.wiki.api.WikiException;
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.content.PageNotFoundException;
 
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToTag.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToTag.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkToTag.java Thu Apr 16 12:04:31 2009
@@ -26,7 +26,6 @@
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.api.WikiException;
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.content.PageNotFoundException;
 
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/PageTypeTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/PageTypeTag.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/PageTypeTag.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/PageTypeTag.java Thu Apr 16 12:04:31 2009
@@ -23,7 +23,6 @@
 import java.io.IOException;
 
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.providers.ProviderException;
 
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/ParentPageNameTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/ParentPageNameTag.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/ParentPageNameTag.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/ParentPageNameTag.java Thu Apr 16 12:04:31 2009
@@ -24,7 +24,6 @@
 
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.content.PageNotFoundException;
 import org.apache.wiki.providers.ProviderException;
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/DefaultWikiContext.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/DefaultWikiContext.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/DefaultWikiContext.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/DefaultWikiContext.java Thu Apr 16 12:04:31 2009
@@ -59,6 +59,14 @@
     private String m_requestContext = null;
 
     private WikiSession m_session = null;
+    
+    /**
+     * No-argument constructor for the DefaultWikiContext class.
+     */
+    public DefaultWikiContext()
+    {
+        super();
+    }
 
     /**
      * Stores the HttpServletRequest. May be null, if the request did not come

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiInterceptor.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiInterceptor.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiInterceptor.java Thu Apr 16 12:04:31 2009
@@ -47,12 +47,14 @@
  * <p>
  * Stripes {@link net.sourceforge.stripes.controller.Interceptor} that
  * instantiates the correct WikiContext associated with JSPs, checks for access,
- * and redirects users if necessary. The interceptor executes twice: the first
+ * and redirects users if necessary. The interceptor executes three times: the first
  * time is after the first lifecycle state, <em>aka</em>
  * {@link  net.sourceforge.stripes.controller.LifecycleStage#ActionBeanResolution}
  * but before the second stage.
  * {@link net.sourceforge.stripes.controller.LifecycleStage#HandlerResolution}.
- * The second time the interceptor executes is after the third lifecycle stage,
+ * The second time the interceptor executes is after the second lifecycle stage,
+ * {@link net.sourceforge.stripes.controller.LifecycleStage#HandlerResolution}.
+ * The third time the interceptor executes is after the third lifecycle stage,
  * aka
  * {@link net.sourceforge.stripes.controller.LifecycleStage#BindingAndValidation},
  * but before the fourth stage
@@ -90,7 +92,7 @@
  * 
  * @author Andrew Jaquith
  */
-@Intercepts( { LifecycleStage.ActionBeanResolution, LifecycleStage.CustomValidation } )
+@Intercepts( { LifecycleStage.ActionBeanResolution, LifecycleStage.HandlerResolution, LifecycleStage.CustomValidation } )
 public class WikiInterceptor implements Interceptor
 {
     private static final Logger log = LoggerFactory.getLogger( WikiInterceptor.class );
@@ -122,6 +124,10 @@
         {
             return interceptAfterActionBeanResolution( context );
         }
+        else if( LifecycleStage.HandlerResolution.equals( context.getLifecycleStage() ) )
+        {
+            return interceptAfterHandlerResolution( context );
+        }
         else if( LifecycleStage.CustomValidation.equals( context.getLifecycleStage() ) )
         {
             return interceptAfterBindingAndValidation( context );
@@ -130,6 +136,39 @@
     }
 
     /**
+     * After the Stripes event handler method has been identified, this method
+     * sets the corresponding JSPWiki request context for the WikiContext.
+     * Because Stripes event handler methods correspond exactly one-to-one
+     * with pre-3.0 JSPWiki requests contexts, we allows Stripes to identify the
+     * handler method first, then make sure the WikiContext's context is synchronized.
+     * @param context the execution context
+     * @return always returns <code>null</code>
+     */
+    protected Resolution interceptAfterHandlerResolution( ExecutionContext context ) throws Exception
+    {
+        // Did the handler resolution stage return a Resolution? If so, bail.
+        Resolution r = context.proceed();
+        if( r != null )
+        {
+            return r;
+        }
+
+        // Get the event handler method
+        Method handler = context.getHandler();
+
+        // Make sure we set the WikiContext request context, while we're at it
+        WikiActionBean actionBean = (WikiActionBean) context.getActionBean();
+        Map<Method, HandlerInfo> eventinfos = HandlerInfo.getHandlerInfoCollection( actionBean.getClass() );
+        HandlerInfo eventInfo = eventinfos.get( handler );
+        if( eventInfo != null )
+        {
+            String requestContext = eventInfo.getRequestContext();
+            actionBean.getContext().setRequestContext( requestContext );
+        }
+        return null;
+    }
+
+    /**
      * After the Stripes
      * {@link net.sourceforge.stripes.controller.LifecycleStage#ActionBeanResolution}
      * executes, this method injects the current WikiEngine, WikiSession and
@@ -235,15 +274,8 @@
 
         // Get the event handler method
         Method handler = context.getHandler();
-
-        // Make sure we set the WikiContext request context, while we're at it
         Map<Method, HandlerInfo> eventinfos = HandlerInfo.getHandlerInfoCollection( actionBean.getClass() );
         HandlerInfo eventInfo = eventinfos.get( handler );
-        if( eventInfo != null )
-        {
-            String requestContext = eventInfo.getRequestContext();
-            actionBean.getContext().setRequestContext( requestContext );
-        }
 
         // Does the event handler have a required permission?
         boolean allowed = true;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiRuntimeConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiRuntimeConfiguration.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiRuntimeConfiguration.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/WikiRuntimeConfiguration.java Thu Apr 16 12:04:31 2009
@@ -29,29 +29,48 @@
 
 import net.sourceforge.stripes.config.RuntimeConfiguration;
 
-
 /**
  * Subclass of Stripes
- * {@link net.sourceforge.stripes.config.RuntimeConfiguration} that keeps a
- * reference to the running WikiEngine. This Configuration is loaded at startup
+ * {@link net.sourceforge.stripes.config.RuntimeConfiguration} that initializes
+ * Stripes and starts up the WikiEngine. This Configuration is loaded at startup
  * by the {@link net.sourceforge.stripes.controller.StripesFilter}, so it is
- * one of the very first things that happens. Because it loads first, it creates
- * the WikiEngine.
+ * one of the very first things that happens. The {@link #init()} method
+ * performs all of the initialization tasks. After initialization, the current
+ * StripesConfiguration can be retrieved at any time by calling {@link }.
  * 
  * @author Andrew Jaquith
  */
 public class WikiRuntimeConfiguration extends RuntimeConfiguration
 {
-    public static final String STRIPES_CONFIGURATION = "WikiRuntimeConfiguration";
+    private static final String STRIPES_CONFIGURATION = "WikiRuntimeConfiguration";
 
-    private static final Logger log = LoggerFactory.getLogger(WikiRuntimeConfiguration.class);
+    private static final Logger log = LoggerFactory.getLogger( WikiRuntimeConfiguration.class );
 
     private WikiEngine m_engine = null;
 
     /**
+     * Returns the Stripes WikiRuntimeConfiguration for a supplied
+     * ServletContext. Only one Stripes Configuration will be stored per
+     * ServletContext (and by implication, per WikiEngine).
+     * 
+     * @param context the servlet context
+     * @return the configuration
+     */
+    public static WikiRuntimeConfiguration getConfiguration( ServletContext context )
+    {
+        WikiRuntimeConfiguration config = (WikiRuntimeConfiguration) context.getAttribute( STRIPES_CONFIGURATION );
+        if( config != null )
+        {
+            return config;
+        }
+        throw new IllegalStateException( "WikiRuntimeConfiguration not found!" );
+    }
+
+    /**
      * Initializes the WikiRuntimeConfiguration by calling the superclass
      * {@link net.sourceforge.stripes.config.Configuration#init()} method, then
-     * setting the internally cached WikiEngine reference.
+     * starting the WikiEngine. This method also stashes the
+     * WikiRuntimeConfiguration in the ServletContext as an attribute.
      */
     @Override
     public void init()
@@ -59,14 +78,14 @@
         // Initialize the Stripes configuration
         super.init();
 
-        // Retrieve the WikiEngine
-        log.info("Attempting to retrieve WikiEngine.");
+        // Stash the Configuration so we can find it later
         ServletContext context = super.getServletContext();
-        m_engine = WikiEngine.getInstance(context, null);
-        log.info("WikiEngine is running.");
-        
-        // Stash the Configuration so JSPWiki (e.g., URLConstructors) can find it
         context.setAttribute( STRIPES_CONFIGURATION, this );
+
+        // Start the JSPWiki WikiEngine
+        log.info( "Attempting to start WikiEngine." );
+        m_engine = WikiEngine.getInstance( context, null );
+        log.info( "WikiEngine is running." );
     }
 
     /**

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/url/StripesURLConstructor.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/url/StripesURLConstructor.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/url/StripesURLConstructor.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/url/StripesURLConstructor.java Thu Apr 16 12:04:31 2009
@@ -173,7 +173,7 @@
         super.initialize( engine, properties );
 
         // Load the Stripes UrlBindingFactory
-        Configuration stripesConfig =(Configuration)engine.getServletContext().getAttribute( WikiRuntimeConfiguration.STRIPES_CONFIGURATION );
+        Configuration stripesConfig =WikiRuntimeConfiguration.getConfiguration( engine.getServletContext() );
         if( stripesConfig != null )
         {
             ActionResolver resolver = stripesConfig.getActionResolver();



Mime
View raw message