RFR: 8201274: Launch Single-File Source-Code Programs (original) (raw)

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Apr 12 20:46:54 UTC 2018


Looks great - some initial comments (I can't really comment on the launcher changes):

int magic = (in.read() << 8) + in.read(); boolean shebang = magic == (('#' << 8) + '!');

but convoluted to read; perhaps could be improved slightly by making '#' << 8) + '!' a static constant, and comparing against that.

getClassLoader() getFileManager()

This way the sharing will be automatic, no need to extract one field from one place and pass it over to the other place.

Overall I like it quite a lot and I think you went for a really clean design - kudos!

Maurizio

On 12/04/18 21:15, Jonathan Gibbons wrote:

Please review an initial implementation for the feature described in JEP 330: Launch Single-File Source-Code Programs.

The work is described in the JEP and CSR, and falls into various parts: * The part to handle the new command-line options is in the native Java launcher code. * The part to invoke the compiler and subsequently execute the code found in the source file is in a new class in the jdk.compiler module. * There are some minor Makefile changes, to add support for a new resource file. There are no changes to javac itself. JEP: http://openjdk.java.net/jeps/330 JBS: https://bugs.openjdk.java.net/browse/JDK-8201274 CSR: https://bugs.openjdk.java.net/browse/JDK-8201275 Webrev: http://cr.openjdk.java.net/~jjg/8201274/webrev.00/ -- Jon



More information about the build-dev mailing list