Skip to content
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

ArrayIndexOutOfBoundsException: 200 at line 1161 of Link.java #41

Open
lxfhfut opened this issue May 30, 2023 · 0 comments
Open

ArrayIndexOutOfBoundsException: 200 at line 1161 of Link.java #41

lxfhfut opened this issue May 30, 2023 · 0 comments

Comments

@lxfhfut
Copy link

lxfhfut commented May 30, 2023

/* Count how often line j needs to be split. */
for (k = 0;  junc[(i + k)].cont1 == j && i + k < num_junc; k++)
	;

I encountered an ArrayIndexOutOfBoundsException: 200 while executing this for loop. To avoid this error, it is advisable to perform a boundary check on the array before accessing it. Consider applying the following modification to address the issue:

/* Count how often line j needs to be split. */
for (k = 0; i + k < num_junc && junc[(i + k)].cont1 == j; k++)
        ;

However, I'm not sure if this for loop serves any purpose, so I'm inclined to think it can be safely omitted. I would appreciate any input on this matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant