proxy creates bytecode that calls super methods of abstract classes

Description

When proxy is used to extend abstract classes (e.g. java.io.Writer), the bytecode it produces include the call to non-existing super methods. For example, here's decompiled method from clojure/pprint/column_writer.clj:

As you can see on the last line, super.close() tries to call a non-defined method (because close() is abstract in Writer).

This hasn't been an issue anywhere until Android 5.0 came out. Its bytecode optimizer is very aggressive and rejects such code. Google guys claim that it is a bug in their code, which they already fixed[1]. Still I wonder if having faulty bytecode, that is not valid by Java standards, might cause issues in future (not only on Android, but in other enviroments too).

[1] https://code.google.com/p/android/issues/detail?id=80687

Environment

Everywhere, but so far relevant only on Android 5.0

Attachments

1

Activity

Show:

Alex Miller July 18, 2015 at 6:25 PM

No, wasn't in triaged but is now.

Alexander Yakushev July 18, 2015 at 4:59 PM

Anything that holds this back? Now that Clojure is in volatile after-release state it's a good time to deal with it.

Alexander Yakushev March 18, 2015 at 10:38 PM

Sorry, I should have checked the guidelines first. I uploaded a new patch, hope it is correct now.

Alex Miller March 18, 2015 at 6:53 PM

Michael Blume March 18, 2015 at 6:50 PM

Alexander: Awesome, thanks =)

Note: If you use git format-patch after making a commit, you can generate a patch file with your name/e-mail and a commit message that a clojure maintainer can apply directly to clojure as a new commit.

Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code

Priority

Affects versions

Fix versions

Created February 8, 2015 at 10:42 AM
Updated July 31, 2015 at 4:28 PM
Resolved July 31, 2015 at 4:28 PM