Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 380501

Summary: [1.8][compiler] Add support for default methods (JSR 335)
Product: [Eclipse Project] JDT Reporter: Srikanth Sankaran <srikanth_sankaran>
Component: CoreAssignee: Stephan Herrmann <stephan.herrmann>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: amj87.iitr, daniel_megert, deepakazad, heidinga, john.arthorne, js102
Version: 3.8   
Target Milestone: BETA J8   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 380194, 382350, 383966, 383968, 383973, 384815, 388954, 390761, 390883, 390889, 399567, 399571, 399695, 400710, 401235, 403867, 404690, 421543, 421747, 421796, 421797, 422051, 422731    
Bug Blocks: 380190    

Description Srikanth Sankaran CLA 2012-05-24 00:28:38 EDT
Add support for Default methods aka Virtual extension methods
aka Defender methods.

    Other than enabling the wider adoption of lambda expressions in
existing libraries, this feature bears no connection to lambda expressions
per se and so is best tracked as a separate project.

    Bug 380194 concerns itself with grammar changes for all of JSR 335.
Thus the grammar changes to support the current topic will be published
in bug 380194 (shortly.)
Comment 1 Srikanth Sankaran CLA 2012-05-24 00:33:26 EDT
Stephan, Thanks for owning and driving this at the top level.

As discussed, as we review the draft spec and identify unit
level tasks, we will spawn separate bugs and link them as
blockers to the current bug -- These tasks can be worked on
by different engineers under overall direction from your side.
Comment 2 Srikanth Sankaran CLA 2012-06-12 07:44:12 EDT
Grammar changes are released already into BETA_JAVA8 branch.
Comment 3 Ayushman Jain CLA 2012-06-19 14:24:05 EDT
Stephan, have you started working on this? I discussed with Srikanth and I think take this up to give you space for reviewing the grammar changes.
Comment 4 Stephan Herrmann CLA 2013-01-31 19:01:35 EST
With a majority of tickets resolved the bulk of this work was finished, but I should note, that all implementation to this point was based on a spec <= 0.5.1.

Looking now at 0.6.1 I have no idea how to identify incremental changes between spec versions, since the text bears little resemblance to the version I worked with.

I made a shy start to log new pending work in bug 399695.
Comment 5 Srikanth Sankaran CLA 2013-02-01 04:37:37 EST
(In reply to comment #4)

> I made a shy start to log new pending work in bug 399695.

If you are not too far down into this, the new engineer Shankha could
get started on this.
Comment 6 Stephan Herrmann CLA 2013-02-20 03:25:09 EST
Status after releasing several fixes in this field: 
Mostly done with these issues pending:

- bug 382350: mostly done, pending feedback if/how method references need special treatment
- bug 391376: need to find test cases for the dark corners of potential feature interactions
- bug 390889: not much we can do, Oracle doesn't seem to give any support for this scenario and our hands seem to be tied.
Comment 7 John Arthorne CLA 2013-05-10 09:24:20 EDT
Changing title to use virtual extension methods which is the official term now. We all understand that "default method" and "defender method" mean the same thing based on earlier drafts of the spec, but to avoid confusion for others we should use the official terminology.
Comment 8 Srikanth Sankaran CLA 2013-05-10 12:02:36 EDT
(In reply to comment #7)
> Changing title to use virtual extension methods which is the official term
> now. We all understand that "default method" and "defender method" mean the
> same thing based on earlier drafts of the spec, but to avoid confusion for
> others we should use the official terminology.

John, lambda spec as of 0.6.2 does not speak of virtual extension methods at all.
In fact Part H is titled "Default methods", Did you have a different reference ?
Comment 9 John Arthorne CLA 2013-05-10 12:12:47 EDT
(In reply to comment #8)
> John, lambda spec as of 0.6.2 does not speak of virtual extension methods at
> all.
> In fact Part H is titled "Default methods", Did you have a different
> reference ?

Ah, I could be wrong then. I attended a talk from one of the Oracle devs where he mentioned they didn't like term "default methods" anymore once they decided the method bodies should not be directly in the interface. That was at least a year ago and maybe they changed their minds again? Also all the recent papers and talks from Brian Goetz seem to use virtual extension methods, e.g.:

http://cr.openjdk.java.net/~briangoetz/lambda/Defender%20Methods%20v4.pdf
Comment 10 Srikanth Sankaran CLA 2013-05-10 12:56:51 EDT
(In reply to comment #9)

> http://cr.openjdk.java.net/~briangoetz/lambda/Defender%20Methods%20v4.pdf

that is dated Jun 2011.

http://cr.openjdk.java.net/~dlsmith/jsr335-0.6.2/ is recent (perhaps 2 months old)
Comment 11 John Arthorne CLA 2013-05-10 13:37:19 EDT
Thanks for the correction Srikanth.
Comment 12 Srikanth Sankaran CLA 2014-01-06 10:22:03 EST
This umbrella bug has served its purpose. The few open tasks have their own
tickets to track. resolving.