From 3f680fcda4007d7d00931846839eaf37a244cfaa Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 13 May 2014 16:12:10 +0200 Subject: DifferenceAccumulatingHandler.isClassConsidered(..): Fix case where class names are reported with '.' --- .../org/semver/jardiff/DifferenceAccumulatingHandler.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'api') diff --git a/api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java b/api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java index b33a711..53b2c54 100755 --- a/api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java +++ b/api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java @@ -42,7 +42,7 @@ import org.semver.Delta.Remove; * */ public final class DifferenceAccumulatingHandler extends AbstractDiffHandler { - + private static final boolean DEBUG = false; private String currentClassName; private final Set includes; private final Set excludes; @@ -240,7 +240,17 @@ public final class DifferenceAccumulatingHandler extends AbstractDiffHandler { * * @return */ + @SuppressWarnings("unused") protected boolean isClassConsidered( final String className ) { + // Fix case where class names are reported with '.' + final String className2 = className.replace('.', '/'); + final boolean b = isClassConsideredImpl(className2); + if( DEBUG && !b ) { + System.err.println("dropped: "+className+" -> "+className2); + } + return b; + } + protected boolean isClassConsideredImpl( final String className ) { for ( String exclude : this.excludes ) { if ( exclude.contains( "/**/" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); -- cgit v1.2.3