RFR: 8201274: Launch Single-File Source-Code Programs

Jaikiran Pai jai.forums2013 at gmail.com
Sat May 12 07:57:27 UTC 2018


Not a reviewer, but a minor comment:

src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/Main.java

+    private Path getFile(String[] args) throws Fault {
....
+        if (!Files.exists(file)) {
+            // should not happen when invoked from launcher
+            throw new Fault(Errors.FileNotFound(file));
+        }


Do you think it would be better to check that the passed source file 
path is indeed a regular file, instead of just checking for existence, 
so that it won't then run into IOException in the readFile method, if 
the passed path happens to a directory?

-Jaikiran


On 05/05/18 3:29 AM, Jonathan Gibbons wrote:
> Here's an update to the previously proposed patch for JEP 330: Launch 
> Single-File Source-Code Programs.
> It includes all review feedback so far. The changes are mostly minor, 
> but with the addition of more test cases.
>
> The webrev includes a delta-webrev for those that just want to see 
> what has changed since last time.
>
> Full webrev: http://cr.openjdk.java.net/~jjg/8201274/webrev.mq/index.html
>
>     Original webrev: 
> http://cr.openjdk.java.net/~jjg/8201274/webrev.mq/webrev.v1/index.html
>     Delta webrev: 
> http://cr.openjdk.java.net/~jjg/8201274/webrev.mq/webrev.v2/index.html
>
> Note that the work is temporarily blocked by JDK-8202387: javac 
> --release 11 not supported.
> A fix for that is underway and in review: 
> http://mail.openjdk.java.net/pipermail/compiler-dev/2018-May/011868.html
> This work has been tested using a workaround for this issue, and will 
> be tested again when the real fix is in place.
>
> -- Jon
>
> On 04/12/2018 01:15 PM, 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 core-libs-dev mailing list