Skip to content

Commit

Permalink
fix: exclude interfaces from transformation
Browse files Browse the repository at this point in the history
Signed-off-by: Joke de Buhr <[email protected]>
  • Loading branch information
joke committed Nov 27, 2022
1 parent 1420bd9 commit b48f9dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion spock-mockable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ test {
useJUnitPlatform()
jvmArgs += [
'-Dorg.slf4j.simpleLogger.defaultLogLevel=debug',
'-Dspock-mockable.disabled=true'
'-Dspock-mockable.disabled=true',
// '-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5005,suspend=n'
]
}

Expand All @@ -94,3 +95,10 @@ publishing {
}
}
}

tasks.withType(GroovyCompile) {
// groovyOptions.fork = true
// groovyOptions.forkOptions.jvmArgs = [
// '-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5006,suspend=n'
// ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ protected Optional<Class<?>> extractClass(final ClassNode classNode) {
protected void checkAndLogError(@Nullable final Class<?> clazz) {
if (clazz != null) {
classDetected = true;
classCollector.addClass(clazz);
if (isTransformable(clazz)) {
classCollector.addClass(clazz);
}
} else if (!classDetected) {
logError();
}
}

protected boolean isTransformable(final Class<?> clazz) {
return clazz != Object.class && !clazz.isInterface();
}
}
}

0 comments on commit b48f9dc

Please sign in to comment.