- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.6k
[Java] Fix array copy length in PrintOptions.setPageRanges method #16516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
[Java] Fix array copy length in PrintOptions.setPageRanges method #16516
Conversation
| PR Compliance Guide 🔍Below is a summary of compliance checks for this PR: 
 Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label | ||||||||||||||||||||||||
| PR Code Suggestions ✨Explore these optional code suggestions: 
 | ||||||||||||
User description
Related Issues
Fixes a bug in
PrintOptions#setPageRangeswhere the last page range argument was not being copied due to an off-by-one error in theSystem.arraycopycall.What does this PR do?
This PR fixes a small but critical logic error in the
setPageRanges(String firstRange, String... ranges)method insideorg.openqa.selenium.print.PrintOptions.Previously, only
ranges.length - 1elements were copied from therangesarray intothis.pageRanges.As a result, the last page range was silently omitted whenever multiple ranges were passed to the method.
Example of the previous behavior: