Skip to content

Fix up-to-date check for invalid file URLs - #539

Closed
gztong666 wants to merge 1 commit into
Guardsquare:masterfrom
gztong666:fix-invalid-file-url-up-to-date-check
Closed

gztong666 wants to merge 1 commit into
Guardsquare:masterfrom
gztong666:fix-invalid-file-url-up-to-date-check

Conversation

@gztong666

Copy link
Copy Markdown

Summary

  • Treat an invalid file: URL as an input whose timestamp cannot be verified.
  • Conservatively consider the output outdated instead of silently skipping that input.
  • Add regression coverage for an obfuscation dictionary URL containing unescaped spaces.

Why

UpToDateChecker currently ignores URISyntaxException when converting auxiliary input URLs to files. If the other timestamps make the output look current, ProGuard can then throw UpToDateException and skip processing even though that input was never checked.

Returning through the existing IllegalStateException path is conservative: ProGuard runs normally whenever an input timestamp cannot be established.

Verification

A minimal reproducer with an output timestamp of 1000 ms and a newer dictionary timestamp of 2000 ms reports the output as up to date before this change when the dictionary URL contains an unescaped space. With this change it follows the existing outdated-output path. The added UpToDateCheckerTest captures that regression for CI.

@sonarqubecloud

Copy link
Copy Markdown

@gztong666 gztong666 closed this Sep 24, 2026
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.

1 participant