Bug 435216 - Set override context for closures to functional interface
Summary: Set override context for closures to functional interface
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-19 11:36 EDT by Johannes Dorn CLA
Modified: 2019-07-24 14:36 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Dorn CLA 2014-05-19 11:36:41 EDT
This bug is for collecting Java 8 shortcomings in Code Recommenders (not JDT)

- override context for default method implementations should be set.
i.e. 

 public interface Foo {
 
    void bar(List l) {
       l.$
    } 
 }
override context should be Foo.bar()
Comment 1 Johannes Dorn CLA 2014-05-20 05:43:44 EDT
On further inspection, this turns out not to be the case. the above example has the correct override context.

There seems to be a problem with overrides context in closures, though.

 default void bar(List<String> list) {
    JButton show = new JButton("Show");
    show.addActionListener((e) -> {
       System.out.println(list.$);
    });
 }

When triggering inside the closure body, the overrides context is set to Test.bar().
I would expect the context to be ActionListener.actionPerformed()
Comment 2 Andreas Sewe CLA 2015-05-27 10:35:34 EDT
Full support for all Java 8 features will happen in Code Recommenders 2.3.0 (post-Mars), not in 2.2.0.