You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
😎 T-Regx The Dinosaur is really proud to announce its release 0.21.0! This time we fixed a bug (yay!), and broke some stuff ;| We found that using nth() method which sometimes throws exception because of subject not matched, and sometimes because of missing items is hard to use. And, it's even not similar to other parts of library - for example all() doesn't throw exception when subject isn't matched. So we decided that nth() should treat all matches equally and not throw a dedicated exception when the subject wasn't matched. And we did the same for stream(). Worry not however, the messages remained the same, so you will know what's the reason for the exception - as a developer. But the API will be more uniform.
Previously nth()/findNth() threw different exceptions when the subject wasn't matched and when the item was
missing. Now they always throw NoSuchNthElementException (regardless of whether the subject was matched or not).
Exception messages still remain, to inform you whether there was not enough occurrences or whether the subject
wasn't matched.
match()->nth() throws NoSuchNthElementException, instead of SubjectNotMatchedException
match()->asInt()->nth() throws NoSuchNthElementException, instead of NoSuchStreamElementException
match()->stream()->nth() throws NoSuchNthElementException, instead of NoSuchStreamElementException
match()->group()->nth() throws NoSuchNthElementException, instead of SubjectNotMatchedException
match()->group()->asInt()->nth() throws NoSuchNthElementException, instead
of NoSuchStreamElementException
match()->group()->stream()->nth() throws NoSuchNthElementException, instead
of NoSuchStreamElementException
Bug fixes
match()->offsets() and match()->group()->offsets() now return offsets as characters. Previously they returned
them as bytes.
Features
Added SubjectNotMatchedException.getSubject()
The detailed list of changes is also in ChangeLog.md.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
😎 T-Regx The Dinosaur is really proud to announce its release
0.21.0
! This time we fixed a bug (yay!), and broke some stuff ;| We found that usingnth()
method which sometimes throws exception because of subject not matched, and sometimes because of missing items is hard to use. And, it's even not similar to other parts of library - for exampleall()
doesn't throw exception when subject isn't matched. So we decided thatnth()
should treat all matches equally and not throw a dedicated exception when the subject wasn't matched. And we did the same forstream()
. Worry not however, the messages remained the same, so you will know what's the reason for the exception - as a developer. But the API will be more uniform.The detailed list of changes is in ChangeLog.md.
GroupLimit
toGroupMatch
.nth()
/findNth()
threw different exceptions when the subject wasn't matched and when the item wasmissing. Now they always throw
NoSuchNthElementException
(regardless of whether the subject was matched or not).Exception messages still remain, to inform you whether there was not enough occurrences or whether the subject
wasn't matched.
match()->nth()
throwsNoSuchNthElementException
, instead ofSubjectNotMatchedException
match()->asInt()->nth()
throwsNoSuchNthElementException
, instead ofNoSuchStreamElementException
match()->stream()->nth()
throwsNoSuchNthElementException
, instead ofNoSuchStreamElementException
match()->group()->nth()
throwsNoSuchNthElementException
, instead ofSubjectNotMatchedException
match()->group()->asInt()->nth()
throwsNoSuchNthElementException
, insteadof
NoSuchStreamElementException
match()->group()->stream()->nth()
throwsNoSuchNthElementException
, insteadof
NoSuchStreamElementException
match()->offsets()
andmatch()->group()->offsets()
now return offsets as characters. Previously they returnedthem as bytes.
SubjectNotMatchedException.getSubject()
The detailed list of changes is also in ChangeLog.md.
Rawrrrr!
This discussion was created from the release 0.21.0 - Small fixes, small steps, big ambitions.
Beta Was this translation helpful? Give feedback.
All reactions