Skip to content

Commit

Permalink
Make the $spock_interceptor field synthetic (spockframework#1031)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire authored and leonard84 committed Jan 12, 2020
1 parent 3b2e01c commit dd33a2f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.TypeCache;
import net.bytebuddy.description.modifier.SynchronizationState;
import net.bytebuddy.description.modifier.SyntheticState;
import net.bytebuddy.description.modifier.Visibility;
import net.bytebuddy.dynamic.Transformer;
import net.bytebuddy.dynamic.loading.ClassInjector;
Expand Down Expand Up @@ -66,7 +67,7 @@ public Class<?> call() throws Exception {
.transform(Transformer.ForMethod.withModifiers(SynchronizationState.PLAIN, Visibility.PUBLIC)) // Overridden methods should be public and non-synchronized.
.implement(ByteBuddyInterceptorAdapter.InterceptorAccess.class)
.intercept(FieldAccessor.ofField("$spock_interceptor"))
.defineField("$spock_interceptor", IProxyBasedMockInterceptor.class, Visibility.PRIVATE)
.defineField("$spock_interceptor", IProxyBasedMockInterceptor.class, Visibility.PRIVATE, SyntheticState.SYNTHETIC)
.make()
.load(classLoader, strategy)
.getLoaded();
Expand Down

0 comments on commit dd33a2f

Please sign in to comment.