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

Evaluate BCEL 6 update strategies #106

Closed
iloveeclipse opened this issue Jun 6, 2016 · 12 comments
Closed

Evaluate BCEL 6 update strategies #106

iloveeclipse opened this issue Jun 6, 2016 · 12 comments
Assignees
Labels
Milestone

Comments

@iloveeclipse
Copy link
Member

iloveeclipse commented Jun 6, 2016

BCEL 6 broke every single API by moving all types in different package structure, see https://issues.apache.org/jira/browse/BCEL-222. No comments about that move.

However, to get up to date with latest Java 9 fixes in BCEL we have either to break every FB plugin/user (because we exposed BCEL in FB API all over the place, see for example use of org.apache.bcel.classfile.JavaClass) and ship totally incompatible FB 4.0, or we need to backport BCEL 6 changes to the "old" package structure.

I'm investigating the later one.

OK, I've managed to rename the packages back (see https://github.com/iloveeclipse/commons-bcel/tree/old_structure) and with few (not committed) FB changes I was able to run FB with that BCEL version. Problem: it simply doesn't work in few cases anymore, neither on Java 8 nor on Java 9. I had few different exceptions, which I'm not sure where the root cause is - new BCEL code or missing adoption on FB side:
bcel_test_result.txt

Now I'm going to break FB API and use BCEL as is, just to test if BCEL 6 "unchanged" will work with FB.

@iloveeclipse iloveeclipse mentioned this issue Jun 6, 2016
8 tasks
@don-vip
Copy link
Contributor

don-vip commented Jun 6, 2016

I think renaming back BCEL package is a lot of effort. A new major version (4.0) with compatibility breaking changes totally makes sense for Java 9.

@iloveeclipse
Copy link
Member Author

Actually I did it in few seconds, this was easy thanks to Eclipse. Unfortunately they also did some other API changes, but also this was easy to fix on FB side. The problem is that the code seem to have some major issues which look like regressions in BCEL6.

@iloveeclipse
Copy link
Member Author

