Skip to main content
Code Review

Return to Revisions

4 of 5
Added detail showing answer is not correct
Phrancis
  • 20.5k
  • 6
  • 69
  • 155

Others have mentioned that your code is overkill, but the biggest problem I see is the parallelism. It is frankly broken and will not always give the expected result. To an observer, it looks like you used a feature that you did not really understand in order to look good, and as a result you wrote incorrect code. Your parallelism will not always produce the correct result and it is expected that you would understand that if you use that feature.

There are other minor stylistic things that others have covered, but that is by far the worst problem.


Edit, per comments:

Looks like I am in fact wrong. The problem, however, is that it took quite a bit of time digging through nitty gritty details of the Java 8 implementation to figure this out. The following give better details than the link @Tunaki provided: http://stackoverflow.com/questions/29710999/is-collect-guaranteed-to-be-ordered-on-parallel-streams?lq=1 So what should I do with this answer. It perhaps should be deleted, but makes sense in some respects because this is likely what the reviewer thought. – Necreaux

Necreaux
  • 241
  • 1
  • 4
default

AltStyle によって変換されたページ (->オリジナル) /