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

Bug 428178

Summary: [1.8] isMainMethod(IMethod) should consider the default Public modifier for main method in interface
Product: [Eclipse Project] JDT Reporter: Sarika Sinha <sarika.sinha>
Component: CoreAssignee: Jay Arthanareeswaran <jarthana>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel.dietrich, daniel_megert, Michael_Rennie, srikanth_sankaran
Version: 4.3.1Flags: srikanth_sankaran: review+
Target Milestone: BETA J8   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix with tests none

Description Sarika Sinha CLA 2014-02-14 06:01:07 EST
Member.isMainMethod(IMethod)
currently checks for isPublic() flag on main method. 
With Java 8, Interface can have main method without explicit Public modifier.
So the condition needs to be modified to take care of this.
Comment 1 Srikanth Sankaran CLA 2014-02-14 06:05:14 EST
Jay, thanks for following up.
Comment 2 Jay Arthanareeswaran CLA 2014-02-14 07:51:50 EST
Created attachment 239952 [details]
Fix with tests

Just to clarify, the method in an interface will be considered only when it's static and not 'default'.
Comment 3 Dani Megert CLA 2014-02-14 11:41:18 EST
*** Bug 428122 has been marked as a duplicate of this bug. ***
Comment 4 Srikanth Sankaran CLA 2014-02-14 13:46:39 EST
Patch looks good, Thanks Jay.

Please make these corrections and release:

(1) Copyright in the new file should not mention 2000
(2) Do we want to use full JCL ? I think not. I worry that this will add up
to indexing costs. (the reason it is needed in CompletionTests18 and 
ResolveTests18 is because in the absence of it, it is a hugely painful chore
having to transform submitter provided snippets into something that will
work within JCLMIN.)

Thanks!
Comment 6 Srikanth Sankaran CLA 2014-02-21 00:09:38 EST
Verified as working for Eclipse + Java 8 RC1 using Kepler SR1 +   
Eclipse Java Development Tools Patch for Java 8 Support (BETA)	1.0.0.v20140220-2054