java.mini
Jaroslav Tulach
jaroslav.tulach at oracle.com
Wed Oct 31 06:22:37 PDT 2012
Hello Dalibor,
thanks for your reply.
Dne St 31. října 2012 13:05:19, Dalibor Topic napsal(a):
> On 10/23/12 9:10 AM, Jaroslav Tulach wrote:
> > This is my observation as well. A Throwable has now a direct dependency on
> > ArrayList (as of JDK7)! That really does not make the transitive closure
> > of
> > Object smaller.
>
> Not necessarily. While the JDK 7 implementation uses ArrayList internally,
> it does not occur in the public API of Throwable. So you could write
> Throwable without it in one way or another if you had to.
Right. The class is not exposed in public signature, so I can re-implement the
internal implementation (which is what I did). On the other hand, that means I
have to fork the code base and that is not good in a long term.
> > However for certain environments it is clearly to big. Can't jigsaw also
> > define the smallest possible profile (e.g. with classes that are directly
> > needed during compilation by Javac like String, StringBuilder, Enum,
> > Throwable)?
> That would be implementation-specific by definition, as per ArrayList
> example above.
I don't think so. JavaC really cares only about some aspects of the above
mentioned classes. It needs a Throwable, but does not need its addSuppressed
method.
I know the Jigsaw team is considering to have "methods that require other
module to be present to work" and there is even a special annotation to
document such requirement.
I'd be still interested in defining java.mini - e.g. set of classes directly
need by JavaC for compilation and marking their methods that require java.base
(for example because of usage of ArrayList) with the annotation. This would be
cleaner solution than forking the codebase.
-jt
More information about the jigsaw-dev
mailing list