Java icon indicating copy to clipboard operation
Java copied to clipboard

Fix 2D array being passed to Arrays.fill in FloydWarshall

Open ChenOst opened this issue 6 years ago • 4 comments

Here an attempt is being made to pass a 2D array to Arrays.fill(). This is not correct as Arrays.fill() accepts a single dimensional array.

I would like to fix this bug myself if that is ok

Test case describing the bug: Try to run FloydWarshall.java with legitimate input

Expected behavior: Succeeds

Actual behavior: java.lang.ArrayStoreException: java.lang.Integer at java.base/java.util.Arrays.fill(Arrays.java:3639)

ChenOst avatar Nov 04 '20 16:11 ChenOst

Hi @icoder211 and @ChenOst , as far as I know, currently you both have created PRs for fixing same issue. Can you guys collaborate and do required. Thanks :)

prashantdoshi28 avatar Nov 14 '20 13:11 prashantdoshi28

Hey @icoder211 and @prashantdoshi28, I have updated my PR (#2010 ) to eliminate Arrays.fill() entirely, So we can have a PR that fixes this issue specifically instead of having #2027 handle multiple issues in one PR.

The problem is that I am failing the check for "Prettier" in #2010 , could you advice what the problem may be?

ChenOst avatar Nov 14 '20 15:11 ChenOst

@ChenOst ,I am not sure how to make two separate PR's, it's just committing the changes to the same fork, and when I make the PR, it updates my old PR.

icoder211 avatar Nov 17 '20 15:11 icoder211

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 13 '21 11:02 stale[bot]