Skip to content

Commit

Permalink
Add fail last error handler if fail fast is not enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Dec 2, 2021
1 parent c9d4b3c commit 832a333
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Expand Up @@ -213,8 +213,8 @@ public void testWithAuxiliaryField() throws Exception {
assertThat(instrumentedType.getLoadedTypeInitializer().isAlive(), is(true));
}

@SuppressWarnings("unchecked")
@Test(expected = IllegalStateException.class)
@SuppressWarnings("unchecked")
public void testWithAuxiliaryFieldConflict() throws Exception {
TypeDescription.Generic fieldType = mock(TypeDescription.Generic.class);
when(fieldType.accept(Mockito.any(TypeDescription.Generic.Visitor.class))).thenReturn(fieldType);
Expand Down
Expand Up @@ -417,7 +417,7 @@ protected void doApply(Plugin.Engine.Source source, Plugin.Engine.Target target)
? Plugin.Engine.ErrorHandler.Enforcing.NO_LIVE_INITIALIZERS
: Plugin.Engine.Listener.NoOp.INSTANCE, isFailFast()
? Plugin.Engine.ErrorHandler.Failing.FAIL_FAST
: Plugin.Engine.Listener.NoOp.INSTANCE)
: Plugin.Engine.ErrorHandler.Failing.FAIL_LAST)
.with(getThreads() == 0
? Plugin.Engine.Dispatcher.ForSerialTransformation.Factory.INSTANCE
: new Plugin.Engine.Dispatcher.ForParallelTransformation.WithThrowawayExecutorService.Factory(getThreads()))
Expand Down
Expand Up @@ -118,6 +118,7 @@ protected AbstractByteBuddyTaskExtension() {
suffix = "";
failOnLiveInitializer = true;
warnOnEmptyTypeSet = true;
failFast = true;
discovery = Discovery.EMPTY;
adjustment = Adjustment.FULL;
adjustmentErrorHandler = Adjustment.ErrorHandler.WARN;
Expand Down
Expand Up @@ -39,13 +39,12 @@ public void testDefaultProperties() {
assertThat(extension.getSuffix(), is(""));
assertThat(extension.getThreads(), is(0));
assertThat(extension.isExtendedParsing(), is(false));
assertThat(extension.isFailFast(), is(false));
assertThat(extension.isFailFast(), is(true));
assertThat(extension.isFailOnLiveInitializer(), is(true));
assertThat(extension.getAdjustment(), is(Adjustment.FULL));
assertThat(extension.getAdjustmentErrorHandler(), is(Adjustment.ErrorHandler.WARN));
assertThat(extension.getAdjustmentPostProcessor(), is((Action<Task>) Adjustment.NoOpPostProcessor.INSTANCE));
assertThat(extension.isWarnOnEmptyTypeSet(), is(true));
assertThat(extension.isFailFast(), is(false));
assertThat(extension.isLazy(), is(false));
assertThat(extension.getDiscovery(), is(Discovery.EMPTY));
assertThat(extension.getClassFileVersion(), nullValue(ClassFileVersion.class));
Expand Down
Expand Up @@ -397,7 +397,7 @@ private Plugin.Engine.Summary apply(File root,
? Plugin.Engine.ErrorHandler.Enforcing.NO_LIVE_INITIALIZERS
: Plugin.Engine.Listener.NoOp.INSTANCE, failFast
? Plugin.Engine.ErrorHandler.Failing.FAIL_FAST
: Plugin.Engine.Listener.NoOp.INSTANCE)
: Plugin.Engine.ErrorHandler.Failing.FAIL_LAST)
.with(threads == 0
? Plugin.Engine.Dispatcher.ForSerialTransformation.Factory.INSTANCE
: new Plugin.Engine.Dispatcher.ForParallelTransformation.WithThrowawayExecutorService.Factory(threads))
Expand Down

0 comments on commit 832a333

Please sign in to comment.