rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
} else
} else
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
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( "-> 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");
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
System.out.println(" -k (kind) : indicates the kind of installer to generate");
System.out.println( " -k (kind) : indicates the kind of installer to generate");
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
System.out.println(" When using vm option -DSTACKTRACE=true there is all kind of debug info ");
System.out.println( " When using vm option -DSTACKTRACE=true there is all kind of debug info ");
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
} else {
} else {
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
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");
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");
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
} else
} else
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
System.out.println("Build time: "+new Date());
System.out.println("Build time: " + new Date());
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
} catch (Exception err)
} catch (Exception err)
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
protected void parseError (XMLElement parent, String message)
protected void parseError(XMLElement parent, String message)
protected void parseError (XMLElement parent, String message) throws CompilerException { this.compileFailed = true; throw new CompilerException(filename+":"+parent.getLineNr()+": "+message); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
throw new CompilerException(filename+":"+parent.getLineNr()+": "+message);
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
protected void parseWarn (XMLElement parent, String message)
protected void parseWarn(XMLElement parent, String message)
protected void parseWarn (XMLElement parent, String message) { System.out.println (filename+":"+parent.getLineNr()+": "+message); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
System.out.println (filename+":"+parent.getLineNr()+": "+message);
System.out.println(filename + ":" + parent.getLineNr() + ": " + message);
protected void parseWarn (XMLElement parent, String message) { System.out.println (filename+":"+parent.getLineNr()+": "+message); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
protected String requireAttribute (XMLElement element, String attribute)
protected String requireAttribute(XMLElement element, String attribute)
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'");
parseError( element, "<" + element.getName() + "> requires attribute '" + attribute + "'");
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
protected XMLElement requireChildNamed (XMLElement parent, String name)
protected XMLElement requireChildNamed(XMLElement parent, String name)
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
parseError(parent, "<"+parent.getName()+"> requires child <"+name+">");
parseError( parent, "<" + parent.getName() + "> requires child <" + name + ">");
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
protected String requireContent (XMLElement element) throws CompilerException
protected String requireContent(XMLElement element) throws CompilerException
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
parseError(element, "<"+element.getName()+"> requires content");
parseError(element, "<" + element.getName() + "> requires 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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
protected int requireIntAttribute (XMLElement element, String attribute)
protected int requireIntAttribute(XMLElement element, String attribute)
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 }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
parseError(element, "<"+element.getName()+"> requires attribute '"+attribute+"'");
parseError( element, "<" + element.getName() + "> requires attribute '" + attribute + "'");
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 }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
} catch (NumberFormatException x)
} catch (NumberFormatException x)
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 }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
parseError(element, "'"+attribute+"' must be an integer");
parseError(element, "'" + attribute + "' must be an integer");
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 }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
String value = requireAttribute(element,attribute);
String value = requireAttribute(element, attribute);
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 }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
parseError(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no)");
parseError( element, "<" + element.getName() + "> invalid attribute '" + attribute + "': Expected (yes|no)");
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 }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
executeCompiler(); } catch (CompilerException ce)
executeCompiler(); } catch (CompilerException ce)
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 ()); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
System.out.println(ce.getMessage()+"\n"); } catch (Exception e)
System.out.println(ce.getMessage() + "\n"); } catch (Exception e)
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 ()); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
if (Debug.stackTracing ())
if (Debug.stackTracing())
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 ()); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
e.printStackTrace(); } else
e.printStackTrace(); } else
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 ()); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
System.out.println ("ERROR: "+e.getMessage ());
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 ()); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue)
protected boolean validateYesNoAttribute( XMLElement element, String attribute, boolean 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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
String value = element.getAttribute(attribute, (defaultValue ? "yes" : "no"));
String value = element.getAttribute(attribute, (defaultValue ? "yes" : "no"));
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
parseWarn(element, "<"+element.getName()+"> invalid attribute '"+ attribute+"': Expected (yes|no) if present");
parseWarn( element, "<" + element.getName() + "> invalid attribute '" + attribute + "': Expected (yes|no) if present");
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
public boolean wasSuccessful ()
public boolean wasSuccessful()
public boolean wasSuccessful () { return ! this.compileFailed; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
return ! this.compileFailed;
return !this.compileFailed;
public boolean wasSuccessful () { return ! this.compileFailed; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
String targetFilename = p.targetdir + "/" + f.getName();
String targetFilename = p.targetdir + f.getName(); if('/' != File.separatorChar) { targetFilename = targetFilename.replace(File.separatorChar, '/'); }
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/dc93ad3ca91acfb903abd58102b96e9624b50e3b/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
getClass().getResourceAsStream("/com/izforge/izpack/installer/icons.xml");
InstallerFrame.class.getResourceAsStream("/com/izforge/izpack/installer/icons.xml");
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); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
url = getClass().getResource(icon.getAttribute("res"));
url = InstallerFrame.class.getResource(icon.getAttribute("res"));
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); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
url = getClass().getResource(icon.getAttribute("res"));
url = InstallerFrame.class.getResource(icon.getAttribute("res"));
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); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
String name = null;
String name;
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Pack.java/buggy/src/lib/com/izforge/izpack/Pack.java
instances.remove(instances.indexOf(this));
public void run() { 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); // We copy the file out = new FileOutputStream(path); listener.progressUnpack(j, 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(); } 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); } 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() != 0) { javax.swing.JOptionPane.showMessageDialog( null, "The installation was not completed.", "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); // rollback installation? } // We put the uninstaller putUninstaller(); // The end :-) listener.stopUnpack(); } catch (Exception err) { listener.stopUnpack(); listener.errorUnpack(err.toString()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/24ab501f4d8488467fd8b63b1057fcc96217b3bf/Unpacker.java/buggy/src/lib/com/izforge/izpack/installer/Unpacker.java
public JLabel createLabel(String textId, String iconId, int pos)
public JLabel createLabel(String subkey, String alternateClass, String iconId, int pos)
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c8304bd275b449f44187bc3547148189a494456e/IzPanel.java/buggy/src/lib/com/izforge/izpack/installer/IzPanel.java
JLabel label = LabelFactory.create(parent.langpack.getString(textId), ii, pos);
String msg = getI18nStringForClass(subkey, alternateClass); JLabel label = LabelFactory.create(msg, ii, pos);
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c8304bd275b449f44187bc3547148189a494456e/IzPanel.java/buggy/src/lib/com/izforge/izpack/installer/IzPanel.java
if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); }
public synchronized Object borrowObject(Object key) throws Exception { long starttime = System.currentTimeMillis(); for(;;) { CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } ObjectTimestampPair pair = null; // if there are any sleeping, just grab one of those try { pair = (ObjectTimestampPair)(pool.removeFirst()); if(null != pair) { _totalIdle--; } } catch(NoSuchElementException e) { /* ignored */ } // otherwise if(null == pair) { // check if we can create one // (note we know that the num sleeping is 0, else we wouldn't be here) int active = 0; Integer act = (Integer)(_activeMap.get(key)); if(null != act) { active = act.intValue(); } if(_maxActive <= 0 || active < _maxActive) { Object obj = _factory.makeObject(key); pair = new ObjectTimestampPair(obj); } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(key); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); case WHEN_EXHAUSTED_BLOCK: try { if(_maxWait <= 0) { wait(); } else { wait(_maxWait); } } catch(InterruptedException e) { // ignored } if(_maxWait > 0 && ((System.currentTimeMillis() - starttime) >= _maxWait)) { throw new NoSuchElementException("Timeout waiting for idle object"); } else { continue; // keep looping } default: throw new IllegalArgumentException("whenExhaustedAction " + _whenExhaustedAction + " not recognized."); } } } _factory.activateObject(key,pair.value); if(_testOnBorrow && !_factory.validateObject(key,pair.value)) { _factory.destroyObject(key,pair.value); } else { Integer active = (Integer)(_activeMap.get(key)); if(null == active) { _activeMap.put(key,new Integer(1)); } else { _activeMap.put(key,new Integer(active.intValue() + 1)); } _totalActive++; return pair.value; } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/feea8a0d3c7e4912fe7929bd4f393db752cfaacf/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
if (item != null) item.trim();
if (item != null) item = item.trim();
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location"),
MessageFormat.format (parentFrame.langpack.getString ("UserInputPanel.search.location"),
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)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
MessageFormat.format (parent.langpack.getString ("UserInputPanel.search.location.checkedfile"),
MessageFormat.format (parentFrame.langpack.getString ("UserInputPanel.search.location.checkedfile"),
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)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
JButton autodetectButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor);
JButton autodetectButton = ButtonFactory.createButton (parentFrame.langpack.getString ("UserInputPanel.search.autodetect"), idata.buttonsHColor);
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)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
autodetectButton.setToolTipText (parent.langpack.getString ("UserInputPanel.search.autodetect.tooltip"));
autodetectButton.setToolTipText (parentFrame.langpack.getString ("UserInputPanel.search.autodetect.tooltip"));
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)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
JButton browseButton = ButtonFactory.createButton (parent.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor);
JButton browseButton = ButtonFactory.createButton (parentFrame.langpack.getString ("UserInputPanel.search.browse"), idata.buttonsHColor);
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)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
searchFields.add (new SearchField (filename, check_filename, parent, combobox, autodetectButton, browseButton, search_type, result_type));
searchFields.add (new SearchField (filename, check_filename, parentFrame, 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, parent, combobox, autodetectButton, browseButton, search_type, result_type)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
uiElement [POS_DISPLAYED] = new Boolean (true);
uiElement [POS_DISPLAYED] = Boolean.valueOf(true);
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); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
uiElement [POS_DISPLAYED] = new Boolean (false);
uiElement [POS_DISPLAYED] = Boolean.valueOf(false);
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); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
JOptionPane.showMessageDialog (parent,
JOptionPane.showMessageDialog (parentFrame,
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
parent.langpack.getString ("UserInputPanel.error.caption"),
parentFrame.langpack.getString ("UserInputPanel.error.caption"),
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
JOptionPane.showMessageDialog (parent,
JOptionPane.showMessageDialog (parentFrame,
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
parent.langpack.getString ("UserInputPanel.error.caption"),
parentFrame.langpack.getString ("UserInputPanel.error.caption"),
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); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
input = parent.getResource (SPEC_FILE_NAME);
input = parentFrame.getResource (SPEC_FILE_NAME);
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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
int n = idata.availablePacks.indexOf(packs.get(i));
int n = idata.allPacks.indexOf(packs.get(i));
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)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c3234416ca8408295e1d45c60daee2efe9c3f5db/Unpacker.java/buggy/src/lib/com/izforge/izpack/installer/Unpacker.java
if (null == pf.os || currentOs.indexOf(pf.os.toLowerCase()) > -1)
if (null == pf.os || matchOS(currentOs, pf.os.toLowerCase()))
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)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c3234416ca8408295e1d45c60daee2efe9c3f5db/Unpacker.java/buggy/src/lib/com/izforge/izpack/installer/Unpacker.java
public CompilationJob (CompileHandler listener, LocaleDatabase langpack, ArrayList files, ArrayList classpath)
public CompilationJob( CompileHandler listener, LocaleDatabase langpack, ArrayList files, ArrayList 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; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
public CompileResult checkCompiler (String compiler, ArrayList arguments)
public CompileResult checkCompiler(String compiler, ArrayList arguments)
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
FileExecutor executor = new FileExecutor ();
FileExecutor executor = new FileExecutor();
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
Debug.trace ("checking whether \"" + compiler + " -help\" works");
Debug.trace("checking whether \"" + compiler + " -help\" works");
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
retval = executor.executeCommand (args, output);
retval = executor.executeCommand(args, output);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ())
CompileResult result = new CompileResult( this.langpack.getString("CompilePanel.error.compilernotfound"), args, output[0], output[1]); this.listener.handleCompileError(result); if (!result.isContinue())
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
Debug.trace ("checking whether \"" + compiler + " -help +arguments\" works");
Debug.trace( "checking whether \"" + compiler + " -help +arguments\" works");
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
args.add (0, "-help");
args.add(0, "-help");
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
args.add (0, compiler);
args.add(0, compiler);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
while (cp_it.hasNext ())
while (cp_it.hasNext())
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
String cp = (String)cp_it.next();
String cp = (String) cp_it.next();
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath());
classpath_sb.append(File.pathSeparatorChar); classpath_sb.append(new File(cp).getAbsolutePath());
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
String classpath_str = classpath_sb.toString ();
String classpath_str = classpath_sb.toString();
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
args.add ("-classpath"); args.add (classpath_str);
args.add("-classpath"); args.add(classpath_str);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
String[] args_arr = (String[])args.toArray(output);
String[] args_arr = (String[]) args.toArray(output);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
retval = executor.executeCommand (args_arr, output);
retval = executor.executeCommand(args_arr, output);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue ())
CompileResult result = new CompileResult( this.langpack.getString("CompilePanel.error.invalidarguments"), args_arr, output[0], output[1]); this.listener.handleCompileError(result); if (!result.isContinue())
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
public String getName ()
public String getName()
public String getName () { if (this.name != null) return this.name; return ""; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
public int getSize ()
public int getSize()
public int getSize () { return this.files.size(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
public CompileResult perform (String compiler, ArrayList arguments)
public CompileResult perform(String compiler, ArrayList arguments)
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
Debug.trace ("starting job " + this.name);
Debug.trace("starting job " + this.name);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
while (arg_it.hasNext ()) cmdline_len += ((String)arg_it.next()).length()+1;
while (arg_it.hasNext()) cmdline_len += ((String) arg_it.next()).length() + 1;
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
args.add (0, compiler); cmdline_len += compiler.length()+1;
args.add(0, compiler); cmdline_len += compiler.length() + 1;
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
while (cp_it.hasNext ())
while (cp_it.hasNext())
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
String cp = (String)cp_it.next();
String cp = (String) cp_it.next();
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
classpath_sb.append (File.pathSeparatorChar); classpath_sb.append (new File (cp).getAbsolutePath());
classpath_sb.append(File.pathSeparatorChar); classpath_sb.append(new File(cp).getAbsolutePath());
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
String classpath_str = classpath_sb.toString ();
String classpath_str = classpath_sb.toString();
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
args.add ("-classpath");
args.add("-classpath");
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
args.add (classpath_str); cmdline_len += classpath_str.length()+1;
args.add(classpath_str); cmdline_len += classpath_str.length() + 1;
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
FileExecutor executor = new FileExecutor ();
FileExecutor executor = new FileExecutor();
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
File f = (File)file_it.next();
File f = (File) file_it.next();
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
Debug.trace ("processing "+fpath);
Debug.trace("processing " + fpath);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
args.add (fpath);
args.add(fpath);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
Debug.trace ("compiling " + jobfiles);
Debug.trace("compiling " + jobfiles);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
this.listener.progress (last_fileno, jobfiles);
this.listener.progress(last_fileno, jobfiles);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
String[] full_cmdline = (String[])args.toArray (output);
String[] full_cmdline = (String[]) args.toArray(output);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
int retval = executor.executeCommand (full_cmdline, output);
int retval = executor.executeCommand(full_cmdline, output);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
this.listener.progress (fileno, jobfiles);
this.listener.progress(fileno, jobfiles);
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
CompileResult result = new CompileResult (this.langpack.getString ("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError (result); if (! result.isContinue())
CompileResult result = new CompileResult( this.langpack.getString("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError(result); if (!result.isContinue())
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(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java