Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

Implements suggestion from PR #15855 to rename the method for improved clarity and eliminate double-negative logic.

Changes

  • Interface: SqlClientAttributesGetter.isParameterizedQuery()isQuerySanitizationNeeded()

    • Inverted boolean semantics: returns true when sanitization is needed (was true when parameterized)
    • Updated default from return false to return true for backward compatibility
    • Updated javadoc to reflect new semantics
  • Caller simplification in SqlClientAttributesExtractor:

    // Before
    boolean parameterizedQuery = getter.isParameterizedQuery(request);
    boolean shouldSanitize = statementSanitizationEnabled && !parameterizedQuery;
    
    // After
    boolean shouldSanitize = statementSanitizationEnabled && getter.isQuerySanitizationNeeded(request);
  • Implementation updates: Inverted boolean logic across all implementations:

    • JDBC: PreparedStatement → false (was true), Statement → true (was false)
    • Cassandra (3.0, 4.0, 4.4): BoundStatement → !(statement instanceof BoundStatement)
    • Vert.x SQL Client (4.0, 5.0): PreparedStatement → !preparedStatement
    • R2DBC: anyMatch(!isEmpty)allMatch(isEmpty) (De Morgan equivalence)

19 files updated across all SQL database instrumentation modules.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • develocity.opentelemetry.io
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
  • scans-in.gradle.com
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

implement suggestion #15855 (comment)

rename method to isQuerySanitizationNeeded


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Rename method to isQuerySanitizationNeeded Rename isParameterizedQuery to isQuerySanitizationNeeded Jan 17, 2026
Copilot AI requested a review from trask January 17, 2026 03:08
@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Jan 17, 2026
@trask trask force-pushed the copilot/rename-method-query-sanitization branch from 579a2f2 to 45dc6ea Compare January 17, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test native This label can be applied to PRs to trigger them to run native tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants