aboutsummaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authoremc <none@none>2013-09-11 08:30:58 -0400
committeremc <none@none>2013-09-11 08:30:58 -0400
commite33ea5db83d448e4f9682b045b799f4d4e46e26c (patch)
tree356477512394a89c4a5f15d4e99e98629d0ec98a /test/lib
parent21830a53d79422ea1d48406d0e35b35449091d28 (diff)
8024510: lib/combo/tools/javac/combo/TemplateTest.java fails
Summary: Edit regex in Template to allow "MAJOR." pattern. Reviewed-by: briangoetz
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/combo/tools/javac/combo/Template.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/lib/combo/tools/javac/combo/Template.java b/test/lib/combo/tools/javac/combo/Template.java
index 8ad4d72e..ad8aeb9f 100644
--- a/test/lib/combo/tools/javac/combo/Template.java
+++ b/test/lib/combo/tools/javac/combo/Template.java
@@ -40,11 +40,22 @@ public interface Template {
public static class Behavior {
/* Looks for expandable keys. An expandable key can take the form:
* #{MAJOR}
+ * #{MAJOR.}
* #{MAJOR.MINOR}
- * where MAJOR can be IDENTIFIER or IDENTIFIER[NUMERIC_INDEX]
- * and MINOR can be an identifier
+ * where MAJOR can be IDENTIFIER or IDENTIFIER[NUMERIC_INDEX]
+ * and MINOR can be an identifier.
+ *
+ * The ability to have an empty minor is provided on the
+ * assumption that some tests that can be written with this
+ * will find it useful to make a distinction akin to
+ * distinguishing F from F(), where F is a function pointer,
+ * and also cases of #{FOO.#{BAR}}, where BAR expands to an
+ * empty string.
+ *
+ * However, this being a general-purpose framework, the exact
+ * use is left up to the test writers.
*/
- private static final Pattern pattern = Pattern.compile("#\\{([A-Z_][A-Z0-9_]*(?:\\[\\d+\\])?)(?:\\.([A-Z_][A-Z0-9_]*))?\\}");
+ private static final Pattern pattern = Pattern.compile("#\\{([A-Z_][A-Z0-9_]*(?:\\[\\d+\\])?)(?:\\.([A-Z0-9_]*))?\\}");
public static String expandTemplate(String template, final Map<String, Template> vars) {
return expandTemplate(template, new MapResolver(vars));