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

BCEL-276 LocalVariableTypeTable is not updated. #12

Closed
wants to merge 14 commits into
base: trunk
from

Conversation

Projects
None yet
3 participants
@KyongSik-Yoon

KyongSik-Yoon commented Dec 24, 2016

@britter I was fixed the problem reported by Mark Robert.
This PR include small change.

KyongSik-Yoon added some commits Jul 28, 2016

@garydgregory

Thank you for the PR. Can you provide a unit test that demonstrates the issue?

@KyongSik-Yoon

This comment has been minimized.

Show comment
Hide comment
@KyongSik-Yoon

KyongSik-Yoon Dec 27, 2016

@garydgregory Unit test class already committed on trunk.
https://github.com/apache/commons-bcel/blob/trunk/src/test/java/org/apache/bcel/LocalVariableTypeTableTestCase.java

Actually before committed MethodGen.class could passed my unit test.
Mark Robert reopen issue on JIRA for Apache BCEL.
He suggested a patch that assumed a bug when reuse LocalVariableTable.
But his patch could not pass my unit test. So I adopt a patch and fixed for pass my unit test.

Please refer https://issues.apache.org/jira/browse/BCEL-276

KyongSik-Yoon commented Dec 27, 2016

@garydgregory Unit test class already committed on trunk.
https://github.com/apache/commons-bcel/blob/trunk/src/test/java/org/apache/bcel/LocalVariableTypeTableTestCase.java

Actually before committed MethodGen.class could passed my unit test.
Mark Robert reopen issue on JIRA for Apache BCEL.
He suggested a patch that assumed a bug when reuse LocalVariableTable.
But his patch could not pass my unit test. So I adopt a patch and fixed for pass my unit test.

Please refer https://issues.apache.org/jira/browse/BCEL-276

@markro49

I was able to get the code working to pass both your tests and my tests, but there were two issues that needed to be fixed. First, when copying the LocalVariableTypeTable, you need to make a true copy, not just save the pointer. Approx line 229. The other change is more complex. You cannot match a LocalVariable and a LocalVariableType based on having the same index and it may have been modified. I Added code to LocalVariable.java and LocalVariableGen.java to maintain a copy of the original index of a LocalVariable and then use this for matching.

I have attached a copy of my diff files to https://issues.apache.org/jira/browse/BCEL-276
Mark

@KyongSik-Yoon

This comment has been minimized.

Show comment
Hide comment
@KyongSik-Yoon

KyongSik-Yoon Jan 12, 2017

@garydgregory I was applied patch of @markro49
Unit test no have any problems.
Thanks for you reports @markro49

KyongSik-Yoon commented Jan 12, 2017

@garydgregory I was applied patch of @markro49
Unit test no have any problems.
Thanks for you reports @markro49

@asfgit asfgit closed this in 54a95d8 Aug 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment