vkostyukov / la4j

Linear Algebra for Java
http://la4j.org
Apache License 2.0
373 stars 108 forks source link

squid:S2272 - 'Iterator.next()' methods should throw 'NoSuchElementException' #271

Closed georgekankava closed 8 years ago

georgekankava commented 8 years ago

This pull request is focused on resolving occurrence of Sonar rule squid:S2272 - 'Iterator.next()' methods should throw 'NoSuchElementException'. You can find more information about the issue here: https://dev.eclipse.org/sonar/rules/show/squid:S2272 Please let me know if you have any questions. George Kankava

vkostyukov commented 8 years ago

This is a tricky one. Some of the hasNext implementations do mutate iterator state (yeah, that was a poor design I guess, but that's a thing). So I quite surprised tests are passed. Or maybe we just don't have a proper test to capture that. Anyways, I think I'd be down to merge this for now, but I'd vote for changing the style a bit: add spaces after if and before {.

georgekankava commented 8 years ago

@vkostyukov Changes applied.

vkostyukov commented 8 years ago

Looking good! Thanks @georgekankava!