Attaching the snapshot jar (github only allows zip's) I've generated from almost unchanges BCEL 6 trunk: iloveeclipse/commons-bcel@5ffd682

commons-bcel6-6.0-SNAPSHOT.zip

iloveeclipse added a commit that referenced this issue Jun 6, 2016
This is the first commit which only fixes BCEL package move (see
https://issues.apache.org/jira/browse/BCEL-222), two commits will follow
with fixes for other BCEL API breakage.
iloveeclipse added a commit that referenced this issue Jun 6, 2016
#106

StackMapTableEntry also changed signature: getByteCodeOffsetDelta ->
getByteCodeOffset
iloveeclipse added a commit that referenced this issue Jun 6, 2016


The jar snapshot is created from
iloveeclipse/commons-bcel@5ffd682

This is almost unmodified HAED from BCEL6, few small commits after
git-svn-id:
https://svn.apache.org/repos/asf/commons/proper/bcel/trunk@1746918
@iloveeclipse
Copy link
Member Author

iloveeclipse commented Jun 6, 2016

OK, after full upgrade of FB code to the untouched BCEL6 trunk state I still see same test errors.
See commits on java9_bcel6 branch: https://github.com/findbugsproject/findbugs/tree/java9_bcel6
=> We cannot use BCEL6 trunk as it is today 👎

BCEL bug reported : https://issues.apache.org/jira/browse/BCEL-273.
Test log file:
bcel6_test_result.txt

@iloveeclipse
Copy link
Member Author

@amaembo : Tagir, do you have time to look into the regressions with BCEL6, see comment above?

@amaembo
Copy link
Contributor

amaembo commented Jun 6, 2016

@iloveeclipse nope, sorry. In general I quit active development of Findbugs as I started my own bytecode analyzer.

@iloveeclipse
Copy link
Member Author

@amaembo A-ha, good news and bad news at same time.
https://github.com/amaembo/huntbugs? Do you have some papers/introduction etc? Does it support Java 9? Ant support? If you will reach ~99% FB warnings coverage, I will be happy to work on the Eclipse plugin.

@amaembo
Copy link
Contributor

amaembo commented Jun 6, 2016

Not yet/not yet/not yet. It's hard to do in two months everything which was done in FindBugs for 15 years :-) We have draft maven and gradle plugins. Ant is not big priority these days, though I will probably write it. Also we already have a volunteer who wrote draft Eclipse plugin. 99% FB warnings is not a priority: some warnings are deliberately excluded as junk/outdated (see this list). Though indeed most of them must be reimplemented.

@iloveeclipse
Copy link
Member Author

OK, an update to the BCEL API story: the package renaming is reverted, and I hope to see other breakages fixed soon.

@iloveeclipse
Copy link
Member Author

iloveeclipse commented Jun 8, 2016

Attached is the snapshot based on iloveeclipse/commons-bcel@452b5e6

bcel-6.0-SNAPSHOT.zip

Corresponding FB branch is https://github.com/findbugsproject/findbugs/commits/java9_bcel6_old

If I apply iloveeclipse/commons-bcel@25dfa20 on BCEL head, all tests pass now on Java 8.

iloveeclipse added a commit that referenced this issue Jun 8, 2016
This also fixes the StackMapTable misery, see BCEL-92 and BCEL-248 and
discussion on
http://mail-archives.apache.org/mod_mbox/commons-dev/201606.mbox/ajax/%3C4595124.Qpp5S77DT7%40pinguin%3E.

Added StackMapTable/StackMapTableEntry to the FB repository, basically
1:1 copy of StackMap/StackMapEntry. The classes are only there to don't
break the clients used them via PreorderVisitor API.

Fixed removed constants from Constants (they match those from Const).

The tests are still failing due
https://issues.apache.org/jira/browse/BCEL-273.
iloveeclipse added a commit that referenced this issue Jun 8, 2016
This also fixes the StackMapTable misery, see BCEL-92 and BCEL-248 and
discussion on
http://mail-archives.apache.org/mod_mbox/commons-dev/201606.mbox/ajax/%3C4595124.Qpp5S77DT7%40pinguin%3E.

Added StackMapTable/StackMapTableEntry to the FB repository, basically
1:1 copy of StackMap/StackMapEntry. The classes are only there to don't
break the clients used them via PreorderVisitor API.

Fixed removed constants from Constants (they match those from Const).

The tests are still failing due
https://issues.apache.org/jira/browse/BCEL-273.
iloveeclipse added a commit that referenced this issue Jun 8, 2016
Created TODO's in the code to avoid analysis errors while visiting
INVOKEDYNAMIC instructions.
@iloveeclipse
Copy link
Member Author

BCEL 6 trunk snapshot with only single patch applied on top: iloveeclipse/commons-bcel@25dfa20

This works now on Java 8/9 without known errors.
bcel-6.0-SNAPSHOT-25dfa20.zip

iloveeclipse added a commit that referenced this issue Jun 9, 2016
@iloveeclipse iloveeclipse self-assigned this Jun 9, 2016
@iloveeclipse iloveeclipse added this to the 3.1.0 milestone Jun 9, 2016
@iloveeclipse
Copy link
Member Author

I think we can close this issue now. BCEL 6.0 will use old namespace and we have the patch to get it working with Findbugs without breaking every client.

sebasjm pushed a commit to sebasjm/findbugs that referenced this issue Mar 11, 2018
This also fixes the StackMapTable misery, see BCEL-92 and BCEL-248 and
discussion on
http://mail-archives.apache.org/mod_mbox/commons-dev/201606.mbox/ajax/%3C4595124.Qpp5S77DT7%40pinguin%3E.

Added StackMapTable/StackMapTableEntry to the FB repository, basically
1:1 copy of StackMap/StackMapEntry. The classes are only there to don't
break the clients used them via PreorderVisitor API.

Fixed removed constants from Constants (they match those from Const).

The tests are still failing due
https://issues.apache.org/jira/browse/BCEL-273.
sebasjm pushed a commit to sebasjm/findbugs that referenced this issue Mar 11, 2018
…oject#106

Created TODO's in the code to avoid analysis errors while visiting
INVOKEDYNAMIC instructions.
sebasjm pushed a commit to sebasjm/findbugs that referenced this issue Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants