-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix search for FeatureGrant in FloatingLicensePackFromRequest #1094
Fix search for FeatureGrant in FloatingLicensePackFromRequest #1094
Conversation
d9dda7a
to
dd86fc1
Compare
Codecov Report
@@ Coverage Diff @@
## master #1094 +/- ##
============================================
- Coverage 33.58% 33.58% -0.01%
Complexity 359 359
============================================
Files 1161 1161
Lines 25738 25741 +3
Branches 1592 1594 +2
============================================
Hits 8644 8644
- Misses 16574 16577 +3
Partials 520 520
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@eparovyshnaya can you please review this, so we can proceed with this PR? |
@HannesWell |
Can you recommand a place and set up for such test-case? At the moment I have no clear idea for that. |
dd86fc1
to
55bd87e
Compare
d8e3274
to
21bfa22
Compare
21bfa22
to
775c8a7
Compare
775c8a7
to
2da7e67
Compare
@eparovyshnaya can you recommand a place and set up for such test-case? |
@HannesWell there should be a new test bundle |
@HannesWell, please make sure your contribution to Passage follows the rules. For start, there must be an issue for the problem and it msut be referenced in each commit for the task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
....core/src/org/eclipse/passage/loc/internal/licenses/core/FloatingLicensePackFromRequest.java
Show resolved
Hide resolved
....core/src/org/eclipse/passage/loc/internal/licenses/core/FloatingLicensePackFromRequest.java
Show resolved
Hide resolved
Would you mind to explain why this is a requirement? In the Eclipse top level projects that requirements used to exist when Bugzilla and Gerrit where used, but since all these projects have moved to github an issue is not mandatory anymore, mainly because a PR offers the same possibility as issues and not mandating them makes contributions simpler.
Thanks! I'm glad this is finally resolved. |
At the moment
FloatingLicensePackFromRequest.forFeature()
always returns an empty Optional because it uses a filter that checks if aString
is equals to aFeatureRef
which is always false.If I understand it right a
FloatingLicensePack
can have multipleFeatureGrant
with the same identifier but differentVersionMatch
? Therefore I enhanced the equals check to consider that as well when comparing two FeatureRefs.If
forFeature()
not always returns an empty OptionalfeatureGrantPeriod()
should check if the vivid is set becausegetVivid()
returns a long primitive which is never boxed to null. Filtering out Grants whose vivid is not set ensures that the given default (60) is used instead of zero in that case.