Community
Participate
Working Groups
Create a Java9 project 1) In the module-info.java file add module test { requires java.sql; provides java.sql.Driver with myDriver; } There is an error reported on myDriver as it is not present. 2) create an interface myDriver which extends java.sql.Driver A new error "Invalid service implementation, the type kpDriver is abstract" is reported on myDriver in module-info.java file. As service provider can be an interface, this should not be an error.
@Sasi, you have all the checks re provider methods in place. AFAICS, IProblem.AbstractServiceImplementation should only ever be raised, when no provider method, but only a provider constructor is present. Surprisingly, I cannot even find that in JLS (no mention of abstract classes), so we should probably double check with javac / Oracle.
I will check
Same behavior as javac 9.0.1. And no mention of abstract classes in JLS as Stephan said, although I remember seeing this in the lang-vm.html that was used as the stand in spec. Probably good to file a bug against javac and see what they have to say.
(In reply to Sasikanth Bharadwaj from comment #3) > Same behavior as javac 9.0.1. Can you be more specific on this? How does javac handle - abstract provider class? - provider interface? with details: - if it has a public constructor but no provider method? - if it has a provider method?
(In reply to comment #4) > (In reply to Sasikanth Bharadwaj from comment #3) > > Same behavior as javac 9.0.1. > > Can you be more specific on this? How does javac handle > - abstract provider class? > - provider interface? > with details: > - if it has a public constructor but no provider method? > - if it has a provider method? Presence of a provider method does not trigger an error, whether the provider is an abstract class or interface, but having just the provider constructor triggers the error even if the provider is a subtype of the service interface. We need to adjust our behavior to accommodate the presence of the provider method but the other case I believe would stay an error and needs a spec update.
New Gerrit change created: https://git.eclipse.org/r/111103
Released to master via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=e60b3b2bd58993c93d460964babb98cd3ffd52da. We don't complain about abstract providers when provider method is present. I left the other case as is. Can be updated when we have new information
Verified for Eclipse Photon 4.8 M4 with Build id: I20171130-2100