Skip to content
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

Exception when maximalRectangleCount is bigger than rectangles.size() [BUG] #165

Closed
Hexronimo opened this issue Jan 11, 2020 · 2 comments
Closed
Assignees
Labels
bug Something isn't working
Projects

Comments

@Hexronimo
Copy link
Contributor

When you set some wanted number of rectangles with imageComparison.setMaximalRectangleCount(10); (other then -1) and the comparing found fewer rectangles than this number, you got java.lang.IllegalArgumentException: -3 at
ImageComparison.java:359 because in

       ` rectanglesForDraw = rectangles.stream()

                .sorted(Comparator.comparing(Rectangle::size))

                .skip(rectangles.size()-maximalRectangleCount)

                .collect(Collectors.toList());`

rectangles.size()-maximalRectangleCount will be negative number.

@Hexronimo Hexronimo added the bug Something isn't working label Jan 11, 2020
@Hexronimo Hexronimo changed the title Exception when maximalRectangleCount is bigger then rectangles.size() [BUG] Exception when maximalRectangleCount is bigger than rectangles.size() [BUG] Jan 11, 2020
@romankh3 romankh3 added this to To do in 4.0.1 via automation Jan 11, 2020
romankh3 added a commit that referenced this issue Jan 11, 2020
4.0.1 automation moved this from To do to Done Jan 11, 2020
@romankh3
Copy link
Owner

@Hexronimo, thanks for your catch. The bug will be published ASAP.

Best regards,
Roman.

romankh3 added a commit that referenced this issue Jan 11, 2020
- #165: fixed bug with maximal rectangle count
- #154: migrated to JUnit 5
- added pull-request template
@romankh3
Copy link
Owner

the new release has been published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
4.0.1
  
Done
Development

No branches or pull requests

2 participants