bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
---|---|---|
public static void main(String[] args) { // Outputs some informations System.out.println(""); System.out.println(".:: IzPack - Version " + IZPACK_VERSION + " ::."); System.out.println(""); System.out.println("< compiler specifications version : " + VERSION + " >"); System.out.println(""); System.out.println("- Copyright (C) 2001-2003 Julien Ponge"); System.out.println("- Visit http://www.izforge.com/ for the latests releases"); System.out.println("- Released under the terms of the GNU GPL either version 2"); System.out.println(" of the licence, or any later version."); System.out.println(""); // exit code 1 means: error int exitCode = 1; // We analyse the command line parameters try { // Our arguments String filename; String base = "."; String kind = "standard"; String output; // First check int nArgs = args.length; if (nArgs < 3) throw new Exception("no arguments given"); // We get the IzPack home directory int stdArgsIndex; if (args[0].equalsIgnoreCase("-HOME")) { stdArgsIndex = 2; IZPACK_HOME = args[1]; } else stdArgsIndex = 0; if (!IZPACK_HOME.endsWith(File.separator)) IZPACK_HOME = IZPACK_HOME + File.separator; // The users wants to know the command line parameters if (args[stdArgsIndex].equalsIgnoreCase("-?")) { System.out.println("-> Command line parameters are : (xml file) [args]"); System.out.println(" (xml file): the xml file describing the installation"); System.out.println(" -b (base) : indicates the base path that the compiler will use for filenames"); System.out.println(" default is the current path"); System.out.println(" -k (kind) : indicates the kind of installer to generate"); System.out.println(" default is standard"); System.out.println(" -o (out) : indicates the output file name"); System.out.println(" default is the xml file name\n"); System.out.println(" When using vm option -DSTACKTRACE=true there is all kind of debug info "); System.out.println(""); } else {// We can parse the other parameters & try to compile the installation // We get the input file name and we initialize the output file name filename = args[stdArgsIndex]; output = filename.substring(0, filename.length() - 3) + "jar"; // We parse the other ones int pos = stdArgsIndex + 1; while (pos < nArgs) if ((args[pos].startsWith("-")) && (args[pos].length() == 2)) { switch (args[pos].toLowerCase().charAt(1)) { case 'b': if ((pos + 1) < nArgs) { pos++; base = args[pos]; } else throw new Exception("base argument missing"); break; case 'k': if ((pos + 1) < nArgs) { pos++; kind = args[pos]; } else throw new Exception("kind argument missing"); break; case 'o': if ((pos + 1) < nArgs) { pos++; output = args[pos]; } else throw new Exception("output argument missing"); break; default: throw new Exception("unknown argument"); } pos++; } else throw new Exception("bad argument"); // Outputs what we are going to do System.out.println("-> Processing : " + filename); System.out.println("-> Output : " + output); System.out.println("-> Base path : " + base); System.out.println("-> Kind : " + kind); System.out.println(""); // Calls the compiler Compiler compiler = new Compiler(filename, base, kind, output); CmdlinePackagerListener listener = new CmdlinePackagerListener(); compiler.setPackagerListener(listener); compiler.compile(); // Waits while (compiler.isAlive()) Thread.sleep(100); if (compiler.wasSuccessful()) exitCode = 0; System.out.println("Build time: "+new Date()); } } catch (Exception err) { // Something bad has happened System.err.println("-> Fatal error :"); System.err.println(" " + err.getMessage()); err.printStackTrace(); System.err.println(""); System.err.println("(tip : use -? to get the commmand line parameters)"); } // Closes the JVM System.exit(exitCode); }
|
public static void main(String[] args) { // Outputs some informations System.out.println(""); System.out.println(".:: IzPack - Version " + IZPACK_VERSION + " ::."); System.out.println(""); System.out.println("< compiler specifications version : " + VERSION + " >"); System.out.println(""); System.out.println("- Copyright (C) 2001-2003 Julien Ponge"); System.out.println("- Visit http://www.izforge.com/ for the latests releases"); System.out.println("- Released under the terms of the GNU GPL either version 2"); System.out.println(" of the licence, or any later version."); System.out.println(""); // exit code 1 means: error int exitCode = 1; // We analyse the command line parameters try { // Our arguments String filename; String base = "."; String kind = "standard"; String output; // First check int nArgs = args.length; if (nArgs < 3) throw new Exception("no arguments given"); // We get the IzPack home directory int stdArgsIndex; if (args[0].equalsIgnoreCase("-HOME")) { stdArgsIndex = 2; IZPACK_HOME = args[1]; } else stdArgsIndex = 0; if (!IZPACK_HOME.endsWith(File.separator)) IZPACK_HOME = IZPACK_HOME + File.separator; // The users wants to know the command line parameters if (args[stdArgsIndex].equalsIgnoreCase("-?")) { System.out.println("-> Command line parameters are : (xml file) [args]"); System.out.println(" (xml file): the xml file describing the installation"); System.out.println(" -b (base) : indicates the base path that the compiler will use for filenames"); System.out.println(" default is the current path"); System.out.println(" -k (kind) : indicates the kind of installer to generate"); System.out.println(" default is standard"); System.out.println(" -o (out) : indicates the output file name"); System.out.println(" default is the xml file name\n"); System.out.println(" When using vm option -DSTACKTRACE=true there is all kind of debug info "); System.out.println(""); } else {// We can parse the other parameters & try to compile the installation // We get the input file name and we initialize the output file name filename = args[stdArgsIndex]; output = filename.substring(0, filename.length() - 3) + "jar"; // We parse the other ones int pos = stdArgsIndex + 1; while (pos < nArgs) if ((args[pos].startsWith("-")) && (args[pos].length() == 2)) { switch (args[pos].toLowerCase().charAt(1)) { case 'b': if ((pos + 1) < nArgs) { pos++; base = args[pos]; } else throw new Exception("base argument missing"); break; case 'k': if ((pos + 1) < nArgs) { pos++; kind = args[pos]; } else throw new Exception("kind argument missing"); break; case 'o': if ((pos + 1) < nArgs) { pos++; output = args[pos]; } else throw new Exception("output argument missing"); break; default: throw new Exception("unknown argument"); } pos++; } else throw new Exception("bad argument"); // Outputs what we are going to do System.out.println("-> Processing : " + filename); System.out.println("-> Output : " + output); System.out.println("-> Base path : " + base); System.out.println("-> Kind : " + kind); System.out.println(""); // Calls the compiler Compiler compiler = new Compiler(filename, base, kind, output); CmdlinePackagerListener listener = new CmdlinePackagerListener(); compiler.setPackagerListener(listener); compiler.compile(); // Waits while (compiler.isAlive()) Thread.sleep(100); if (compiler.wasSuccessful()) exitCode = 0; System.out.println("Build time: " + new Date()); } } catch (Exception err) { // Something bad has happened System.err.println("-> Fatal error :"); System.err.println(" " + err.getMessage()); err.printStackTrace(); System.err.println(""); System.err.println("(tip : use -? to get the commmand line parameters)"); } // Closes the JVM System.exit(exitCode); }
| 3,241,008 |
public static void main(String[] args) { // Outputs some informations System.out.println(""); System.out.println(".:: IzPack - Version " + IZPACK_VERSION + " ::."); System.out.println(""); System.out.println("< compiler specifications version : " + VERSION + " >"); System.out.println(""); System.out.println("- Copyright (C) 2001-2003 Julien Ponge"); System.out.println("- Visit http://www.izforge.com/ for the latests releases"); System.out.println("- Released under the terms of the GNU GPL either version 2"); System.out.println(" of the licence, or any later version."); System.out.println(""); // exit code 1 means: error int exitCode = 1; // We analyse the command line parameters try { // Our arguments String filename; String base = "."; String kind = "standard"; String output; // First check int nArgs = args.length; if (nArgs < 3) throw new Exception("no arguments given"); // We get the IzPack home directory int stdArgsIndex; if (args[0].equalsIgnoreCase("-HOME")) { stdArgsIndex = 2; IZPACK_HOME = args[1]; } else stdArgsIndex = 0; if (!IZPACK_HOME.endsWith(File.separator)) IZPACK_HOME = IZPACK_HOME + File.separator; // The users wants to know the command line parameters if (args[stdArgsIndex].equalsIgnoreCase("-?")) { System.out.println("-> Command line parameters are : (xml file) [args]"); System.out.println(" (xml file): the xml file describing the installation"); System.out.println(" -b (base) : indicates the base path that the compiler will use for filenames"); System.out.println(" default is the current path"); System.out.println(" -k (kind) : indicates the kind of installer to generate"); System.out.println(" default is standard"); System.out.println(" -o (out) : indicates the output file name"); System.out.println(" default is the xml file name\n"); System.out.println(" When using vm option -DSTACKTRACE=true there is all kind of debug info "); System.out.println(""); } else {// We can parse the other parameters & try to compile the installation // We get the input file name and we initialize the output file name filename = args[stdArgsIndex]; output = filename.substring(0, filename.length() - 3) + "jar"; // We parse the other ones int pos = stdArgsIndex + 1; while (pos < nArgs) if ((args[pos].startsWith("-")) && (args[pos].length() == 2)) { switch (args[pos].toLowerCase().charAt(1)) { case 'b': if ((pos + 1) < nArgs) { pos++; base = args[pos]; } else throw new Exception("base argument missing"); break; case 'k': if ((pos + 1) < nArgs) { pos++; kind = args[pos]; } else throw new Exception("kind argument missing"); break; case 'o': if ((pos + 1) < nArgs) { pos++; output = args[pos]; } else throw new Exception("output argument missing"); break; default: throw new Exception("unknown argument"); } pos++; } else throw new Exception("bad argument"); // Outputs what we are going to do System.out.println("-> Processing : " + filename); System.out.println("-> Output : " + output); System.out.println("-> Base path : " + base); System.out.println("-> Kind : " + kind); System.out.println(""); // Calls the compiler Compiler compiler = new Compiler(filename, base, kind, output); CmdlinePackagerListener listener = new CmdlinePackagerListener(); compiler.setPackagerListener(listener); compiler.compile(); // Waits while (compiler.isAlive()) Thread.sleep(100); if (compiler.wasSuccessful()) exitCode = 0; System.out.println("Build time: "+new Date()); } } catch (Exception err) { // Something bad has happened System.err.println("-> Fatal error :"); System.err.println(" " + err.getMessage()); err.printStackTrace(); System.err.println(""); System.err.println("(tip : use -? to get the commmand line parameters)"); } // Closes the JVM System.exit(exitCode); }
|
public static void main(String[] args) { // Outputs some informations System.out.println(""); System.out.println(".:: IzPack - Version " + IZPACK_VERSION + " ::."); System.out.println(""); System.out.println("< compiler specifications version : " + VERSION + " >"); System.out.println(""); System.out.println("- Copyright (C) 2001-2003 Julien Ponge"); System.out.println("- Visit http://www.izforge.com/ for the latests releases"); System.out.println("- Released under the terms of the GNU GPL either version 2"); System.out.println(" of the licence, or any later version."); System.out.println(""); // exit code 1 means: error int exitCode = 1; // We analyse the command line parameters try { // Our arguments String filename; String base = "."; String kind = "standard"; String output; // First check int nArgs = args.length; if (nArgs < 3) throw new Exception("no arguments given"); // We get the IzPack home directory int stdArgsIndex; if (args[0].equalsIgnoreCase("-HOME")) { stdArgsIndex = 2; IZPACK_HOME = args[1]; } else stdArgsIndex = 0; if (!IZPACK_HOME.endsWith(File.separator)) IZPACK_HOME = IZPACK_HOME + File.separator; // The users wants to know the command line parameters if (args[stdArgsIndex].equalsIgnoreCase("-?")) { System.out.println("-> Command line parameters are : (xml file) [args]"); System.out.println(" (xml file): the xml file describing the installation"); System.out.println(" -b (base) : indicates the base path that the compiler will use for filenames"); System.out.println(" default is the current path"); System.out.println(" -k (kind) : indicates the kind of installer to generate"); System.out.println(" default is standard"); System.out.println(" -o (out) : indicates the output file name"); System.out.println(" default is the xml file name\n"); System.out.println(" When using vm option -DSTACKTRACE=true there is all kind of debug info "); System.out.println(""); } else {// We can parse the other parameters & try to compile the installation // We get the input file name and we initialize the output file name filename = args[stdArgsIndex]; output = filename.substring(0, filename.length() - 3) + "jar"; // We parse the other ones int pos = stdArgsIndex + 1; while (pos < nArgs) if ((args[pos].startsWith("-")) && (args[pos].length() == 2)) { switch (args[pos].toLowerCase().charAt(1)) { case 'b': if ((pos + 1) < nArgs) { pos++; base = args[pos]; } else throw new Exception("base argument missing"); break; case 'k': if ((pos + 1) < nArgs) { pos++; kind = args[pos]; } else throw new Exception("kind argument missing"); break; case 'o': if ((pos + 1) < nArgs) { pos++; output = args[pos]; } else throw new Exception("output argument missing"); break; default: throw new Exception("unknown argument"); } pos++; } else throw new Exception("bad argument"); // Outputs what we are going to do System.out.println("-> Processing : " + filename); System.out.println("-> Output : " + output); System.out.println("-> Base path : " + base); System.out.println("-> Kind : " + kind); System.out.println(""); // Calls the compiler Compiler compiler = new Compiler(filename, base, kind, output); CmdlinePackagerListener listener = new CmdlinePackagerListener(); compiler.setPackagerListener(listener); compiler.compile(); // Waits while (compiler.isAlive()) Thread.sleep(100); if (compiler.wasSuccessful()) exitCode = 0; System.out.println("Build time: "+new Date()); } } catch (Exception err) { // Something bad has happened System.err.println("-> Fatal error :"); System.err.println(" " + err.getMessage()); err.printStackTrace(); System.err.println(""); System.err.println("(tip : use -? to get the commmand line parameters)"); } // Closes the JVM System.exit(exitCode); }
| 3,241,009 |
protected void parseError (XMLElement parent, String message) throws CompilerException { this.compileFailed = true; throw new CompilerException(filename+":"+parent.getLineNr()+": "+message); }
|
protected void parseError(XMLElement parent, String message) throws CompilerException { this.compileFailed = true; throw new CompilerException(filename+":"+parent.getLineNr()+": "+message); }
| 3,241,010 |
protected void parseError (XMLElement parent, String message) throws CompilerException { this.compileFailed = true; throw new CompilerException(filename+":"+parent.getLineNr()+": "+message); }
|
protected void parseError (XMLElement parent, String message) throws CompilerException { this.compileFailed = true; throw new CompilerException( filename + ":" + parent.getLineNr() + ": " + message); }
| 3,241,011 |
protected void parseWarn (XMLElement parent, String message) { System.out.println (filename+":"+parent.getLineNr()+": "+message); }
|
protected void parseWarn(XMLElement parent, String message) { System.out.println (filename+":"+parent.getLineNr()+": "+message); }
| 3,241,012 |
protected void parseWarn (XMLElement parent, String message) { System.out.println (filename+":"+parent.getLineNr()+": "+message); }
|
protected void parseWarn (XMLElement parent, String message) { System.out.println(filename + ":" + parent.getLineNr() + ": " + message); }
| 3,241,013 |
protected String requireAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); return value; }
|
protected String requireAttribute(XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); return value; }
| 3,241,014 |
protected String requireAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); return value; }
|
protected String requireAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null) parseError( element, "<" + element.getName() + "> requires attribute '" + attribute + "'"); return value; }
| 3,241,015 |
protected XMLElement requireChildNamed (XMLElement parent, String name) throws CompilerException { XMLElement child = parent.getFirstChildNamed(name); if (child == null) parseError(parent, "<"+parent.getName()+"> requires child <"+name+">"); return child; }
|
protected XMLElement requireChildNamed(XMLElement parent, String name) throws CompilerException { XMLElement child = parent.getFirstChildNamed(name); if (child == null) parseError(parent, "<"+parent.getName()+"> requires child <"+name+">"); return child; }
| 3,241,016 |
protected XMLElement requireChildNamed (XMLElement parent, String name) throws CompilerException { XMLElement child = parent.getFirstChildNamed(name); if (child == null) parseError(parent, "<"+parent.getName()+"> requires child <"+name+">"); return child; }
|
protected XMLElement requireChildNamed (XMLElement parent, String name) throws CompilerException { XMLElement child = parent.getFirstChildNamed(name); if (child == null) parseError( parent, "<" + parent.getName() + "> requires child <" + name + ">"); return child; }
| 3,241,017 |
protected String requireContent (XMLElement element) throws CompilerException { String content = element.getContent(); if (content == null || content.length() == 0) parseError(element, "<"+element.getName()+"> requires content"); return content; }
|
protected String requireContent (XMLElement element) throws CompilerException { String content = element.getContent(); if (content == null || content.length() == 0) parseError(element, "<"+element.getName()+"> requires content"); return content; }
| 3,241,018 |
protected String requireContent (XMLElement element) throws CompilerException { String content = element.getContent(); if (content == null || content.length() == 0) parseError(element, "<"+element.getName()+"> requires content"); return content; }
|
protected String requireContent (XMLElement element) throws CompilerException { String content = element.getContent(); if (content == null || content.length() == 0) parseError(element, "<" + element.getName() + "> requires content"); return content; }
| 3,241,019 |
protected int requireIntAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null || value.length() == 0) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); try { return Integer.parseInt(value); } catch (NumberFormatException x) { parseError(element, "'"+attribute+"' must be an integer"); } return 0; // never happens }
|
protected int requireIntAttribute(XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null || value.length() == 0) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); try { return Integer.parseInt(value); } catch (NumberFormatException x) { parseError(element, "'"+attribute+"' must be an integer"); } return 0; // never happens }
| 3,241,020 |
protected int requireIntAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null || value.length() == 0) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); try { return Integer.parseInt(value); } catch (NumberFormatException x) { parseError(element, "'"+attribute+"' must be an integer"); } return 0; // never happens }
|
protected int requireIntAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null || value.length() == 0) parseError( element, "<" + element.getName() + "> requires attribute '" + attribute + "'"); try { return Integer.parseInt(value); } catch (NumberFormatException x) { parseError(element, "'"+attribute+"' must be an integer"); } return 0; // never happens }
| 3,241,021 |
protected int requireIntAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null || value.length() == 0) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); try { return Integer.parseInt(value); } catch (NumberFormatException x) { parseError(element, "'"+attribute+"' must be an integer"); } return 0; // never happens }
|
protected int requireIntAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null || value.length() == 0) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); try { return Integer.parseInt(value); } catch (NumberFormatException x) { parseError(element, "'"+attribute+"' must be an integer"); } return 0; // never happens }
| 3,241,022 |
protected int requireIntAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null || value.length() == 0) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); try { return Integer.parseInt(value); } catch (NumberFormatException x) { parseError(element, "'"+attribute+"' must be an integer"); } return 0; // never happens }
|
protected int requireIntAttribute (XMLElement element, String attribute) throws CompilerException { String value = element.getAttribute(attribute); if (value == null || value.length() == 0) parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'"); try { return Integer.parseInt(value); } catch (NumberFormatException x) { parseError(element, "'" + attribute + "' must be an integer"); } return 0; // never happens }
| 3,241,023 |
protected boolean requireYesNoAttribute(XMLElement element, String attribute) throws CompilerException { String value = requireAttribute(element,attribute); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; parseError(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no)"); return false; // never happens }
|
protected boolean requireYesNoAttribute(XMLElement element, String attribute) throws CompilerException { String value = requireAttribute(element, attribute); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; parseError(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no)"); return false; // never happens }
| 3,241,024 |
protected boolean requireYesNoAttribute(XMLElement element, String attribute) throws CompilerException { String value = requireAttribute(element,attribute); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; parseError(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no)"); return false; // never happens }
|
protected boolean requireYesNoAttribute(XMLElement element, String attribute) throws CompilerException { String value = requireAttribute(element,attribute); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; parseError(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no)"); return false; // never happens }
| 3,241,025 |
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing ()) { e.printStackTrace(); } else { System.out.println ("ERROR: "+e.getMessage ()); } } }
|
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing ()) { e.printStackTrace(); } else { System.out.println ("ERROR: "+e.getMessage ()); } } }
| 3,241,026 |
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing ()) { e.printStackTrace(); } else { System.out.println ("ERROR: "+e.getMessage ()); } } }
|
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing ()) { e.printStackTrace(); } else { System.out.println ("ERROR: "+e.getMessage ()); } } }
| 3,241,027 |
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing ()) { e.printStackTrace(); } else { System.out.println ("ERROR: "+e.getMessage ()); } } }
|
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing()) { e.printStackTrace(); } else { System.out.println ("ERROR: "+e.getMessage ()); } } }
| 3,241,028 |
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing ()) { e.printStackTrace(); } else { System.out.println ("ERROR: "+e.getMessage ()); } } }
|
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing ()) { e.printStackTrace(); } else { System.out.println ("ERROR: "+e.getMessage ()); } } }
| 3,241,029 |
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing ()) { e.printStackTrace(); } else { System.out.println ("ERROR: "+e.getMessage ()); } } }
|
public void run() { try { executeCompiler();// Execute the compiler - may send info to System.out } catch (CompilerException ce) { System.out.println(ce.getMessage()+"\n"); } catch (Exception e) { if (Debug.stackTracing ()) { e.printStackTrace(); } else { System.out.println("ERROR: " + e.getMessage()); } } }
| 3,241,030 |
protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue) { String value = element.getAttribute(attribute, (defaultValue ? "yes" : "no")); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; // TODO: should this be an error if it's present but "none of the above"? parseWarn(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no) if present"); return defaultValue; }
|
protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue) { String value = element.getAttribute(attribute, (defaultValue ? "yes" : "no")); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; // TODO: should this be an error if it's present but "none of the above"? parseWarn(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no) if present"); return defaultValue; }
| 3,241,031 |
protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue) { String value = element.getAttribute(attribute, (defaultValue ? "yes" : "no")); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; // TODO: should this be an error if it's present but "none of the above"? parseWarn(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no) if present"); return defaultValue; }
|
protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue) { String value = element.getAttribute(attribute, (defaultValue ? "yes" : "no")); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; // TODO: should this be an error if it's present but "none of the above"? parseWarn(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no) if present"); return defaultValue; }
| 3,241,032 |
protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue) { String value = element.getAttribute(attribute, (defaultValue ? "yes" : "no")); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; // TODO: should this be an error if it's present but "none of the above"? parseWarn(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no) if present"); return defaultValue; }
|
protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue) { String value = element.getAttribute(attribute, (defaultValue ? "yes" : "no")); if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false; // TODO: should this be an error if it's present but "none of the above"? parseWarn(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no) if present"); return defaultValue; }
| 3,241,033 |
public boolean wasSuccessful () { return ! this.compileFailed; }
|
public boolean wasSuccessful() { return ! this.compileFailed; }
| 3,241,034 |
public boolean wasSuccessful () { return ! this.compileFailed; }
|
public boolean wasSuccessful () { return !this.compileFailed; }
| 3,241,035 |
public void executeCompiler() throws Exception { // Usefull variables int i; String str; InputStream inStream; // We get the XML data tree XMLElement data = getXMLTree(); // We get the Packager Packager packager = getPackager(); // We add the variable declaration packager.setVariables(getVariables(data)); // We add the info packager.setInfo(getInfo(data)); // We add the GUIPrefs packager.setGUIPrefs(getGUIPrefs(data)); // We add the language packs ArrayList langpacks = getLangpacksCodes(data); Iterator iter = langpacks.iterator(); while (iter.hasNext()) { str = (String) iter.next(); // The language pack inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "installer" + File.separator + str + ".xml"); packager.addLangPack(str, inStream); // The flag inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "flags" + File.separator + str + ".gif"); packager.addResource("flag." + str, inStream); } // We add the resources ArrayList resources = getResources(data); iter = resources.iterator(); while (iter.hasNext()) { Resource res = (Resource) iter.next(); if (res.parse) { if (null != varMap) { File resFile = new File(res.src); FileInputStream inFile = new FileInputStream(resFile); BufferedInputStream bin = new BufferedInputStream(inFile, 5120); File parsedFile = File.createTempFile("izpp", null, resFile.getParentFile()); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream bout = new BufferedOutputStream(outFile, 5120); VariableSubstitutor vs = new VariableSubstitutor(varMap); vs.substitute(bin, bout, res.type, res.encoding); bin.close(); bout.close(); inFile = new FileInputStream(parsedFile); packager.addResource(res.id, inFile); inFile.close(); parsedFile.delete(); } else { System.err.println("ERROR: no variable is defined. " + res.src + " is not parsed."); inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } else { inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } // We add the native libraries ArrayList natives = getNativeLibraries(data); iter = natives.iterator(); while (iter.hasNext()) { NativeLibrary nat = (NativeLibrary) iter.next(); inStream = new FileInputStream(nat.path); packager.addNativeLibrary(nat.name, inStream); } // We add the additionnal jar files content ArrayList jars = getJars(data); iter = jars.iterator(); while (iter.hasNext()) packager.addJarContent((String) iter.next()); // We add the panels ArrayList panels = getPanels(data); ArrayList panelsOrder = new ArrayList(panels.size()); TreeSet panelsCache = new TreeSet(); iter = panels.iterator(); while (iter.hasNext()) { // We locate the panel classes directory str = (String) iter.next(); File dir = new File(Compiler.IZPACK_HOME + "bin" + File.separator + "panels" + File.separator + str); if (!dir.exists()) throw new Exception(str + " panel does not exist"); // We add the panel in the order array panelsOrder.add(str); // We add each file in the panel folder if (panelsCache.contains(str)) continue; panelsCache.add(str); File[] files = dir.listFiles(); int nf = files.length; for (int j = 0; j < nf; j++) { if (files[j].isDirectory()) continue; FileInputStream inClass = new FileInputStream(files[j]); packager.addPanelClass(files[j].getName(), inClass); } } // We set the panels order packager.setPanelsOrder(panelsOrder); // We add the packs i = 0; ArrayList packs = getPacks(data); iter = packs.iterator(); while (iter.hasNext()) { Pack pack = (Pack) iter.next(); ZipOutputStream zipOut = packager.addPack(i++, pack.name, pack.os, pack.required, pack.description); ObjectOutputStream objOut = new ObjectOutputStream(zipOut); // We write the pack data objOut.writeInt(pack.packFiles.size()); Iterator iter2 = pack.packFiles.iterator(); long packageBytes = 0; while (iter2.hasNext()) { // Initialisations PackSource p = (PackSource) iter2.next(); File f = new File(p.src); FileInputStream in = new FileInputStream(f); long nbytes = f.length(); String targetFilename = p.targetdir + "/" + f.getName(); // Writing objOut.writeObject(new PackFile(targetFilename, p.os, nbytes, p.override)); byte[] buffer = new byte[5120]; long bytesWritten = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { objOut.write(buffer, 0, bytesInBuffer); bytesWritten += bytesInBuffer; } if (bytesWritten != nbytes) throw new IOException ("File size mismatch when reading " + f); packageBytes += bytesWritten; in.close(); } packager.packAdded(i - 1, packageBytes); // Write out information about parsable files objOut.writeInt(pack.parsables.size()); iter2 = pack.parsables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Write out information about executable files objOut.writeInt(pack.executables.size()); iter2 = pack.executables.iterator(); while (iter2.hasNext()) { objOut.writeObject(iter2.next()); } // Cleanup objOut.flush(); zipOut.closeEntry(); } // We ask the packager to finish packager.finish(); }
|
public void executeCompiler() throws Exception { // Usefull variables int i; String str; InputStream inStream; // We get the XML data tree XMLElement data = getXMLTree(); // We get the Packager Packager packager = getPackager(); // We add the variable declaration packager.setVariables(getVariables(data)); // We add the info packager.setInfo(getInfo(data)); // We add the GUIPrefs packager.setGUIPrefs(getGUIPrefs(data)); // We add the language packs ArrayList langpacks = getLangpacksCodes(data); Iterator iter = langpacks.iterator(); while (iter.hasNext()) { str = (String) iter.next(); // The language pack inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "installer" + File.separator + str + ".xml"); packager.addLangPack(str, inStream); // The flag inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "flags" + File.separator + str + ".gif"); packager.addResource("flag." + str, inStream); } // We add the resources ArrayList resources = getResources(data); iter = resources.iterator(); while (iter.hasNext()) { Resource res = (Resource) iter.next(); if (res.parse) { if (null != varMap) { File resFile = new File(res.src); FileInputStream inFile = new FileInputStream(resFile); BufferedInputStream bin = new BufferedInputStream(inFile, 5120); File parsedFile = File.createTempFile("izpp", null, resFile.getParentFile()); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream bout = new BufferedOutputStream(outFile, 5120); VariableSubstitutor vs = new VariableSubstitutor(varMap); vs.substitute(bin, bout, res.type, res.encoding); bin.close(); bout.close(); inFile = new FileInputStream(parsedFile); packager.addResource(res.id, inFile); inFile.close(); parsedFile.delete(); } else { System.err.println("ERROR: no variable is defined. " + res.src + " is not parsed."); inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } else { inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } // We add the native libraries ArrayList natives = getNativeLibraries(data); iter = natives.iterator(); while (iter.hasNext()) { NativeLibrary nat = (NativeLibrary) iter.next(); inStream = new FileInputStream(nat.path); packager.addNativeLibrary(nat.name, inStream); } // We add the additionnal jar files content ArrayList jars = getJars(data); iter = jars.iterator(); while (iter.hasNext()) packager.addJarContent((String) iter.next()); // We add the panels ArrayList panels = getPanels(data); ArrayList panelsOrder = new ArrayList(panels.size()); TreeSet panelsCache = new TreeSet(); iter = panels.iterator(); while (iter.hasNext()) { // We locate the panel classes directory str = (String) iter.next(); File dir = new File(Compiler.IZPACK_HOME + "bin" + File.separator + "panels" + File.separator + str); if (!dir.exists()) throw new Exception(str + " panel does not exist"); // We add the panel in the order array panelsOrder.add(str); // We add each file in the panel folder if (panelsCache.contains(str)) continue; panelsCache.add(str); File[] files = dir.listFiles(); int nf = files.length; for (int j = 0; j < nf; j++) { if (files[j].isDirectory()) continue; FileInputStream inClass = new FileInputStream(files[j]); packager.addPanelClass(files[j].getName(), inClass); } } // We set the panels order packager.setPanelsOrder(panelsOrder); // We add the packs i = 0; ArrayList packs = getPacks(data); iter = packs.iterator(); while (iter.hasNext()) { Pack pack = (Pack) iter.next(); ZipOutputStream zipOut = packager.addPack(i++, pack.name, pack.os, pack.required, pack.description); ObjectOutputStream objOut = new ObjectOutputStream(zipOut); // We write the pack data objOut.writeInt(pack.packFiles.size()); Iterator iter2 = pack.packFiles.iterator(); long packageBytes = 0; while (iter2.hasNext()) { // Initialisations PackSource p = (PackSource) iter2.next(); File f = new File(p.src); FileInputStream in = new FileInputStream(f); long nbytes = f.length(); String targetFilename = p.targetdir + f.getName(); if('/' != File.separatorChar) { targetFilename = targetFilename.replace(File.separatorChar, '/'); } // Writing objOut.writeObject(new PackFile(targetFilename, p.os, nbytes, p.override)); byte[] buffer = new byte[5120]; long bytesWritten = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { objOut.write(buffer, 0, bytesInBuffer); bytesWritten += bytesInBuffer; } if (bytesWritten != nbytes) throw new IOException ("File size mismatch when reading " + f); packageBytes += bytesWritten; in.close(); } packager.packAdded(i - 1, packageBytes); // Write out information about parsable files objOut.writeInt(pack.parsables.size()); iter2 = pack.parsables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Write out information about executable files objOut.writeInt(pack.executables.size()); iter2 = pack.executables.iterator(); while (iter2.hasNext()) { objOut.writeObject(iter2.next()); } // Cleanup objOut.flush(); zipOut.closeEntry(); } // We ask the packager to finish packager.finish(); }
| 3,241,036 |
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; XMLElement icon; InputStream inXML = getClass().getResourceAsStream("/com/izforge/izpack/installer/icons.xml"); // Initialises the parser StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setReader(new StdXMLReader(inXML)); parser.setValidator(new NonValidator()); // We get the data XMLElement data = (XMLElement) parser.parse(); // We load the icons Vector children = data.getChildrenNamed("icon"); int size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = getClass().getResource(icon.getAttribute("res")); img = new ImageIcon(url); icons.put(icon.getAttribute("id"), img); } // We load the Swing-specific icons children = data.getChildrenNamed("sysicon"); size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = getClass().getResource(icon.getAttribute("res")); img = new ImageIcon(url); UIManager.put(icon.getAttribute("id"), img); } }
|
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; XMLElement icon; InputStream inXML = InstallerFrame.class.getResourceAsStream("/com/izforge/izpack/installer/icons.xml"); // Initialises the parser StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setReader(new StdXMLReader(inXML)); parser.setValidator(new NonValidator()); // We get the data XMLElement data = (XMLElement) parser.parse(); // We load the icons Vector children = data.getChildrenNamed("icon"); int size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = getClass().getResource(icon.getAttribute("res")); img = new ImageIcon(url); icons.put(icon.getAttribute("id"), img); } // We load the Swing-specific icons children = data.getChildrenNamed("sysicon"); size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = getClass().getResource(icon.getAttribute("res")); img = new ImageIcon(url); UIManager.put(icon.getAttribute("id"), img); } }
| 3,241,037 |
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; XMLElement icon; InputStream inXML = getClass().getResourceAsStream("/com/izforge/izpack/installer/icons.xml"); // Initialises the parser StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setReader(new StdXMLReader(inXML)); parser.setValidator(new NonValidator()); // We get the data XMLElement data = (XMLElement) parser.parse(); // We load the icons Vector children = data.getChildrenNamed("icon"); int size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = getClass().getResource(icon.getAttribute("res")); img = new ImageIcon(url); icons.put(icon.getAttribute("id"), img); } // We load the Swing-specific icons children = data.getChildrenNamed("sysicon"); size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = getClass().getResource(icon.getAttribute("res")); img = new ImageIcon(url); UIManager.put(icon.getAttribute("id"), img); } }
|
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; XMLElement icon; InputStream inXML = getClass().getResourceAsStream("/com/izforge/izpack/installer/icons.xml"); // Initialises the parser StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setReader(new StdXMLReader(inXML)); parser.setValidator(new NonValidator()); // We get the data XMLElement data = (XMLElement) parser.parse(); // We load the icons Vector children = data.getChildrenNamed("icon"); int size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = InstallerFrame.class.getResource(icon.getAttribute("res")); img = new ImageIcon(url); icons.put(icon.getAttribute("id"), img); } // We load the Swing-specific icons children = data.getChildrenNamed("sysicon"); size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = InstallerFrame.class.getResource(icon.getAttribute("res")); img = new ImageIcon(url); UIManager.put(icon.getAttribute("id"), img); } }
| 3,241,038 |
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; XMLElement icon; InputStream inXML = getClass().getResourceAsStream("/com/izforge/izpack/installer/icons.xml"); // Initialises the parser StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setReader(new StdXMLReader(inXML)); parser.setValidator(new NonValidator()); // We get the data XMLElement data = (XMLElement) parser.parse(); // We load the icons Vector children = data.getChildrenNamed("icon"); int size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = getClass().getResource(icon.getAttribute("res")); img = new ImageIcon(url); icons.put(icon.getAttribute("id"), img); } // We load the Swing-specific icons children = data.getChildrenNamed("sysicon"); size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = getClass().getResource(icon.getAttribute("res")); img = new ImageIcon(url); UIManager.put(icon.getAttribute("id"), img); } }
|
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; XMLElement icon; InputStream inXML = getClass().getResourceAsStream("/com/izforge/izpack/installer/icons.xml"); // Initialises the parser StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setReader(new StdXMLReader(inXML)); parser.setValidator(new NonValidator()); // We get the data XMLElement data = (XMLElement) parser.parse(); // We load the icons Vector children = data.getChildrenNamed("icon"); int size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = InstallerFrame.class.getResource(icon.getAttribute("res")); img = new ImageIcon(url); icons.put(icon.getAttribute("id"), img); } // We load the Swing-specific icons children = data.getChildrenNamed("sysicon"); size = children.size(); for (int i = 0; i < size; i++) { icon = (XMLElement) children.get(i); url = InstallerFrame.class.getResource(icon.getAttribute("res")); img = new ImageIcon(url); UIManager.put(icon.getAttribute("id"), img); } }
| 3,241,039 |
public String depString() { String text = ""; if (dependencies == null) return text; String name = null; for (int i = 0; i < dependencies.size() - 1; i++) { name = (String) dependencies.get(i); text += name + ","; } name = (String) dependencies.get(dependencies.size() - 1); text += name; return text; }
|
public String depString() { String text = ""; if (dependencies == null) return text; String name; for (int i = 0; i < dependencies.size() - 1; i++) { name = (String) dependencies.get(i); text += name + ","; } name = (String) dependencies.get(dependencies.size() - 1); text += name; return text; }
| 3,241,040 |
public JLabel createLabel(String textId, String iconId, int pos) { ImageIcon ii = (iconId != null) ? parent.icons.getImageIcon(iconId) : null; JLabel label = LabelFactory.create(parent.langpack.getString(textId), ii, pos); if (label != null) label.setFont(getControlTextFont()); return (label); }
|
public JLabel createLabel(String subkey, String alternateClass, String iconId, int pos) { ImageIcon ii = (iconId != null) ? parent.icons.getImageIcon(iconId) : null; JLabel label = LabelFactory.create(parent.langpack.getString(textId), ii, pos); if (label != null) label.setFont(getControlTextFont()); return (label); }
| 3,241,042 |
public JLabel createLabel(String textId, String iconId, int pos) { ImageIcon ii = (iconId != null) ? parent.icons.getImageIcon(iconId) : null; JLabel label = LabelFactory.create(parent.langpack.getString(textId), ii, pos); if (label != null) label.setFont(getControlTextFont()); return (label); }
|
public JLabel createLabel(String textId, String iconId, int pos) { ImageIcon ii = (iconId != null) ? parent.icons.getImageIcon(iconId) : null; String msg = getI18nStringForClass(subkey, alternateClass); JLabel label = LabelFactory.create(msg, ii, pos); if (label != null) label.setFont(getControlTextFont()); return (label); }
| 3,241,043 |
public String getResult () { String item = (String)this.pathComboBox.getSelectedItem (); if (item != null) item.trim(); String path = item; File f = new File (item); if (! f.isDirectory ()) { path = f.getParent (); } // path now contains the final content of the combo box if (this.resultType == RESULT_DIRECTORY) { return path; } else if (this.resultType == RESULT_FILE) { if (this.filename != null) { return path + File.separatorChar + this.filename; } else { return item; } } else if (this.resultType == RESULT_PARENTDIR) { File dir = new File (path); return dir.getParent (); } return null; }
|
public String getResult () { String item = (String)this.pathComboBox.getSelectedItem (); if (item != null) item = item.trim(); String path = item; File f = new File (item); if (! f.isDirectory ()) { path = f.getParent (); } // path now contains the final content of the combo box if (this.resultType == RESULT_DIRECTORY) { return path; } else if (this.resultType == RESULT_FILE) { if (this.filename != null) { return path + File.separatorChar + this.filename; } else { return item; } } else if (this.resultType == RESULT_PARENTDIR) { File dir = new File (path); return dir.getParent (); } return null; }
| 3,241,045 |
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
|
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parentFrame.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
| 3,241,046 |
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
|
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parentFrame.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
| 3,241,047 |
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
|
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parentFrame.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
| 3,241,048 |
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
|
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parentFrame.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
| 3,241,049 |
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
|
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parentFrame.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
| 3,241,050 |
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
|
private void addSearch (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); String filename = null; String check_filename = null; int search_type = 0; int result_type = 0; JComboBox combobox = new JComboBox (); JLabel label = null; //System.out.println ("adding search combobox, variable "+variable); // allow the user to enter something combobox.setEditable (true); // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); // search type is optional (default: file) search_type = SearchField.TYPE_FILE; String search_type_str = element.getAttribute (SEARCH_TYPE); if (search_type_str != null) { if (search_type_str.equals (SEARCH_FILE)) { search_type = SearchField.TYPE_FILE; } else if (search_type_str.equals (SEARCH_DIRECTORY)) { search_type = SearchField.TYPE_DIRECTORY; } } // result type is mandatory too String result_type_str = element.getAttribute (SEARCH_RESULT); if (result_type_str == null) { return; } else if (result_type_str.equals (SEARCH_FILE)) { result_type = SearchField.RESULT_FILE; } else if (result_type_str.equals (SEARCH_DIRECTORY)) { result_type = SearchField.RESULT_DIRECTORY; } else if (result_type_str.equals (SEARCH_PARENTDIR)) { result_type = SearchField.RESULT_PARENTDIR; } else { return; } // might be missing - null is okay filename = element.getAttribute (SEARCH_FILENAME); check_filename = element.getAttribute (SEARCH_CHECKFILENAME); Vector choices = element.getChildrenNamed (SEARCH_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { XMLElement choice_el = (XMLElement)choices.elementAt (i); if (! OsConstraint.oneMatchesCurrentSystem(element)) continue; String value = choice_el.getAttribute (SEARCH_VALUE); combobox.addItem (value); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { combobox.setSelectedIndex (i); } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints westconstraint1 = new TwoColumnConstraints (); westconstraint1.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, westconstraint1, label, forPacks, forOs}); TwoColumnConstraints eastconstraint1 = new TwoColumnConstraints (); eastconstraint1.position = TwoColumnConstraints.EAST; StringBuffer tooltiptext = new StringBuffer (); if ((filename != null) && (filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"), new String[] { filename} )); } if ((check_filename != null) && (check_filename.length() > 0)) { tooltiptext.append ( MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"), new String[] { check_filename } )); } if (tooltiptext.length() > 0) combobox.setToolTipText (tooltiptext.toString()); uiElements.add (new Object [] {null, SEARCH_FIELD, variable, eastconstraint1, combobox, forPacks, forOs}); JPanel buttonPanel = new JPanel (); buttonPanel.setLayout (new com.izforge.izpack.gui.FlowLayout (com.izforge.izpack.gui.FlowLayout.LEADING)); JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor); autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip")); buttonPanel.add (autodetectButton); JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor); buttonPanel.add (browseButton); TwoColumnConstraints eastonlyconstraint = new TwoColumnConstraints (); eastonlyconstraint.position = TwoColumnConstraints.EASTONLY; uiElements.add (new Object [] {null, SEARCH_BUTTON_FIELD, null, eastonlyconstraint, buttonPanel, forPacks, forOs}); searchFields.add (new SearchField (filename, check_filename, parentFrame, combobox, autodetectButton, browseButton, search_type, result_type)); }
| 3,241,051 |
private void buildUI () { Object [] uiElement; for (int i = 0; i < uiElements.size (); i++) { uiElement = (Object [])uiElements.elementAt (i); if (itemRequiredFor ((Vector)uiElement [POS_PACKS]) && itemRequiredForOs((Vector) uiElement[POS_OS]) ) { try { if (uiElement [POS_DISPLAYED] == null || uiElement [POS_DISPLAYED].toString().equals("false")) { add ((JComponent)uiElement [POS_FIELD], uiElement [POS_CONSTRAINTS]); } uiElement [POS_DISPLAYED] = new Boolean (true); uiElements.remove(i); uiElements.add(i, uiElement); } catch (Throwable exception) { System.out.println ("Internal format error in field: " + uiElement [POS_TYPE].toString ()); // !!! logging } } else { try { if (uiElement [POS_DISPLAYED] != null && uiElement [POS_DISPLAYED].toString().equals("true")) { remove((JComponent)uiElement [POS_FIELD]); } } catch (Throwable exception) { System.out.println ("Internal format error in field: " + uiElement [POS_TYPE].toString ()); // !!! logging } uiElement [POS_DISPLAYED] = new Boolean (false); uiElements.remove(i); uiElements.add(i, uiElement); } } }
|
private void buildUI () { Object [] uiElement; for (int i = 0; i < uiElements.size (); i++) { uiElement = (Object [])uiElements.elementAt (i); if (itemRequiredFor ((Vector)uiElement [POS_PACKS]) && itemRequiredForOs((Vector) uiElement[POS_OS]) ) { try { if (uiElement [POS_DISPLAYED] == null || uiElement [POS_DISPLAYED].toString().equals("false")) { add ((JComponent)uiElement [POS_FIELD], uiElement [POS_CONSTRAINTS]); } uiElement [POS_DISPLAYED] = new Boolean (true); uiElements.remove(i); uiElements.add(i, uiElement); } catch (Throwable exception) { System.out.println ("Internal format error in field: " + uiElement [POS_TYPE].toString ()); // !!! logging } } else { try { if (uiElement [POS_DISPLAYED] != null && uiElement [POS_DISPLAYED].toString().equals("true")) { remove((JComponent)uiElement [POS_FIELD]); } } catch (Throwable exception) { System.out.println ("Internal format error in field: " + uiElement [POS_TYPE].toString ()); // !!! logging } uiElement [POS_DISPLAYED] = new Boolean (false); uiElements.remove(i); uiElements.add(i, uiElement); } } }
| 3,241,052 |
private void buildUI () { Object [] uiElement; for (int i = 0; i < uiElements.size (); i++) { uiElement = (Object [])uiElements.elementAt (i); if (itemRequiredFor ((Vector)uiElement [POS_PACKS]) && itemRequiredForOs((Vector) uiElement[POS_OS]) ) { try { if (uiElement [POS_DISPLAYED] == null || uiElement [POS_DISPLAYED].toString().equals("false")) { add ((JComponent)uiElement [POS_FIELD], uiElement [POS_CONSTRAINTS]); } uiElement [POS_DISPLAYED] = new Boolean (true); uiElements.remove(i); uiElements.add(i, uiElement); } catch (Throwable exception) { System.out.println ("Internal format error in field: " + uiElement [POS_TYPE].toString ()); // !!! logging } } else { try { if (uiElement [POS_DISPLAYED] != null && uiElement [POS_DISPLAYED].toString().equals("true")) { remove((JComponent)uiElement [POS_FIELD]); } } catch (Throwable exception) { System.out.println ("Internal format error in field: " + uiElement [POS_TYPE].toString ()); // !!! logging } uiElement [POS_DISPLAYED] = new Boolean (false); uiElements.remove(i); uiElements.add(i, uiElement); } } }
|
private void buildUI () { Object [] uiElement; for (int i = 0; i < uiElements.size (); i++) { uiElement = (Object [])uiElements.elementAt (i); if (itemRequiredFor ((Vector)uiElement [POS_PACKS]) && itemRequiredForOs((Vector) uiElement[POS_OS]) ) { try { if (uiElement [POS_DISPLAYED] == null || uiElement [POS_DISPLAYED].toString().equals("false")) { add ((JComponent)uiElement [POS_FIELD], uiElement [POS_CONSTRAINTS]); } uiElement [POS_DISPLAYED] = new Boolean (true); uiElements.remove(i); uiElements.add(i, uiElement); } catch (Throwable exception) { System.out.println ("Internal format error in field: " + uiElement [POS_TYPE].toString ()); // !!! logging } } else { try { if (uiElement [POS_DISPLAYED] != null && uiElement [POS_DISPLAYED].toString().equals("true")) { remove((JComponent)uiElement [POS_FIELD]); } } catch (Throwable exception) { System.out.println ("Internal format error in field: " + uiElement [POS_TYPE].toString ()); // !!! logging } uiElement [POS_DISPLAYED] = new Boolean (false); uiElements.remove(i); uiElements.add(i, uiElement); } } }
| 3,241,053 |
private boolean readPasswordField (Object [] field) { PasswordGroup group = null; String variable = null; String message = null; try { group = (PasswordGroup)field [POS_GROUP]; variable = (String)field [POS_VARIABLE]; message = (String)field [POS_MESSAGE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (passwordGroupsRead.contains (group))) { return (true); } passwordGroups.add (group); boolean success = group.validateContents (); if (!success) { JOptionPane.showMessageDialog (parent, message, parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable(variable, group.getPassword ()); entries.add (new TextValuePair (variable, group.getPassword ())); return (true); }
|
private boolean readPasswordField (Object [] field) { PasswordGroup group = null; String variable = null; String message = null; try { group = (PasswordGroup)field [POS_GROUP]; variable = (String)field [POS_VARIABLE]; message = (String)field [POS_MESSAGE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (passwordGroupsRead.contains (group))) { return (true); } passwordGroups.add (group); boolean success = group.validateContents (); if (!success) { JOptionPane.showMessageDialog (parentFrame, message, parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable(variable, group.getPassword ()); entries.add (new TextValuePair (variable, group.getPassword ())); return (true); }
| 3,241,054 |
private boolean readPasswordField (Object [] field) { PasswordGroup group = null; String variable = null; String message = null; try { group = (PasswordGroup)field [POS_GROUP]; variable = (String)field [POS_VARIABLE]; message = (String)field [POS_MESSAGE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (passwordGroupsRead.contains (group))) { return (true); } passwordGroups.add (group); boolean success = group.validateContents (); if (!success) { JOptionPane.showMessageDialog (parent, message, parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable(variable, group.getPassword ()); entries.add (new TextValuePair (variable, group.getPassword ())); return (true); }
|
private boolean readPasswordField (Object [] field) { PasswordGroup group = null; String variable = null; String message = null; try { group = (PasswordGroup)field [POS_GROUP]; variable = (String)field [POS_VARIABLE]; message = (String)field [POS_MESSAGE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (passwordGroupsRead.contains (group))) { return (true); } passwordGroups.add (group); boolean success = group.validateContents (); if (!success) { JOptionPane.showMessageDialog (parent, message, parentFrame.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable(variable, group.getPassword ()); entries.add (new TextValuePair (variable, group.getPassword ())); return (true); }
| 3,241,055 |
private boolean readRuleField (Object [] field) { RuleInputField ruleField = null; String variable = null; try { ruleField = (RuleInputField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (ruleField == null)) { return (true); } boolean success = ruleField.validateContents (); if (!success) { String message = ""; try{ message = langpack.getString( (String)field [POS_MESSAGE]); if (message.equals("")){ message = (String)field [POS_MESSAGE]; } }catch (Throwable t){ message = (String)field [POS_MESSAGE]; } JOptionPane.showMessageDialog (parent, message, parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable (variable, ruleField.getText ()); entries.add (new TextValuePair (variable, ruleField.getText ())); return (true); }
|
private boolean readRuleField (Object [] field) { RuleInputField ruleField = null; String variable = null; try { ruleField = (RuleInputField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (ruleField == null)) { return (true); } boolean success = ruleField.validateContents (); if (!success) { String message = ""; try{ message = langpack.getString( (String)field [POS_MESSAGE]); if (message.equals("")){ message = (String)field [POS_MESSAGE]; } }catch (Throwable t){ message = (String)field [POS_MESSAGE]; } JOptionPane.showMessageDialog (parentFrame, message, parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable (variable, ruleField.getText ()); entries.add (new TextValuePair (variable, ruleField.getText ())); return (true); }
| 3,241,056 |
private boolean readRuleField (Object [] field) { RuleInputField ruleField = null; String variable = null; try { ruleField = (RuleInputField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (ruleField == null)) { return (true); } boolean success = ruleField.validateContents (); if (!success) { String message = ""; try{ message = langpack.getString( (String)field [POS_MESSAGE]); if (message.equals("")){ message = (String)field [POS_MESSAGE]; } }catch (Throwable t){ message = (String)field [POS_MESSAGE]; } JOptionPane.showMessageDialog (parent, message, parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable (variable, ruleField.getText ()); entries.add (new TextValuePair (variable, ruleField.getText ())); return (true); }
|
private boolean readRuleField (Object [] field) { RuleInputField ruleField = null; String variable = null; try { ruleField = (RuleInputField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (ruleField == null)) { return (true); } boolean success = ruleField.validateContents (); if (!success) { String message = ""; try{ message = langpack.getString( (String)field [POS_MESSAGE]); if (message.equals("")){ message = (String)field [POS_MESSAGE]; } }catch (Throwable t){ message = (String)field [POS_MESSAGE]; } JOptionPane.showMessageDialog (parent, message, parentFrame.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.setVariable (variable, ruleField.getText ()); entries.add (new TextValuePair (variable, ruleField.getText ())); return (true); }
| 3,241,057 |
private void readSpec () throws Exception { InputStream input = null; XMLElement data; Vector specElements; String attribute; String instance = Integer.toString (instanceNumber); try { input = parent.getResource (SPEC_FILE_NAME); } catch (Exception exception) { haveSpec = false; return; } if (input == null) { haveSpec = false; return; } // initialize the parser StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); parser.setReader (new StdXMLReader (input)); // get the data data = (XMLElement) parser.parse (); // extract the spec to this specific panel instance if (data.hasChildren ()) { specElements = data.getChildrenNamed (NODE_ID); for (int i = 0; i < specElements.size (); i++) { data = (XMLElement)specElements.elementAt (i); attribute = data.getAttribute (INSTANCE_IDENTIFIER); if (instance.equals (attribute)) { // use the current element as spec spec = data; // close the stream input.close (); haveSpec = true; return; } } haveSpec = false; return; } haveSpec = false; }
|
private void readSpec () throws Exception { InputStream input = null; XMLElement data; Vector specElements; String attribute; String instance = Integer.toString (instanceNumber); try { input = parentFrame.getResource (SPEC_FILE_NAME); } catch (Exception exception) { haveSpec = false; return; } if (input == null) { haveSpec = false; return; } // initialize the parser StdXMLParser parser = new StdXMLParser (); parser.setBuilder (new StdXMLBuilder ()); parser.setValidator (new NonValidator ()); parser.setReader (new StdXMLReader (input)); // get the data data = (XMLElement) parser.parse (); // extract the spec to this specific panel instance if (data.hasChildren ()) { specElements = data.getChildrenNamed (NODE_ID); for (int i = 0; i < specElements.size (); i++) { data = (XMLElement)specElements.elementAt (i); attribute = data.getAttribute (INSTANCE_IDENTIFIER); if (instance.equals (attribute)) { // use the current element as spec spec = data; // close the stream input.close (); haveSpec = true; return; } } haveSpec = false; return; } haveSpec = false; }
| 3,241,058 |
public void run() { instances.add(this); try { listener.startUnpack(); String currentOs = System.getProperty("os.name").toLowerCase(); // // Initialisations FileOutputStream out = null; ArrayList parsables = new ArrayList(); ArrayList executables = new ArrayList(); List packs = idata.selectedPacks; int npacks = packs.size(); udata = UninstallData.getInstance(); // Specific to the web installers if (idata.kind.equalsIgnoreCase("web") || idata.kind.equalsIgnoreCase("web-kunststoff")) { InputStream kin = getClass().getResourceAsStream("/res/WebInstallers.url"); BufferedReader kreader = new BufferedReader(new InputStreamReader(kin)); jarLocation = kreader.readLine(); } // We unpack the selected packs for (int i = 0; i < npacks; i++) { // We get the pack stream int n = idata.availablePacks.indexOf(packs.get(i)); ObjectInputStream objIn = new ObjectInputStream(getPackAsStream(n)); // We unpack the files int nfiles = objIn.readInt(); listener.changeUnpack(0, nfiles, ((Pack) packs.get(i)).name); for (int j = 0; j < nfiles; j++) { // We read the header PackFile pf = (PackFile) objIn.readObject(); if (null == pf.os || currentOs.indexOf(pf.os.toLowerCase()) > -1) { // We translate & build the path String path = translatePath(pf.targetPath); File pathFile = new File(path); String fname = pathFile.getName(); int z = fname.length(); File dest = pathFile.getParentFile(); if (!dest.exists()) dest.mkdirs(); // We add the path to the log, udata.addFile(path); listener.progressUnpack(j, path); //if this file exists and shouldnot override skip this file if (((pf.override == false) && (pathFile.exists()))) { objIn.skip(pf.length); continue; } // We copy the file out = new FileOutputStream(path); byte[] buffer = new byte[5120]; long bytesCopied = 0; while (bytesCopied < pf.length) { int maxBytes = (pf.length - bytesCopied < buffer.length ? (int) (pf.length - bytesCopied) : buffer.length); int bytesInBuffer = objIn.read(buffer, 0, maxBytes); if (bytesInBuffer == -1) throw new IOException("Unexpected end of stream"); out.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } // Cleanings out.close(); // Empty dirs restoring String _n = pathFile.getName(); if (_n.startsWith("izpack-keepme") && _n.endsWith(".tmp")) pathFile.delete(); } else objIn.skip(pf.length); } // Load information about parsable files int numParsables = objIn.readInt(); int k; for (k = 0; k < numParsables; k++) { ParsableFile pf = (ParsableFile) objIn.readObject(); pf.path = translatePath(pf.path); parsables.add(pf); } // Load information about executable files int numExecutables = objIn.readInt(); for (k = 0; k < numExecutables; k++) { ExecutableFile ef = (ExecutableFile) objIn.readObject(); ef.path = translatePath(ef.path); if (null != ef.argList && !ef.argList.isEmpty()) { String arg = null; for (int j = 0; j < ef.argList.size(); j++) { arg = (String) ef.argList.get(j); arg = translatePath(arg); ef.argList.set(j, arg); } } executables.add(ef); if(ef.executionStage == ExecutableFile.UNINSTALL) { udata.addExecutable(ef); } } objIn.close(); } // We use the scripts parser ScriptParser parser = new ScriptParser(parsables, vs); parser.parseFiles(); // We use the file executor FileExecutor executor = new FileExecutor(executables); if (executor.executeFiles(ExecutableFile.POSTINSTALL) != 0) javax.swing.JOptionPane.showMessageDialog( null, "The installation was not completed.", "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); // We put the uninstaller putUninstaller(); // The end :-) listener.stopUnpack(); } catch (Exception err) { listener.stopUnpack(); listener.errorUnpack(err.toString()); } instances.remove(instances.indexOf(this)); }
|
public void run() { instances.add(this); try { listener.startUnpack(); String currentOs = System.getProperty("os.name").toLowerCase(); // // Initialisations FileOutputStream out = null; ArrayList parsables = new ArrayList(); ArrayList executables = new ArrayList(); List packs = idata.selectedPacks; int npacks = packs.size(); udata = UninstallData.getInstance(); // Specific to the web installers if (idata.kind.equalsIgnoreCase("web") || idata.kind.equalsIgnoreCase("web-kunststoff")) { InputStream kin = getClass().getResourceAsStream("/res/WebInstallers.url"); BufferedReader kreader = new BufferedReader(new InputStreamReader(kin)); jarLocation = kreader.readLine(); } // We unpack the selected packs for (int i = 0; i < npacks; i++) { // We get the pack stream int n = idata.allPacks.indexOf(packs.get(i)); ObjectInputStream objIn = new ObjectInputStream(getPackAsStream(n)); // We unpack the files int nfiles = objIn.readInt(); listener.changeUnpack(0, nfiles, ((Pack) packs.get(i)).name); for (int j = 0; j < nfiles; j++) { // We read the header PackFile pf = (PackFile) objIn.readObject(); if (null == pf.os || currentOs.indexOf(pf.os.toLowerCase()) > -1) { // We translate & build the path String path = translatePath(pf.targetPath); File pathFile = new File(path); String fname = pathFile.getName(); int z = fname.length(); File dest = pathFile.getParentFile(); if (!dest.exists()) dest.mkdirs(); // We add the path to the log, udata.addFile(path); listener.progressUnpack(j, path); //if this file exists and shouldnot override skip this file if (((pf.override == false) && (pathFile.exists()))) { objIn.skip(pf.length); continue; } // We copy the file out = new FileOutputStream(path); byte[] buffer = new byte[5120]; long bytesCopied = 0; while (bytesCopied < pf.length) { int maxBytes = (pf.length - bytesCopied < buffer.length ? (int) (pf.length - bytesCopied) : buffer.length); int bytesInBuffer = objIn.read(buffer, 0, maxBytes); if (bytesInBuffer == -1) throw new IOException("Unexpected end of stream"); out.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } // Cleanings out.close(); // Empty dirs restoring String _n = pathFile.getName(); if (_n.startsWith("izpack-keepme") && _n.endsWith(".tmp")) pathFile.delete(); } else objIn.skip(pf.length); } // Load information about parsable files int numParsables = objIn.readInt(); int k; for (k = 0; k < numParsables; k++) { ParsableFile pf = (ParsableFile) objIn.readObject(); pf.path = translatePath(pf.path); parsables.add(pf); } // Load information about executable files int numExecutables = objIn.readInt(); for (k = 0; k < numExecutables; k++) { ExecutableFile ef = (ExecutableFile) objIn.readObject(); ef.path = translatePath(ef.path); if (null != ef.argList && !ef.argList.isEmpty()) { String arg = null; for (int j = 0; j < ef.argList.size(); j++) { arg = (String) ef.argList.get(j); arg = translatePath(arg); ef.argList.set(j, arg); } } executables.add(ef); if(ef.executionStage == ExecutableFile.UNINSTALL) { udata.addExecutable(ef); } } objIn.close(); } // We use the scripts parser ScriptParser parser = new ScriptParser(parsables, vs); parser.parseFiles(); // We use the file executor FileExecutor executor = new FileExecutor(executables); if (executor.executeFiles(ExecutableFile.POSTINSTALL) != 0) javax.swing.JOptionPane.showMessageDialog( null, "The installation was not completed.", "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); // We put the uninstaller putUninstaller(); // The end :-) listener.stopUnpack(); } catch (Exception err) { listener.stopUnpack(); listener.errorUnpack(err.toString()); } instances.remove(instances.indexOf(this)); }
| 3,241,059 |
public void run() { instances.add(this); try { listener.startUnpack(); String currentOs = System.getProperty("os.name").toLowerCase(); // // Initialisations FileOutputStream out = null; ArrayList parsables = new ArrayList(); ArrayList executables = new ArrayList(); List packs = idata.selectedPacks; int npacks = packs.size(); udata = UninstallData.getInstance(); // Specific to the web installers if (idata.kind.equalsIgnoreCase("web") || idata.kind.equalsIgnoreCase("web-kunststoff")) { InputStream kin = getClass().getResourceAsStream("/res/WebInstallers.url"); BufferedReader kreader = new BufferedReader(new InputStreamReader(kin)); jarLocation = kreader.readLine(); } // We unpack the selected packs for (int i = 0; i < npacks; i++) { // We get the pack stream int n = idata.availablePacks.indexOf(packs.get(i)); ObjectInputStream objIn = new ObjectInputStream(getPackAsStream(n)); // We unpack the files int nfiles = objIn.readInt(); listener.changeUnpack(0, nfiles, ((Pack) packs.get(i)).name); for (int j = 0; j < nfiles; j++) { // We read the header PackFile pf = (PackFile) objIn.readObject(); if (null == pf.os || currentOs.indexOf(pf.os.toLowerCase()) > -1) { // We translate & build the path String path = translatePath(pf.targetPath); File pathFile = new File(path); String fname = pathFile.getName(); int z = fname.length(); File dest = pathFile.getParentFile(); if (!dest.exists()) dest.mkdirs(); // We add the path to the log, udata.addFile(path); listener.progressUnpack(j, path); //if this file exists and shouldnot override skip this file if (((pf.override == false) && (pathFile.exists()))) { objIn.skip(pf.length); continue; } // We copy the file out = new FileOutputStream(path); byte[] buffer = new byte[5120]; long bytesCopied = 0; while (bytesCopied < pf.length) { int maxBytes = (pf.length - bytesCopied < buffer.length ? (int) (pf.length - bytesCopied) : buffer.length); int bytesInBuffer = objIn.read(buffer, 0, maxBytes); if (bytesInBuffer == -1) throw new IOException("Unexpected end of stream"); out.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } // Cleanings out.close(); // Empty dirs restoring String _n = pathFile.getName(); if (_n.startsWith("izpack-keepme") && _n.endsWith(".tmp")) pathFile.delete(); } else objIn.skip(pf.length); } // Load information about parsable files int numParsables = objIn.readInt(); int k; for (k = 0; k < numParsables; k++) { ParsableFile pf = (ParsableFile) objIn.readObject(); pf.path = translatePath(pf.path); parsables.add(pf); } // Load information about executable files int numExecutables = objIn.readInt(); for (k = 0; k < numExecutables; k++) { ExecutableFile ef = (ExecutableFile) objIn.readObject(); ef.path = translatePath(ef.path); if (null != ef.argList && !ef.argList.isEmpty()) { String arg = null; for (int j = 0; j < ef.argList.size(); j++) { arg = (String) ef.argList.get(j); arg = translatePath(arg); ef.argList.set(j, arg); } } executables.add(ef); if(ef.executionStage == ExecutableFile.UNINSTALL) { udata.addExecutable(ef); } } objIn.close(); } // We use the scripts parser ScriptParser parser = new ScriptParser(parsables, vs); parser.parseFiles(); // We use the file executor FileExecutor executor = new FileExecutor(executables); if (executor.executeFiles(ExecutableFile.POSTINSTALL) != 0) javax.swing.JOptionPane.showMessageDialog( null, "The installation was not completed.", "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); // We put the uninstaller putUninstaller(); // The end :-) listener.stopUnpack(); } catch (Exception err) { listener.stopUnpack(); listener.errorUnpack(err.toString()); } instances.remove(instances.indexOf(this)); }
|
public void run() { instances.add(this); try { listener.startUnpack(); String currentOs = System.getProperty("os.name").toLowerCase(); // // Initialisations FileOutputStream out = null; ArrayList parsables = new ArrayList(); ArrayList executables = new ArrayList(); List packs = idata.selectedPacks; int npacks = packs.size(); udata = UninstallData.getInstance(); // Specific to the web installers if (idata.kind.equalsIgnoreCase("web") || idata.kind.equalsIgnoreCase("web-kunststoff")) { InputStream kin = getClass().getResourceAsStream("/res/WebInstallers.url"); BufferedReader kreader = new BufferedReader(new InputStreamReader(kin)); jarLocation = kreader.readLine(); } // We unpack the selected packs for (int i = 0; i < npacks; i++) { // We get the pack stream int n = idata.availablePacks.indexOf(packs.get(i)); ObjectInputStream objIn = new ObjectInputStream(getPackAsStream(n)); // We unpack the files int nfiles = objIn.readInt(); listener.changeUnpack(0, nfiles, ((Pack) packs.get(i)).name); for (int j = 0; j < nfiles; j++) { // We read the header PackFile pf = (PackFile) objIn.readObject(); if (null == pf.os || matchOS(currentOs, pf.os.toLowerCase())) { // We translate & build the path String path = translatePath(pf.targetPath); File pathFile = new File(path); String fname = pathFile.getName(); int z = fname.length(); File dest = pathFile.getParentFile(); if (!dest.exists()) dest.mkdirs(); // We add the path to the log, udata.addFile(path); listener.progressUnpack(j, path); //if this file exists and shouldnot override skip this file if (((pf.override == false) && (pathFile.exists()))) { objIn.skip(pf.length); continue; } // We copy the file out = new FileOutputStream(path); byte[] buffer = new byte[5120]; long bytesCopied = 0; while (bytesCopied < pf.length) { int maxBytes = (pf.length - bytesCopied < buffer.length ? (int) (pf.length - bytesCopied) : buffer.length); int bytesInBuffer = objIn.read(buffer, 0, maxBytes); if (bytesInBuffer == -1) throw new IOException("Unexpected end of stream"); out.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } // Cleanings out.close(); // Empty dirs restoring String _n = pathFile.getName(); if (_n.startsWith("izpack-keepme") && _n.endsWith(".tmp")) pathFile.delete(); } else objIn.skip(pf.length); } // Load information about parsable files int numParsables = objIn.readInt(); int k; for (k = 0; k < numParsables; k++) { ParsableFile pf = (ParsableFile) objIn.readObject(); pf.path = translatePath(pf.path); parsables.add(pf); } // Load information about executable files int numExecutables = objIn.readInt(); for (k = 0; k < numExecutables; k++) { ExecutableFile ef = (ExecutableFile) objIn.readObject(); ef.path = translatePath(ef.path); if (null != ef.argList && !ef.argList.isEmpty()) { String arg = null; for (int j = 0; j < ef.argList.size(); j++) { arg = (String) ef.argList.get(j); arg = translatePath(arg); ef.argList.set(j, arg); } } executables.add(ef); if(ef.executionStage == ExecutableFile.UNINSTALL) { udata.addExecutable(ef); } } objIn.close(); } // We use the scripts parser ScriptParser parser = new ScriptParser(parsables, vs); parser.parseFiles(); // We use the file executor FileExecutor executor = new FileExecutor(executables); if (executor.executeFiles(ExecutableFile.POSTINSTALL) != 0) javax.swing.JOptionPane.showMessageDialog( null, "The installation was not completed.", "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); // We put the uninstaller putUninstaller(); // The end :-) listener.stopUnpack(); } catch (Exception err) { listener.stopUnpack(); listener.errorUnpack(err.toString()); } instances.remove(instances.indexOf(this)); }
| 3,241,060 |
public CompilationJob (CompileHandler listener, LocaleDatabase langpack, ArrayList files, ArrayList classpath) { this.listener = listener; this.langpack = langpack; this.name = null; this.files = files; this.classpath = classpath; }
|
public CompilationJob( CompileHandler listener, LocaleDatabase langpack, ArrayList files, ArrayList classpath) { this.listener = listener; this.langpack = langpack; this.name = null; this.files = files; this.classpath = classpath; }
| 3,241,061 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler(String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,062 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor(); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,063 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,064 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand(args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,065 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,066 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace( "checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,067 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add(0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,068 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add(0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,069 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,070 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String) cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,071 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,072 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString(); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,073 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,074 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[]) args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,075 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand(args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,076 |
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
|
public CompileResult checkCompiler (String compiler, ArrayList arguments) { int retval = 0; FileExecutor executor = new FileExecutor (); String[] output = new String[2]; Debug.trace ("checking whether \"" + compiler + " -help\" works"); { String[] args = { compiler, "-help" }; retval = executor.executeCommand (args, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } } Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works"); // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); // add -help argument to prevent the compiler from doing anything args.add (0, "-help"); // add compiler in front of arguments args.add (0, compiler); // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); args.add (classpath_str); } String[] args_arr = (String[])args.toArray(output); retval = executor.executeCommand (args_arr, output); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ()) return result; } return new CompileResult(); }
| 3,241,077 |
public String getName () { if (this.name != null) return this.name; return ""; }
|
public String getName() { if (this.name != null) return this.name; return ""; }
| 3,241,078 |
public int getSize () { return this.files.size(); }
|
public int getSize() { return this.files.size(); }
| 3,241,079 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform(String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,080 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,081 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,082 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,083 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,084 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String) cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,085 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,086 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString(); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,087 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,088 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,089 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor(); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,090 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File) file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,091 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace("processing " + fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,092 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add(fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,093 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,094 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress(last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress(last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,095 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[]) args.toArray(output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[]) args.toArray(output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,096 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand(full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand(full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,097 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress(fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress(fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,098 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,099 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,100 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator(common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,101 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File((String) arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,102 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,103 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (!class_file.exists()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,104 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,105 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size() - 1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,106 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast(); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,107 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress(last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress(last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,108 |
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[])args.toArray (output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
|
public CompileResult perform (String compiler, ArrayList arguments) { Debug.trace ("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1; } // add compiler in front of arguments args.add (0, compiler); cmdline_len += compiler.length()+1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext ()) { String cp = (String)cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString (); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add ("-classpath"); cmdline_len = cmdline_len + 11; args.add (classpath_str); cmdline_len += classpath_str.length()+1; } // remember how many arguments we have which don't change for the job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor (); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File)file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace ("processing "+fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add (fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace ("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while still // compiling a lot) this.listener.progress (last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[]) args.toArray(output); int retval = executor.executeCommand (full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned although // compilation failed. Iterator arg_it = args.listIterator (common_args_no); while (arg_it.hasNext()) { File java_file = new File ((String)arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf ('.'); basename = basename.substring (0, dotpos) + ".class"; File class_file = new File (java_file.getParentFile(), basename); if (! class_file.exists ()) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.noclassfile")+java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size()-1; i >= common_args_no; i--) { args.removeLast (); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress (last_fileno, jobfiles); String[] full_cmdline = (String[]) args.toArray(output); int retval = executor.executeCommand (full_cmdline, output); this.listener.progress (fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue()) return result; } } Debug.trace ("job "+this.name+" done (" + fileno + " files compiled)"); return new CompileResult(); }
| 3,241,109 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.