dcapwell commented on code in PR #2660:
URL: https://github.com/apache/cassandra/pull/2660#discussion_r1320332842


##########
src/java/org/apache/cassandra/exceptions/RepairException.java:
##########
@@ -27,9 +29,9 @@ public class RepairException extends Exception
 {
     private final boolean shouldLogWarn;
 
-    private RepairException(RepairJobDesc desc, PreviewKind previewKind, 
String message, boolean shouldLogWarn)
+    private RepairException(@Nullable RepairJobDesc desc, PreviewKind 
previewKind, String message, boolean shouldLogWarn)
     {
-        this(desc.toString(previewKind != null ? previewKind : 
PreviewKind.NONE) + ' ' + message, shouldLogWarn);
+        this((desc == null ? "" : desc.toString(previewKind != null ? 
previewKind : PreviewKind.NONE)) + ' ' + message, shouldLogWarn);

Review Comment:
   > I wonder if there's an alternative
   
   some of the code that calls this path only know `RepairMessage`, so seems 
tricky as we need type checks or something to solve this without using null?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to