Skip to content

Commit

Permalink
Merge pull request #33220 from sdeleuze
Browse files Browse the repository at this point in the history
* pr/33220:
  Polish 'Refine BackgroundPreinitializer Jackson initialization'
  Refine BackgroundPreinitializer Jackson initialization

Closes gh-33220
  • Loading branch information
philwebb committed Nov 16, 2022
2 parents a650361 + 6cc6a15 commit c1fe43a
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,22 @@ private void performPreinitialization() {
public void run() {
runSafely(new ConversionServiceInitializer());
runSafely(new ValidationInitializer());
runSafely(new MessageConverterInitializer());
runSafely(new JacksonInitializer());
if (!runSafely(new MessageConverterInitializer())) {
// If the MessageConverterInitializer we still might be able to
// initialize Jackson
runSafely(new JacksonInitializer());
}
runSafely(new CharsetInitializer());
preinitializationComplete.countDown();
}

public void runSafely(Runnable runnable) {
boolean runSafely(Runnable runnable) {
try {
runnable.run();
return true;
}
catch (Throwable ex) {
// Ignore
return false;
}
}

Expand Down

0 comments on commit c1fe43a

Please sign in to comment.