Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void launcherDiscoveryFinished(LauncherDiscoveryRequest request) {
if (orderer.isEmpty() || !(orderer.get()
.equals(DESIRED_CLASS_ORDERER.getName())
|| orderer.get().equals(CONFIG_SETTING_DESIRED_CLASS_ORDERER.getName()))) {
if (facadeLoader.hasMultipleClassLoaders()) {
if (facadeLoader != null && facadeLoader.hasMultipleClassLoaders()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The facadeLoader is also accessed in line 127, should we move this null check to there instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good question. With the caveat that a null FCL should never happen, thinking about the logic here, just moving the check up and bypassing the whole block if the FCL is null isn't right. For the resetting of the TCCL, we can safely skip if the FCL is null, because that implies the TCCL has already been reset.

For the orderer check, without an FCL, we can't properly check if the orderer override would cause problems. But it's an edge case of an edge case of an edge case.

I'll add an extra guard on the first usage of FCL, so that the subsequent guard doesn't look stupid. But I think I won't wrap everything in the guard, even though it's functionally equivalent, because it's semantically wrong.

String message = getFailureMessageForJUnitMisconfiguration(orderer);
throw new IllegalStateException(message);
}
Expand All @@ -157,7 +157,7 @@ private static String getFailureMessageForJUnitMisconfiguration(Optional<String>
String message;
if (orderer.isPresent()) {
message = String.format(
"%sTo set a test order while preserving the Quarkus required sorting, please set use the Quarkus configuration to set junit.quarkus.orderer.secondary-orderer=%s, and remove the junit-platform.properties (if any) from the classpath.",
"%sTo set a test order while preserving the Quarkus required sorting, please use the Quarkus configuration to set junit.quarkus.orderer.secondary-orderer=%s, and remove the junit-platform.properties (if any) from the classpath.",
generalExplanation, orderer.get());
} else {
message = String.format(
Expand Down
Loading