aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/JavaConfiguration.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-03-25 00:19:14 +0000
committerKenneth Russel <[email protected]>2006-03-25 00:19:14 +0000
commit62c9fd1b4bcba9ad6cac5756b6113542f2d867e3 (patch)
tree7d5434783700660199a01439cd9d6a385122072f /src/java/com/sun/gluegen/JavaConfiguration.java
parent6502e754c6f4c12148433d2376cc241c374d9fc7 (diff)
Applied Unignore / IgnoreNot patch from Justin Couch
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@23 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src/java/com/sun/gluegen/JavaConfiguration.java')
-rw-r--r--src/java/com/sun/gluegen/JavaConfiguration.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/java/com/sun/gluegen/JavaConfiguration.java b/src/java/com/sun/gluegen/JavaConfiguration.java
index b5f43d6..18001aa 100644
--- a/src/java/com/sun/gluegen/JavaConfiguration.java
+++ b/src/java/com/sun/gluegen/JavaConfiguration.java
@@ -98,6 +98,7 @@ public class JavaConfiguration {
private Set/*<Pattern>*/ ignores = new HashSet();
private Map/*<String,Pattern>*/ ignoreMap = new HashMap();
private Set/*<Pattern>*/ ignoreNots = new HashSet();
+ private Set/*<Pattern>*/ unignores = new HashSet();
private Set/*<Pattern>*/ unimplemented = new HashSet();
private Set/*<String>*/ nioDirectOnly = new HashSet();
private Set/*<String>*/ manuallyImplement = new HashSet();
@@ -468,7 +469,23 @@ public class JavaConfiguration {
Pattern regexp = (Pattern)iter.next();
Matcher matcher = regexp.matcher(symbol);
if (!matcher.matches()) {
- return true;
+ // Special case as this is most often likely to be the case.
+ // Unignores are not used very often.
+ if(unignores.size() == 0)
+ return true;
+
+ boolean unignoreFound = false;
+ for (Iterator iter2 = unignores.iterator(); iter2.hasNext(); ) {
+ Pattern unignoreRegexp = (Pattern)iter2.next();
+ Matcher unignoreMatcher = unignoreRegexp.matcher(symbol);
+ if (unignoreMatcher.matches()) {
+ unignoreFound = true;
+ break;
+ }
+ }
+
+ if (!unignoreFound)
+ return true;
}
}
}
@@ -819,6 +836,13 @@ public class JavaConfiguration {
Pattern pattern = (Pattern) ignoreMap.get(regex);
ignoreMap.remove(regex);
ignores.remove(pattern);
+
+ // If the pattern wasn't registered before, then make sure we have a
+ // valid pattern instance to put into the unignores set.
+ if(pattern == null)
+ pattern = Pattern.compile(regex);
+ unignores.add(pattern);
+
//System.err.println("UN-IGNORING " + regex + " / " + ignores.get(regex));
} catch (NoSuchElementException e) {
throw new RuntimeException("Error parsing \"Unignore\" command at line " + lineNo +