From 62c9fd1b4bcba9ad6cac5756b6113542f2d867e3 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sat, 25 Mar 2006 00:19:14 +0000 Subject: 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 --- src/java/com/sun/gluegen/JavaConfiguration.java | 26 ++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/java/com') 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/**/ ignores = new HashSet(); private Map/**/ ignoreMap = new HashMap(); private Set/**/ ignoreNots = new HashSet(); + private Set/**/ unignores = new HashSet(); private Set/**/ unimplemented = new HashSet(); private Set/**/ nioDirectOnly = new HashSet(); private Set/**/ 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 + -- cgit v1.2.3