From f200a926ba0312248ff2dc1125d649732b99b99c Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Mon, 18 Nov 2024 07:37:22 +0100 Subject: [PATCH] Document follow-up work --- .../errorprone/bugpatterns/RedundantStringEscape.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringEscape.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringEscape.java index 6e9690f7cc..f699c3d669 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringEscape.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RedundantStringEscape.java @@ -17,6 +17,12 @@ import tech.picnic.errorprone.utils.SourceCode; /** A {@link BugChecker} that flags string constants with extraneous escaping. */ +// XXX: Also cover `\"` sequences inside text blocks. Note that this requires a more subtle +// approach, as double-quote characters will need to remain escaped if removing the backslash would +// create a new sequence of three or more double-quotes. (TBD whether we'd like to enforce a +// "preferred" approach to escaping, e.g. by always escaping the last of a triplet, such that the +// over-all number of escaped characters is minimized.) +// XXX: Also flag `'\"'` char literals. @AutoService(BugChecker.class) @BugPattern( summary = "Inside string expressions single quotes do not need to be escaped",