Proposal: #CompileTimeDependences: `requires static`

David M. Lloyd david.lloyd at
Wed Jun 29 12:37:34 UTC 2016

On 06/28/2016 06:31 PM, mark.reinhold at wrote:
> 2016/6/28 15:50:52 -0700, Remi Forax <forax at>:
>> Apart the fact that 'static' should be spelled 'optional', there is no
>> reason to reuse static as it doesn't convey the semantics we want,
>> i.e. optional at runtime, i fully agree with this proposal.

I agree that 'static' really doesn't have any existing meaning in this 
context, so we'd be inventing another connotation for that term.

> In this context `static` is intended to mean "at compile time" or,
> equivalently, before the more "dynamic" phases of run time and link
> time (the latter of which is more like run time than compile time).
> I agree that `static` is potentially confusing since its meaning here
> is different from what `static` means when used on a member of a class.
> It does, however, fit nicely with its (nearly) dual directive, `exports
> dynamic`, proposed for #ReflectiveAccessToNonExportedTypes.
> I think `optional` is a non-starter, since `requires optional` reads as
> an oxymoron, and it's optional at run time but mandatory at compile
> time, so in what sense is it, really, "optional"?
> Suggestions of other alternatives are welcome ...

Some random ideas:

"optional_at_runtime" - hey, it's descriptive.

Use "compile" or "compile_time" instead, i.e. indicate where the 
dependency is required, not where it isn't required.

Use "optional" instead of "requires"; this has a grammatical problem 
though because "requires" is a verb but "optional" is an adjective.  You 
could use "required" instead, but that's weird I guess.

Drop "requires" completely and describe dependencies in a different way, 
like "dependenc[ey] joda.collect run(optional) compile(required)".


Just let build tools rewrite the descriptor after the fact, as seems 
inevitable anyway.


More information about the jpms-spec-observers mailing list