You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2009/09/13 19:57:03 UTC
svn commit: r814368 - in /incubator/jspwiki/trunk: doc/ src/WebContent/
src/java/org/apache/wiki/action/ tests/java/ tests/java/org/apache/wiki/
tests/java/org/apache/wiki/content/
Author: ajaquith
Date: Sun Sep 13 17:57:02 2009
New Revision: 814368
URL: http://svn.apache.org/viewvc?rev=814368&view=rev
Log:
Fiddly tweaks to make bunches of compiler warnings/verification errors go away.
Modified:
incubator/jspwiki/trunk/doc/API Changes from 2.4.html
incubator/jspwiki/trunk/src/WebContent/SisterSites.jsp
incubator/jspwiki/trunk/src/WebContent/rss.jsp
incubator/jspwiki/trunk/src/java/org/apache/wiki/action/package.html
incubator/jspwiki/trunk/tests/java/SamplePlugin2.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJDBCDataSource.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java
Modified: incubator/jspwiki/trunk/doc/API Changes from 2.4.html
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/doc/API%20Changes%20from%202.4.html?rev=814368&r1=814367&r2=814368&view=diff
==============================================================================
--- incubator/jspwiki/trunk/doc/API Changes from 2.4.html (original)
+++ incubator/jspwiki/trunk/doc/API Changes from 2.4.html Sun Sep 13 17:57:02 2009
@@ -33,9 +33,7 @@
<hr>
<a name="[build/JSPWiki.jar]"></a>
<h2>[../JSPWiki-2.6.3-src/build/JSPWiki.jar] to [build/JSPWiki.jar]</h2>
-<li>
-<nobr><code>JSPWiki Public API Changes</code></nobr>
-</li>
+<p><nobr><code>JSPWiki Public API Changes</code></nobr></p>
<h3>Removed Classes:</h3>
<ul>
<li>
Modified: incubator/jspwiki/trunk/src/WebContent/SisterSites.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/SisterSites.jsp?rev=814368&r1=814367&r2=814368&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/SisterSites.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/SisterSites.jsp Sun Sep 13 17:57:02 2009
@@ -38,12 +38,12 @@
// Create wiki context and check for authorization
WikiContext wikiContext = wiki.createContext( request, "rss" );
- Set allPages = wiki.getReferenceManager().findCreated();
+ Set<String> allPages = wiki.getReferenceManager().findCreated();
response.setContentType("text/plain; charset=UTF-8");
- for( Iterator i = allPages.iterator(); i.hasNext(); )
+ for( Iterator<String> i = allPages.iterator(); i.hasNext(); )
{
- String pageName = (String)i.next();
+ String pageName = i.next();
// Let's not add attachments.
// TODO: This is a kludge and not forward-compatible.
Modified: incubator/jspwiki/trunk/src/WebContent/rss.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/rss.jsp?rev=814368&r1=814367&r2=814368&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/rss.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/rss.jsp Sun Sep 13 17:57:02 2009
@@ -88,13 +88,13 @@
SimpleDateFormat iso8601fmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
Properties properties = wiki.getWikiProperties();
- String channelDescription = wiki.getRequiredProperty( properties, RSSGenerator.PROP_CHANNEL_DESCRIPTION );
- String channelLanguage = wiki.getRequiredProperty( properties, RSSGenerator.PROP_CHANNEL_LANGUAGE );
+ String channelDescription = WikiEngine.getRequiredProperty( properties, RSSGenerator.PROP_CHANNEL_DESCRIPTION );
+ String channelLanguage = WikiEngine.getRequiredProperty( properties, RSSGenerator.PROP_CHANNEL_LANGUAGE );
//
// Now, list items.
//
- List changed;
+ List<WikiPage> changed;
if( mode.equals("blog") )
{
@@ -115,9 +115,9 @@
boolean hasChanged = false;
Date latest = new Date(0);
- for( Iterator i = changed.iterator(); i.hasNext(); )
+ for( Iterator<WikiPage> i = changed.iterator(); i.hasNext(); )
{
- WikiPage p = (WikiPage) i.next();
+ WikiPage p = i.next();
if( !HttpUtil.checkFor304( request, p ) ) hasChanged = true;
if( p.getLastModified().after( latest ) ) latest = p.getLastModified();
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/package.html
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/package.html?rev=814368&r1=814367&r2=814368&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/package.html (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/package.html Sun Sep 13 17:57:02 2009
@@ -173,8 +173,8 @@
method and passes the String "Finished". This is all done completely
automatically -- there is no code to write.</p>
-<blockquote><a name="1" /><strong>Guideline #1
-for JSPWiki developers</strong>: processing code that extracts request parameters
+<blockquote><a name="1"><strong>Guideline #1
+for JSPWiki developers</strong></a>: processing code that extracts request parameters
should be moved into WikiActionBean getter and setter fields. For
example, if the parameter <code>foo</code> is needed, add methods <code>setFoo</code>
and <code>getFoo</code> to the ActionBean). The field types can be any
@@ -241,8 +241,8 @@
EL syntax can be used to navigate much more complicated object graphs
than this, but you get the idea. What could be easier?</p>
-<blockquote><a name="2" /><strong>Guideline #2
-for JSPWiki developers</strong>: JSPs should not attempt to instantiate
+<blockquote><a name="2"><strong>Guideline #2
+for JSPWiki developers</strong></a>: JSPs should not attempt to instantiate
WikiContexts directly. Instead, they <em>must</em> include a <code><stripes:useActionBean
beanclass="org.apache.wiki.action.<em>foo</em>Bean" event="foo"
id="wikiActionBean" /></code> element that tells JSPWiki which
@@ -284,13 +284,13 @@
URLs. For this reason, automatic binding also causes fields to be
validated as well (more on this shortly).</p>
-<blockquote><a name="3" /><strong>Guideline #3
-for JSPWiki developers</strong>: every WikiActionBean subclass should contain a
+<blockquote><a name="3"><strong>Guideline #3
+for JSPWiki developers</strong></a>: every WikiActionBean subclass should contain a
class-level <code>@UrlBinding</code> annotation that tells Stripes how
to locate the bean when user submit forms.</blockquote>
-<blockquote><a name="4" /><strong>Guideline #4
-for JSPWiki developers</strong>: JSPs can -- and should -- use JSP 2.0 EL syntax
+<blockquote><a name="4"><strong>Guideline #4
+for JSPWiki developers</strong></a>: JSPs can -- and should -- use JSP 2.0 EL syntax
to access properties of the current WikiActionBean. JSPWiki guarantees
that when the <code><useActionBean></code> tag is present, the
ActionBean will be made available as the page attibute <code>wikiActionBean</code>.
@@ -356,8 +356,8 @@
snippet, the event name "createAssertedName" matches the value of the <code>@HandlerEvent</code>
annotation.</p>
-<blockquote><a name="5" /><strong>Guideline #5
-for JSPWiki developers</strong>: processing code that handles form POST
+<blockquote><a name="5"><strong>Guideline #5
+for JSPWiki developers</strong></a>: processing code that handles form POST
activities (that would have ordinarily gone into top-level JSPs) should
<em>always</em> be moved into WikiActionBean event handler methods.
These methods should contain a <code>@HandlesEvent</code> annotation
@@ -369,8 +369,8 @@
the ActionBean class the event pertains to. Example: <code><stripes:form
beanclass="UserPreferencesAction.class"></code></blockquote>
-<blockquote><a name="6" /><strong>Guideline #6
-for JSPWiki developers</strong>: all <code><form></code> tags and related
+<blockquote><a name="6"><strong>Guideline #6
+for JSPWiki developers</strong></a>: all <code><form></code> tags and related
markup (such as <code><input></code>, <code><textarea></code>,
<code><option></code>) should use the Stripes tags instead (<em>e.g.</em>,
<code><stripes:form></code>, <code><a
@@ -422,8 +422,8 @@
type. In addition to Stripes' own converters, JSPWiki 3.0 contains
converters for fields of type WikiPage, Group and Principal.</p>
-<blockquote><a name="7" /><strong>Guideline #7
-for JSPWiki developers</strong>: When creating WikiActionBeans, all fields that
+<blockquote><a name="7"><strong>Guideline #7
+for JSPWiki developers</strong></a>: When creating WikiActionBeans, all fields that
require validation should have <code>@validate</code> annotations on
their setter methods.</blockquote>
@@ -433,7 +433,7 @@
redirects were implemented directly in JSP scriptlet code. For example,
consider this snippet from <code>Edit.jsp</code>:</p>
-<pre>if( change != null && change.getTime() != pagedate )
+<pre>if( change != null && change.getTime() != pagedate )
{
//
// Someone changed the page while we were editing it!
@@ -505,8 +505,8 @@
generated images/charts and XML islands.</li>
</ul>
-<blockquote><a name="8" /><strong>Guideline #8
-for JSPWiki developers</strong>: event handler methods should return
+<blockquote><a name="8"><strong>Guideline #8
+for JSPWiki developers</strong></a>: event handler methods should return
ForwardResolutions when the target is a "display JSP" that renders a
page. Hander methods that need to redirect the user to destinations
elsewhere in the application should return RedirectResolutions that
@@ -521,7 +521,7 @@
@HandlesEvent("save")
public Resolution save()
{
- if( m_change != null && m_change.getTime() != m_pagedate )
+ if( m_change != null && m_change.getTime() != m_pagedate )
{
//
// Someone changed the page while we were editing it!
@@ -552,13 +552,13 @@
<p>After retrieving the previously-flashed EditActionBean, its
contents can be retrieved and manipulated like any other bean.</p>
-<blockquote><a name="9" /><strong>Guideline #10
-for JSPWiki developers</strong>: client-side code that need to retrieve AJAX or
+<blockquote><a name="9"><strong>Guideline #10
+for JSPWiki developers</strong></a>: client-side code that need to retrieve AJAX or
JSON data from JSPWiki should POST to a WikiActionBean event handler,
which should in turn return a <code>JavaScriptResolution</code> or a <code>StreamingResolution</code>.</blockquote>
-<blockquote><a name="10" /><strong>Guideline #11
-for JSPWiki developers</strong>: event handlers that need to ensure that the
+<blockquote><a name="10"><strong>Guideline #11
+for JSPWiki developers</strong></a>: event handlers that need to ensure that the
current WikiActionBean is accessible by the next one in the request
cycle should add themselves to "flash scope" by calling the Resolution's
<code><a
Modified: incubator/jspwiki/trunk/tests/java/SamplePlugin2.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/SamplePlugin2.java?rev=814368&r1=814367&r2=814368&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/SamplePlugin2.java (original)
+++ incubator/jspwiki/trunk/tests/java/SamplePlugin2.java Sun Sep 13 17:57:02 2009
@@ -40,7 +40,7 @@
{
}
- public String execute( WikiContext context, Map params )
+ public String execute( WikiContext context, Map<String,Object> params )
throws PluginException
{
return (String)params.get("text");
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJDBCDataSource.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJDBCDataSource.java?rev=814368&r1=814367&r2=814368&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJDBCDataSource.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJDBCDataSource.java Sun Sep 13 17:57:02 2009
@@ -180,15 +180,21 @@
m_driver = (Driver) driverClass.newInstance();
}
+ /**
+ * No-op method needed for compatibility with Java 6.
+ * @return always returns {@code false}
+ */
public boolean isWrapperFor( Class<?> arg0 ) throws SQLException
{
- // unused interface methods required for JDK 6
return false;
}
+ /**
+ * No-op method needed for compatibility with Java 6.
+ * @return always returns {@code null}
+ */
public <T> T unwrap( Class<T> arg0 ) throws SQLException
{
- // unused interface methods required for JDK 6
return null;
}
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java?rev=814368&r1=814367&r2=814368&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java Sun Sep 13 17:57:02 2009
@@ -476,7 +476,7 @@
String data = m_engine.getPureText( "TestPageReferring", WikiProvider.LATEST_VERSION );
assertEquals( "page not renamed", "[Test Page Referred|TestPageReferredNew]", data.trim() );
- Collection refs = findReferrers( "TestPageReferred" );
+ Collection<WikiPath> refs = findReferrers( "TestPageReferred" );
assertNull( "oldpage", refs );
refs = findReferrers( "TestPageReferredNew" );
@@ -496,7 +496,7 @@
String data = m_engine.getPureText( "RenameTest", WikiProvider.LATEST_VERSION );
assertEquals( "page not renamed", "[link one|Link uno] [link two]", data.trim() );
- Collection refs = findReferrers( "Link one" );
+ Collection<WikiPath> refs = findReferrers( "Link one" );
assertNull( "oldpage", refs );
refs = findReferrers( "Link uno" );