Skip to content

Commit 494c027

Browse files
edburnsCopilot
andcommitted
Add CodeQL suppression for intentional string identity comparison
The lgtm[java/reference-equality-on-strings] comment suppresses CodeQL for the ABSENT_SENTINEL identity check. Java's @SuppressWarnings is not honored by CodeQL's analysis engine. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c4e523e3-9d39-4598-90ec-54d959c44ce8
1 parent 60bee63 commit 494c027

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

java/sdk/src/test/java/com/github/copilot/ffi/InProcessEnvGuard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void close() {
123123
// Identity comparison is intentional: ABSENT_SENTINEL is a unique instance
124124
// used to distinguish "env var was absent" from "env var was empty string".
125125
@SuppressWarnings("StringEquality")
126-
boolean wasAbsent = entry.getValue() == ABSENT_SENTINEL;
126+
boolean wasAbsent = entry.getValue() == ABSENT_SENTINEL; // lgtm[java/reference-equality-on-strings]
127127
String restoreValue = wasAbsent ? null : entry.getValue();
128128
nativeSetEnv(entry.getKey(), restoreValue);
129129
}

0 commit comments

Comments
 (0)