jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juanpa...@apache.org
Subject svn commit: r1426068 - in /incubator/jspwiki/trunk: src/org/apache/wiki/ src/org/apache/wiki/auth/ src/org/apache/wiki/event/ src/org/apache/wiki/forms/ src/org/apache/wiki/plugin/ src/org/apache/wiki/ui/admin/ src/org/apache/wiki/ui/admin/beans/ tests...
Date Wed, 26 Dec 2012 22:34:40 GMT
Author: juanpablo
Date: Wed Dec 26 22:34:40 2012
New Revision: 1426068

URL: http://svn.apache.org/viewvc?rev=1426068&view=rev
Log:
explicit access to API interfaces to get rid of "cannot dereference error with generics" errors
at builds.a.o 

(cfr. http://stackoverflow.com/q/4144623)

Modified:
    incubator/jspwiki/trunk/src/org/apache/wiki/PageManager.java
    incubator/jspwiki/trunk/src/org/apache/wiki/VariableManager.java
    incubator/jspwiki/trunk/src/org/apache/wiki/WikiEngine.java
    incubator/jspwiki/trunk/src/org/apache/wiki/auth/UserManager.java
    incubator/jspwiki/trunk/src/org/apache/wiki/event/WikiEventUtils.java
    incubator/jspwiki/trunk/src/org/apache/wiki/forms/FormOutput.java
    incubator/jspwiki/trunk/src/org/apache/wiki/plugin/TableOfContents.java
    incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/AdminBeanManager.java
    incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/beans/PluginBean.java
    incubator/jspwiki/trunk/tests/org/apache/wiki/workflow/ApprovalWorkflowTest.java

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/PageManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/PageManager.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/PageManager.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/PageManager.java Wed Dec 26 22:34:40 2012
@@ -34,6 +34,7 @@ import org.apache.wiki.auth.acl.AclEntry
 import org.apache.wiki.auth.user.UserProfile;
 import org.apache.wiki.event.*;
 import org.apache.wiki.api.exceptions.FilterException;
+import org.apache.wiki.api.filters.FilterManager;
 import org.apache.wiki.modules.ModuleManager;
 import org.apache.wiki.providers.CachingProvider;
 import org.apache.wiki.providers.ProviderException;
@@ -704,7 +705,8 @@ public class PageManager extends ModuleM
             String saveText;
             try
             {
-                saveText = engine.getFilterManager().doPreSaveFiltering( m_context, m_proposedText
);
+                FilterManager fm = engine.getFilterManager();
+                saveText = fm.doPreSaveFiltering( m_context, m_proposedText );
             }
             catch ( FilterException e )
             {
@@ -754,7 +756,8 @@ public class PageManager extends ModuleM
             // Refresh the context for post save filtering.
             engine.getPage( page.getName() );
             engine.textToHTML( context, proposedText );
-            engine.getFilterManager().doPostSaveFiltering( context, proposedText );
+            FilterManager fm = engine.getFilterManager();
+            fm.doPostSaveFiltering( context, proposedText );
 
             return Outcome.STEP_COMPLETE;
         }

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/VariableManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/VariableManager.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/VariableManager.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/VariableManager.java Wed Dec 26 22:34:40 2012
@@ -27,6 +27,7 @@ import javax.servlet.http.HttpSession;
 
 import org.apache.log4j.Logger;
 
+import org.apache.wiki.api.filters.FilterManager;
 import org.apache.wiki.api.filters.PageFilter;
 import org.apache.wiki.i18n.InternationalizationManager;
 import org.apache.wiki.modules.InternalModule;
@@ -495,7 +496,8 @@ public class VariableManager
 
         public String getPagefilters()
         {
-            List<PageFilter> filters = m_context.getEngine().getFilterManager().getFilterList();
+            FilterManager fm = m_context.getEngine().getFilterManager();
+            List<PageFilter> filters = fm.getFilterList();
             StringBuffer sb = new StringBuffer();
 
             for (PageFilter pf : filters )

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/WikiEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/WikiEngine.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/WikiEngine.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/WikiEngine.java Wed Dec 26 22:34:40 2012
@@ -594,8 +594,8 @@ public class WikiEngine
             //
             //  Hook the different manager routines into the system.
             //
-            getFilterManager().addPageFilter(m_referenceManager, -1001 );
-            getFilterManager().addPageFilter(m_searchManager, -1002 );
+            m_filterManager.addPageFilter(m_referenceManager, -1001 );
+            m_filterManager.addPageFilter(m_searchManager, -1002 );
         }
 
         catch( RuntimeException e )

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/auth/UserManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/auth/UserManager.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/auth/UserManager.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/auth/UserManager.java Wed Dec 26 22:34:40
2012
@@ -40,6 +40,7 @@ import org.apache.wiki.auth.user.UserPro
 import org.apache.wiki.event.WikiEventListener;
 import org.apache.wiki.event.WikiEventManager;
 import org.apache.wiki.event.WikiSecurityEvent;
+import org.apache.wiki.api.filters.FilterManager;
 import org.apache.wiki.api.filters.PageFilter;
 import org.apache.wiki.filters.SpamFilter;
 import org.apache.wiki.i18n.InternationalizationManager;
@@ -479,7 +480,8 @@ public final class UserManager
         //
         //  Query the SpamFilter first
         //
-        List<PageFilter> ls = m_engine.getFilterManager().getFilterList();
+        FilterManager fm = m_engine.getFilterManager();
+        List<PageFilter> ls = fm.getFilterList();
         for( PageFilter pf : ls )
         {
             if( pf instanceof SpamFilter )

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/event/WikiEventUtils.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/event/WikiEventUtils.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/event/WikiEventUtils.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/event/WikiEventUtils.java Wed Dec 26 22:34:40
2012
@@ -19,7 +19,8 @@
 
 package org.apache.wiki.event;
 
-import  org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiEngine;
+import org.apache.wiki.api.filters.FilterManager;
 
 /**
  *  A utility class that adds some JSPWiki-specific functionality to the
@@ -131,7 +132,8 @@ public class WikiEventUtils
                    || type == WikiPageEvent.POST_SAVE_BEGIN
                    || type == WikiPageEvent.POST_SAVE_END ) // attach to FilterManager
             {
-                WikiEventManager.addWikiEventListener( ((WikiEngine)client).getFilterManager(),
listener );
+                FilterManager fm = ((WikiEngine)client).getFilterManager();
+                WikiEventManager.addWikiEventListener( fm, listener );
             }
             else //if (  type == WikiPageEvent.PRE_TRANSLATE
                  // || type == WikiPageEvent.POST_TRANSLATE

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/forms/FormOutput.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/forms/FormOutput.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/forms/FormOutput.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/forms/FormOutput.java Wed Dec 26 22:34:40
2012
@@ -23,6 +23,7 @@ import java.util.Map;
 import java.util.ResourceBundle;
 
 import org.apache.wiki.WikiContext;
+import org.apache.wiki.api.PluginManager;
 import org.apache.wiki.api.WikiPlugin;
 import org.apache.wiki.api.exceptions.PluginException;
 import org.apache.wiki.plugin.DefaultPluginManager;
@@ -127,7 +128,8 @@ public class FormOutput
         {
             // The plugin _can_ modify the parameters, so we make sure
             // they stay with us.
-            handlerOutput = ctx.getEngine().getPluginManager().execute( ctx, handler, info.getSubmission()
);
+            PluginManager pm = ctx.getEngine().getPluginManager();
+            handlerOutput = pm.execute( ctx, handler, info.getSubmission() );
             info.setResult( handlerOutput );
             info.setStatus( FormInfo.EXECUTED );
         }

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/plugin/TableOfContents.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/plugin/TableOfContents.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/plugin/TableOfContents.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/plugin/TableOfContents.java Wed Dec 26 22:34:40
2012
@@ -27,6 +27,7 @@ import org.apache.log4j.Logger;
 import org.apache.wiki.*;
 import org.apache.wiki.api.WikiPlugin;
 import org.apache.wiki.api.exceptions.PluginException;
+import org.apache.wiki.api.filters.FilterManager;
 import org.apache.wiki.parser.Heading;
 import org.apache.wiki.parser.HeadingListener;
 import org.apache.wiki.parser.JSPWikiMarkupParser;
@@ -217,8 +218,11 @@ public class TableOfContents
             
             try
             {
-                if( runFilters )
-                    wikiText = engine.getFilterManager().doPreTranslateFiltering( context,
wikiText );
+                if( runFilters ) 
+                {
+                    FilterManager fm = engine.getFilterManager();
+                    wikiText = fm.doPreTranslateFiltering( context, wikiText );
+                }
             }
             catch(Exception e) 
             {

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/AdminBeanManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/AdminBeanManager.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/AdminBeanManager.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/AdminBeanManager.java Wed Dec 26
22:34:40 2012
@@ -27,9 +27,9 @@ import java.util.List;
 import javax.management.*;
 
 import org.apache.log4j.Logger;
-
 import org.apache.wiki.Release;
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.api.PluginManager;
 import org.apache.wiki.event.WikiEngineEvent;
 import org.apache.wiki.event.WikiEvent;
 import org.apache.wiki.event.WikiEventListener;
@@ -173,18 +173,15 @@ public class AdminBeanManager implements
             }
             catch (ClassNotFoundException e)
             {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
+                log.error( e.getMessage(), e );
             }
             catch (InstantiationException e)
             {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
+                log.error( e.getMessage(), e );
             }
             catch (IllegalAccessException e)
             {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
+                log.error( e.getMessage(), e );
             }
         }
 
@@ -208,7 +205,8 @@ public class AdminBeanManager implements
             e.printStackTrace();
         }
         registerBeans( m_engine.getEditorManager().modules() );
-        registerBeans( m_engine.getPluginManager().modules() );
+        PluginManager pm = m_engine.getPluginManager();
+        registerBeans( pm.modules() );
     }
 
     /**

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/beans/PluginBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/beans/PluginBean.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/beans/PluginBean.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/ui/admin/beans/PluginBean.java Wed Dec 26
22:34:40 2012
@@ -24,10 +24,10 @@ import java.util.Iterator;
 import javax.management.NotCompliantMBeanException;
 
 import org.apache.ecs.xhtml.*;
-
 import org.apache.wiki.Release;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.api.PluginManager;
 import org.apache.wiki.plugin.DefaultPluginManager.WikiPluginInfo;
 import org.apache.wiki.ui.admin.SimpleAdminBean;
 
@@ -63,7 +63,8 @@ public class PluginBean extends SimpleAd
     @SuppressWarnings("unchecked")
     public String doGet(WikiContext context)
     {
-        Collection<WikiPluginInfo> plugins = m_engine.getPluginManager().modules();
+        PluginManager pm = m_engine.getPluginManager();
+        Collection<WikiPluginInfo> plugins = pm.modules();
 
         div root = new div();
 

Modified: incubator/jspwiki/trunk/tests/org/apache/wiki/workflow/ApprovalWorkflowTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/org/apache/wiki/workflow/ApprovalWorkflowTest.java?rev=1426068&r1=1426067&r2=1426068&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/org/apache/wiki/workflow/ApprovalWorkflowTest.java (original)
+++ incubator/jspwiki/trunk/tests/org/apache/wiki/workflow/ApprovalWorkflowTest.java Wed Dec
26 22:34:40 2012
@@ -31,6 +31,7 @@ import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiException;
 import org.apache.wiki.api.exceptions.FilterException;
 import org.apache.wiki.api.filters.BasicPageFilter;
+import org.apache.wiki.api.filters.FilterManager;
 import org.apache.wiki.auth.Users;
 import org.apache.wiki.auth.WikiPrincipal;
 
@@ -250,7 +251,8 @@ public class ApprovalWorkflowTest extend
     public void testSaveWikiPageWithException() throws WikiException
     {
         // Add a PageFilter that rejects all save attempts
-        m_engine.getFilterManager().addPageFilter( new AbortFilter(), 0 );
+        FilterManager fm = m_engine.getFilterManager();
+        fm.addPageFilter( new AbortFilter(), 0 );
 
         // Create a sample test page and try to save it
         String pageName = "SaveWikiPageWorkflow-Test" + System.currentTimeMillis();



Mime
View raw message