rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
public Pack(String name, String description, boolean required)
public Pack(String name, String description, String targetOs, boolean required)
public Pack(String name, String description, boolean required) { this.name = name; this.description = description; this.required = required; nbytes = 0; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c3234416ca8408295e1d45c60daee2efe9c3f5db/Pack.java/buggy/src/lib/com/izforge/izpack/Pack.java
this.os = targetOs;
public Pack(String name, String description, boolean required) { this.name = name; this.description = description; this.required = required; nbytes = 0; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c3234416ca8408295e1d45c60daee2efe9c3f5db/Pack.java/buggy/src/lib/com/izforge/izpack/Pack.java
ZipInputStream skeleton_is = new ZipInputStream (getClass().getResourceAsStream("/lib/installer.jar"));
InputStream is = getClass().getResourceAsStream("lib/installer.jar"); ZipInputStream skeleton_is = null; if (is != null) { skeleton_is = new ZipInputStream (is); }
public void writeSkeletonInstaller (JarOutputStream out) throws Exception { ZipInputStream skeleton_is = new ZipInputStream (getClass().getResourceAsStream("/lib/installer.jar")); if (skeleton_is == null) { skeleton_is = new JarInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "installer.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry out.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, out); out.closeEntry(); skeleton_is.closeEntry(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/1af4590abcb03e8f61989331bd1218a2826aa117/Packager.java/clean/src/lib/com/izforge/izpack/compiler/Packager.java
if (pack.required == true) propRequirement(pack.name);
if (pack.required) propRequirement(pack.name);
private void initvalues() { // name to pack position map namesPos = new HashMap(); for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); namesPos.put(pack.name, new Integer(i)); } // Init to the first values for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); if (packsToInstall.contains(pack)) checkValues[i] = 1; } // Check out and disable the ones that are excluded by non fullfiled // deps for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); if (checkValues[i] == 0) { List deps = pack.revDependencies; for (int j = 0; deps != null && j < deps.size(); j++) { String name = (String) deps.get(j); int pos = getPos(name); checkValues[pos] = -2; } } } // The required ones must propagate their required status to all the // ones // that they depend on for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); if (pack.required == true) propRequirement(pack.name); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PacksModel.java/clean/src/lib/com/izforge/izpack/panels/PacksModel.java
else if (columnIndex == 0) { return true; } else { return false; }
else return columnIndex == 0;
public boolean isCellEditable(int rowIndex, int columnIndex) { if (checkValues[rowIndex] < 0) { return false; } else if (columnIndex == 0) { return true; } else { return false; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PacksModel.java/clean/src/lib/com/izforge/izpack/panels/PacksModel.java
this.vs = new VariableSubstitutor(idata.getVariableValueMap());
this.vs = new VariableSubstitutor(idata.getVariables());
public CompileWorker(AutomatedInstallData idata, CompileHandler handler) throws IOException { this.idata = idata; this.handler = handler; this.vs = new VariableSubstitutor(idata.getVariableValueMap()); this.compilationThread = null; if (!readSpec()) throw new IOException("Error reading compilation specification"); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/CompileWorker.java/buggy/src/lib/com/izforge/izpack/installer/CompileWorker.java
el.setAttribute("index", new Integer(i).toString());
el.setAttribute("index", Integer.toString(i));
public void makeXMLData(AutomatedInstallData idata, XMLElement panelRoot) { // We add each pack to the panelRoot element for (int i = 0; i < idata.availablePacks.size(); i++) { Pack pack = (Pack) idata.availablePacks.get(i); XMLElement el = new XMLElement("pack"); el.setAttribute("index", new Integer(i).toString()); el.setAttribute("name", pack.name); Boolean selected = Boolean.valueOf(idata.selectedPacks.contains(pack)); el.setAttribute("selected", selected.toString()); panelRoot.addChild(el); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PacksPanelAutomationHelper.java/clean/src/lib/com/izforge/izpack/panels/PacksPanelAutomationHelper.java
Boolean selected = new Boolean(true);
Boolean selected = Boolean.TRUE;
public void runAutomated(AutomatedInstallData idata, XMLElement panelRoot) { // We first get the <selected> child (new from version 3.7.0). XMLElement selectedPacks = panelRoot.getFirstChildNamed("selected"); // We get the packs markups Vector pm = selectedPacks.getChildrenNamed("pack"); // We figure out the selected ones int size = pm.size(); idata.selectedPacks.clear(); for (int i = 0; i < size; i++) { XMLElement el = (XMLElement) pm.get(i); Boolean selected = new Boolean(true); // No longer needed. if (selected.booleanValue()) { String index_str = el.getAttribute("index"); // be liberal in what we accept // (For example, this allows auto-installer files to be fitted // to automatically // generated installers, yes I need this! tisc.) if (index_str != null) { try { int index = Integer.parseInt(index_str); if ((index >= 0) && (index < idata.availablePacks.size())) { idata.selectedPacks.add(idata.availablePacks.get(index)); } else { System.err.println("Invalid pack index \"" + index_str + "\" in line " + el.getLineNr()); } } catch (NumberFormatException e) { System.err.println("Invalid pack index \"" + index_str + "\" in line " + el.getLineNr()); } } else { String name = el.getAttribute("name"); if (name != null) { // search for pack with that name Iterator pack_it = idata.availablePacks.iterator(); boolean found = false; while ((!found) && pack_it.hasNext()) { Pack pack = (Pack) pack_it.next(); if (pack.name.equals(name)) { idata.selectedPacks.add(pack); found = true; } } if (!found) { System.err.println("Could not find selected pack named \"" + name + "\" in line " + el.getLineNr()); } } } } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PacksPanelAutomationHelper.java/clean/src/lib/com/izforge/izpack/panels/PacksPanelAutomationHelper.java
if((_maxIdle > 0) && (_pool.size() >= _maxIdle)) {
if((_maxIdle >= 0) && (_pool.size() >= _maxIdle)) {
public void returnObject(Object obj) throws Exception { assertOpen(); boolean success = true; if(_testOnReturn && !(_factory.validateObject(obj))) { success = false; } else { try { _factory.passivateObject(obj); } catch(Exception e) { success = false; } } boolean shouldDestroy = !success; synchronized(this) { _numActive--; if((_maxIdle > 0) && (_pool.size() >= _maxIdle)) { shouldDestroy = true; } else if(success) { _pool.addFirst(new ObjectTimestampPair(obj)); } notifyAll(); // _numActive has changed } if(shouldDestroy) { try { _factory.destroyObject(obj); } catch(Exception e) { // ignored } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/f8a1f534966dffbdcc51ee41a0670298d939dfc8/GenericObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
BoxLayout layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
public HelloPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // The 'super' layout GridBagLayout superLayout = new GridBagLayout(); setLayout(superLayout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(0, 0, 0, 0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.CENTER; // We initialize our 'real' layout JPanel centerPanel = new JPanel(); layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS); centerPanel.setLayout(layout); superLayout.addLayoutComponent(centerPanel, gbConstraints); add(centerPanel); // We create and put the labels String str; centerPanel.add(Box.createVerticalStrut(10)); str = parent.langpack.getString("HelloPanel.welcome1") + idata.info.getAppName() + " " + idata.info.getAppVersion() + parent.langpack.getString("HelloPanel.welcome2"); welcomeLabel = LabelFactory.create(str, parent.icons.getImageIcon("host"), JLabel.TRAILING); centerPanel.add(welcomeLabel); centerPanel.add(Box.createVerticalStrut(20)); ArrayList authors = idata.info.getAuthors(); int size = authors.size(); if (size > 0) { str = parent.langpack.getString("HelloPanel.authors"); appAuthorsLabel = LabelFactory.create(str, parent.icons.getImageIcon("information"), JLabel.TRAILING); centerPanel.add(appAuthorsLabel); JLabel label; for (int i = 0; i < size; i++) { Info.Author a = (Info.Author) authors.get(i); String email = (a.getEmail() != null && a.getEmail().length() > 0) ? (" <" + a.getEmail() + ">") : ""; label = LabelFactory.create(" - " + a.getName() + email, parent.icons .getImageIcon("empty"), JLabel.TRAILING); centerPanel.add(label); } centerPanel.add(Box.createVerticalStrut(20)); } if (idata.info.getAppURL() != null) { str = parent.langpack.getString("HelloPanel.url") + idata.info.getAppURL(); appURLLabel = LabelFactory.create(str, parent.icons.getImageIcon("bookmark"), JLabel.TRAILING); centerPanel.add(appURLLabel); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/HelloPanel.java/buggy/src/lib/com/izforge/izpack/panels/HelloPanel.java
welcomeLabel = LabelFactory.create(str, parent.icons.getImageIcon("host"), JLabel.TRAILING);
JLabel welcomeLabel = LabelFactory.create(str, parent.icons.getImageIcon("host"), JLabel.TRAILING);
public HelloPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // The 'super' layout GridBagLayout superLayout = new GridBagLayout(); setLayout(superLayout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(0, 0, 0, 0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.CENTER; // We initialize our 'real' layout JPanel centerPanel = new JPanel(); layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS); centerPanel.setLayout(layout); superLayout.addLayoutComponent(centerPanel, gbConstraints); add(centerPanel); // We create and put the labels String str; centerPanel.add(Box.createVerticalStrut(10)); str = parent.langpack.getString("HelloPanel.welcome1") + idata.info.getAppName() + " " + idata.info.getAppVersion() + parent.langpack.getString("HelloPanel.welcome2"); welcomeLabel = LabelFactory.create(str, parent.icons.getImageIcon("host"), JLabel.TRAILING); centerPanel.add(welcomeLabel); centerPanel.add(Box.createVerticalStrut(20)); ArrayList authors = idata.info.getAuthors(); int size = authors.size(); if (size > 0) { str = parent.langpack.getString("HelloPanel.authors"); appAuthorsLabel = LabelFactory.create(str, parent.icons.getImageIcon("information"), JLabel.TRAILING); centerPanel.add(appAuthorsLabel); JLabel label; for (int i = 0; i < size; i++) { Info.Author a = (Info.Author) authors.get(i); String email = (a.getEmail() != null && a.getEmail().length() > 0) ? (" <" + a.getEmail() + ">") : ""; label = LabelFactory.create(" - " + a.getName() + email, parent.icons .getImageIcon("empty"), JLabel.TRAILING); centerPanel.add(label); } centerPanel.add(Box.createVerticalStrut(20)); } if (idata.info.getAppURL() != null) { str = parent.langpack.getString("HelloPanel.url") + idata.info.getAppURL(); appURLLabel = LabelFactory.create(str, parent.icons.getImageIcon("bookmark"), JLabel.TRAILING); centerPanel.add(appURLLabel); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/HelloPanel.java/buggy/src/lib/com/izforge/izpack/panels/HelloPanel.java
appAuthorsLabel = LabelFactory.create(str, parent.icons.getImageIcon("information"),
JLabel appAuthorsLabel = LabelFactory.create(str, parent.icons.getImageIcon("information"),
public HelloPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // The 'super' layout GridBagLayout superLayout = new GridBagLayout(); setLayout(superLayout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(0, 0, 0, 0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.CENTER; // We initialize our 'real' layout JPanel centerPanel = new JPanel(); layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS); centerPanel.setLayout(layout); superLayout.addLayoutComponent(centerPanel, gbConstraints); add(centerPanel); // We create and put the labels String str; centerPanel.add(Box.createVerticalStrut(10)); str = parent.langpack.getString("HelloPanel.welcome1") + idata.info.getAppName() + " " + idata.info.getAppVersion() + parent.langpack.getString("HelloPanel.welcome2"); welcomeLabel = LabelFactory.create(str, parent.icons.getImageIcon("host"), JLabel.TRAILING); centerPanel.add(welcomeLabel); centerPanel.add(Box.createVerticalStrut(20)); ArrayList authors = idata.info.getAuthors(); int size = authors.size(); if (size > 0) { str = parent.langpack.getString("HelloPanel.authors"); appAuthorsLabel = LabelFactory.create(str, parent.icons.getImageIcon("information"), JLabel.TRAILING); centerPanel.add(appAuthorsLabel); JLabel label; for (int i = 0; i < size; i++) { Info.Author a = (Info.Author) authors.get(i); String email = (a.getEmail() != null && a.getEmail().length() > 0) ? (" <" + a.getEmail() + ">") : ""; label = LabelFactory.create(" - " + a.getName() + email, parent.icons .getImageIcon("empty"), JLabel.TRAILING); centerPanel.add(label); } centerPanel.add(Box.createVerticalStrut(20)); } if (idata.info.getAppURL() != null) { str = parent.langpack.getString("HelloPanel.url") + idata.info.getAppURL(); appURLLabel = LabelFactory.create(str, parent.icons.getImageIcon("bookmark"), JLabel.TRAILING); centerPanel.add(appURLLabel); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/HelloPanel.java/buggy/src/lib/com/izforge/izpack/panels/HelloPanel.java
appURLLabel = LabelFactory.create(str, parent.icons.getImageIcon("bookmark"),
JLabel appURLLabel = LabelFactory.create(str, parent.icons.getImageIcon("bookmark"),
public HelloPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // The 'super' layout GridBagLayout superLayout = new GridBagLayout(); setLayout(superLayout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(0, 0, 0, 0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.CENTER; // We initialize our 'real' layout JPanel centerPanel = new JPanel(); layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS); centerPanel.setLayout(layout); superLayout.addLayoutComponent(centerPanel, gbConstraints); add(centerPanel); // We create and put the labels String str; centerPanel.add(Box.createVerticalStrut(10)); str = parent.langpack.getString("HelloPanel.welcome1") + idata.info.getAppName() + " " + idata.info.getAppVersion() + parent.langpack.getString("HelloPanel.welcome2"); welcomeLabel = LabelFactory.create(str, parent.icons.getImageIcon("host"), JLabel.TRAILING); centerPanel.add(welcomeLabel); centerPanel.add(Box.createVerticalStrut(20)); ArrayList authors = idata.info.getAuthors(); int size = authors.size(); if (size > 0) { str = parent.langpack.getString("HelloPanel.authors"); appAuthorsLabel = LabelFactory.create(str, parent.icons.getImageIcon("information"), JLabel.TRAILING); centerPanel.add(appAuthorsLabel); JLabel label; for (int i = 0; i < size; i++) { Info.Author a = (Info.Author) authors.get(i); String email = (a.getEmail() != null && a.getEmail().length() > 0) ? (" <" + a.getEmail() + ">") : ""; label = LabelFactory.create(" - " + a.getName() + email, parent.icons .getImageIcon("empty"), JLabel.TRAILING); centerPanel.add(label); } centerPanel.add(Box.createVerticalStrut(20)); } if (idata.info.getAppURL() != null) { str = parent.langpack.getString("HelloPanel.url") + idata.info.getAppURL(); appURLLabel = LabelFactory.create(str, parent.icons.getImageIcon("bookmark"), JLabel.TRAILING); centerPanel.add(appURLLabel); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/HelloPanel.java/buggy/src/lib/com/izforge/izpack/panels/HelloPanel.java
public boolean validateObject(Object key, Object obj) { return true; }
public boolean validateObject(Object key, Object obj) { return valid; }
public boolean validateObject(Object key, Object obj) { return true; }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/feea8a0d3c7e4912fe7929bd4f393db752cfaacf/TestGenericKeyedObjectPool.java/clean/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
for (int t = from+1; t <= to; t++) {
for (int t = from; t <= to; t++) {
public void copyStackAcrossT(int from, int to, int sizeZ) { PlaneArea pa; ROI3D roi3D = logicalROI.getStack(from); for (int z = 0; z < sizeZ; z++) { pa = roi3D.getPlaneArea(z); for (int t = from+1; t <= to; t++) { if (pa != null) logicalROI.setPlaneArea( (PlaneArea) (pa.copy()), z, t); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b1e66026456497d4d450b994b0c5812397f58575/ScreenROI.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/defs/ScreenROI.java
return new String[] { Compiler.STANDARD, Compiler.WEB};
return new String[] { CompilerConfig.STANDARD, CompilerConfig.WEB};
public String[] getValues() { return new String[] { Compiler.STANDARD, Compiler.WEB}; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/1f9cec5c1add4cf52e05c113fdd2729a66e479fb/IzPackTask.java/buggy/src/lib/com/izforge/izpack/ant/IzPackTask.java
config = null;
public IzPackTask() { basedir = null; input = null; output = null; installerType = null; izPackDir = null; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/1f9cec5c1add4cf52e05c113fdd2729a66e479fb/IzPackTask.java/buggy/src/lib/com/izforge/izpack/ant/IzPackTask.java
if (input == null)
if (input == null && config == null)
public void execute() throws org.apache.tools.ant.BuildException { if (input == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "input_must_be_specified")); if (output == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "output_must_be_specified")); // if (installerType == null) now optional if (basedir == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "basedir_must_be_specified")); // if (izPackDir == null) // throw new // BuildException(java.util.ResourceBundle.getBundle("com/izforge/izpack/ant/langpacks/messages").getString("izPackDir_must_be_specified")); String kind = (installerType == null ? null : installerType.getValue()); Compiler c = new Compiler(input, basedir, kind, output);// Create the // compiler Compiler.IZPACK_HOME = izPackDir; c.setPackagerListener(this);// Listen to the compiler messages if (properties != null) { Enumeration e = properties.keys(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = properties.getProperty(name); c.addProperty(name, value); } } if (inheritAll == true) { Hashtable projectProps = getProject().getProperties(); Enumeration e = projectProps.keys(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = (String) projectProps.get(name); c.addProperty(name, value); } } try { c.executeCompiler(); } catch (Exception e) { throw new BuildException(e);// Throw an exception if compilation // failed } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/1f9cec5c1add4cf52e05c113fdd2729a66e479fb/IzPackTask.java/buggy/src/lib/com/izforge/izpack/ant/IzPackTask.java
Compiler c = new Compiler(input, basedir, kind, output); Compiler.IZPACK_HOME = izPackDir;
public void execute() throws org.apache.tools.ant.BuildException { if (input == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "input_must_be_specified")); if (output == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "output_must_be_specified")); // if (installerType == null) now optional if (basedir == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "basedir_must_be_specified")); // if (izPackDir == null) // throw new // BuildException(java.util.ResourceBundle.getBundle("com/izforge/izpack/ant/langpacks/messages").getString("izPackDir_must_be_specified")); String kind = (installerType == null ? null : installerType.getValue()); Compiler c = new Compiler(input, basedir, kind, output);// Create the // compiler Compiler.IZPACK_HOME = izPackDir; c.setPackagerListener(this);// Listen to the compiler messages if (properties != null) { Enumeration e = properties.keys(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = properties.getProperty(name); c.addProperty(name, value); } } if (inheritAll == true) { Hashtable projectProps = getProject().getProperties(); Enumeration e = projectProps.keys(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = (String) projectProps.get(name); c.addProperty(name, value); } } try { c.executeCompiler(); } catch (Exception e) { throw new BuildException(e);// Throw an exception if compilation // failed } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/1f9cec5c1add4cf52e05c113fdd2729a66e479fb/IzPackTask.java/buggy/src/lib/com/izforge/izpack/ant/IzPackTask.java
c.setPackagerListener(this);
CompilerConfig c = null; if( config != null ) { String configText = config.getText(); c = new CompilerConfig(basedir, kind, output, this, configText); } else { c = new CompilerConfig(input, basedir, kind, output, this); } CompilerConfig.setIzpackHome(izPackDir);
public void execute() throws org.apache.tools.ant.BuildException { if (input == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "input_must_be_specified")); if (output == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "output_must_be_specified")); // if (installerType == null) now optional if (basedir == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "basedir_must_be_specified")); // if (izPackDir == null) // throw new // BuildException(java.util.ResourceBundle.getBundle("com/izforge/izpack/ant/langpacks/messages").getString("izPackDir_must_be_specified")); String kind = (installerType == null ? null : installerType.getValue()); Compiler c = new Compiler(input, basedir, kind, output);// Create the // compiler Compiler.IZPACK_HOME = izPackDir; c.setPackagerListener(this);// Listen to the compiler messages if (properties != null) { Enumeration e = properties.keys(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = properties.getProperty(name); c.addProperty(name, value); } } if (inheritAll == true) { Hashtable projectProps = getProject().getProperties(); Enumeration e = projectProps.keys(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = (String) projectProps.get(name); c.addProperty(name, value); } } try { c.executeCompiler(); } catch (Exception e) { throw new BuildException(e);// Throw an exception if compilation // failed } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/1f9cec5c1add4cf52e05c113fdd2729a66e479fb/IzPackTask.java/buggy/src/lib/com/izforge/izpack/ant/IzPackTask.java
if (res.src != null) inStream.close ();
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 - first try to get stream directly (for standalone compiler) inStream = getClass().getResourceAsStream("/bin/langpacks/installer/"+str+".xml"); if (inStream == null) { inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "installer" + File.separator + str + ".xml"); } packager.addLangPack(str, inStream); // The flag - try to get stream for standalone compiler inStream = getClass ().getResourceAsStream("/bin/langpacks/flags/"+str+".gif"); if (inStream == null) { 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 ((res.src == null) || (res.src_is != null)) { System.err.println("ERROR: cannot parse resource from stream. (Internal error.)"); packager.addResource(res.id, res.src_is); } 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 { if (res.src != null) { inStream = new FileInputStream(res.src); } else { inStream = res.src_is; } 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(); // first try to get a Jar file for standalone compiler JarInputStream panel_is = null; try { InputStream jarInStream = getClass().getResourceAsStream("/bin/panels/"+str+".jar"); if (jarInStream != null) panel_is = new JarInputStream (jarInStream); } catch (IOException e) { // for now, ignore this - try to read panel classes from filesystem panel_is = null; } if (panel_is != null) { // We add the panel in the order array panelsOrder.add(str); if (panelsCache.contains(str)) continue; panelsCache.add(str); // now add files ZipEntry entry = null; while ((entry = panel_is.getNextEntry()) != null) { packager.addPanelClass(entry.getName(), panel_is); } } else { 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.osConstraints, pack.required, pack.description, pack.preselected); 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(); long mtime = f.lastModified(); String targetFilename = p.getTargetFilename (); // pack paths in canonical (unix) form regardless of current host o/s: if('/' != File.separatorChar) { targetFilename = targetFilename.replace(File.separatorChar, '/'); } // Writing objOut.writeObject(new PackFile(targetFilename, p.osConstraints, nbytes, mtime, 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/1af4590abcb03e8f61989331bd1218a2826aa117/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
m_annotationType= TestNG.JDK5_ANNOTATION_TYPE;
m_annotationType= TestNG.JDK_ANNOTATION_TYPE;
public CustomSuite(final String projectName, final String suiteName, final Map parameters, final String annotationType) { super(true); m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK5_ANNOTATION_TYPE; } }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/1bed3276c436b35c725a944299219be0d85ab7c1/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
m_annotationTypeE= AnnotationTypeEnum.valueOf(annotationType);
public CustomSuite(final String projectName, final String suiteName, final Map parameters, final String annotationType) { super(true); m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK5_ANNOTATION_TYPE; } }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/1bed3276c436b35c725a944299219be0d85ab7c1/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" );
private static PrintWriter createLogFile() { String tempDir = System.getProperty("java.io.tmpdir");
private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); PrintWriter logfile; if( tempDirFile.canWrite( ) ) { try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
File tempDirFile = new File( tempDir );
File tempDirFile = new File(tempDir);
private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); PrintWriter logfile; if( tempDirFile.canWrite( ) ) { try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); PrintWriter logfile; if( tempDirFile.canWrite( ) ) {
private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); PrintWriter logfile; if( tempDirFile.canWrite( ) ) { try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) );
tempDirFile.mkdirs();
private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); PrintWriter logfile; if( tempDirFile.canWrite( ) ) { try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
catch( Exception e )
catch (RuntimeException e1)
private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); PrintWriter logfile; if( tempDirFile.canWrite( ) ) { try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
logfile = null; e.printStackTrace( );
e1.printStackTrace();
private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); PrintWriter logfile; if( tempDirFile.canWrite( ) ) { try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
} else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); }
private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); PrintWriter logfile; if( tempDirFile.canWrite( ) ) { try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
return logfile; }
String logfilename = LOGFILENAME; System.out.println("creating Logfile: '" + logfilename + "' in: '" + tempDir + "'"); File out = new File(tempDir, logfilename); PrintWriter logfile; if (tempDirFile.canWrite()) { try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream( out), "UTF-8")); logfile = setLogFile(new PrintWriter(fw)); } catch (Exception e) { logfile = null; e.printStackTrace(); } } else { logfile = null; System.err.println("Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile); } return logfile; }
private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); PrintWriter logfile; if( tempDirFile.canWrite( ) ) { try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static void error( Object s ) { trace( s ); System.err.println( s ); System.err.flush( ); log( s ); }
public static void error(Object s) { trace(s); System.err.println(s); System.err.flush(); log(s); }
public static void error( Object s ) { trace( s ); System.err.println( s ); System.err.flush( ); log( s ); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static PrintWriter getLogFile( ) { PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE);
public static PrintWriter getLogFile() { PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE);
public static PrintWriter getLogFile( ) { PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE); return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
return logfile; }
return logfile; }
public static PrintWriter getLogFile( ) { PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE); return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static boolean isLOG( ) { return LOG; }
public static boolean isLOG() { return LOG; }
public static boolean isLOG( ) { return LOG; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static boolean isSTACKTRACE( ) { return STACKTRACE; }
public static boolean isSTACKTRACE() { return STACKTRACE; }
public static boolean isSTACKTRACE( ) { return STACKTRACE; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static boolean isTRACE( ) { return TRACE; }
public static boolean isTRACE() { return TRACE; }
public static boolean isTRACE( ) { return TRACE; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static void log( Object o ) { if(LOG )
public static void log(Object o)
public static void log( Object o ) { //if LOG was given if(LOG ) { PrintWriter logfile; if( ( logfile = getLogFile( ) ) == null ) { logfile = createLogFile( ); } if( logfile != null ) { if( o == null ) { o = "null"; } logfile.println( o ); if( o instanceof Throwable ) { ( (Throwable) o ).printStackTrace( logfile ); } logfile.flush( ); //logfile.close(); //logFile = null; } else { System.err.println( "Cannot write into logfile: (" + logfile + ") <- '" + o + "'" ); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
PrintWriter logfile; if( ( logfile = getLogFile( ) ) == null ) { logfile = createLogFile( ); } if( logfile != null ) { if( o == null ) { o = "null"; } logfile.println( o ); if( o instanceof Throwable ) { ( (Throwable) o ).printStackTrace( logfile ); } logfile.flush( ); } else { System.err.println( "Cannot write into logfile: (" + logfile + ") <- '" + o + "'" ); }
log(o, LOG_WITH_TIME_AND_DATE);
public static void log( Object o ) { //if LOG was given if(LOG ) { PrintWriter logfile; if( ( logfile = getLogFile( ) ) == null ) { logfile = createLogFile( ); } if( logfile != null ) { if( o == null ) { o = "null"; } logfile.println( o ); if( o instanceof Throwable ) { ( (Throwable) o ).printStackTrace( logfile ); } logfile.flush( ); //logfile.close(); //logFile = null; } else { System.err.println( "Cannot write into logfile: (" + logfile + ") <- '" + o + "'" ); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
}
public static void log( Object o ) { //if LOG was given if(LOG ) { PrintWriter logfile; if( ( logfile = getLogFile( ) ) == null ) { logfile = createLogFile( ); } if( logfile != null ) { if( o == null ) { o = "null"; } logfile.println( o ); if( o instanceof Throwable ) { ( (Throwable) o ).printStackTrace( logfile ); } logfile.flush( ); //logfile.close(); //logFile = null; } else { System.err.println( "Cannot write into logfile: (" + logfile + ") <- '" + o + "'" ); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static void setLOG( boolean aFlag ) { System.out.println( DLOG + " = " + aFlag ); LOG = aFlag; }
public static void setLOG(boolean aFlag) { System.out.println(DLOG + " = " + aFlag); LOG = aFlag; }
public static void setLOG( boolean aFlag ) { System.out.println( DLOG + " = " + aFlag ); LOG = aFlag; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static synchronized PrintWriter setLogFile( PrintWriter aLogFile ) { System.getProperties( ).put( IZPACK_LOGFILE, aLogFile );
public static synchronized PrintWriter setLogFile(PrintWriter aLogFile) { System.getProperties().put(IZPACK_LOGFILE, aLogFile);
public static synchronized PrintWriter setLogFile( PrintWriter aLogFile ) { System.getProperties( ).put( IZPACK_LOGFILE, aLogFile ); PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE); if( logfile == null ) { System.err.println( "Set::logfile == null" ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE);
PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE);
public static synchronized PrintWriter setLogFile( PrintWriter aLogFile ) { System.getProperties( ).put( IZPACK_LOGFILE, aLogFile ); PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE); if( logfile == null ) { System.err.println( "Set::logfile == null" ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
if( logfile == null ) { System.err.println( "Set::logfile == null" );
if (logfile == null) { System.err.println("Set::logfile == null"); } return logfile;
public static synchronized PrintWriter setLogFile( PrintWriter aLogFile ) { System.getProperties( ).put( IZPACK_LOGFILE, aLogFile ); PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE); if( logfile == null ) { System.err.println( "Set::logfile == null" ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
return logfile; }
public static synchronized PrintWriter setLogFile( PrintWriter aLogFile ) { System.getProperties( ).put( IZPACK_LOGFILE, aLogFile ); PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE); if( logfile == null ) { System.err.println( "Set::logfile == null" ); } return logfile; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static void setSTACKTRACE( boolean aFlag ) { System.out.println( DSTACKTRACE + " = " + aFlag ); STACKTRACE = aFlag; }
public static void setSTACKTRACE(boolean aFlag) { System.out.println(DSTACKTRACE + " = " + aFlag); STACKTRACE = aFlag; }
public static void setSTACKTRACE( boolean aFlag ) { System.out.println( DSTACKTRACE + " = " + aFlag ); STACKTRACE = aFlag; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static void setTRACE( boolean aFlag ) { System.out.println( DTRACE + " = " + aFlag ); TRACE = aFlag; }
public static void setTRACE(boolean aFlag) { System.out.println(DTRACE + " = " + aFlag); TRACE = aFlag; }
public static void setTRACE( boolean aFlag ) { System.out.println( DTRACE + " = " + aFlag ); TRACE = aFlag; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static boolean stackTracing( ) { return STACKTRACE; }
public static boolean stackTracing() { return STACKTRACE; }
public static boolean stackTracing( ) { return STACKTRACE; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static void trace( Object s ) { if( TRACE )
public static void trace(Object s)
public static void trace( Object s ) { if( TRACE ) { // console.println(s.toString()); System.out.println( s ); if( STACKTRACE && ( s instanceof Throwable ) ) { // StringWriter sw = new StringWriter(); // PrintWriter pw = new PrintWriter(sw); // ((Throwable)s).printStackTrace(pw); // console.println(sw.toString()); ( (Throwable) s ).printStackTrace( ); } System.out.flush( ); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
System.out.println( s );
if (TRACE) { System.out.println(s);
public static void trace( Object s ) { if( TRACE ) { // console.println(s.toString()); System.out.println( s ); if( STACKTRACE && ( s instanceof Throwable ) ) { // StringWriter sw = new StringWriter(); // PrintWriter pw = new PrintWriter(sw); // ((Throwable)s).printStackTrace(pw); // console.println(sw.toString()); ( (Throwable) s ).printStackTrace( ); } System.out.flush( ); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
if( STACKTRACE && ( s instanceof Throwable ) ) { ( (Throwable) s ).printStackTrace( ); }
if (STACKTRACE && (s instanceof Throwable)) { ((Throwable) s).printStackTrace(); }
public static void trace( Object s ) { if( TRACE ) { // console.println(s.toString()); System.out.println( s ); if( STACKTRACE && ( s instanceof Throwable ) ) { // StringWriter sw = new StringWriter(); // PrintWriter pw = new PrintWriter(sw); // ((Throwable)s).printStackTrace(pw); // console.println(sw.toString()); ( (Throwable) s ).printStackTrace( ); } System.out.flush( ); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
System.out.flush( );
System.out.flush(); }
public static void trace( Object s ) { if( TRACE ) { // console.println(s.toString()); System.out.println( s ); if( STACKTRACE && ( s instanceof Throwable ) ) { // StringWriter sw = new StringWriter(); // PrintWriter pw = new PrintWriter(sw); // ((Throwable)s).printStackTrace(pw); // console.println(sw.toString()); ( (Throwable) s ).printStackTrace( ); } System.out.flush( ); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
}
public static void trace( Object s ) { if( TRACE ) { // console.println(s.toString()); System.out.println( s ); if( STACKTRACE && ( s instanceof Throwable ) ) { // StringWriter sw = new StringWriter(); // PrintWriter pw = new PrintWriter(sw); // ((Throwable)s).printStackTrace(pw); // console.println(sw.toString()); ( (Throwable) s ).printStackTrace( ); } System.out.flush( ); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
public static boolean tracing( ) { return TRACE; }
public static boolean tracing() { return TRACE; }
public static boolean tracing( ) { return TRACE; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9926542eaee78822409cfde7e339113ef1dee9de/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java
IdentityKey(final int ident) { this.ident = ident;
IdentityKey(final Object obj) { this(System.identityHashCode(obj));
IdentityKey(final int ident) { this.ident = ident; }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/ReferenceTracker.java/buggy/src/java/org/apache/commons/pool/composite/ReferenceTracker.java
for (int i = 0; i < m_courses.length; i++)
StringBuffer tab = new StringBuffer(); String[] fields; fields = courseId.split(","); if (fields.length == 6)
public String getCourseName(String courseId) { for (int i = 0; i < m_courses.length; i++) { if (m_courses[i].getId().equals(courseId)) { return m_courses[i].getTitle(); } } return null; }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/8e212b1d787a4d48a506a1585d001e3dea67f84e/SampleCourseManagementProvider.java/clean/sample/src/java/org/sakaiproject/component/legacy/coursemanagement/SampleCourseManagementProvider.java
if (m_courses[i].getId().equals(courseId)) { return m_courses[i].getTitle(); }
tab.append(fields[3]); tab.append(" "); tab.append(fields[4]); tab.append(" "); tab.append(fields[5]);
public String getCourseName(String courseId) { for (int i = 0; i < m_courses.length; i++) { if (m_courses[i].getId().equals(courseId)) { return m_courses[i].getTitle(); } } return null; }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/8e212b1d787a4d48a506a1585d001e3dea67f84e/SampleCourseManagementProvider.java/clean/sample/src/java/org/sakaiproject/component/legacy/coursemanagement/SampleCourseManagementProvider.java
return null;
return tab.toString();
public String getCourseName(String courseId) { for (int i = 0; i < m_courses.length; i++) { if (m_courses[i].getId().equals(courseId)) { return m_courses[i].getTitle(); } } return null; }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/8e212b1d787a4d48a506a1585d001e3dea67f84e/SampleCourseManagementProvider.java/clean/sample/src/java/org/sakaiproject/component/legacy/coursemanagement/SampleCourseManagementProvider.java
public void onPostDelete(PostDeleteEvent event) {}
/** unused */ public void onPostDelete(PostDeleteEvent event) {}
public void onPostDelete(PostDeleteEvent event) {}
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1fa4aa1df076354d9e858cfea9c54d59ae47d22a/ACLEventListener.java/buggy/components/server/src/ome/security/ACLEventListener.java
public void onPostInsert(PostInsertEvent event) {}
/** unused */ public void onPostInsert(PostInsertEvent event) {}
public void onPostInsert(PostInsertEvent event) {}
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1fa4aa1df076354d9e858cfea9c54d59ae47d22a/ACLEventListener.java/buggy/components/server/src/ome/security/ACLEventListener.java
public void onPostUpdate(PostUpdateEvent event) {}
/** unused */ public void onPostUpdate(PostUpdateEvent event) {}
public void onPostUpdate(PostUpdateEvent event) {}
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1fa4aa1df076354d9e858cfea9c54d59ae47d22a/ACLEventListener.java/buggy/components/server/src/ome/security/ACLEventListener.java
public void onPreLoad(PreLoadEvent event) {}
/** unused */ public void onPreLoad(PreLoadEvent event) {}
public void onPreLoad(PreLoadEvent event) {}
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1fa4aa1df076354d9e858cfea9c54d59ae47d22a/ACLEventListener.java/buggy/components/server/src/ome/security/ACLEventListener.java
&& (stage.equalsIgnoreCase("both") || stage.equalsIgnoreCase("uninstall")))
&& ("both".equalsIgnoreCase(stage) || "uninstall".equalsIgnoreCase(stage)))
protected void addJars(XMLElement data) throws Exception { notifyCompilerListener("addJars", CompilerListener.BEGIN, data); Iterator iter = data.getChildrenNamed("jar").iterator(); while (iter.hasNext()) { XMLElement el = (XMLElement) iter.next(); String src = requireAttribute(el, "src"); URL url = findProjectResource(src, "Jar file", el); compiler.addJarContent(url); // Additionals for mark a jar file also used in the uninstaller. // The contained files will be copied from the installer into the // uninstaller if needed. // Therefore the contained files of the jar should be in the // installer also // they are used only from the uninstaller. This is the reason why // the stage // wiil be only observed for the uninstaller. String stage = el.getAttribute("stage"); if (stage != null && (stage.equalsIgnoreCase("both") || stage.equalsIgnoreCase("uninstall"))) { CustomData ca = new CustomData(null, getContainedFilePaths(url), null, CustomData.UNINSTALLER_JAR); compiler.addCustomJar(ca, url); } } notifyCompilerListener("addJars", CompilerListener.END, data); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
&& (stage.equalsIgnoreCase("both") || stage.equalsIgnoreCase("uninstall")))
&& ("both".equalsIgnoreCase(stage) || "uninstall".equalsIgnoreCase(stage)))
protected void addNativeLibraries(XMLElement data) throws Exception { boolean needAddOns = false; notifyCompilerListener("addNativeLibraries", CompilerListener.BEGIN, data); Iterator iter = data.getChildrenNamed("native").iterator(); while (iter.hasNext()) { XMLElement el = (XMLElement) iter.next(); String type = requireAttribute(el, "type"); String name = requireAttribute(el, "name"); String path = "bin/native/" + type + "/" + name; URL url = findIzPackResource(path, "Native Library", el); compiler.addNativeLibrary(name, url); // Additionals for mark a native lib also used in the uninstaller // The lib will be copied from the installer into the uninstaller if // needed. // Therefore the lib should be in the installer also it is used only // from // the uninstaller. This is the reason why the stage wiil be only // observed // for the uninstaller. String stage = el.getAttribute("stage"); List constraints = OsConstraint.getOsList(el); if (stage != null && (stage.equalsIgnoreCase("both") || stage.equalsIgnoreCase("uninstall"))) { ArrayList al = new ArrayList(); al.add(name); CustomData cad = new CustomData(null, al, constraints, CustomData.UNINSTALLER_LIB); compiler.addNativeUninstallerLibrary(cad); needAddOns = true; } } if (needAddOns) { // Add the uninstaller extensions as a resource if specified XMLElement root = requireChildNamed(data, "info"); XMLElement uninstallInfo = root.getFirstChildNamed("uninstaller"); if (validateYesNoAttribute(uninstallInfo, "write", YES)) { URL url = findIzPackResource("lib/uninstaller-ext.jar", "Uninstaller extensions", root); compiler.addResource("IzPack.uninstaller-ext", url); } } notifyCompilerListener("addNativeLibraries", CompilerListener.END, data); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
;
protected void addPanels(XMLElement data) throws CompilerException { notifyCompilerListener("addPanels", CompilerListener.BEGIN, data); XMLElement root = requireChildNamed(data, "panels"); // at least one panel is required Vector panels = root.getChildrenNamed("panel"); if (panels.isEmpty()) parseError(root, "<panels> requires a <panel>"); // We process each panel markup Iterator iter = panels.iterator(); while (iter.hasNext()) { XMLElement xmlPanel = (XMLElement) iter.next(); // create the serialized Panel data Panel panel = new Panel(); panel.osConstraints = OsConstraint.getOsList(xmlPanel); String className = xmlPanel.getAttribute("classname"); // Panel files come in jars packaged w/ IzPack String jarPath = "bin/panels/" + className + ".jar"; URL url = findIzPackResource(jarPath, "Panel jar file", xmlPanel); String fullClassName = null; try { fullClassName = getFullClassName(url, className); } catch (Exception e) { ; } if (fullClassName != null) panel.className = fullClassName; else panel.className = className; // insert into the packager compiler.addPanelJar(panel, url); } notifyCompilerListener("addPanels", CompilerListener.END, data); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
if (override_val.equalsIgnoreCase("true"))
if ("true".equalsIgnoreCase(override_val))
protected int getOverrideValue(XMLElement f) throws CompilerException { int override = PackFile.OVERRIDE_UPDATE; String override_val = f.getAttribute("override"); if (override_val != null) { if (override_val.equalsIgnoreCase("true")) { override = PackFile.OVERRIDE_TRUE; } else if (override_val.equalsIgnoreCase("false")) { override = PackFile.OVERRIDE_FALSE; } else if (override_val.equalsIgnoreCase("asktrue")) { override = PackFile.OVERRIDE_ASK_TRUE; } else if (override_val.equalsIgnoreCase("askfalse")) { override = PackFile.OVERRIDE_ASK_FALSE; } else if (override_val.equalsIgnoreCase("update")) { override = PackFile.OVERRIDE_UPDATE; } else parseError(f, "invalid value for attribute \"override\""); } return override; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
else if (override_val.equalsIgnoreCase("false"))
else if ("false".equalsIgnoreCase(override_val))
protected int getOverrideValue(XMLElement f) throws CompilerException { int override = PackFile.OVERRIDE_UPDATE; String override_val = f.getAttribute("override"); if (override_val != null) { if (override_val.equalsIgnoreCase("true")) { override = PackFile.OVERRIDE_TRUE; } else if (override_val.equalsIgnoreCase("false")) { override = PackFile.OVERRIDE_FALSE; } else if (override_val.equalsIgnoreCase("asktrue")) { override = PackFile.OVERRIDE_ASK_TRUE; } else if (override_val.equalsIgnoreCase("askfalse")) { override = PackFile.OVERRIDE_ASK_FALSE; } else if (override_val.equalsIgnoreCase("update")) { override = PackFile.OVERRIDE_UPDATE; } else parseError(f, "invalid value for attribute \"override\""); } return override; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
else if (override_val.equalsIgnoreCase("asktrue"))
else if ("asktrue".equalsIgnoreCase(override_val))
protected int getOverrideValue(XMLElement f) throws CompilerException { int override = PackFile.OVERRIDE_UPDATE; String override_val = f.getAttribute("override"); if (override_val != null) { if (override_val.equalsIgnoreCase("true")) { override = PackFile.OVERRIDE_TRUE; } else if (override_val.equalsIgnoreCase("false")) { override = PackFile.OVERRIDE_FALSE; } else if (override_val.equalsIgnoreCase("asktrue")) { override = PackFile.OVERRIDE_ASK_TRUE; } else if (override_val.equalsIgnoreCase("askfalse")) { override = PackFile.OVERRIDE_ASK_FALSE; } else if (override_val.equalsIgnoreCase("update")) { override = PackFile.OVERRIDE_UPDATE; } else parseError(f, "invalid value for attribute \"override\""); } return override; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
else if (override_val.equalsIgnoreCase("askfalse"))
else if ("askfalse".equalsIgnoreCase(override_val))
protected int getOverrideValue(XMLElement f) throws CompilerException { int override = PackFile.OVERRIDE_UPDATE; String override_val = f.getAttribute("override"); if (override_val != null) { if (override_val.equalsIgnoreCase("true")) { override = PackFile.OVERRIDE_TRUE; } else if (override_val.equalsIgnoreCase("false")) { override = PackFile.OVERRIDE_FALSE; } else if (override_val.equalsIgnoreCase("asktrue")) { override = PackFile.OVERRIDE_ASK_TRUE; } else if (override_val.equalsIgnoreCase("askfalse")) { override = PackFile.OVERRIDE_ASK_FALSE; } else if (override_val.equalsIgnoreCase("update")) { override = PackFile.OVERRIDE_UPDATE; } else parseError(f, "invalid value for attribute \"override\""); } return override; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
else if (override_val.equalsIgnoreCase("update"))
else if ("update".equalsIgnoreCase(override_val))
protected int getOverrideValue(XMLElement f) throws CompilerException { int override = PackFile.OVERRIDE_UPDATE; String override_val = f.getAttribute("override"); if (override_val != null) { if (override_val.equalsIgnoreCase("true")) { override = PackFile.OVERRIDE_TRUE; } else if (override_val.equalsIgnoreCase("false")) { override = PackFile.OVERRIDE_FALSE; } else if (override_val.equalsIgnoreCase("asktrue")) { override = PackFile.OVERRIDE_ASK_TRUE; } else if (override_val.equalsIgnoreCase("askfalse")) { override = PackFile.OVERRIDE_ASK_FALSE; } else if (override_val.equalsIgnoreCase("update")) { override = PackFile.OVERRIDE_UPDATE; } else parseError(f, "invalid value for attribute \"override\""); } return override; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
if (args[0].equalsIgnoreCase("-?"))
if ("-?".equalsIgnoreCase(args[0]))
public static void main(String[] args) { // Outputs some informations System.out.println(""); System.out.println(".:: IzPack - Version " + Compiler.IZPACK_VERSION + " ::."); System.out.println(""); System.out.println("< compiler specifications version : " + VERSION + " >"); System.out.println(""); System.out.println("- Copyright (C) 2001-2006 Julien Ponge"); System.out.println("- Visit http://www.izforge.com/ for the latests releases"); System.out.println("- Released under the terms of the Apache Software License version 2.0."); 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; String compr_format = "default"; int compr_level = -1; // First check int nArgs = args.length; if (nArgs < 1) throw new Exception("no arguments given"); // We get the IzPack home directory String home = "."; String izHome = System.getProperty("IZPACK_HOME"); if (izHome != null) home = izHome; File homeFile = new File(home); if (!homeFile.exists() && homeFile.isDirectory()) { System.err.println("IZPACK_HOME (" + home + ") doesn't exist"); System.exit(-1); } Compiler.setIzpackHome(home); // The users wants to know the command line parameters if (args[0].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(" -c (compression) : indicates the compression format to be used for packs"); System.out.println(" default is the internal deflate compression\n"); System.out.println(" -l (compression-level) : indicates the level for the used compression format"); System.out.println(" if supported. Only integer are valid\n"); System.out.println(" When using vm option -DSTACKTRACE=true there is all kind of debug info "); System.out.println(""); exitCode = 0; } 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[0]; // default jar files names are based on input file name output = filename.substring(0, filename.length() - 3) + "jar"; // We parse the other ones int pos = 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; case 'c': if ((pos + 1) < nArgs) { pos++; compr_format = args[pos]; } else throw new Exception("compression format argument missing"); break; case 'l': if ((pos + 1) < nArgs) { pos++; compr_level = Integer.parseInt(args[pos]); } else throw new Exception("compression level 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("-> Compression : " + compr_format); System.out.println("-> Compr. level: " + compr_level); System.out.println(""); // Calls the compiler CmdlinePackagerListener listener = new CmdlinePackagerListener(); CompilerConfig compiler = new CompilerConfig(filename, base, kind, output, compr_format, compr_level, listener, (String) null); compiler.executeCompiler(); // 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/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false;
if ("yes".equalsIgnoreCase(value)) return true; if ("no".equalsIgnoreCase(value)) return false;
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/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
if (value.equalsIgnoreCase("yes")) return true; if (value.equalsIgnoreCase("no")) return false;
if ("yes".equalsIgnoreCase(value)) return true; if ("no".equalsIgnoreCase(value)) return false;
protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue) { if (element == null) return 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/9619b3a25f43787dc92011111668210e06c00c71/CompilerConfig.java/clean/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
protected PackInfo(String name, String id, String description, boolean required)
protected PackInfo(String name, String id, String description, boolean required, boolean loose)
protected PackInfo(String name, String id, String description, boolean required) { pack = new Pack( name, id, description, null, required, true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/670d2dce35e3033459b7343ab34ed921bd2331ed/PackInfo.java/buggy/src/lib/com/izforge/izpack/compiler/PackInfo.java
pack = new Pack( name, id, description, null, required, true);
pack = new Pack( name, id, description, null, required, true, loose);
protected PackInfo(String name, String id, String description, boolean required) { pack = new Pack( name, id, description, null, required, true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/670d2dce35e3033459b7343ab34ed921bd2331ed/PackInfo.java/buggy/src/lib/com/izforge/izpack/compiler/PackInfo.java
public UpdateCheck(ArrayList includes, ArrayList excludes, String casesensitive)
public UpdateCheck()
public UpdateCheck(ArrayList includes, ArrayList excludes, String casesensitive) { this.includesList = includes; this.excludesList = excludes; this.caseSensitive = ((casesensitive != null) && casesensitive.equalsIgnoreCase("yes")); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/UpdateCheck.java/buggy/src/lib/com/izforge/izpack/UpdateCheck.java
this.includesList = includes; this.excludesList = excludes; this.caseSensitive = ((casesensitive != null) && casesensitive.equalsIgnoreCase("yes"));
public UpdateCheck(ArrayList includes, ArrayList excludes, String casesensitive) { this.includesList = includes; this.excludesList = excludes; this.caseSensitive = ((casesensitive != null) && casesensitive.equalsIgnoreCase("yes")); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/UpdateCheck.java/buggy/src/lib/com/izforge/izpack/UpdateCheck.java
URL appURL = requireURLContent(requireChildNamed(root, "url")); info.setAppURL(appURL.toString());
final XMLElement URLElem = root.getFirstChildNamed("url"); if(URLElem != null) { URL appURL = requireURLContent(URLElem); info.setAppURL(appURL.toString()); }else info.setAppURL(null);
protected void addInfo(XMLElement data) throws Exception { notifyCompilerListener("addInfo", CompilerListener.BEGIN, data); // Initialisation XMLElement root = requireChildNamed(data, "info"); Info info = new Info(); String temp = null; info.setAppName(requireContent(requireChildNamed(root, "appname"))); info.setAppVersion(requireContent(requireChildNamed(root, "appversion"))); // validate and insert app URL URL appURL = requireURLContent(requireChildNamed(root, "url")); info.setAppURL(appURL.toString()); // We get the authors list XMLElement authors = root.getFirstChildNamed("authors"); if (authors != null) { Iterator iter = authors.getChildrenNamed("author").iterator(); while (iter.hasNext()) { XMLElement author = (XMLElement) iter.next(); String name = requireAttribute(author, "name"); String email = requireAttribute(author, "email"); info.addAuthor(new Info.Author(name, email)); } } // We get the java version required XMLElement javaVersion = root.getFirstChildNamed("javaversion"); if (javaVersion != null) info.setJavaVersion(requireContent(javaVersion)); // validate and insert (and require if -web kind) web dir XMLElement webDirURL = root.getFirstChildNamed("webdir"); if (webDirURL != null) info.setWebDirURL(requireURLContent(webDirURL).toString()); if (kind != null) { if (kind.equalsIgnoreCase(WEB) && webDirURL == null) { parseError(root, "<webdir> required when \"WEB\" installer requested"); } else if (kind.equalsIgnoreCase(STANDARD) && webDirURL != null) { // Need a Warning? parseWarn(webDirURL, "Not creating web installer."); info.setWebDirURL(null); } } // Add the uninstaller as a resource if specified XMLElement uninstallInfo = root.getFirstChildNamed("uninstaller"); if (validateYesNoAttribute(uninstallInfo, "write", YES)) { URL url = findIzPackResource("lib/uninstaller.jar", "Uninstaller", root); packager.addResource("IzPack.uninstaller", url); } packager.setInfo(info); notifyCompilerListener("addInfo", CompilerListener.END, data); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/4ea47fd61dd2a4377b68288fe5295bbfe5e76722/Compiler.java/clean/src/lib/com/izforge/izpack/compiler/Compiler.java
return sb.toString();
String id = sb.toString(); if(log.isDebugEnabled()) log.debug("courseId constructed as: " + id); return id;
public String getCourseId(Term term, List requiredFields) { StringBuffer sb = new StringBuffer(); if (term != null) { sb.append(term.getYear()); sb.append(","); sb.append(term.getTerm()); } else { sb.append(",,"); } for (int i = 0; i < requiredFields.size(); i++) { sb.append(","); sb.append((String) requiredFields.get(i)); } return sb.toString(); }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/b60e03ddf44c76e63098940e219b00b046a2b7c9/CourseManagementProviderCMImpl.java/buggy/cm/cm-cm-provider/src/java/org/sakaiproject/coursemanagement/impl/provider/CourseManagementProviderCMImpl.java
if(log.isDebugEnabled()) { StringBuffer sb = new StringBuffer("Found the following course members for "); sb.append(courseId); sb.append(": "); for(Iterator iter = members.iterator(); iter.hasNext();) { CourseMember member = (CourseMember)iter.next(); sb.append(member.getUniqname()); if(iter.hasNext()) { sb.append(", "); } } log.debug(sb.toString()); }
public List getCourseMembers(String courseId) { Section section = cmService.getSection(courseId); Map userRoles = cmGroupProvider.getUserRolesForGroup(courseId); List members = new ArrayList(); for(Iterator iter = userRoles.keySet().iterator(); iter.hasNext();) { String userEid = (String)iter.next(); String role = (String)userRoles.get(userEid); CourseMember courseMember = new CourseMember(); courseMember.setCourse(courseId); courseMember.setCredits(null); // TODO: Get the credits from the CM Enrollment String displayName = null; try { displayName = uds.getUserByEid(userEid).getDisplayName(); } catch (UserNotDefinedException unde) { log.warn("UserDirService can't find user " + userEid + " even though this eid was provided by the CM Service."); } courseMember.setName(displayName); courseMember.setRole(role); courseMember.setProviderRole(role); courseMember.setSection(section.getTitle()); courseMember.setUniqname(userEid); // Add the course member to the list members.add(courseMember); } return members; }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/b60e03ddf44c76e63098940e219b00b046a2b7c9/CourseManagementProviderCMImpl.java/buggy/cm/cm-cm-provider/src/java/org/sakaiproject/coursemanagement/impl/provider/CourseManagementProviderCMImpl.java
Set sections = cmService.findInstructingSections(instructorId);
Map groupRoleMap = cmGroupProvider.getGroupRolesForUser(instructorId); if(log.isDebugEnabled()) log.debug("Found the following section EIDs for instructor " + instructorId + ": " + groupRoleMap.keySet());
public List getInstructorCourses(String instructorId, String termYear, String termTerm) { Set sections = cmService.findInstructingSections(instructorId); List courses = new ArrayList(); for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next(); Course course = getLegacyCourseFromCmSection(section); AcademicSession as = cmService.getAcademicSession(course.getTermId()); // TODO: How do we convert between these term strings and the CM AcademicSession? if(as.getTitle().indexOf(termYear) != -1 && as.getTitle().indexOf(termTerm) != -1) { courses.add(course); } } return courses; }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/b60e03ddf44c76e63098940e219b00b046a2b7c9/CourseManagementProviderCMImpl.java/buggy/cm/cm-cm-provider/src/java/org/sakaiproject/coursemanagement/impl/provider/CourseManagementProviderCMImpl.java
for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next();
for(Iterator iter = groupRoleMap.keySet().iterator(); iter.hasNext();) { String sectionEid = (String)iter.next(); String role = (String)groupRoleMap.get(sectionEid); if( ! sectionMappingRoles.contains(role)) { continue; } Section section = cmService.getSection(sectionEid);
public List getInstructorCourses(String instructorId, String termYear, String termTerm) { Set sections = cmService.findInstructingSections(instructorId); List courses = new ArrayList(); for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next(); Course course = getLegacyCourseFromCmSection(section); AcademicSession as = cmService.getAcademicSession(course.getTermId()); // TODO: How do we convert between these term strings and the CM AcademicSession? if(as.getTitle().indexOf(termYear) != -1 && as.getTitle().indexOf(termTerm) != -1) { courses.add(course); } } return courses; }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/b60e03ddf44c76e63098940e219b00b046a2b7c9/CourseManagementProviderCMImpl.java/buggy/cm/cm-cm-provider/src/java/org/sakaiproject/coursemanagement/impl/provider/CourseManagementProviderCMImpl.java
if(as.getTitle().indexOf(termYear) != -1 && as.getTitle().indexOf(termTerm) != -1) {
if(as.getTitle().toLowerCase().indexOf(termYear.toLowerCase()) != -1 && as.getTitle().toLowerCase().indexOf(termTerm.toLowerCase()) != -1) { if(log.isDebugEnabled()) log.debug("Section " + section.getEid() + " matches the term " + termTerm + " " + termYear);
public List getInstructorCourses(String instructorId, String termYear, String termTerm) { Set sections = cmService.findInstructingSections(instructorId); List courses = new ArrayList(); for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next(); Course course = getLegacyCourseFromCmSection(section); AcademicSession as = cmService.getAcademicSession(course.getTermId()); // TODO: How do we convert between these term strings and the CM AcademicSession? if(as.getTitle().indexOf(termYear) != -1 && as.getTitle().indexOf(termTerm) != -1) { courses.add(course); } } return courses; }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/b60e03ddf44c76e63098940e219b00b046a2b7c9/CourseManagementProviderCMImpl.java/buggy/cm/cm-cm-provider/src/java/org/sakaiproject/coursemanagement/impl/provider/CourseManagementProviderCMImpl.java
} else { if(log.isDebugEnabled()) log.debug("Section " + section.getEid() + " does not match the term " + termTerm + " " + termYear);
public List getInstructorCourses(String instructorId, String termYear, String termTerm) { Set sections = cmService.findInstructingSections(instructorId); List courses = new ArrayList(); for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next(); Course course = getLegacyCourseFromCmSection(section); AcademicSession as = cmService.getAcademicSession(course.getTermId()); // TODO: How do we convert between these term strings and the CM AcademicSession? if(as.getTitle().indexOf(termYear) != -1 && as.getTitle().indexOf(termTerm) != -1) { courses.add(course); } } return courses; }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/b60e03ddf44c76e63098940e219b00b046a2b7c9/CourseManagementProviderCMImpl.java/buggy/cm/cm-cm-provider/src/java/org/sakaiproject/coursemanagement/impl/provider/CourseManagementProviderCMImpl.java
if(log.isDebugEnabled()) log.debug("Provider id = " + sb.toString());
public String getProviderId(List providerIdList) { StringBuffer sb = new StringBuffer(); for(Iterator iter = providerIdList.iterator(); iter.hasNext();) { String id = (String)iter.next(); sb.append(id); if(iter.hasNext()) { sb.append("+"); } } return sb.toString(); }
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/b60e03ddf44c76e63098940e219b00b046a2b7c9/CourseManagementProviderCMImpl.java/buggy/cm/cm-cm-provider/src/java/org/sakaiproject/coursemanagement/impl/provider/CourseManagementProviderCMImpl.java
private void doInstall(AutomatedInstallData installdata) throws Exception
private void doInstall(AutomatedInstallData installdata) throws Exception
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
while(panelsIterator.hasNext())
while (panelsIterator.hasNext())
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue;
Panel p = (Panel) panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue;
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper";
String automationHelperClassName = "com.izforge.izpack.panels." + panelClassName + "AutomationHelper";
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
try
try
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
} catch(ClassNotFoundException e)
} catch (ClassNotFoundException e)
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
if(automationHelperClass != null)
if (automationHelperClass != null)
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
try
try
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e)
automationHelperInstance = (PanelAutomation) automationHelperClass.newInstance(); } catch (Exception e)
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping...");
System.err.println( "ERROR: no default constructor for " + automationHelperClassName + ", skipping...");
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName);
Vector panelRoots = installdata.xmlData.getChildrenNamed(panelClassName);
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
if (this.panelInstanceCount.containsKey (panelClassName))
if (this.panelInstanceCount.containsKey(panelClassName))
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue ();
panelRootNo = ((Integer) this.panelInstanceCount.get(panelClassName)).intValue();
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1));
XMLElement panelRoot = (XMLElement) panelRoots.elementAt(panelRootNo); this.panelInstanceCount.put(panelClassName, new Integer(panelRootNo + 1));
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
if(automationHelperInstance != null)
if (automationHelperInstance != null)
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while(panelsIterator.hasNext()) { Panel p = (Panel)panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels."+panelClassName+"AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch(ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if(automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation)automationHelperClass.newInstance(); } catch(Exception e) { System.err.println("ERROR: no default constructor for "+automationHelperClassName+", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed (panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey (panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer)this.panelInstanceCount.get (panelClassName)).intValue (); } XMLElement panelRoot = (XMLElement)panelRoots.elementAt (panelRootNo); this.panelInstanceCount.put (panelClassName, new Integer (panelRootNo+1)); // execute the installation logic for the current panel, if it has any: if(automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch(Exception e) { System.err.println ("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace (); continue; } } } System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java