Skip to content

Commit

Permalink
CR carried out
Browse files Browse the repository at this point in the history
  • Loading branch information
zub4t committed Jun 25, 2024
1 parent 8426120 commit 793dbe2
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
Expand All @@ -9,7 +9,6 @@
*
* Contributors:
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
* zub4t - Improving failure detail message
*
*/

Expand All @@ -33,11 +32,7 @@ public StreamFailure(List<String> messages, Reason reason) {
@Override
public String getFailureDetail() {
var str = super.getFailureDetail();
if (str != null && !str.isEmpty()) {
str = reason + ": " + str;
return str;
}
return String.valueOf(reason);
return (str != null && !str.isEmpty()) ? (reason + ": " + str) : (reason + "");
}

public Reason getReason() {
Expand Down

0 comments on commit 793dbe2

Please sign in to comment.