diff options
author | Sven Gothel <[email protected]> | 2014-05-13 16:12:10 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-05-13 23:05:54 +0200 |
commit | 3f680fcda4007d7d00931846839eaf37a244cfaa (patch) | |
tree | 43383b23f1899a88743eb044bf90808783b8b9e3 /api | |
parent | d44d189bfd816a9936ae20d8582ec8475c830189 (diff) |
DifferenceAccumulatingHandler.isClassConsidered(..): Fix case where class names are reported with '.'
Diffstat (limited to 'api')
-rwxr-xr-x | api/src/main/java/org/semver/jardiff/DifferenceAccumulatingHandler.java | 12 |
1 files changed, 11 insertions, 1 deletions
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<String> includes; private final Set<String> 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}**/" ); |