Author: gseitz
Date: Tue May 6 13:14:50 2008
New Revision: 653902
URL: http://svn.apache.org/viewvc?rev=653902&view=rev
Log:
generics
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/license/ApacheLicenseHeaderTestCase.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/listener/ListenerSet.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/MetaPattern.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/OptionalMetaPattern.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/parsers/ListParser.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/PackageResourceStream.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/XSLTResourceStream.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ExtensionResourceNameIterator.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/LocaleResourceNameIterator.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/OsgiResourceStreamLocator.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceNameIterator.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceStreamLocator.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/StyleAndVariationResourceNameIterator.java
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/license/ApacheLicenseHeaderTestCase.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/license/ApacheLicenseHeaderTestCase.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/license/ApacheLicenseHeaderTestCase.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/license/ApacheLicenseHeaderTestCase.java
Tue May 6 13:14:50 2008
@@ -20,9 +20,9 @@
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import junit.framework.TestCase;
@@ -94,15 +94,15 @@
{
String relativePathname =
pathname.getAbsolutePath();
relativePathname =
Strings.replaceAll(relativePathname,
- baseDirectory.getAbsolutePath()
+ System.getProperty("file.separator"), "")
- .toString();
+ baseDirectory.getAbsolutePath() +
System.getProperty("file.separator"), "")
+ .toString();
for (int i = 0; i < ignoreFiles.length; i++)
{
String ignorePath = ignoreFiles[i];
// Will convert '/'s to '\\'s on Windows
ignorePath =
Strings.replaceAll(ignorePath, "/",
-
System.getProperty("file.separator")).toString();
+
System.getProperty("file.separator")).toString();
File ignoreFile = new
File(baseDirectory, ignorePath);
// Directory ignore
@@ -143,8 +143,8 @@
{
String relativePathname =
pathname.getAbsolutePath();
relativePathname =
Strings.replaceAll(relativePathname,
- baseDirectory.getAbsolutePath()
+ System.getProperty("file.separator"), "")
- .toString();
+ baseDirectory.getAbsolutePath() +
System.getProperty("file.separator"), "")
+ .toString();
if (relativePathname.equals("target") == false)
{
boolean found = false;
@@ -193,6 +193,7 @@
*
* @see junit.framework.TestCase#setUp()
*/
+ @Override
public final void setUp()
{
// setup the base directory for when running inside maven
(building a release
@@ -217,56 +218,50 @@
new CssLicenseHeaderHandler(cssIgnore), new
HtmlLicenseHeaderHandler(htmlIgnore),
new
VelocityLicenseHeaderHandler(velocityIgnore) };
- final Map/* <ILicenseHeaderHandler, List<File>> */badFiles =
new HashMap/*
-
* <ILicenseHeaderHandler,
-
* List<File>>
-
*/();
+ final Map<ILicenseHeaderHandler, List<File>> badFiles = new
HashMap<ILicenseHeaderHandler, List<File>>();
for (int i = 0; i < licenseHeaderHandlers.length; i++)
{
final ILicenseHeaderHandler licenseHeaderHandler =
licenseHeaderHandlers[i];
visitFiles(licenseHeaderHandler.getSuffixes(),
licenseHeaderHandler.getIgnoreFiles(),
- new FileVisitor()
+ new FileVisitor()
+ {
+ public void visitFile(File file)
{
- public void visitFile(File file)
+ if
(licenseHeaderHandler.checkLicenseHeader(file) == false)
{
- if
(licenseHeaderHandler.checkLicenseHeader(file) == false)
+ if (addHeaders == false
||
+
licenseHeaderHandler.addLicenseHeader(file) == false)
{
- if (addHeaders
== false ||
-
licenseHeaderHandler.addLicenseHeader(file) == false)
- {
- List/*
<File> */files = (List)badFiles
-
.get(licenseHeaderHandler);
+ List<File>
files = badFiles.get(licenseHeaderHandler);
- if
(files == null)
- {
-
files = new ArrayList/* <File> */();
-
badFiles.put(licenseHeaderHandler, files);
- }
-
-
files.add(file);
+ if (files ==
null)
+ {
+ files =
new ArrayList<File>();
+
badFiles.put(licenseHeaderHandler, files);
}
+
+ files.add(file);
}
}
- });
+ }
+ });
}
failIncorrectLicenceHeaders(badFiles);
}
- private void failIncorrectLicenceHeaders(Map/* <ILicenseHeaderHandler,
List<File>> */files)
+ private void failIncorrectLicenceHeaders(Map<ILicenseHeaderHandler,
List<File>> files)
{
if (files.size() > 0)
{
StringBuffer failString = new StringBuffer();
- for (Iterator iter = files.entrySet().iterator();
iter.hasNext();)
+ for (Entry<ILicenseHeaderHandler, List<File>> entry :
files.entrySet())
{
- Map.Entry entry = (Map.Entry) iter.next();
-
- ILicenseHeaderHandler licenseHeaderHandler =
(ILicenseHeaderHandler) entry.getKey();
- List/* <File> */fileList = (List)
entry.getValue();
+ ILicenseHeaderHandler licenseHeaderHandler =
entry.getKey();
+ List<File> fileList = entry.getValue();
failString.append("\n");
failString.append(licenseHeaderHandler.getClass().getName());
@@ -274,9 +269,8 @@
failString.append(fileList.size());
failString.append(") didn't have correct
license header:\n");
- for (Iterator iterator = fileList.iterator();
iterator.hasNext();)
+ for (File file : fileList)
{
- File file = (File)iterator.next();
String filename =
file.getAbsolutePath();
// Find the license type
@@ -306,7 +300,7 @@
}
private void visitDirectory(String[] suffixes, String[] ignoreFiles,
File directory,
- FileVisitor fileVisitor)
+ FileVisitor fileVisitor)
{
File[] files = directory.listFiles(new
SuffixAndIgnoreFileFilter(suffixes, ignoreFiles));
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/listener/ListenerSet.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/listener/ListenerSet.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/listener/ListenerSet.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/listener/ListenerSet.java
Tue May 6 13:14:50 2008
@@ -17,7 +17,6 @@
package org.apache.wicket.util.listener;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
/**
@@ -30,7 +29,7 @@
public abstract class ListenerSet
{
/** Set of change listeners */
- private final Set listeners = new HashSet();
+ private final Set<IListener> listeners = new HashSet<IListener>();
/**
* Adds a listener to this set of listeners.
@@ -50,12 +49,12 @@
public void notifyListeners()
{
// Create a stable copy for iterating over
- final Set copy = new HashSet(listeners);
+ final Set<IListener> copy = new HashSet<IListener>(listeners);
// Notify all listeners that the file changed
- for (final Iterator iterator = copy.iterator();
iterator.hasNext();)
+ for (IListener listener : copy)
{
- notifyListener((IListener)iterator.next());
+ notifyListener(listener);
}
}
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/MetaPattern.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/MetaPattern.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/MetaPattern.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/MetaPattern.java
Tue May 6 13:14:50 2008
@@ -51,7 +51,7 @@
private Pattern pattern;
/** List of patterns, or null if pattern variable is valid instead */
- private List patterns;
+ private List<MetaPattern> patterns;
/** The compiled MetaPattern */
private Pattern compiledPattern;
@@ -60,7 +60,7 @@
private static final String _DOUBLE_QUOTED_STRING = "\"[^\"]*?\"";
private static final String _SINGLE_QUOTED_STRING = "'[^']*?\'";
private static final String _STRING = "(?:[\\w\\-\\.]+|" +
_DOUBLE_QUOTED_STRING + "|" +
- _SINGLE_QUOTED_STRING + ")";
+ _SINGLE_QUOTED_STRING + ")";
private static final String _OPTIONAL_STRING = _STRING + "?";
private static final String _VARIABLE_NAME = "[A-Za-z_][A-Za-z0-9_]*";
private static final String _XML_NAME = "[A-Za-z_][A-Za-z0-9_.-]*";
@@ -164,7 +164,7 @@
/** Constant for a floating point number. */
public static final MetaPattern FLOATING_POINT_NUMBER = new MetaPattern(
- "-?\\d+\\.?\\d*|-?\\.\\d+");
+ "-?\\d+\\.?\\d*|-?\\.\\d+");
/** Constant for a positive integer. */
public static final MetaPattern POSITIVE_INTEGER = new
MetaPattern("\\d+");
@@ -198,7 +198,7 @@
/** Constant for perl interpolation. */
public static final MetaPattern PERL_INTERPOLATION = new
MetaPattern("$\\{" + _VARIABLE_NAME +
- "\\}");
+ "\\}");
/** Constant for a double quoted string. */
public static final MetaPattern DOUBLE_QUOTED_STRING = new
MetaPattern(_DOUBLE_QUOTED_STRING);
@@ -250,7 +250,7 @@
* @param patterns
* List of MetaPatterns
*/
- public MetaPattern(final List patterns)
+ public MetaPattern(final List<MetaPattern> patterns)
{
this.patterns = patterns;
}
@@ -316,6 +316,7 @@
* @return A String representing this MetaPattern
* @see java.lang.Object#toString()
*/
+ @Override
public String toString()
{
if (pattern != null)
@@ -368,7 +369,7 @@
{
for (int i = 0; i < patterns.size(); i++)
{
- group =
((MetaPattern)patterns.get(i)).bind(group);
+ group = (patterns.get(i)).bind(group);
}
}
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/OptionalMetaPattern.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/OptionalMetaPattern.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/OptionalMetaPattern.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/OptionalMetaPattern.java
Tue May 6 13:14:50 2008
@@ -54,7 +54,7 @@
*
* @param patterns
*/
- public OptionalMetaPattern(final List patterns)
+ public OptionalMetaPattern(final List<MetaPattern> patterns)
{
super(patterns);
}
@@ -72,6 +72,7 @@
/**
* @return String representation of this pattern
*/
+ @Override
public String toString()
{
return "(?:" + super.toString() + ")?";
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/parsers/ListParser.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/parsers/ListParser.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/parsers/ListParser.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/parse/metapattern/parsers/ListParser.java
Tue May 6 13:14:50 2008
@@ -39,7 +39,7 @@
private final MetaPattern separatorPattern;
/** The list elements parsed */
- private final List values = new ArrayList();
+ private final List<String> values = new ArrayList<String>();
/**
* Constructs a list parser from an entry MetaPattern, a separator
MetaPattern and an input
@@ -53,10 +53,10 @@
* The input to parse
*/
public ListParser(final MetaPattern entryPattern, final MetaPattern
separatorPattern,
- final CharSequence input)
+ final CharSequence input)
{
super(input);
- this.entryGroup = new Group(entryPattern);
+ entryGroup = new Group(entryPattern);
this.separatorPattern = separatorPattern;
}
@@ -66,6 +66,7 @@
* @see #getValues()
* @see
org.apache.wicket.util.parse.metapattern.parsers.MetaPatternParser#matches()
*/
+ @Override
public final boolean matches()
{
// Are there any more elements
@@ -96,7 +97,7 @@
*
* @return the parsed values
*/
- public final List getValues()
+ public final List<String> getValues()
{
return values;
}
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/PackageResourceStream.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/PackageResourceStream.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/PackageResourceStream.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/PackageResourceStream.java
Tue May 6 13:14:50 2008
@@ -51,16 +51,16 @@
* @param path
* The path to the resource
*/
- public PackageResourceStream(Class scope, String path)
+ public PackageResourceStream(Class< ? > scope, String path)
{
String absolutePath = Packages.absolutePath(scope, path);
resourceStream =
Application.get().getResourceSettings().getResourceStreamLocator().locate(
- scope, absolutePath, null, null, null);
+ scope, absolutePath, null, null, null);
if (resourceStream == null)
{
throw new WicketRuntimeException("Cannot find resource
with " + scope.getName() +
- " and path " + path);
+ " and path " + path);
}
}
@@ -69,6 +69,7 @@
resourceStream.close();
}
+ @Override
public String getContentType()
{
return resourceStream.getContentType();
@@ -79,11 +80,13 @@
return resourceStream.getInputStream();
}
+ @Override
public long length()
{
return resourceStream.length();
}
+ @Override
public Time lastModifiedTime()
{
return resourceStream.lastModifiedTime();
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/XSLTResourceStream.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/XSLTResourceStream.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/XSLTResourceStream.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/XSLTResourceStream.java
Tue May 6 13:14:50 2008
@@ -53,7 +53,7 @@
* @return a [EMAIL PROTECTED] Map} of XSLT parameters, appropriate for
passing information to the XSL
* stylesheet
*/
- protected Map getParameters()
+ protected Map<Object, Object> getParameters()
{
return null;
}
@@ -71,24 +71,23 @@
try
{
javax.xml.transform.Source xmlSource = new
javax.xml.transform.stream.StreamSource(
- xmlResource.getInputStream());
+ xmlResource.getInputStream());
javax.xml.transform.Source xsltSource = new
javax.xml.transform.stream.StreamSource(
- xsltResource.getInputStream());
+ xsltResource.getInputStream());
out = new ByteArrayOutputStream();
javax.xml.transform.Result result = new
javax.xml.transform.stream.StreamResult(out);
// create an instance of TransformerFactory
- javax.xml.transform.TransformerFactory transFact =
javax.xml.transform.TransformerFactory
- .newInstance();
+ javax.xml.transform.TransformerFactory transFact =
javax.xml.transform.TransformerFactory.newInstance();
javax.xml.transform.Transformer trans =
transFact.newTransformer(xsltSource);
- Map parameters = getParameters();
+ Map<Object, Object> parameters = getParameters();
if (parameters != null)
{
- Iterator it = parameters.entrySet().iterator();
+ Iterator<Entry<Object, Object>> it =
parameters.entrySet().iterator();
while (it.hasNext())
{
- Entry e = (Entry)it.next();
+ Entry<Object, Object> e = it.next();
trans.setParameter(e.getKey().toString(), e.getValue().toString());
}
}
@@ -125,6 +124,7 @@
*
* @see org.apache.wicket.util.resource.IResourceStream#getContentType()
*/
+ @Override
public String getContentType()
{
return null;
@@ -141,6 +141,7 @@
/**
* @see org.apache.wicket.util.resource.IResourceStream#length()
*/
+ @Override
public long length()
{
return out.size();
@@ -151,6 +152,7 @@
*
* @see org.apache.wicket.util.watch.IModifiable#lastModifiedTime()
*/
+ @Override
public Time lastModifiedTime()
{
return null;
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ExtensionResourceNameIterator.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ExtensionResourceNameIterator.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ExtensionResourceNameIterator.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ExtensionResourceNameIterator.java
Tue May 6 13:14:50 2008
@@ -45,7 +45,7 @@
* @author Juergen Donnerstag
* @author Jonathan Locke
*/
-public class ExtensionResourceNameIterator implements Iterator
+public class ExtensionResourceNameIterator implements Iterator<String>
{
/** The base path */
private final String path;
@@ -104,7 +104,7 @@
*
* @see java.util.Iterator#next()
*/
- public Object next()
+ public String next()
{
return path + extensions[index++];
}
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/IResourceStreamLocator.java
Tue May 6 13:14:50 2008
@@ -43,7 +43,7 @@
*
* @return The resource or null
*/
- public IResourceStream locate(Class clazz, String path);
+ public IResourceStream locate(Class< ? > clazz, String path);
/**
* Loads a resource, given a path, style, locale and extension.
@@ -61,6 +61,6 @@
*
* @return The resource or null
*/
- public IResourceStream locate(Class clazz, String path, String style,
Locale locale,
- String extension);
+ public IResourceStream locate(Class< ? > clazz, String path, String
style, Locale locale,
+ String extension);
}
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/LocaleResourceNameIterator.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/LocaleResourceNameIterator.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/LocaleResourceNameIterator.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/LocaleResourceNameIterator.java
Tue May 6 13:14:50 2008
@@ -46,7 +46,7 @@
* @author Juergen Donnerstag
* @author Jonathan Locke
*/
-public class LocaleResourceNameIterator implements Iterator
+public class LocaleResourceNameIterator implements Iterator<String>
{
/** The base path */
private final String path;
@@ -92,14 +92,14 @@
*/
public boolean hasNext()
{
- return (this.state < 4);
+ return (state < 4);
}
/**
*
* @see java.util.Iterator#next()
*/
- public Object next()
+ public String next()
{
if (locale == null)
{
@@ -110,10 +110,10 @@
// 1. Apply Locale default toString() implementation. See
Locale.
if (state == 0)
{
- this.state++;
- this.currentLocale = locale;
- this.currentPath = path + '_' + locale.toString();
- return this.currentPath;
+ state++;
+ currentLocale = locale;
+ currentPath = path + '_' + locale.toString();
+ return currentPath;
}
// Get language and country, either of which may be the empty
string
@@ -123,13 +123,13 @@
// 2. If country and language are available
if (state == 1)
{
- this.state++;
+ state++;
if (!Strings.isEmpty(language) &&
!Strings.isEmpty(country))
{
- this.currentLocale = new Locale(language,
country);
+ currentLocale = new Locale(language, country);
String newPath = path + '_' + language + '_' +
country;
- if (this.currentPath.equals(newPath) == false)
+ if (currentPath.equals(newPath) == false)
{
return newPath;
}
@@ -139,19 +139,19 @@
// 3. If language is available
if (state == 2)
{
- this.state++;
+ state++;
if (!Strings.isEmpty(language))
{
- this.currentLocale = new Locale(language);
+ currentLocale = new Locale(language);
return path + '_' + language;
}
}
// 4. The path only; without locale
- this.state++;
+ state++;
- this.currentLocale = null;
+ currentLocale = null;
return path;
}
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/OsgiResourceStreamLocator.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/OsgiResourceStreamLocator.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/OsgiResourceStreamLocator.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/OsgiResourceStreamLocator.java
Tue May 6 13:14:50 2008
@@ -48,7 +48,7 @@
* @see
org.apache.wicket.util.resource.locator.ResourceStreamLocator#locate(java.lang.Class,
* java.lang.String)
*/
- public IResourceStream locate(final Class clazz, final String path)
+ public IResourceStream locate(final Class< ? > clazz, final String path)
{
return super.locate(clazz, "/" + path);
}
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceNameIterator.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceNameIterator.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceNameIterator.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceNameIterator.java
Tue May 6 13:14:50 2008
@@ -48,7 +48,7 @@
*
* @author Juergen Donnerstag
*/
-public class ResourceNameIterator implements Iterator
+public class ResourceNameIterator implements Iterator<String>
{
// The locale to search for the resource file
private final Locale locale;
@@ -57,9 +57,9 @@
private final String extensions;
// The various iterators used to locate the resource file
- private final Iterator styleIterator;
+ private final Iterator<String> styleIterator;
private LocaleResourceNameIterator localeIterator;
- private Iterator extenstionsIterator;
+ private Iterator<String> extenstionsIterator;
// The latest exact Locale used
private Locale currentLocale;
@@ -129,7 +129,7 @@
{
// Get the next Locale from the iterator and
start the next
// inner iterator over again.
- String newPath = (String)localeIterator.next();
+ String newPath = localeIterator.next();
currentLocale = localeIterator.getLocale();
extenstionsIterator = new
ExtensionResourceNameIterator(newPath, extensions);
if (extenstionsIterator.hasNext() == true)
@@ -144,12 +144,12 @@
// variations
while (styleIterator.hasNext())
{
- String newPath = (String)styleIterator.next();
+ String newPath = styleIterator.next();
localeIterator = new
LocaleResourceNameIterator(newPath, locale);
while (localeIterator.hasNext())
{
- newPath = (String)localeIterator.next();
+ newPath = localeIterator.next();
currentLocale = localeIterator.getLocale();
extenstionsIterator = new
ExtensionResourceNameIterator(newPath, extensions);
if (extenstionsIterator.hasNext() == true)
@@ -166,7 +166,7 @@
/**
* @see java.util.Iterator#next()
*/
- public Object next()
+ public String next()
{
if (extenstionsIterator != null)
{
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceStreamLocator.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceStreamLocator.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceStreamLocator.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/ResourceStreamLocator.java
Tue May 6 13:14:50 2008
@@ -84,7 +84,7 @@
* @see
org.apache.wicket.util.resource.locator.IResourceStreamLocator#locate(java.lang.Class,
* java.lang.String)
*/
- public IResourceStream locate(final Class clazz, final String path)
+ public IResourceStream locate(final Class< ? > clazz, final String path)
{
// First try with the resource finder registered with the
application
// (allows for markup reloading)
@@ -109,8 +109,8 @@
* @see
org.apache.wicket.util.resource.locator.IResourceStreamLocator#locate(java.lang.Class,
* java.lang.String, java.lang.String, java.util.Locale,
java.lang.String)
*/
- public IResourceStream locate(final Class clazz, String path, final
String style,
- final Locale locale, final String extension)
+ public IResourceStream locate(final Class< ? > clazz, String path,
final String style,
+ final Locale locale, final String extension)
{
// Try the various combinations of style, locale and extension
to find
// the resource.
@@ -137,7 +137,7 @@
* @param path
* @return resource stream
*/
- protected IResourceStream locateByClassLoader(final Class clazz, final
String path)
+ protected IResourceStream locateByClassLoader(final Class< ? > clazz,
final String path)
{
ClassLoader classLoader = null;
if (clazz != null)
@@ -162,7 +162,7 @@
if (log.isDebugEnabled())
{
log.debug("Attempting to locate resource '" + path + "'
using classloader " +
- classLoader);
+ classLoader);
}
// Try loading path using classloader
@@ -181,9 +181,9 @@
* @param path
* @return resource stream
*/
- protected IResourceStream locateByResourceFinder(final Class clazz,
final String path)
+ protected IResourceStream locateByResourceFinder(final Class< ? >
clazz, final String path)
{
- if (this.finder == null)
+ if (finder == null)
{
finder =
Application.get().getResourceSettings().getResourceFinder();
}
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/StyleAndVariationResourceNameIterator.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/StyleAndVariationResourceNameIterator.java?rev=653902&r1=653901&r2=653902&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/StyleAndVariationResourceNameIterator.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/util/resource/locator/StyleAndVariationResourceNameIterator.java
Tue May 6 13:14:50 2008
@@ -42,7 +42,7 @@
* @author Juergen Donnerstag
* @author Jonathan Locke
*/
-public class StyleAndVariationResourceNameIterator implements Iterator
+public class StyleAndVariationResourceNameIterator implements Iterator<String>
{
/** The base path */
private final String path;
@@ -64,7 +64,7 @@
* @param variation
*/
public StyleAndVariationResourceNameIterator(final String path, final
String style,
- final String variation)
+ final String variation)
{
this.path = path;
this.style = style;
@@ -77,14 +77,14 @@
*/
public boolean hasNext()
{
- return (this.state < 3);
+ return (state < 3);
}
/**
*
* @see java.util.Iterator#next()
*/
- public Object next()
+ public String next()
{
if (state == 0)
{