-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P5
-
None
-
Affects Version/s: 25
-
Component/s: specification
-
None
§ 7.7.4 of the Java Language specification states:
> It is a compile-time error if a provides directive specifies an enum class (§8.9) as the service.
Javac ignores this and allows enum classes to be specified as service if the enum has a provider method.
The Eclipse Compiler for Java (ECJ) honors this requirement.
I speculate that this requirement was added without considering the provider method - as an enum can never have a public constructor and can therefore not have a provider constructor.
Proposed fix: Remove this statement from the specification.
> It is a compile-time error if a provides directive specifies an enum class (§8.9) as the service.
Javac ignores this and allows enum classes to be specified as service if the enum has a provider method.
The Eclipse Compiler for Java (ECJ) honors this requirement.
I speculate that this requirement was added without considering the provider method - as an enum can never have a public constructor and can therefore not have a provider constructor.
Proposed fix: Remove this statement from the specification.