You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2008/12/23 21:52:32 UTC

svn commit: r729108 - in /wicket/trunk/wicket/src/main/java/org/apache/wicket/application: ReloadingClassLoader.java WildcardMatcherHelper.java

Author: jdonnerstag
Date: Tue Dec 23 12:52:32 2008
New Revision: 729108

URL: http://svn.apache.org/viewvc?rev=729108&view=rev
Log:
wicket-1360 fixed: Wrong path separator in reloading classloader patterns

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/application/ReloadingClassLoader.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/application/WildcardMatcherHelper.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/application/ReloadingClassLoader.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/application/ReloadingClassLoader.java?rev=729108&r1=729107&r2=729108&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/application/ReloadingClassLoader.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/application/ReloadingClassLoader.java Tue Dec 23 12:52:32 2008
@@ -93,6 +93,7 @@
 				{
 					continue;
 				}
+				// FIXME it seems that only "includes" are handled. "Excludes" are ignored
 				boolean isInclude = rawpattern.substring(0, 1).equals("+");
 				String pattern = rawpattern.substring(1);
 				if (WildcardMatcherHelper.match(pattern, name) != null)
@@ -210,10 +211,11 @@
 	 * Gets a resource from this <code>ClassLoader</class>.  If the
 	 * resource does not exist in this one, we check the parent.
 	 * Please note that this is the exact opposite of the
-	 * <code>ClassLoader</code> spec.  We use it to work around
-	 * inconsistent class loaders from third party vendors.
-	 *
-	 * @param name of resource
+	 * <code>ClassLoader</code> spec. We use it to work around inconsistent class loaders from third
+	 * party vendors.
+	 * 
+	 * @param name
+	 *            of resource
 	 */
 	@Override
 	public final URL getResource(final String name)
@@ -232,20 +234,22 @@
 	 * Loads the class from this <code>ClassLoader</class>.  If the
 	 * class does not exist in this one, we check the parent.  Please
 	 * note that this is the exact opposite of the
-	 * <code>ClassLoader</code> spec.  We use it to load the class
-	 * from the same classloader as WicketFilter or WicketServlet.
-	 * When found, the class file is watched for modifications.
-	 *
-	 * @param     name the name of the class
-	 * @param     resolve if <code>true</code> then resolve the class
-	 * @return    the resulting <code>Class</code> object
-	 * @exception ClassNotFoundException if the class could not be found
+	 * <code>ClassLoader</code> spec. We use it to load the class from the same classloader as
+	 * WicketFilter or WicketServlet. When found, the class file is watched for modifications.
+	 * 
+	 * @param name
+	 *            the name of the class
+	 * @param resolve
+	 *            if <code>true</code> then resolve the class
+	 * @return the resulting <code>Class</code> object
+	 * @exception ClassNotFoundException
+	 *                if the class could not be found
 	 */
 	@Override
-	public final Class< ? > loadClass(String name, boolean resolve) throws ClassNotFoundException
+	public final Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
 	{
 		// First check if it's already loaded
-		Class< ? > clazz = findLoadedClass(name);
+		Class<?> clazz = findLoadedClass(name);
 
 		if (clazz == null)
 		{
@@ -308,7 +312,7 @@
 	 * @param clz
 	 *            the class to watch
 	 */
-	private void watchForModifications(Class< ? > clz)
+	private void watchForModifications(Class<?> clz)
 	{
 		// Watch class in the future
 		Iterator<URL> locationsIterator = urls.iterator();

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/application/WildcardMatcherHelper.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/application/WildcardMatcherHelper.java?rev=729108&r1=729107&r2=729108&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/application/WildcardMatcherHelper.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/application/WildcardMatcherHelper.java Tue Dec 23 12:52:32 2008
@@ -30,29 +30,28 @@
 	// ~ Static fields/initializers
 	// -----------------------------------------------------------------
 
-	/** Default path separator: "/" */
+	/** Escape character */
 	public static final char ESC = '\\';
 
-	/** Default path separator: "/" */
-	public static final char PATHSEP = '/';
+	/** Default path separator: "." */
+	public static final char PATHSEP = '.';
 
-	/** Default path separator: "/" */
+	/** any char */
 	public static final char STAR = '*';
 
 	// ~ Methods
 	// ------------------------------------------------------------------------------------
 
 	/**
-	 * Match a pattern against a string and isolates wildcard replacement into a <code>Map</code>.
-	 * <br>
+	 * Match a pattern against a string and isolates wildcard replacement into a <code>Map</code>. <br>
 	 * Here is how the matching algorithm works:
 	 * 
 	 * <ul>
-	 * <li> The '*' character, meaning that zero or more characters (excluding the path separator
-	 * '/') are to be matched. </li>
-	 * <li> The '**' sequence, meaning that zero or more characters (including the path separator
-	 * '/') are to be matched. </li>
-	 * <li> The '\*' sequence is honored as a literal '*' character, not a wildcard </li>
+	 * <li>The '*' character, meaning that zero or more characters (excluding the path separator
+	 * '/') are to be matched.</li>
+	 * <li>The '**' sequence, meaning that zero or more characters (including the path separator
+	 * '/') are to be matched.</li>
+	 * <li>The '\*' sequence is honored as a literal '*' character, not a wildcard</li>
 	 * </ul>
 	 * <br>
 	 * When more than two '*' characters, not separated by another character, are found their value
@@ -76,9 +75,9 @@
 	 *            The string to math against the pattern
 	 * 
 	 * @return a <code>Map</code> containing the representation of the extracted pattern. The
-	 *         extracted patterns are keys in the <code>Map</code> from left to right beginning
-	 *         with "1" for the left most, "2" for the next, a.s.o. The key "0" is the string
-	 *         itself. If the return value is null, string does not match to the pattern .
+	 *         extracted patterns are keys in the <code>Map</code> from left to right beginning with
+	 *         "1" for the left most, "2" for the next, a.s.o. The key "0" is the string itself. If
+	 *         the return value is null, string does not match to the pattern .
 	 */
 	public static Map<String, String> match(final String pat, final String str)
 	{