langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/CommandLine.java
changeset 36157 fdbf6c9be2ab
parent 25874 83c19f00452c
child 41438 5e21aa284a82
equal deleted inserted replaced
36156:9ff93012d1e3 36157:fdbf6c9be2ab
     1 /*
     1 /*
     2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    25 
    25 
    26 package com.sun.tools.javac.main;
    26 package com.sun.tools.javac.main;
    27 
    27 
    28 import java.io.IOException;
    28 import java.io.IOException;
    29 import java.io.Reader;
    29 import java.io.Reader;
    30 import java.io.FileReader;
       
    31 import java.io.BufferedReader;
       
    32 import java.io.StreamTokenizer;
    30 import java.io.StreamTokenizer;
       
    31 import java.nio.file.Files;
       
    32 import java.nio.file.Paths;
       
    33 
    33 import com.sun.tools.javac.util.ListBuffer;
    34 import com.sun.tools.javac.util.ListBuffer;
    34 
    35 
    35 /**
    36 /**
    36  * Various utility methods for processing Java tool command line arguments.
    37  * Various utility methods for processing Java tool command line arguments.
    37  *
    38  *
    71     }
    72     }
    72 
    73 
    73     private static void loadCmdFile(String name, ListBuffer<String> args)
    74     private static void loadCmdFile(String name, ListBuffer<String> args)
    74         throws IOException
    75         throws IOException
    75     {
    76     {
    76         try (Reader r = new BufferedReader(new FileReader(name))) {
    77         try (Reader r = Files.newBufferedReader(Paths.get(name))) {
    77             StreamTokenizer st = new StreamTokenizer(r);
    78             StreamTokenizer st = new StreamTokenizer(r);
    78             st.resetSyntax();
    79             st.resetSyntax();
    79             st.wordChars(' ', 255);
    80             st.wordChars(' ', 255);
    80             st.whitespaceChars(0, ' ');
    81             st.whitespaceChars(0, ' ');
    81             st.commentChar('#');
    82             st.commentChar('#');