Package daikon.split

Class FileCompiler


  • public final class FileCompiler
    extends Object
    This class has method compileFiles(List) that compiles Java source files. It invokes a user-specified external command, such as javac or jikes.
    • Constructor Detail

      • FileCompiler

        public FileCompiler​(String @MinLen(1) [] compiler,
                            @org.checkerframework.checker.index.qual.Positive long timeLimit)
        Creates a new FileCompiler. Compared to FileCompiler(String,long), this constructor permits spaces and other special characters in the command and arguments.
        Parameters:
        compiler - an array of Strings representing a command that runs a Java compiler (it could be the full path name or whatever is used on the commandline), plus any command-line options
        timeLimit - the maximum permitted compilation time, in msec
      • FileCompiler

        public FileCompiler​(ArrayList<String> compiler,
                            @org.checkerframework.checker.index.qual.Positive long timeLimit)
        Creates a new FileCompiler. Compared to FileCompiler(String,long), this constructor permits spaces and other special characters in the command and arguments.
        Parameters:
        compiler - a list of Strings representing a command that runs a Java compiler (it could be the full path name or whatever is used on the commandline), plus any command-line options
        timeLimit - the maximum permitted compilation time, in msec
      • FileCompiler

        public FileCompiler​(String compiler,
                            @org.checkerframework.checker.index.qual.Positive long timeLimit)
        Creates a new FileCompiler.
        Parameters:
        compiler - a command that runs a Java compiler; for instance, it could be the full path name or whatever is used on the commandline. It may contain command-line arguments, and is split on spaces.
        timeLimit - the maximum permitted compilation time, in msec
    • Method Detail

      • compileFiles

        public String compileFiles​(List<String> fileNames)
                            throws IOException
        Compiles the files given by fileNames. Returns the error output.
        Parameters:
        fileNames - paths to the files to be compiled as Strings
        Returns:
        the error output from compiling the files
        Throws:
        IOException - if there is a problem reading a file