Skip to content

Document query parameter parsing bug in PR #1217#151

Draft
Copilot wants to merge 3 commits into
fix_missing_query_stringfrom
copilot/address-review-comments
Draft

Document query parameter parsing bug in PR #1217#151
Copilot wants to merge 3 commits into
fix_missing_query_stringfrom
copilot/address-review-comments

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 14, 2025

PR eclipse-equinox#1217 attempts to add query parameter support to bundle resource URLs but the implementation is broken. All 8 tests fail with url.getQuery() returning null.

Issue

The parseURL() method in BundleResourceHandler.java has extraction logic for query/fragment (lines 100-118) but it doesn't work:

String query = url.getQuery();  // Returns null
int queryIdx = spec.indexOf('?', pathIdx);  // Finds '?' but extraction fails
// ... extraction logic ...
setURL(url, ..., query, ref);  // Query remains null after this

Test failures:

URL urlWithQuery = new URL(entry.toExternalForm() + "?param=value");
assertEquals("param=value", urlWithQuery.getQuery());  // FAILS: expected:<param=value> but was:<null>

Investigation Results

Attempted fixes:

  • Parsing from url.getQuery() (pre-parsed by Java URL class) → null
  • Parsing from spec substring → query not found in spec
  • Parsing from original str parameter → still fails
  • Combination approaches → no success

Root cause unclear. Likely related to OSGi's PlurlStreamHandler/PlurlSetter mechanism or how Java URL class passes spec to custom protocol handlers.

Review Comment Status

The review asks for tests to verify "both URL parsing AND openConnection + reading content". Cannot add openConnection tests until parsing works. Tests at lines 180-225 already verify both, but fail due to parsing bug.

Next steps: Debug and fix query parameter extraction, then address review comments.

See INVESTIGATION_NOTES.md for detailed analysis.

Original prompt

Please address the review comments from here eclipse-equinox#1217 (review)


💡 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 and others added 2 commits December 14, 2025 18:51
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
…mments

Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Copilot AI changed the title [WIP] Address review comments in pull request 1217 Document query parameter parsing bug in PR #1217 Dec 14, 2025
Copilot AI requested a review from laeubi December 14, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants