diff --git a/org.springframework.core/src/main/java/org/springframework/util/AntPatchStringMatcher.java b/org.springframework.core/src/main/java/org/springframework/util/AntPatchStringMatcher.java
index b747bee726f..2bee2e4e4f8 100644
--- a/org.springframework.core/src/main/java/org/springframework/util/AntPatchStringMatcher.java
+++ b/org.springframework.core/src/main/java/org/springframework/util/AntPatchStringMatcher.java
@@ -1,11 +1,29 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.springframework.util;
import java.util.Map;
/**
- * Package-protected helper class for {@link AntPathMatcher}. Tests whether or not a string matches against a pattern.
- * The pattern may contain special characters:
'*' means zero or more characters
'?' means one and only one
- * character, '{' and '}' indicate a uri template pattern
+ * Package-protected helper class for {@link AntPathMatcher}.
+ * Tests whether or not a string matches against a pattern.
+ *
+ *
The pattern may contain special characters: '*' means zero or more characters;
+ * '?' means one and only one character; '{' and '}' indicate a URI template pattern.
*
* @author Arjen Poutsma
* @since 3.0
@@ -28,29 +46,24 @@ class AntPatchStringMatcher {
private final MapAntPatchStringMatcher. */
- AntPatchStringMatcher(String pattern, String str, MapAntPatchStringMatcher.
+ */
+ public AntPatchStringMatcher(String pattern, String str, Maptrue if the string matches against the pattern, or false otherwise.
*/
- boolean matchStrings() {
+ public boolean matchStrings() {
if (shortcutPossible()) {
return doShortcut();
}
@@ -119,6 +132,14 @@ class AntPatchStringMatcher {
return onlyStarsLeft();
}
+ private void addTemplateVariable(int curlyIdxStart, int curlyIdxEnd, int valIdxStart, int valIdxEnd) {
+ if (uriTemplateVariables != null) {
+ String varName = new String(patArr, curlyIdxStart + 1, curlyIdxEnd - curlyIdxStart - 1);
+ String varValue = new String(strArr, valIdxStart, valIdxEnd - valIdxStart + 1);
+ uriTemplateVariables.put(varName, varValue);
+ }
+ }
+
private boolean consecutiveStars(int patIdxTmp) {
if (patIdxTmp == patIdxStart + 1 && patArr[patIdxStart] == '*' && patArr[patIdxTmp] == '*') {
// Two stars next to each other, skip the first one.
diff --git a/org.springframework.core/src/main/java/org/springframework/util/CachingMapDecorator.java b/org.springframework.core/src/main/java/org/springframework/util/CachingMapDecorator.java
index 7ba4d8b6f3a..f758e412a2f 100644
--- a/org.springframework.core/src/main/java/org/springframework/util/CachingMapDecorator.java
+++ b/org.springframework.core/src/main/java/org/springframework/util/CachingMapDecorator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -106,7 +106,7 @@ public class CachingMapDecorator