Added missing * to comment, added toString() for debugging.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/1.6@4528 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefix.java b/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefix.java
index 25537bb..c844d86 100644
--- a/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefix.java
+++ b/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefix.java
@@ -135,6 +135,11 @@
return shouldReroot;
}
+ @Override
+ public String toString() {
+ return prefix + (shouldReroot ? "**" : "*") + (filter == null ? "" : "?");
+ }
+
private void assertValidPrefix(String prefix) {
assert (prefix != null);
assert ("".equals(prefix) || (!prefix.startsWith("/") && prefix.endsWith("/"))) : "malformed prefix";
diff --git a/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefixSet.java b/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefixSet.java
index d0bf0d2..cbb2a9a 100644
--- a/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefixSet.java
+++ b/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefixSet.java
@@ -91,15 +91,15 @@
}
/**
- * The sequence number in which the PathPrefix was added.
- */
- private int size = 0;
-
- /**
* Map of pathPrefix => the sequence number when the pathPrefix was added.
*/
private final Map<PathPrefix, Integer> prefixes = new HashMap<PathPrefix, Integer>();
+
private final TrieNode rootTrieNode = new TrieNode("/");
+ /**
+ * The sequence number in which the PathPrefix was added.
+ */
+ private int size = 0;
/**
* @param prefix the prefix to add
@@ -264,7 +264,7 @@
/**
* Returns true if the first pathPrefix is inserted into the PathPrefixSet
- * after the second pathPrefix. Also, rereooting PathPrefixes take priority
+ * after the second pathPrefix. Also, rereooting PathPrefixes take priority
* over non-rerooting ones (ie, super-source).
*/
public boolean secondPrefixOverridesFirst(PathPrefix prefix1,
@@ -279,6 +279,11 @@
return rank2 > rank1;
}
+ @Override
+ public String toString() {
+ return rootTrieNode.toString();
+ }
+
public Collection<PathPrefix> values() {
return Collections.unmodifiableCollection(prefixes.keySet());
}
diff --git a/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java b/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java
index 4144e28..5473026 100644
--- a/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java
+++ b/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java
@@ -303,7 +303,7 @@
new ClassPathEntry[] {cpe1, cpe2}, pp1, pp2);
}
- /*
+ /**
* Ensure refresh is stable when multiple classpaths + multiple path prefixes
* all include the same resource.
*/