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/04/16 14:04:34 UTC
svn commit: r765589 [2/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...
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/util/ClassUtil.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/util/ClassUtil.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/util/ClassUtil.java Thu Apr 16 12:04:31 2009
@@ -67,9 +67,9 @@
XPath xpath = XPath.newInstance("/classmappings/mapping");
- 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();
@@ -112,7 +112,7 @@
* @throws ClassNotFoundException if this particular class cannot be found
* from the list.
*/
- public static Class findClass( List packages, String className )
+ public static Class<?> findClass( List<String> packages, String className )
throws ClassNotFoundException
{
ClassLoader loader = ClassUtil.class.getClassLoader();
@@ -123,10 +123,8 @@
}
catch( ClassNotFoundException e )
{
- for( Iterator i = packages.iterator(); i.hasNext(); )
+ for( String packageName : packages )
{
- String packageName = (String)i.next();
-
try
{
return loader.loadClass( packageName + "." + className );
@@ -152,7 +150,7 @@
* @throws ClassNotFoundException if this particular class cannot be found.
*/
- public static Class findClass( String packageName, String className )
+ public static Class<?> findClass( String packageName, String className )
throws ClassNotFoundException
{
ArrayList<String> list = new ArrayList<String>();
@@ -256,7 +254,7 @@
{
Class<?> cl = getMappedClass( requestedClass );
- Constructor[] ctors = cl.getConstructors();
+ Constructor<?>[] ctors = cl.getConstructors();
//
// Try to find the proper constructor by comparing the
@@ -322,7 +320,7 @@
* @return A Class object which you can then instantiate.
* @throws WikiException
*/
- private static Class getMappedClass( String requestedClass )
+ private static Class<?> getMappedClass( String requestedClass )
throws WikiException
{
String mappedClass = c_classMappings.get( requestedClass );
@@ -334,7 +332,7 @@
try
{
- Class cl = Class.forName(mappedClass);
+ Class<?> cl = Class.forName(mappedClass);
return cl;
}
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/util/PropertyReader.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/util/PropertyReader.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/util/PropertyReader.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/util/PropertyReader.java Thu Apr 16 12:04:31 2009
@@ -314,7 +314,7 @@
{
//get variable name/values from properties...
Map<String,String> vars = new HashMap<String,String>();
- Enumeration propertyList = properties.propertyNames();
+ Enumeration<?> propertyList = properties.propertyNames();
while( propertyList.hasMoreElements() )
{
String propertyName = (String)propertyList.nextElement();
@@ -341,12 +341,10 @@
continue;
}
- Iterator iter = vars.entrySet().iterator();
- while ( iter.hasNext() )
+ for ( Map.Entry<String, String>entry : vars.entrySet() )
{
- Map.Entry entry = (Map.Entry)iter.next();
- String varName = (String)entry.getKey();
- String varValue = (String)entry.getValue();
+ String varName = entry.getKey();
+ String varValue = entry.getValue();
//replace old property value, using the same variabe. If we don't overwrite
//the same one the next loop works with the original one again and
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TimedCounterList.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TimedCounterList.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TimedCounterList.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TimedCounterList.java Thu Apr 16 12:04:31 2009
@@ -159,7 +159,7 @@
try
{
- for( CounterItem i : m_list )
+ for( CounterItem<T> i : m_list )
{
if( i.m_obj.equals( obj ) )
{
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/util/WatchDog.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/util/WatchDog.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/util/WatchDog.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/util/WatchDog.java Thu Apr 16 12:04:31 2009
@@ -146,18 +146,18 @@
synchronized( c_kennel )
{
- for( Iterator i = c_kennel.entrySet().iterator(); i.hasNext(); )
+ for( Iterator<Map.Entry<Integer, WeakReference<WatchDog>>> i = c_kennel.entrySet().iterator(); i.hasNext(); )
{
- Map.Entry e = (Map.Entry) i.next();
+ Map.Entry<Integer, WeakReference<WatchDog>> e = i.next();
- WeakReference w = (WeakReference) e.getValue();
+ WeakReference<WatchDog> w = e.getValue();
//
// Remove expired as well
//
if( w.get() == null )
{
- c_kennel.remove( e.getKey() );
+ i.remove();
scrub();
break;
}
@@ -413,11 +413,11 @@
synchronized( c_kennel )
{
- for( Iterator i = c_kennel.entrySet().iterator(); i.hasNext(); )
+ for( Iterator<Map.Entry<Integer, WeakReference<WatchDog>>> i = c_kennel.entrySet().iterator(); i.hasNext(); )
{
- Map.Entry entry = (Map.Entry) i.next();
+ Map.Entry<Integer, WeakReference<WatchDog>> entry = i.next();
- WeakReference wr = (WeakReference) entry.getValue();
+ WeakReference<WatchDog> wr = entry.getValue();
WatchDog w = (WatchDog) wr.get();
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/AbstractRPCHandler.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/AbstractRPCHandler.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/AbstractRPCHandler.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/AbstractRPCHandler.java Thu Apr 16 12:04:31 2009
@@ -29,6 +29,7 @@
import org.apache.wiki.auth.AuthorizationManager;
import org.apache.wiki.auth.permissions.PagePermission;
import org.apache.wiki.auth.permissions.WikiPermission;
+import org.apache.wiki.providers.ProviderException;
import org.apache.xmlrpc.AuthenticationFailed;
@@ -76,13 +77,13 @@
m_engine = context.getEngine();
}
- protected abstract Hashtable encodeWikiPage( WikiPage p );
+ protected abstract Hashtable<String,Object> encodeWikiPage( WikiPage p );
- public Vector getRecentChanges( Date since )
+ public Vector<Hashtable<String,Object>> getRecentChanges( Date since ) throws ProviderException
{
checkPermission( PagePermission.VIEW );
- Collection pages = m_engine.getRecentChanges(m_context.getPage().getWiki());
- Vector<Hashtable<?, ?>> result = new Vector<Hashtable<?, ?>>();
+ Collection<WikiPage> pages = m_engine.getRecentChanges(m_context.getPage().getWiki());
+ Vector<Hashtable<String,Object>> result = new Vector<Hashtable<String,Object>>();
// Transform UTC into local time.
Calendar cal = Calendar.getInstance();
@@ -91,10 +92,8 @@
(cal.get( Calendar.ZONE_OFFSET ) +
(cal.getTimeZone().inDaylightTime( since ) ? cal.get( Calendar.DST_OFFSET ) : 0 )) );
- for( Iterator i = pages.iterator(); i.hasNext(); )
+ for( WikiPage page : pages )
{
- WikiPage page = (WikiPage)i.next();
-
if( page.getLastModified().after( cal.getTime() ) )
{
result.add( encodeWikiPage( page ) );
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java Thu Apr 16 12:04:31 2009
@@ -101,7 +101,7 @@
return toRPCString(m_engine.getApplicationName());
}
- public Vector<String> getAllPages()
+ public Vector<String> getAllPages() throws ProviderException
{
checkPermission( PagePermission.VIEW );
Collection<WikiPage> pages = m_engine.getRecentChanges(m_context.getPage().getWiki());
@@ -109,16 +109,9 @@
for( WikiPage p : pages )
{
- try
+ if( !(p.isAttachment() ) )
{
- if( !(p.isAttachment()) )
- {
- result.add( toRPCString(p.getName()) );
- }
- }
- catch( ProviderException e )
- {
- // We ignore these exceptions. Don't know whether we really should.
+ result.add( toRPCString(p.getName()) );
}
}
@@ -160,7 +153,7 @@
return ht;
}
- public Vector<Hashtable<String, Object>> getRecentChanges( Date since )
+ public Vector<Hashtable<String, Object>> getRecentChanges( Date since ) throws ProviderException
{
checkPermission( PagePermission.VIEW );
Collection<WikiPage> pages = m_engine.getRecentChanges(m_context.getPage().getWiki());
@@ -179,16 +172,9 @@
for( WikiPage page : pages )
{
- try
- {
- if( page.getLastModified().after( since ) && !(page.isAttachment()) )
- {
- result.add( encodeWikiPage( page ) );
- }
- }
- catch( ProviderException e )
+ if( page.getLastModified().after( since ) && !( page.isAttachment() ) )
{
- // We ignore these.
+ result.add( encodeWikiPage( page ) );
}
}
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java Thu Apr 16 12:04:31 2009
@@ -51,25 +51,19 @@
return m_engine.getApplicationName();
}
- public Vector getAllPages()
+ public Vector<String> getAllPages() throws ProviderException
{
checkPermission( PagePermission.VIEW );
- Collection pages = m_engine.getRecentChanges(m_context.getPage().getWiki());
+ Collection<WikiPage> pages = m_engine.getRecentChanges(m_context.getPage().getWiki());
Vector<String> result = new Vector<String>();
- for( Iterator i = pages.iterator(); i.hasNext(); )
+ for( WikiPage p : pages)
{
- WikiPage p = (WikiPage) i.next();
-
- try
+ if( !( p.isAttachment() ) )
{
- if( !(p.isAttachment()) )
- {
- result.add( p.getName() );
- }
+ result.add( p.getName() );
}
- catch( ProviderException e ) {}
}
return result;
@@ -110,11 +104,11 @@
return ht;
}
- public Vector getRecentChanges( Date since )
+ public Vector<Hashtable<String,Object>> getRecentChanges( Date since ) throws ProviderException
{
checkPermission( PagePermission.VIEW );
- Collection pages = m_engine.getRecentChanges(m_context.getPage().getWiki());
+ Collection<WikiPage> pages = m_engine.getRecentChanges(m_context.getPage().getWiki());
Vector<Hashtable<String, Object>> result = new Vector<Hashtable<String, Object>>();
Calendar cal = Calendar.getInstance();
@@ -128,18 +122,12 @@
(cal.getTimeZone().inDaylightTime(since) ? cal.get( Calendar.DST_OFFSET ) : 0 ) ) );
since = cal.getTime();
- for( Iterator i = pages.iterator(); i.hasNext(); )
+ for( WikiPage page : pages )
{
- WikiPage page = (WikiPage)i.next();
-
- try
+ if( page.getLastModified().after( since ) && !(page.isAttachment() ) )
{
- if( page.getLastModified().after( since ) && !(page.isAttachment()) )
- {
- result.add( encodeWikiPage( page ) );
- }
+ result.add( encodeWikiPage( page ) );
}
- catch( ProviderException e ) {}
}
return result;
@@ -173,7 +161,7 @@
}
}
- public Hashtable getPageInfo( String pagename )
+ public Hashtable<String,Object> getPageInfo( String pagename )
throws XmlRpcException
{
pagename = parsePageCheckCondition( pagename );
@@ -192,7 +180,7 @@
}
}
- public Hashtable getPageInfoVersion( String pagename, int version )
+ public Hashtable<String,Object> getPageInfoVersion( String pagename, int version )
throws XmlRpcException
{
pagename = parsePageCheckCondition( pagename );
@@ -260,7 +248,7 @@
}
}
- public Vector listLinks( String pagename )
+ public Vector<Hashtable<String,Object>> listLinks( String pagename )
throws XmlRpcException
{
pagename = parsePageCheckCondition( pagename );
@@ -283,17 +271,16 @@
extCollector,
attCollector );
- Vector<Hashtable<String, String>> result = new Vector<Hashtable<String, String>>();
+ Vector<Hashtable<String, Object>> result = new Vector<Hashtable<String, Object>>();
// FIXME: Contains far too much common with RPCHandler. Refactor!
//
// Add local links.
//
- for( Iterator i = localCollector.getLinks().iterator(); i.hasNext(); )
+ for( String link : localCollector.getLinks() )
{
- String link = (String) i.next();
- Hashtable<String, String> ht = new Hashtable<String, String>();
+ Hashtable<String, Object> ht = new Hashtable<String, Object>();
ht.put( "page", link );
ht.put( "type", LINK_LOCAL );
@@ -312,16 +299,12 @@
//
// Add links to inline attachments
//
- for( Iterator i = attCollector.getLinks().iterator(); i.hasNext(); )
+ for( String link : attCollector.getLinks() )
{
- String link = (String) i.next();
-
- Hashtable<String, String> ht = new Hashtable<String, String>();
-
+ Hashtable<String, Object> ht = new Hashtable<String, Object>();
ht.put( "page", link );
ht.put( "type", LINK_LOCAL );
ht.put( "href", context.getURL(WikiContext.ATTACH,link) );
-
result.add( ht );
}
@@ -330,16 +313,12 @@
// simply because URLs are by definition ASCII.
//
- for( Iterator i = extCollector.getLinks().iterator(); i.hasNext(); )
+ for( String link : extCollector.getLinks() )
{
- String link = (String) i.next();
-
- Hashtable<String, String> ht = new Hashtable<String, String>();
-
+ Hashtable<String, Object> ht = new Hashtable<String, Object>();
ht.put( "page", link );
ht.put( "type", LINK_EXTERNAL );
ht.put( "href", link );
-
result.add( ht );
}
Modified: incubator/jspwiki/trunk/tests/java/com/foo/SamplePlugin3.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/com/foo/SamplePlugin3.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/com/foo/SamplePlugin3.java (original)
+++ incubator/jspwiki/trunk/tests/java/com/foo/SamplePlugin3.java Thu Apr 16 12:04:31 2009
@@ -43,7 +43,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/ReferenceManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/ReferenceManagerTest.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/ReferenceManagerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/ReferenceManagerTest.java Thu Apr 16 12:04:31 2009
@@ -33,7 +33,6 @@
import org.apache.wiki.api.WikiException;
import org.apache.wiki.content.WikiPath;
-import org.apache.wiki.providers.AbstractFileProvider;
import org.apache.wiki.providers.ProviderException;
@@ -141,7 +140,7 @@
public void testUnreferenced()
throws Exception
{
- Collection c = mgr.findUnreferenced();
+ Collection<String> c = mgr.findUnreferenced();
assertTrue( "Unreferenced page not found by ReferenceManager",
Util.collectionContains( c, "TestPage" ));
}
@@ -152,24 +151,24 @@
{
engine.saveText( "Foobar2", "[TestPage]" );
- Collection c = mgr.findUnreferenced();
+ Collection<String> c = mgr.findUnreferenced();
assertEquals( "Wrong # of orphan pages, stage 1", 0, c.size() );
engine.saveText( "Foobar2", "norefs" );
c = mgr.findUnreferenced();
assertEquals( "Wrong # of orphan pages", 1, c.size() );
- Iterator i = c.iterator();
- String first = (String) i.next();
+ Iterator<String> i = c.iterator();
+ String first = i.next();
assertEquals( "Not correct referrers", "TestPage", first );
}
public void testUncreated()
throws Exception
{
- Collection c = mgr.findUncreated();
+ Collection<String> c = mgr.findUncreated();
- assertTrue( c.size()==1 && ((String) c.iterator().next()).equals("Foobar2") );
+ assertTrue( c.size()==1 && c.iterator().next().equals("Foobar2") );
}
public void testReferrers()
@@ -192,7 +191,7 @@
public void testRefersTo()
throws Exception
{
- Collection s = mgr.findRefersTo( "Foobar" );
+ Collection<String> s = mgr.findRefersTo( "Foobar" );
assertTrue( "does not have Foobar", s.contains("Foobar") );
// assertTrue( "does not have Foobars", s.contains("Foobars") );
@@ -226,12 +225,12 @@
throws Exception
{
engine.saveText( "TestPage", "Reference to [Foobars]." );
- Collection c = mgr.findUnreferenced();
- assertTrue( "Foobar unreferenced", c.size()==1 && ((String) c.iterator().next()).equals("TestPage") );
+ Collection<String> c = mgr.findUnreferenced();
+ assertTrue( "Foobar unreferenced", c.size()==1 && c.iterator().next().equals("TestPage") );
- c = findReferrers( "Foobar" );
+ Collection<WikiPath>p = findReferrers( "Foobar" );
assertTrue( "Foobar referrers",
- c.size()==2 );
+ p.size()==2 );
}
@@ -246,17 +245,18 @@
engine.saveText( "Foobar2s", "qwertz" );
assertTrue( "no uncreated", mgr.findUncreated().size()==0 );
- Collection c = findReferrers( "Foobar2s" );
- assertTrue( "referrers", c!=null && c.size()==1 && ((String) c.iterator().next()).equals("Foobar") );
+ Collection<WikiPath> c = findReferrers( "Foobar2s" );
+ assertTrue( "referrers", c!=null && c.size()==1 && c.iterator().next().toString().equals("Foobar") );
}
public void testUpdateBothExist()
throws Exception
{
engine.saveText( "Foobars", "qwertz" );
- Collection c = findReferrers( "Foobars" );
+ Collection<WikiPath> c = findReferrers( "Foobars" );
assertEquals( "Foobars referrers", 2, c.size() );
- assertTrue( "Foobars referrer is not TestPage", c.contains( "TestPage" ) && c.contains("Foobar"));
+ assertTrue( "Foobars referrer is not TestPage", c.contains( WikiPath.valueOf( "TestPage" ) )
+ && c.contains( WikiPath.valueOf( "Foobar") ) );
}
public void testUpdateBothExist2()
@@ -265,7 +265,7 @@
engine.saveText( "Foobars", "qwertz" );
engine.saveText( "TestPage", "Reference to [Foobar], [Foobars]." );
- Collection c = findReferrers( "Foobars" );
+ Collection<WikiPath> c = findReferrers( "Foobars" );
assertEquals( "Foobars referrers count", 2, c.size() );
assertTrue( "Foobars referrers",
@@ -290,7 +290,7 @@
engine.saveText( "BugOne", "OpenBug" );
- Collection ref = findReferrers( "NewBugs" );
+ Collection<WikiPath> ref = findReferrers( "NewBugs" );
assertNull("newbugs",ref); // No referrers must be found
ref = findReferrers( "NewBug" );
@@ -298,11 +298,11 @@
ref = findReferrers( "OpenBugs" );
assertEquals("openbugs",1,ref.size());
- assertEquals("openbugs2","BugOne",ref.iterator().next());
+ assertEquals("openbugs2","BugOne",ref.iterator().next().toString());
ref = findReferrers( "OpenBug" );
assertEquals("openbug",1,ref.size());
- assertEquals("openbug2","BugOne",ref.iterator().next());
+ assertEquals("openbug2","BugOne",ref.iterator().next().toString());
}
@@ -315,7 +315,7 @@
engine.saveText( "BugOne", "OpenBug" );
- Collection ref = findReferrers( "NewBugs" );
+ Collection<WikiPath> ref = findReferrers( "NewBugs" );
assertNull("newbugs",ref); // No referrers must be found
ref = findReferrers( "NewBug" );
@@ -323,11 +323,11 @@
ref = findReferrers( "OpenBugs" );
assertEquals("openbugs",1,ref.size());
- assertEquals("openbugs2","BugOne",ref.iterator().next());
+ assertEquals("openbugs2","BugOne",ref.iterator().next().toString());
ref = findReferrers( "OpenBug" );
assertEquals("openbug",1,ref.size());
- assertEquals("openbug2","BugOne",ref.iterator().next());
+ assertEquals("openbug2","BugOne",ref.iterator().next().toString());
}
@@ -341,30 +341,30 @@
engine.saveText( "BugOne", "OpenBug" );
- Collection ref = findReferrers( "NewBugs" );
+ Collection<WikiPath> ref = findReferrers( "NewBugs" );
assertEquals("newbugs",1,ref.size());
- assertEquals("newbugs2","BugTwo",ref.iterator().next());
+ assertEquals("newbugs2","BugTwo",ref.iterator().next().toString());
ref = findReferrers( "NewBug" );
assertEquals("newbugs",1,ref.size());
- assertEquals("newbugs2","BugTwo",ref.iterator().next());
+ assertEquals("newbugs2","BugTwo",ref.iterator().next().toString());
ref = findReferrers( "OpenBugs" );
assertEquals("openbugs",1,ref.size());
- assertEquals("openbugs2","BugOne",ref.iterator().next());
+ assertEquals("openbugs2","BugOne",ref.iterator().next().toString());
ref = findReferrers( "OpenBug" );
assertEquals("openbug",1,ref.size());
- assertEquals("openbug2","BugOne",ref.iterator().next());
+ assertEquals("openbug2","BugOne",ref.iterator().next().toString());
}
public void testSelf() throws WikiException
{
engine.saveText( "BugOne", "BugOne" );
- Collection ref = findReferrers( "BugOne" );
+ Collection<WikiPath> ref = findReferrers( "BugOne" );
assertEquals("wrong size",1,ref.size());
- assertEquals("ref", "Main:BugOne", ref.iterator().next());
+ assertEquals("ref", "Main:BugOne", ref.iterator().next().toString());
}
public static Test suite()
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=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJDBCDataSource.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJDBCDataSource.java Thu Apr 16 12:04:31 2009
@@ -175,7 +175,7 @@
return new URLClassLoader( new URL[] { driverURL }, parent );
}
});
- Class driverClass = loader.loadClass( clazz );
+ Class<?> driverClass = loader.loadClass( clazz );
// Cache the driver
m_driver = (Driver) driverClass.newInstance();
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJNDIContext.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJNDIContext.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJNDIContext.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestJNDIContext.java Thu Apr 16 12:04:31 2009
@@ -67,7 +67,7 @@
private static Context ctx = null;
- public Context getInitialContext( Hashtable environment ) throws NamingException
+ public Context getInitialContext( Hashtable<?,?> environment ) throws NamingException
{
return ctx;
}
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java Thu Apr 16 12:04:31 2009
@@ -30,13 +30,11 @@
/**
* Check that a collection contains the required string.
*/
- public static boolean collectionContains( Collection container,
+ public static boolean collectionContains( Collection<String> container,
String captive )
{
- Iterator i = container.iterator();
- while( i.hasNext() )
+ for ( String cap : container )
{
- Object cap = i.next();
if( cap instanceof String && captive.equals( cap ) )
return true;
}
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/WikiContextFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/WikiContextFactoryTest.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/WikiContextFactoryTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/WikiContextFactoryTest.java Thu Apr 16 12:04:31 2009
@@ -24,7 +24,6 @@
*/
package org.apache.wiki.action;
-import java.net.URI;
import java.util.Properties;
import junit.framework.Test;
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/attachment/AttachmentManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/attachment/AttachmentManagerTest.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/attachment/AttachmentManagerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/attachment/AttachmentManagerTest.java Thu Apr 16 12:04:31 2009
@@ -22,14 +22,10 @@
package org.apache.wiki.attachment;
import java.io.*;
-import java.util.Collection;
import java.util.Properties;
import org.apache.wiki.TestEngine;
-import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.attachment.Attachment;
import org.apache.wiki.attachment.AttachmentManager;
-import org.apache.wiki.providers.ProviderException;
import org.apache.wiki.util.FileUtil;
import junit.framework.Test;
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java Thu Apr 16 12:04:31 2009
@@ -21,15 +21,12 @@
package org.apache.wiki.parser;
import java.io.BufferedReader;
-import java.io.IOException;
import java.io.StringReader;
import java.util.Collection;
import java.util.Iterator;
import java.util.Properties;
import java.util.Vector;
-import javax.servlet.ServletException;
-
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/JavaScriptPlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/JavaScriptPlugin.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/JavaScriptPlugin.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/JavaScriptPlugin.java Thu Apr 16 12:04:31 2009
@@ -41,7 +41,7 @@
{
protected static boolean c_inited = false;
- public String execute( WikiContext context, Map params )
+ public String execute( WikiContext context, Map<String,Object> params )
throws PluginException
{
return "<script language=\"JavaScript\"><!--\nfoo='';\n--></script>\n";
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/SamplePlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/SamplePlugin.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/SamplePlugin.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/SamplePlugin.java Thu Apr 16 12:04:31 2009
@@ -43,7 +43,7 @@
{
protected static boolean c_rendered = false;
- public String execute( WikiContext context, Map params )
+ public String execute( WikiContext context, Map<String,Object> params )
throws PluginException
{
StringBuffer sb = new StringBuffer();
@@ -64,7 +64,7 @@
return sb.toString();
}
- public void executeParser(PluginContent element, WikiContext context, Map params)
+ public void executeParser(PluginContent element, WikiContext context, Map<String,Object> params)
{
if( element.getParameter("render") != null ) c_rendered = true;
}
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/search/SearchManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/search/SearchManagerTest.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/search/SearchManagerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/search/SearchManagerTest.java Thu Apr 16 12:04:31 2009
@@ -157,7 +157,7 @@
Thread.sleep( 5000L ); // Should cover for both index and initial delay
- Collection res = m_mgr.findPages( "Test" );
+ Collection<SearchResult> res = m_mgr.findPages( "Test" );
assertNotNull( "null result", res );
assertEquals( "no pages", 1, res.size() );
@@ -176,7 +176,7 @@
Thread.sleep( 5000L ); // Should cover for both index and initial delay
- Collection res = m_mgr.findPages( "TestPage" );
+ Collection<SearchResult> res = m_mgr.findPages( "TestPage" );
assertNotNull( "null result", res );
assertEquals( "no pages", 1, res.size() );
Modified: incubator/jspwiki/trunk/tests/java/stress/MassiveRepositoryTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/stress/MassiveRepositoryTest.java?rev=765589&r1=765588&r2=765589&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/stress/MassiveRepositoryTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/stress/MassiveRepositoryTest.java Thu Apr 16 12:04:31 2009
@@ -20,7 +20,6 @@
*/
package stress;
-import java.io.File;
import java.util.Properties;
import java.util.Random;
@@ -28,7 +27,6 @@
import org.apache.wiki.TestEngine;
import org.apache.wiki.WikiProvider;
-import org.apache.wiki.providers.AbstractFileProvider;
import org.apache.wiki.providers.CachingProvider;
import org.apache.wiki.util.TextUtil;