rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
if (token.equals("U"))
if ("U".equals(token))
public FieldSpec(String spec) throws Exception { StringTokenizer tokenizer = new StringTokenizer(spec, ":"); if ((tokenizer.countTokens() >= MIN_TOKENS) && (tokenizer.countTokens() <= MAX_TOKENS)) { String token = tokenizer.nextToken().toUpperCase(); // ------------------------------------------------ // test the first token for a valid type identifier // if it's valid assign the token to the type. // ------------------------------------------------ if (token.equals("N")) { type = RuleTextField.N; } else if (token.equals("H")) { type = RuleTextField.H; } else if (token.equals("A")) { type = RuleTextField.A; } else if (token.equals("O")) { type = RuleTextField.O; } else if (token.equals("AN")) { type = RuleTextField.AN; } else { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the size // of the field and assing to columns. // ------------------------------------------------ try { token = tokenizer.nextToken(); columns = Integer.parseInt(token); } catch (Throwable exception) { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the edit // length and assign to editLength. If this fails // test for identifier for unlimited edit length. // If this works, set unlimitedEdit to true. // ------------------------------------------------ try { token = tokenizer.nextToken().toUpperCase(); editLength = Integer.parseInt(token); } catch (Throwable exception) { if (token.equals("U")) { unlimitedEdit = true; } else { throw (new Exception()); } } } else { throw (new Exception()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RuleInputField.java/clean/src/lib/com/izforge/izpack/panels/RuleInputField.java
if (!className.equals("") && !process)
if (!"".equals(className) && !process)
private void setFields(String data) { StringTokenizer tokenizer = new StringTokenizer(data); String token; String indexString; int index; boolean process = false; String[] vals = null; int i = 0; vals = new String[tokenizer.countTokens()]; while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); indexString = token.substring(0, token.indexOf(':')); try { index = Integer.parseInt(indexString); if (index < inputFields.size()) { String val = token.substring((token.indexOf(':') + 1), token.length()); String className = ""; if (val.indexOf(":") > -1) { className = val.substring(val.indexOf(":") + 1); val = val.substring(0, val.indexOf(":")); } if (!className.equals("") && !process) { process = true; } VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables()); val = vs.substitute(val, null); vals[i] = val; i++; ((JTextField) inputFields.elementAt(index)).setText(val); } } catch (Throwable exception) { exception.printStackTrace(); } } if (process) { tokenizer = new StringTokenizer(data); while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); indexString = token.substring(0, token.indexOf(':')); try { index = Integer.parseInt(indexString); if (index < inputFields.size()) { String val = token.substring((token.indexOf(':') + 1), token.length()); String className = ""; String presult = ""; if (val.indexOf(":") > -1) { className = val.substring(val.indexOf(":") + 1); val = val.substring(0, val.indexOf(":")); } if (!className.equals("")) { Processor p = (Processor) Class.forName(className).newInstance(); presult = p.process(this); } String[] td = new RE("\\*").split(presult); ((JTextField) inputFields.elementAt(index)).setText(td[index]); } } catch (Throwable exception) { ; } } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RuleInputField.java/clean/src/lib/com/izforge/izpack/panels/RuleInputField.java
if (!className.equals(""))
if (!"".equals(className))
private void setFields(String data) { StringTokenizer tokenizer = new StringTokenizer(data); String token; String indexString; int index; boolean process = false; String[] vals = null; int i = 0; vals = new String[tokenizer.countTokens()]; while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); indexString = token.substring(0, token.indexOf(':')); try { index = Integer.parseInt(indexString); if (index < inputFields.size()) { String val = token.substring((token.indexOf(':') + 1), token.length()); String className = ""; if (val.indexOf(":") > -1) { className = val.substring(val.indexOf(":") + 1); val = val.substring(0, val.indexOf(":")); } if (!className.equals("") && !process) { process = true; } VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables()); val = vs.substitute(val, null); vals[i] = val; i++; ((JTextField) inputFields.elementAt(index)).setText(val); } } catch (Throwable exception) { exception.printStackTrace(); } } if (process) { tokenizer = new StringTokenizer(data); while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); indexString = token.substring(0, token.indexOf(':')); try { index = Integer.parseInt(indexString); if (index < inputFields.size()) { String val = token.substring((token.indexOf(':') + 1), token.length()); String className = ""; String presult = ""; if (val.indexOf(":") > -1) { className = val.substring(val.indexOf(":") + 1); val = val.substring(0, val.indexOf(":")); } if (!className.equals("")) { Processor p = (Processor) Class.forName(className).newInstance(); presult = p.process(this); } String[] td = new RE("\\*").split(presult); ((JTextField) inputFields.elementAt(index)).setText(td[index]); } } catch (Throwable exception) { ; } } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RuleInputField.java/clean/src/lib/com/izforge/izpack/panels/RuleInputField.java
;
private void setFields(String data) { StringTokenizer tokenizer = new StringTokenizer(data); String token; String indexString; int index; boolean process = false; String[] vals = null; int i = 0; vals = new String[tokenizer.countTokens()]; while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); indexString = token.substring(0, token.indexOf(':')); try { index = Integer.parseInt(indexString); if (index < inputFields.size()) { String val = token.substring((token.indexOf(':') + 1), token.length()); String className = ""; if (val.indexOf(":") > -1) { className = val.substring(val.indexOf(":") + 1); val = val.substring(0, val.indexOf(":")); } if (!className.equals("") && !process) { process = true; } VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables()); val = vs.substitute(val, null); vals[i] = val; i++; ((JTextField) inputFields.elementAt(index)).setText(val); } } catch (Throwable exception) { exception.printStackTrace(); } } if (process) { tokenizer = new StringTokenizer(data); while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); indexString = token.substring(0, token.indexOf(':')); try { index = Integer.parseInt(indexString); if (index < inputFields.size()) { String val = token.substring((token.indexOf(':') + 1), token.length()); String className = ""; String presult = ""; if (val.indexOf(":") > -1) { className = val.substring(val.indexOf(":") + 1); val = val.substring(0, val.indexOf(":")); } if (!className.equals("")) { Processor p = (Processor) Class.forName(className).newInstance(); presult = p.process(this); } String[] td = new RE("\\*").split(presult); ((JTextField) inputFields.elementAt(index)).setText(td[index]); } } catch (Throwable exception) { ; } } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RuleInputField.java/clean/src/lib/com/izforge/izpack/panels/RuleInputField.java
public StdPackager(String outputFilename, PackagerListener plistener) throws Exception
public StdPackager(String outputFilename, PackagerListener plistener) throws Exception
public StdPackager(String outputFilename, PackagerListener plistener) throws Exception { packs = new ArrayList(); langpacks = new ArrayList(); setPackagerListener(plistener); sendStart(); // Sets up the zipped output stream FileOutputStream outFile = new FileOutputStream(outputFilename); outJar = new JarOutputStream(outFile); outJar.setLevel(Deflater.BEST_COMPRESSION); // Copies the skeleton installer sendMsg("Copying the skeleton installer ..."); writeSkeletonInstaller (outJar); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/StdPackager.java/clean/src/lib/com/izforge/izpack/compiler/StdPackager.java
writeSkeletonInstaller (outJar);
writeSkeletonInstaller(outJar);
public StdPackager(String outputFilename, PackagerListener plistener) throws Exception { packs = new ArrayList(); langpacks = new ArrayList(); setPackagerListener(plistener); sendStart(); // Sets up the zipped output stream FileOutputStream outFile = new FileOutputStream(outputFilename); outJar = new JarOutputStream(outFile); outJar.setLevel(Deflater.BEST_COMPRESSION); // Copies the skeleton installer sendMsg("Copying the skeleton installer ..."); writeSkeletonInstaller (outJar); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/StdPackager.java/clean/src/lib/com/izforge/izpack/compiler/StdPackager.java
} catch (ZipException zerr)
} catch (ZipException zerr)
public void addJarContent(String file) throws Exception { sendMsg("Adding a jar file content ..."); JarFile jar = new JarFile(file); Enumeration entries = jar.entries(); while (entries.hasMoreElements()) { // Puts a new entry ZipEntry zentry = (ZipEntry) entries.nextElement(); try { InputStream zin = jar.getInputStream(zentry); outJar.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(zin, outJar); outJar.closeEntry(); zin.close(); } catch (ZipException zerr) { } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/StdPackager.java/clean/src/lib/com/izforge/izpack/compiler/StdPackager.java
public ZipOutputStream addPack(int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception
public ZipOutputStream addPack( int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception
public ZipOutputStream addPack(int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, osConstraints, required, preselected); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); outJar.putNextEntry(entry); return outJar; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/StdPackager.java/clean/src/lib/com/izforge/izpack/compiler/StdPackager.java
Pack pack = new Pack(name, description, osConstraints, required, preselected);
Pack pack = new Pack(name, description, osConstraints, required, preselected);
public ZipOutputStream addPack(int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, osConstraints, required, preselected); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); outJar.putNextEntry(entry); return outJar; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/StdPackager.java/clean/src/lib/com/izforge/izpack/compiler/StdPackager.java
public void addPanelClass(String classFilename, InputStream input) throws Exception
public void addPanelClass(String classFilename, InputStream input) throws Exception
public void addPanelClass(String classFilename, InputStream input) throws Exception { sendMsg("Adding the (sub)classes for " + classFilename + " ..."); outJar.putNextEntry(new ZipEntry("com/izforge/izpack/panels/" + classFilename)); copyStream(input, outJar); outJar.closeEntry(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/StdPackager.java/clean/src/lib/com/izforge/izpack/compiler/StdPackager.java
outJar.putNextEntry(new ZipEntry("com/izforge/izpack/panels/" + classFilename));
outJar.putNextEntry( new ZipEntry("com/izforge/izpack/panels/" + classFilename));
public void addPanelClass(String classFilename, InputStream input) throws Exception { sendMsg("Adding the (sub)classes for " + classFilename + " ..."); outJar.putNextEntry(new ZipEntry("com/izforge/izpack/panels/" + classFilename)); copyStream(input, outJar); outJar.closeEntry(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/StdPackager.java/clean/src/lib/com/izforge/izpack/compiler/StdPackager.java
return true;
return true;
public boolean allowPackFileBackReferences() { return true; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/StdPackager.java/clean/src/lib/com/izforge/izpack/compiler/StdPackager.java
ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(order); objOut.flush();
ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(order); objOut.flush();
public void setPanelsOrder(ArrayList order) throws Exception { sendMsg("Setting the panels order ..."); outJar.putNextEntry(new ZipEntry("panelsOrder")); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(order); objOut.flush(); outJar.closeEntry(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/StdPackager.java/clean/src/lib/com/izforge/izpack/compiler/StdPackager.java
if (em.equals("functionFailed.RegOpenKeyEx")) { return (false); }
if (em.equals("functionFailed.RegOpenKeyEx") || em.equals("functionFailed.RegQueryValueEx")) { return (false); }
public boolean valueExist(String key, String value) throws NativeLibException { try { this.getValue(currentRoot, key, value); } catch (NativeLibException ne) { String em = ne.getLibMessage(); if (em.equals("functionFailed.RegOpenKeyEx")) { return (false); } throw (ne); } return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ec544a764f5db6b6f0d08629afd6bc6a191c5e13/RegistryImpl.java/clean/src/lib/com/coi/tools/os/win/RegistryImpl.java
temp.append(aStringList.get(idx) + "\n");
temp.append(aStringList.get(idx)).append("\n");
public static String stringArrayListToString(ArrayList aStringList) { StringBuffer temp = new StringBuffer(); for (int idx = 0; idx < aStringList.size(); idx++) { temp.append(aStringList.get(idx) + "\n"); } return temp.toString(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/StringTool.java/buggy/src/lib/com/izforge/izpack/util/StringTool.java
wipeAborted();
public void windowClosing(WindowEvent e) { // We show an alert anyway if (!installdata.canClose) JOptionPane.showMessageDialog(null, langpack.getString("installer.quit.message"), langpack.getString("installer.warning"), JOptionPane.ERROR_MESSAGE); Housekeeper.getInstance ().shutDown (0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/24ab501f4d8488467fd8b63b1057fcc96217b3bf/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
wipeAborted();
public void exit() { if (installdata.canClose) { // Everything went well writeUninstallData(); Housekeeper.getInstance ().shutDown (0); } else { // The installation is not over int res = JOptionPane.showConfirmDialog(this, langpack.getString("installer.quit.message"), langpack.getString("installer.quit.title"), JOptionPane.YES_NO_OPTION); if (res == JOptionPane.YES_OPTION) { Housekeeper.getInstance ().shutDown (0); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/24ab501f4d8488467fd8b63b1057fcc96217b3bf/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
public void activateObject(Object obj) { }
public void activateObject(Object obj) throws Exception { if (exceptionOnActivate) { if (!(validateCounter++%2 == 0 ? evenValid : oddValid)) { throw new Exception(); } } }
public void activateObject(Object obj) { }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/32caf7c554aea378c0cd19f096295176c8695402/TestGenericObjectPool.java/buggy/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java
void setThrowExceptionOnPassivate(boolean bool) {
public void setThrowExceptionOnPassivate(boolean bool) {
void setThrowExceptionOnPassivate(boolean bool) { exceptionOnPassivate = bool; }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/32caf7c554aea378c0cd19f096295176c8695402/TestGenericObjectPool.java/buggy/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java
public boolean validateObject(Object obj) { return validateCounter++%2 == 0 ? evenValid : oddValid; }
public boolean validateObject(Object obj) { if (enableValidation) { return validateCounter++%2 == 0 ? evenValid : oddValid; } else { return true; } }
public boolean validateObject(Object obj) { return validateCounter++%2 == 0 ? evenValid : oddValid; }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/32caf7c554aea378c0cd19f096295176c8695402/TestGenericObjectPool.java/buggy/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java
assertNotNull(obj);
public void testSetFactoryWithActiveObjects() throws Exception { GenericObjectPool pool = new GenericObjectPool(); pool.setMaxIdle(10); pool.setFactory(new SimpleFactory()); Object obj = pool.borrowObject(); try { pool.setFactory(null); fail("Expected IllegalStateException"); } catch(IllegalStateException e) { // expected } try { pool.setFactory(new SimpleFactory()); fail("Expected IllegalStateException"); } catch(IllegalStateException e) { // expected } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/32caf7c554aea378c0cd19f096295176c8695402/TestGenericObjectPool.java/buggy/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java
paramList.add("-cp=" + file.toString());
paramList.add("-cp " + file.toString());
public int executeFiles(int currentStage, AbstractUIHandler handler) { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { ExecutableFile efile = (ExecutableFile) efileIterator.next(); boolean deleteAfterwards = ! efile.keepFile; File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // skip file if not for current OS (it might not have been installed at all) if (! OsConstraint.oneMatchesCurrentSystem (efile.osList)) continue; if(currentStage!=ExecutableFile.UNINSTALL) { // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); } } // execute command in POSTINSTALL stage if ((exitStatus == 0) && ((currentStage == ExecutableFile.POSTINSTALL && efile.executionStage == ExecutableFile.POSTINSTALL) || (currentStage==ExecutableFile.UNINSTALL && efile.executionStage == ExecutableFile.UNINSTALL))) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp=" + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) { // CHECKME: let the user decide or abort anyway? handler.emitError("file execution error", message); } else if (efile.onFailure == ExecutableFile.WARN) { // CHECKME: let the user decide or abort anyway? handler.emitWarning ("file execution error", message); exitStatus = 0; } else { if (handler.askQuestion (null, "Continue?", AbstractUIHandler.CHOICES_YES_NO) == AbstractUIHandler.ANSWER_YES) exitStatus = 0; } } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/e6916b0aec158418014d45d6e2e42c1c7b118e5a/FileExecutor.java/buggy/src/lib/com/izforge/izpack/util/FileExecutor.java
String text = activeField.getText(); int fieldSize = activeField.getEditLength(); int caretPosition = activeField.getCaretPosition(); int selection = activeField.getSelectionEnd() - activeField.getSelectionStart();
if (activeField != null) { String text = activeField.getText(); int fieldSize = activeField.getEditLength(); int caretPosition = activeField.getCaretPosition(); int selection = activeField.getSelectionEnd() - activeField.getSelectionStart();
public void caretUpdate(CaretEvent event) { String text = activeField.getText(); int fieldSize = activeField.getEditLength(); int caretPosition = activeField.getCaretPosition(); int selection = activeField.getSelectionEnd() - activeField.getSelectionStart(); if ((!inputFields.lastElement().equals(activeField)) && (!activeField.unlimitedEdit())) { if ((text.length() == fieldSize) && (selection == 0) && (caretPosition == fieldSize) && !backstep) { activeField.transferFocus(); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/e379bca3b699c2188efebed999375b18f7071ab3/RuleInputField.java/buggy/src/lib/com/izforge/izpack/panels/RuleInputField.java
if ((!inputFields.lastElement().equals(activeField)) && (!activeField.unlimitedEdit())) { if ((text.length() == fieldSize) && (selection == 0) && (caretPosition == fieldSize) && !backstep)
if ((!inputFields.lastElement().equals(activeField)) && (!activeField.unlimitedEdit()))
public void caretUpdate(CaretEvent event) { String text = activeField.getText(); int fieldSize = activeField.getEditLength(); int caretPosition = activeField.getCaretPosition(); int selection = activeField.getSelectionEnd() - activeField.getSelectionStart(); if ((!inputFields.lastElement().equals(activeField)) && (!activeField.unlimitedEdit())) { if ((text.length() == fieldSize) && (selection == 0) && (caretPosition == fieldSize) && !backstep) { activeField.transferFocus(); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/e379bca3b699c2188efebed999375b18f7071ab3/RuleInputField.java/buggy/src/lib/com/izforge/izpack/panels/RuleInputField.java
activeField.transferFocus();
if ((text.length() == fieldSize) && (selection == 0) && (caretPosition == fieldSize) && !backstep) { activeField.transferFocus(); }
public void caretUpdate(CaretEvent event) { String text = activeField.getText(); int fieldSize = activeField.getEditLength(); int caretPosition = activeField.getCaretPosition(); int selection = activeField.getSelectionEnd() - activeField.getSelectionStart(); if ((!inputFields.lastElement().equals(activeField)) && (!activeField.unlimitedEdit())) { if ((text.length() == fieldSize) && (selection == 0) && (caretPosition == fieldSize) && !backstep) { activeField.transferFocus(); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/e379bca3b699c2188efebed999375b18f7071ab3/RuleInputField.java/buggy/src/lib/com/izforge/izpack/panels/RuleInputField.java
{ }
{}
private void setFields(String data) { StringTokenizer tokenizer = new StringTokenizer(data); String token; String indexString; int index; boolean process = false; String[] vals = null; int i = 0; vals = new String[tokenizer.countTokens()]; while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); indexString = token.substring(0, token.indexOf(':')); try { index = Integer.parseInt(indexString); if (index < inputFields.size()) { String val = token.substring((token.indexOf(':') + 1), token.length()); String className = ""; if (val.indexOf(":") > -1) { className = val.substring(val.indexOf(":") + 1); val = val.substring(0, val.indexOf(":")); } if (!"".equals(className) && !process) { process = true; } VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables()); val = vs.substitute(val, null); vals[i] = val; i++; ((JTextField) inputFields.elementAt(index)).setText(val); } } catch (Throwable exception) { exception.printStackTrace(); } } if (process) { tokenizer = new StringTokenizer(data); while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); indexString = token.substring(0, token.indexOf(':')); try { index = Integer.parseInt(indexString); if (index < inputFields.size()) { String val = token.substring((token.indexOf(':') + 1), token.length()); String className = ""; String presult = ""; if (val.indexOf(":") > -1) { className = val.substring(val.indexOf(":") + 1); val = val.substring(0, val.indexOf(":")); } if (!"".equals(className)) { Processor p = (Processor) Class.forName(className).newInstance(); presult = p.process(this); } String[] td = new RE("\\*").split(presult); ((JTextField) inputFields.elementAt(index)).setText(td[index]); } } catch (Throwable exception) { } } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/e379bca3b699c2188efebed999375b18f7071ab3/RuleInputField.java/buggy/src/lib/com/izforge/izpack/panels/RuleInputField.java
textArea = new JTextArea(licence);
JTextArea textArea = new JTextArea(licence);
public LicencePanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); // We load the licence loadLicence(); // We put our components JLabel infoLabel = LabelFactory.create(parent.langpack.getString("LicencePanel.info"), parent.icons.getImageIcon("history"), JLabel.TRAILING); add(infoLabel); add(Box.createRigidArea(new Dimension(0, 3))); textArea = new JTextArea(licence); textArea.setMargin(new Insets(2, 2, 2, 2)); textArea.setCaretPosition(0); textArea.setEditable(false); textArea.setLineWrap(true); textArea.setWrapStyleWord(true); scroller = new JScrollPane(textArea); scroller.setAlignmentX(LEFT_ALIGNMENT); add(scroller); ButtonGroup group = new ButtonGroup(); yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.agree"), false); group.add(yesRadio); add(yesRadio); yesRadio.addActionListener(this); noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.notagree"), true); group.add(noRadio); add(noRadio); noRadio.addActionListener(this); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/LicencePanel.java/clean/src/lib/com/izforge/izpack/panels/LicencePanel.java
scroller = new JScrollPane(textArea);
JScrollPane scroller = new JScrollPane(textArea);
public LicencePanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); // We load the licence loadLicence(); // We put our components JLabel infoLabel = LabelFactory.create(parent.langpack.getString("LicencePanel.info"), parent.icons.getImageIcon("history"), JLabel.TRAILING); add(infoLabel); add(Box.createRigidArea(new Dimension(0, 3))); textArea = new JTextArea(licence); textArea.setMargin(new Insets(2, 2, 2, 2)); textArea.setCaretPosition(0); textArea.setEditable(false); textArea.setLineWrap(true); textArea.setWrapStyleWord(true); scroller = new JScrollPane(textArea); scroller.setAlignmentX(LEFT_ALIGNMENT); add(scroller); ButtonGroup group = new ButtonGroup(); yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.agree"), false); group.add(yesRadio); add(yesRadio); yesRadio.addActionListener(this); noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.notagree"), true); group.add(noRadio); add(noRadio); noRadio.addActionListener(this); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/LicencePanel.java/clean/src/lib/com/izforge/izpack/panels/LicencePanel.java
buf.append("Active: ").append(numActive()).append("\n"); buf.append("Idle: ").append(numIdle()).append("\n");
buf.append("Active: ").append(getNumActive()).append("\n"); buf.append("Idle: ").append(getNumIdle()).append("\n");
synchronized String debugInfo() { StringBuffer buf = new StringBuffer(); buf.append("Active: ").append(numActive()).append("\n"); buf.append("Idle: ").append(numIdle()).append("\n"); Iterator it = _poolList.iterator(); while(it.hasNext()) { buf.append("\t").append(_poolMap.get(it.next())).append("\n"); } return buf.toString(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/ac68a2836421b5fa4c13cdecd2ff7031f8c49bd6/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
public synchronized void returnObject(Object key, Object obj) throws Exception { _totalActive--;
public void returnObject(Object key, Object obj) throws Exception {
public synchronized void returnObject(Object key, Object obj) throws Exception { _totalActive--; CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key,new Integer(active.intValue() - 1)); } if(_maxIdle > 0 && (pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(key,obj)))) { try { _factory.passivateObject(key,obj); } catch(Exception e) { ; // ignored, we're throwing it out anyway } _factory.destroyObject(key,obj); } else { try { _factory.passivateObject(key,obj); pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } catch(Exception e) { _factory.destroyObject(key,obj); } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/ac68a2836421b5fa4c13cdecd2ff7031f8c49bd6/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key);
CursorableLinkedList pool = null; synchronized(this) { pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key, pool); _poolList.add(key); }
public synchronized void returnObject(Object key, Object obj) throws Exception { _totalActive--; CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key,new Integer(active.intValue() - 1)); } if(_maxIdle > 0 && (pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(key,obj)))) { try { _factory.passivateObject(key,obj); } catch(Exception e) { ; // ignored, we're throwing it out anyway } _factory.destroyObject(key,obj); } else { try { _factory.passivateObject(key,obj); pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } catch(Exception e) { _factory.destroyObject(key,obj); } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/ac68a2836421b5fa4c13cdecd2ff7031f8c49bd6/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
Integer active = (Integer)(_activeMap.get(key)); if(null == active) { } else if(active.intValue() <= 1) { _activeMap.remove(key);
boolean success = true; if((_testOnReturn && !_factory.validateObject(key, obj))) { success = false; try { _factory.destroyObject(key, obj); } catch(Exception e) { }
public synchronized void returnObject(Object key, Object obj) throws Exception { _totalActive--; CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key,new Integer(active.intValue() - 1)); } if(_maxIdle > 0 && (pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(key,obj)))) { try { _factory.passivateObject(key,obj); } catch(Exception e) { ; // ignored, we're throwing it out anyway } _factory.destroyObject(key,obj); } else { try { _factory.passivateObject(key,obj); pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } catch(Exception e) { _factory.destroyObject(key,obj); } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/ac68a2836421b5fa4c13cdecd2ff7031f8c49bd6/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
_activeMap.put(key,new Integer(active.intValue() - 1));
try { _factory.passivateObject(key, obj); } catch(Exception e) { success = false; }
public synchronized void returnObject(Object key, Object obj) throws Exception { _totalActive--; CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key,new Integer(active.intValue() - 1)); } if(_maxIdle > 0 && (pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(key,obj)))) { try { _factory.passivateObject(key,obj); } catch(Exception e) { ; // ignored, we're throwing it out anyway } _factory.destroyObject(key,obj); } else { try { _factory.passivateObject(key,obj); pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } catch(Exception e) { _factory.destroyObject(key,obj); } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/ac68a2836421b5fa4c13cdecd2ff7031f8c49bd6/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
if(_maxIdle > 0 && (pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(key,obj)))) { try { _factory.passivateObject(key,obj); } catch(Exception e) { ;
boolean shouldDestroy = false; synchronized(this) { _totalActive--; Integer active = (Integer)(_activeMap.get(key)); if(null == active) { } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key, new Integer(active.intValue() - 1));
public synchronized void returnObject(Object key, Object obj) throws Exception { _totalActive--; CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key,new Integer(active.intValue() - 1)); } if(_maxIdle > 0 && (pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(key,obj)))) { try { _factory.passivateObject(key,obj); } catch(Exception e) { ; // ignored, we're throwing it out anyway } _factory.destroyObject(key,obj); } else { try { _factory.passivateObject(key,obj); pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } catch(Exception e) { _factory.destroyObject(key,obj); } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/ac68a2836421b5fa4c13cdecd2ff7031f8c49bd6/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
_factory.destroyObject(key,obj); } else { try { _factory.passivateObject(key,obj);
if(_maxIdle > 0 && (pool.size() >= _maxIdle)) { shouldDestroy = true; } else if(success) {
public synchronized void returnObject(Object key, Object obj) throws Exception { _totalActive--; CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key,new Integer(active.intValue() - 1)); } if(_maxIdle > 0 && (pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(key,obj)))) { try { _factory.passivateObject(key,obj); } catch(Exception e) { ; // ignored, we're throwing it out anyway } _factory.destroyObject(key,obj); } else { try { _factory.passivateObject(key,obj); pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } catch(Exception e) { _factory.destroyObject(key,obj); } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/ac68a2836421b5fa4c13cdecd2ff7031f8c49bd6/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
_factory.destroyObject(key,obj);
public synchronized void returnObject(Object key, Object obj) throws Exception { _totalActive--; CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key,new Integer(active.intValue() - 1)); } if(_maxIdle > 0 && (pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(key,obj)))) { try { _factory.passivateObject(key,obj); } catch(Exception e) { ; // ignored, we're throwing it out anyway } _factory.destroyObject(key,obj); } else { try { _factory.passivateObject(key,obj); pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } catch(Exception e) { _factory.destroyObject(key,obj); } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/ac68a2836421b5fa4c13cdecd2ff7031f8c49bd6/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
notifyAll();
public synchronized void returnObject(Object key, Object obj) throws Exception { _totalActive--; CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key,new Integer(active.intValue() - 1)); } if(_maxIdle > 0 && (pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(key,obj)))) { try { _factory.passivateObject(key,obj); } catch(Exception e) { ; // ignored, we're throwing it out anyway } _factory.destroyObject(key,obj); } else { try { _factory.passivateObject(key,obj); pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } catch(Exception e) { _factory.destroyObject(key,obj); } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/ac68a2836421b5fa4c13cdecd2ff7031f8c49bd6/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
syncSlider();
public void actionPerformed(ActionEvent e) { if (frameNumber <= max && frameNumber >= startMovie && frameNumber <= endMovie && playing) { renderImage(frameNumber); switch (movieType) { case Player.LOOP: handleLoop(); break; case Player.BACKWARD: handleBackward(); break; case Player.FORWARD: handleForward(); break; case Player.PINGPONG: handlePingPong(); break; } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/307b46abefd43070ad77e63095c151223a982ae5/PlayerManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/movie/PlayerManager.java
syncSlider();
public void pause() { playing = false; pause = true; syncSlider(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/307b46abefd43070ad77e63095c151223a982ae5/PlayerManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/movie/PlayerManager.java
up = true; syncSlider();
up = true;
public void stop() { timer.stop(); playing = false; pause = false; up = true; syncSlider(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/307b46abefd43070ad77e63095c151223a982ae5/PlayerManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/movie/PlayerManager.java
if (text == null) text = langpack.getString("installer.quit"); quitButton.setText(text);
String text1 = text; if (text1 == null) text1 = langpack.getString("installer.quit"); quitButton.setText(text1);
public void setQuitButtonText(String text) { if (text == null) text = langpack.getString("installer.quit"); quitButton.setText(text); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
if (fullCleanup == null || !fullCleanup.equalsIgnoreCase("no"))
if (fullCleanup == null || !"no".equalsIgnoreCase(fullCleanup))
protected void wipeAborted() { Iterator it; // We set interrupt to all running Unpacker and wait 40 sec for maximum. // If interrupt is discarded (return value false), return immediately: if (!Unpacker.interruptAll(40000)) return; // Wipes them all in 2 stages UninstallData u = UninstallData.getInstance(); it = u.getFilesList().iterator(); if (!it.hasNext()) return; while (it.hasNext()) { String p = (String) it.next(); File f = new File(p); f.delete(); } String fullCleanup = installdata.getVariable("InstallerFrame.cleanAllAtInterrupt"); if (fullCleanup == null || !fullCleanup.equalsIgnoreCase("no")) cleanWipe(new File(installdata.getInstallPath())); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
if (key.equals("__uninstallLibs__"))
if ("__uninstallLibs__".equals(key))
private void writeUninstallData() { try { // We get the data UninstallData udata = UninstallData.getInstance(); List files = udata.getFilesList(); ZipOutputStream outJar = installdata.uninstallOutJar; if (outJar == null) return; // We write the files log outJar.putNextEntry(new ZipEntry("install.log")); BufferedWriter logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(installdata.getInstallPath()); logWriter.newLine(); Iterator iter = files.iterator(); while (iter.hasNext()) { logWriter.write((String) iter.next()); if (iter.hasNext()) logWriter.newLine(); } logWriter.flush(); outJar.closeEntry(); // We write the uninstaller jar file log outJar.putNextEntry(new ZipEntry("jarlocation.log")); logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(udata.getUninstallerJarFilename()); logWriter.newLine(); logWriter.write(udata.getUninstallerPath()); logWriter.flush(); outJar.closeEntry(); // Write out executables to execute on uninstall outJar.putNextEntry(new ZipEntry("executables")); ObjectOutputStream execStream = new ObjectOutputStream(outJar); iter = udata.getExecutablesList().iterator(); execStream.writeInt(udata.getExecutablesList().size()); while (iter.hasNext()) { ExecutableFile file = (ExecutableFile) iter.next(); execStream.writeObject(file); } execStream.flush(); outJar.closeEntry(); // Write out additional uninstall data // Do not "kill" the installation if there is a problem // with custom uninstall data. Therefore log it to Debug, // but do not throw. Map additionalData = udata.getAdditionalData(); if (additionalData != null && !additionalData.isEmpty()) { Iterator keys = additionalData.keySet().iterator(); HashSet exist = new HashSet(); while (keys != null && keys.hasNext()) { String key = (String) keys.next(); Object contents = additionalData.get(key); if (key.equals("__uninstallLibs__")) { Iterator nativeLibIter = ((List) contents).iterator(); while (nativeLibIter != null && nativeLibIter.hasNext()) { String nativeLibName = (String) ((List) nativeLibIter.next()).get(0); byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; outJar.putNextEntry(new ZipEntry("native/" + nativeLibName)); InputStream in = getClass().getResourceAsStream( "/native/" + nativeLibName); while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } outJar.closeEntry(); } } else if (key.equals("uninstallerListeners") || key.equals("uninstallerJars")) { // It is a ArrayList of ArrayLists which contains the // full // package paths of all needed class files. // First we create a new ArrayList which contains only // the full paths for the uninstall listener self; thats // the first entry of each sub ArrayList. ArrayList subContents = new ArrayList(); // Secound put the class into uninstaller.jar Iterator listenerIter = ((List) contents).iterator(); while (listenerIter.hasNext()) { byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; CustomData customData = (CustomData) listenerIter.next(); // First element of the list contains the listener // class path; // remind it for later. if (customData.listenerName != null) subContents.add(customData.listenerName); Iterator liClaIter = customData.contents.iterator(); while (liClaIter.hasNext()) { String contentPath = (String) liClaIter.next(); if (exist.contains(contentPath)) continue; exist.add(contentPath); try { outJar.putNextEntry(new ZipEntry(contentPath)); } catch (ZipException ze) { // Ignore, or ignore not ?? May be it is a // exception because // a doubled entry was tried, then we should // ignore ... Debug.trace("ZipException in writing custom data: " + ze.getMessage()); continue; } InputStream in = getClass().getResourceAsStream("/" + contentPath); if (in != null) { while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } } else Debug.trace("custom data not found: " + contentPath); outJar.closeEntry(); } } // Third we write the list into the // uninstaller.jar outJar.putNextEntry(new ZipEntry(key)); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(subContents); objOut.flush(); outJar.closeEntry(); } else { outJar.putNextEntry(new ZipEntry(key)); if (contents instanceof ByteArrayOutputStream) { ((ByteArrayOutputStream) contents).writeTo(outJar); } else { ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(contents); objOut.flush(); } outJar.closeEntry(); } } } // Cleanup outJar.flush(); outJar.close(); } catch (Exception err) { err.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
else if (key.equals("uninstallerListeners") || key.equals("uninstallerJars"))
else if ("uninstallerListeners".equals(key) || "uninstallerJars".equals(key))
private void writeUninstallData() { try { // We get the data UninstallData udata = UninstallData.getInstance(); List files = udata.getFilesList(); ZipOutputStream outJar = installdata.uninstallOutJar; if (outJar == null) return; // We write the files log outJar.putNextEntry(new ZipEntry("install.log")); BufferedWriter logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(installdata.getInstallPath()); logWriter.newLine(); Iterator iter = files.iterator(); while (iter.hasNext()) { logWriter.write((String) iter.next()); if (iter.hasNext()) logWriter.newLine(); } logWriter.flush(); outJar.closeEntry(); // We write the uninstaller jar file log outJar.putNextEntry(new ZipEntry("jarlocation.log")); logWriter = new BufferedWriter(new OutputStreamWriter(outJar)); logWriter.write(udata.getUninstallerJarFilename()); logWriter.newLine(); logWriter.write(udata.getUninstallerPath()); logWriter.flush(); outJar.closeEntry(); // Write out executables to execute on uninstall outJar.putNextEntry(new ZipEntry("executables")); ObjectOutputStream execStream = new ObjectOutputStream(outJar); iter = udata.getExecutablesList().iterator(); execStream.writeInt(udata.getExecutablesList().size()); while (iter.hasNext()) { ExecutableFile file = (ExecutableFile) iter.next(); execStream.writeObject(file); } execStream.flush(); outJar.closeEntry(); // Write out additional uninstall data // Do not "kill" the installation if there is a problem // with custom uninstall data. Therefore log it to Debug, // but do not throw. Map additionalData = udata.getAdditionalData(); if (additionalData != null && !additionalData.isEmpty()) { Iterator keys = additionalData.keySet().iterator(); HashSet exist = new HashSet(); while (keys != null && keys.hasNext()) { String key = (String) keys.next(); Object contents = additionalData.get(key); if (key.equals("__uninstallLibs__")) { Iterator nativeLibIter = ((List) contents).iterator(); while (nativeLibIter != null && nativeLibIter.hasNext()) { String nativeLibName = (String) ((List) nativeLibIter.next()).get(0); byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; outJar.putNextEntry(new ZipEntry("native/" + nativeLibName)); InputStream in = getClass().getResourceAsStream( "/native/" + nativeLibName); while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } outJar.closeEntry(); } } else if (key.equals("uninstallerListeners") || key.equals("uninstallerJars")) { // It is a ArrayList of ArrayLists which contains the // full // package paths of all needed class files. // First we create a new ArrayList which contains only // the full paths for the uninstall listener self; thats // the first entry of each sub ArrayList. ArrayList subContents = new ArrayList(); // Secound put the class into uninstaller.jar Iterator listenerIter = ((List) contents).iterator(); while (listenerIter.hasNext()) { byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; CustomData customData = (CustomData) listenerIter.next(); // First element of the list contains the listener // class path; // remind it for later. if (customData.listenerName != null) subContents.add(customData.listenerName); Iterator liClaIter = customData.contents.iterator(); while (liClaIter.hasNext()) { String contentPath = (String) liClaIter.next(); if (exist.contains(contentPath)) continue; exist.add(contentPath); try { outJar.putNextEntry(new ZipEntry(contentPath)); } catch (ZipException ze) { // Ignore, or ignore not ?? May be it is a // exception because // a doubled entry was tried, then we should // ignore ... Debug.trace("ZipException in writing custom data: " + ze.getMessage()); continue; } InputStream in = getClass().getResourceAsStream("/" + contentPath); if (in != null) { while ((bytesInBuffer = in.read(buffer)) != -1) { outJar.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } } else Debug.trace("custom data not found: " + contentPath); outJar.closeEntry(); } } // Third we write the list into the // uninstaller.jar outJar.putNextEntry(new ZipEntry(key)); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(subContents); objOut.flush(); outJar.closeEntry(); } else { outJar.putNextEntry(new ZipEntry(key)); if (contents instanceof ByteArrayOutputStream) { ((ByteArrayOutputStream) contents).writeTo(outJar); } else { ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(contents); objOut.flush(); } outJar.closeEntry(); } } } // Cleanup outJar.flush(); outJar.close(); } catch (Exception err) { err.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
return new GenericKeyedObjectPool(_factory,_maxActive,_whenExhaustedAction,_maxWait,_maxIdle,_maxTotal,_testOnBorrow,_testOnReturn,_timeBetweenEvictionRunsMillis,_numTestsPerEvictionRun,_minEvictableIdleTimeMillis,_testWhileIdle);
return new GenericKeyedObjectPool(_factory,_maxActive,_whenExhaustedAction,_maxWait,_maxIdle,_maxTotal,_minIdle,_testOnBorrow,_testOnReturn,_timeBetweenEvictionRunsMillis,_numTestsPerEvictionRun,_minEvictableIdleTimeMillis,_testWhileIdle);
public KeyedObjectPool createPool() { return new GenericKeyedObjectPool(_factory,_maxActive,_whenExhaustedAction,_maxWait,_maxIdle,_maxTotal,_testOnBorrow,_testOnReturn,_timeBetweenEvictionRunsMillis,_numTestsPerEvictionRun,_minEvictableIdleTimeMillis,_testWhileIdle); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/GenericKeyedObjectPoolFactory.java/buggy/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPoolFactory.java
error.toString(),
error,
public void errorUnpack(String error) { this.packOpLabel.setText(error); idata.installSuccess = false; JOptionPane.showMessageDialog( this, error.toString(), parent.langpack.getString("installer.error"), JOptionPane.ERROR_MESSAGE); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/InstallPanel.java/buggy/src/lib/com/izforge/izpack/panels/InstallPanel.java
copy.model = this.model;
public RenderingDef copy() { RenderingDef copy = new RenderingDef(); copy.defaultZ = this.defaultZ; copy.defaultT = this.defaultT; copy.qDef = this.qDef.copy(); ChannelBindings[] cb = new ChannelBindings[channelBindings.length]; for (int i = 0; i < channelBindings.length; i++) cb[i] = channelBindings[i].copy(); copy.channelBindings = cb; List list = new ArrayList(); Iterator j = cdChainDef.iterator(); CodomainMapContext ctxCopy; while (j.hasNext()) { ctxCopy = ((CodomainMapContext) j.next()).copy(); list.add(ctxCopy); } copy.cdChainDef = list; return copy; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/RenderingDef.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/defs/RenderingDef.java
return new QuantumDef(family, pixelType, curveCoefficient, cdStart, cdEnd, bitResolution);
return new QuantumDef(pixelType, cdStart, cdEnd, bitResolution, noiseReduction);
QuantumDef copy() { return new QuantumDef(family, pixelType, curveCoefficient, cdStart, cdEnd, bitResolution); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/QuantumDef.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/defs/QuantumDef.java
super(title);
super(title);
public InstallerFrame(String title, InstallData installdata) throws Exception { super(title); guiListener = new ArrayList(); visiblePanelMapping = new ArrayList(); this.installdata = installdata; this.langpack = installdata.langpack; // Sets the window events handler addWindowListener(new WindowHandler()); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); // initialize rules by loading the conditions loadConditions(); // Builds the GUI loadIcons(); loadPanels(); buildGUI(); // We show the frame showFrame(); switchPanel(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
protected void loadConditions() {
protected void loadConditions() {
protected void loadConditions() { try { InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { // there seem to be no conditions return; } StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data XMLElement conditionsxml = (XMLElement) parser.parse(); this.rules = new RulesEngine(conditionsxml, installdata); } catch (Exception e) { Debug.log(e.getMessage()); e.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { return;
InputStream input = null; input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { this.rules = new RulesEngine(null,installdata); return;
protected void loadConditions() { try { InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { // there seem to be no conditions return; } StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data XMLElement conditionsxml = (XMLElement) parser.parse(); this.rules = new RulesEngine(conditionsxml, installdata); } catch (Exception e) { Debug.log(e.getMessage()); e.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
Debug.log(e.getMessage()); e.printStackTrace();
Debug.trace("Can not find optional resource " + CONDITIONS_SPECRESOURCENAME); this.rules = new RulesEngine(null,installdata);
protected void loadConditions() { try { InputStream input = this.getResource(CONDITIONS_SPECRESOURCENAME); if (input == null) { // there seem to be no conditions return; } StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data XMLElement conditionsxml = (XMLElement) parser.parse(); this.rules = new RulesEngine(conditionsxml, installdata); } catch (Exception e) { Debug.log(e.getMessage()); e.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
c.createCriteria("defaultPixels",LEFT_JOIN);
Criteria pix = c.createCriteria("defaultPixels",LEFT_JOIN); pix.createCriteria("pixelsType",LEFT_JOIN); pix.createCriteria("pixelsDimensions",LEFT_JOIN);
protected void buildQuery(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(Image.class); c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); c.createCriteria("defaultPixels",LEFT_JOIN); // Add restrictions to the most distant criteria Criteria[] hy = Hierarchy.fetchParents(c,(Class) value(CLASS),Integer.MAX_VALUE); hy[hy.length-1].add(Restrictions.in("id",(Collection) value(IDS))); setCriteria( c ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b8f8feca610352c631ee8c28d8b9b7279652be1b/PojosGetImagesQueryDefinition.java/clean/components/server/src/ome/services/query/PojosGetImagesQueryDefinition.java
in = this.getClass().getResourceAsStream(resourcePath);
in = ResourceManager.class.getResourceAsStream(resourcePath);
private String getLanguageResourceString(String resource) throws ResourceNotFoundException { InputStream in; String resourcePath = this.resourceBasePath + resource + "_" + this.locale; in = this.getClass().getResourceAsStream(resourcePath); if (in != null) return resourcePath; else { // if there's no language dependent resource found resourcePath = this.resourceBasePath + resource; in = this.getClass().getResourceAsStream(resourcePath); if (in != null) return resourcePath; else throw new ResourceNotFoundException("Can not find Resource " + resource + " for language " + this.locale); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/ResourceManager.java/clean/src/lib/com/izforge/izpack/installer/ResourceManager.java
in = this.getClass().getResourceAsStream(resourcePath);
in = ResourceManager.class.getResourceAsStream(resourcePath);
private String getLanguageResourceString(String resource) throws ResourceNotFoundException { InputStream in; String resourcePath = this.resourceBasePath + resource + "_" + this.locale; in = this.getClass().getResourceAsStream(resourcePath); if (in != null) return resourcePath; else { // if there's no language dependent resource found resourcePath = this.resourceBasePath + resource; in = this.getClass().getResourceAsStream(resourcePath); if (in != null) return resourcePath; else throw new ResourceNotFoundException("Can not find Resource " + resource + " for language " + this.locale); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/ResourceManager.java/clean/src/lib/com/izforge/izpack/installer/ResourceManager.java
QuantumDef qDef = new QuantumDef(QuantumFactory.LINEAR, pixelType, 1, 0, QuantumFactory.DEPTH_8BIT, QuantumFactory.DEPTH_8BIT);
QuantumDef qDef = new QuantumDef(pixelType, 0, QuantumFactory.DEPTH_8BIT, QuantumFactory.DEPTH_8BIT, QuantumFactory.NOISE_REDUCTION);
private RenderingDef createDefaultRenderingDef(PixelsDimensions dims, PixelsStats stats, int pixelType) { QuantumDef qDef = new QuantumDef(QuantumFactory.LINEAR, pixelType, 1, 0, QuantumFactory.DEPTH_8BIT, QuantumFactory.DEPTH_8BIT); ChannelBindings[] waves = new ChannelBindings[dims.sizeW]; PixelsGlobalStatsEntry wGlobal; int[] rgb; for (int w = 0; w < dims.sizeW; ++w) { wGlobal = stats.getGlobalEntry(w); //TODO: calcultate default interval, should come in next version. rgb = setDefaultColor(w); waves[w] = new ChannelBindings(w, wGlobal.getGlobalMin(), wGlobal.getGlobalMax(), rgb[0], rgb[1], rgb[2], 255, false); } waves[0].setActive(true); //NOTE: ImageDimensions enforces 1 < sizeW. return new RenderingDef(dims.sizeZ/2+dims.sizeZ%2-1, 0, RenderingDef.GS, qDef, waves); //NOTE: middle of stack is z=1 if szZ==3, z=1 if szZ==4, etc. }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
wGlobal = stats.getGlobalEntry(w); rgb = setDefaultColor(w); waves[w] = new ChannelBindings(w, wGlobal.getGlobalMin(), wGlobal.getGlobalMax(), rgb[0], rgb[1], rgb[2], 255, false);
wGlobal = stats.getGlobalEntry(w); rgb = setDefaultColor(w); waves[w] = new ChannelBindings(w, wGlobal.getGlobalMin(), wGlobal.getGlobalMax(), rgb[0], rgb[1], rgb[2], 255, false, QuantumFactory.LINEAR, 1);
private RenderingDef createDefaultRenderingDef(PixelsDimensions dims, PixelsStats stats, int pixelType) { QuantumDef qDef = new QuantumDef(QuantumFactory.LINEAR, pixelType, 1, 0, QuantumFactory.DEPTH_8BIT, QuantumFactory.DEPTH_8BIT); ChannelBindings[] waves = new ChannelBindings[dims.sizeW]; PixelsGlobalStatsEntry wGlobal; int[] rgb; for (int w = 0; w < dims.sizeW; ++w) { wGlobal = stats.getGlobalEntry(w); //TODO: calcultate default interval, should come in next version. rgb = setDefaultColor(w); waves[w] = new ChannelBindings(w, wGlobal.getGlobalMin(), wGlobal.getGlobalMax(), rgb[0], rgb[1], rgb[2], 255, false); } waves[0].setActive(true); //NOTE: ImageDimensions enforces 1 < sizeW. return new RenderingDef(dims.sizeZ/2+dims.sizeZ%2-1, 0, RenderingDef.GS, qDef, waves); //NOTE: middle of stack is z=1 if szZ==3, z=1 if szZ==4, etc. }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
if (renderingDef == null)
boolean isNull = false; if (renderingDef == null) { isNull = true;
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); if (renderingDef == null) renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
source.getPixelType());
source.getPixelType()); }
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); if (renderingDef == null) renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings());
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); if (renderingDef == null) renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
ChannelBindings[] cBindings= renderingDef.getChannelBindings(); StatsComputer.computeStats(dataSink, source, cBindings, getDefaultPlaneDef(), isNull); quantumManager.initStrategies(qd, pixelsStats, cBindings);
private void initialize(MetadataSource source) { //Grab pixels metadata (create default display options if //none available). omeisPixelsID = source.getOmeisPixelsID(); pixelsDims = source.getPixelsDims(); pixelsStats = source.getPixelsStats(); renderingDef = source.getDisplayOptions(); if (renderingDef == null) renderingDef = createDefaultRenderingDef(pixelsDims, pixelsStats, source.getPixelType()); //Create and configure the quantum strategies. QuantumDef qd = renderingDef.getQuantumDef(); quantumManager = new QuantumManager(pixelsDims.sizeW); quantumManager.initStrategies(qd, pixelsStats, renderingDef.getChannelBindings()); //Create and configure the codomain chain. codomainChain = new CodomainChain(qd.cdStart, qd.cdEnd, renderingDef.getCodomainChainDef()); //Create an appropriate rendering strategy. renderingStrategy = RenderingStrategy.makeNew(renderingDef.getModel()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
rgb[0] = 0; rgb[1] = 0; rgb[2] = 255;
rgb[0] = ChannelBindings.COLOR_MIN; rgb[1] = ChannelBindings.COLOR_MIN; rgb[2] = ChannelBindings.COLOR_MAX;
private int[] setDefaultColor(int w) { int[] rgb = new int[3]; if (w == 0) { //blue rgb[0] = 0; rgb[1] = 0; rgb[2] = 255; } else if (w == 1) { //green rgb[0] = 0; rgb[1] = 255; rgb[2] = 0; } else { //red rgb[0] = 255; rgb[1] = 0; rgb[2] = 0; } return rgb; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
rgb[0] = 0; rgb[1] = 255; rgb[2] = 0;
rgb[0] = ChannelBindings.COLOR_MIN; rgb[1] = ChannelBindings.COLOR_MAX; rgb[2] = ChannelBindings.COLOR_MIN;
private int[] setDefaultColor(int w) { int[] rgb = new int[3]; if (w == 0) { //blue rgb[0] = 0; rgb[1] = 0; rgb[2] = 255; } else if (w == 1) { //green rgb[0] = 0; rgb[1] = 255; rgb[2] = 0; } else { //red rgb[0] = 255; rgb[1] = 0; rgb[2] = 0; } return rgb; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
rgb[0] = 255; rgb[1] = 0; rgb[2] = 0;
rgb[0] = ChannelBindings.COLOR_MAX; rgb[1] = ChannelBindings.COLOR_MIN; rgb[2] = ChannelBindings.COLOR_MIN;
private int[] setDefaultColor(int w) { int[] rgb = new int[3]; if (w == 0) { //blue rgb[0] = 0; rgb[1] = 0; rgb[2] = 255; } else if (w == 1) { //green rgb[0] = 0; rgb[1] = 255; rgb[2] = 0; } else { //red rgb[0] = 255; rgb[1] = 0; rgb[2] = 0; } return rgb; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
for (i = 0; i < size; i++) availablePacks.add(objIn.readObject());
ArrayList allPacks = new ArrayList(); for (i = 0; i < size; i++) { Pack pk = (Pack) objIn.readObject(); allPacks.add(pk); if (null == pk.os || os.toLowerCase().indexOf(pk.os.toLowerCase()) > -1) availablePacks.add(pk); }
private void loadInstallData() throws Exception { // Usefull variables InputStream in; DataInputStream datIn; ObjectInputStream objIn; int size; int i; // We load the variables Properties variables = null; in = getClass().getResourceAsStream("/vars"); if (null != in) { objIn = new ObjectInputStream(in); variables = (Properties) objIn.readObject(); objIn.close(); } // We load the Info data in = getClass().getResourceAsStream("/info"); objIn = new ObjectInputStream(in); Info inf = (Info) objIn.readObject(); objIn.close(); // We load the GUIPrefs in = getClass().getResourceAsStream("/GUIPrefs"); objIn = new ObjectInputStream(in); GUIPrefs guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); // We read the panels order data in = getClass().getResourceAsStream("/panelsOrder"); datIn = new DataInputStream(in); size = datIn.readInt(); ArrayList panelsOrder = new ArrayList(); for (i = 0; i < size; i++) panelsOrder.add(datIn.readUTF()); datIn.close(); // We read the packs data in = getClass().getResourceAsStream("/packs.info"); objIn = new ObjectInputStream(in); size = objIn.readInt(); ArrayList availablePacks = new ArrayList(); for (i = 0; i < size; i++) availablePacks.add(objIn.readObject()); objIn.close(); // We determine the operating system and the initial installation path String os = System.getProperty("os.name"); String user = System.getProperty("user.name"); String dir; String installPath; if (os.regionMatches(true, 0, "windows", 0, 7)) dir = System.getProperty("user.home").substring(0, 3) + "Program Files" + File.separator; else if (os.regionMatches(true, 0, "mac os x", 0, 6)) dir = "/Applications" + File.separator; else if (os.regionMatches(true, 0, "mac", 0, 3)) dir = ""; else if (user.equals("root")) dir = "/usr/local" + File.separator; else dir = System.getProperty("user.home") + File.separator; installPath = dir + inf.getAppName(); // We read the installation kind in = getClass().getResourceAsStream("/kind"); datIn = new DataInputStream(in); String kind = datIn.readUTF(); datIn.close(); // We build a new InstallData installdata = InstallData.getInstance(); installdata.setInstallPath(installPath); installdata.setVariable (ScriptParser.JAVA_HOME, System.getProperty("java.home")); installdata.setVariable (ScriptParser.USER_HOME, System.getProperty("user.home")); installdata.setVariable (ScriptParser.USER_NAME, System.getProperty("user.name")); installdata.setVariable (ScriptParser.FILE_SEPARATOR, File.separator); if (null != variables) { Enumeration enum = variables.keys(); String varName = null; String varValue = null; while (enum.hasMoreElements()) { varName = (String) enum.nextElement(); varValue = (String) variables.getProperty(varName); installdata.setVariable(varName, varValue); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c3234416ca8408295e1d45c60daee2efe9c3f5db/Installer.java/buggy/src/lib/com/izforge/izpack/installer/Installer.java
String os = System.getProperty("os.name");
private void loadInstallData() throws Exception { // Usefull variables InputStream in; DataInputStream datIn; ObjectInputStream objIn; int size; int i; // We load the variables Properties variables = null; in = getClass().getResourceAsStream("/vars"); if (null != in) { objIn = new ObjectInputStream(in); variables = (Properties) objIn.readObject(); objIn.close(); } // We load the Info data in = getClass().getResourceAsStream("/info"); objIn = new ObjectInputStream(in); Info inf = (Info) objIn.readObject(); objIn.close(); // We load the GUIPrefs in = getClass().getResourceAsStream("/GUIPrefs"); objIn = new ObjectInputStream(in); GUIPrefs guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); // We read the panels order data in = getClass().getResourceAsStream("/panelsOrder"); datIn = new DataInputStream(in); size = datIn.readInt(); ArrayList panelsOrder = new ArrayList(); for (i = 0; i < size; i++) panelsOrder.add(datIn.readUTF()); datIn.close(); // We read the packs data in = getClass().getResourceAsStream("/packs.info"); objIn = new ObjectInputStream(in); size = objIn.readInt(); ArrayList availablePacks = new ArrayList(); for (i = 0; i < size; i++) availablePacks.add(objIn.readObject()); objIn.close(); // We determine the operating system and the initial installation path String os = System.getProperty("os.name"); String user = System.getProperty("user.name"); String dir; String installPath; if (os.regionMatches(true, 0, "windows", 0, 7)) dir = System.getProperty("user.home").substring(0, 3) + "Program Files" + File.separator; else if (os.regionMatches(true, 0, "mac os x", 0, 6)) dir = "/Applications" + File.separator; else if (os.regionMatches(true, 0, "mac", 0, 3)) dir = ""; else if (user.equals("root")) dir = "/usr/local" + File.separator; else dir = System.getProperty("user.home") + File.separator; installPath = dir + inf.getAppName(); // We read the installation kind in = getClass().getResourceAsStream("/kind"); datIn = new DataInputStream(in); String kind = datIn.readUTF(); datIn.close(); // We build a new InstallData installdata = InstallData.getInstance(); installdata.setInstallPath(installPath); installdata.setVariable (ScriptParser.JAVA_HOME, System.getProperty("java.home")); installdata.setVariable (ScriptParser.USER_HOME, System.getProperty("user.home")); installdata.setVariable (ScriptParser.USER_NAME, System.getProperty("user.name")); installdata.setVariable (ScriptParser.FILE_SEPARATOR, File.separator); if (null != variables) { Enumeration enum = variables.keys(); String varName = null; String varValue = null; while (enum.hasMoreElements()) { varName = (String) enum.nextElement(); varValue = (String) variables.getProperty(varName); installdata.setVariable(varName, varValue); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c3234416ca8408295e1d45c60daee2efe9c3f5db/Installer.java/buggy/src/lib/com/izforge/izpack/installer/Installer.java
textArea.setText(info.toString());
textArea.setText(info);
public void panelActivate() { // Text handling loadInfo(); parseText(); // UI handling textArea.setText(info.toString()); textArea.setCaretPosition(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/XInfoPanel.java/clean/src/lib/com/izforge/izpack/panels/XInfoPanel.java
case TYPE_AT:
protected String escapeSpecialChars(String str, int type) { StringBuffer buffer; int len; int i; switch (type) { case TYPE_PLAIN: case TYPE_SHELL: return str; case TYPE_JAVA_PROPERTIES: buffer = new StringBuffer(str); len = str.length(); for (i = 0; i < len; i++) { // Check for control characters char c = buffer.charAt(i); if (c == '\t' || c == '\n' || c == '\r') { char tag; if (c == '\t') tag = 't'; else if (c == '\n') tag = 'n'; else tag = 'r'; buffer.replace(i, i + 1, "\\" + tag); len++; i++; } // Check for special characters if (c == '\\' || c == '"' || c == '\'' || c == ' ') { buffer.insert(i, '\\'); len++; i++; } } return buffer.toString(); case TYPE_XML: buffer = new StringBuffer(str); len = str.length(); for (i = 0; i < len; i++) { String r = null; char c = buffer.charAt(i); switch (c) { case '<': r = "&lt;"; break; case '>': r = "&gt;"; break; case '&': r = "&amp;"; break; case '\'': r = "&apos;"; break; case '"': r = "&quot;"; break; } if (r != null) { buffer.replace(i, i + 1, r); len = buffer.length(); i += r.length() - 1; } } return buffer.toString(); default: throw new Error ("Unknown file type constant " + type); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/23a2028deb19509c4385e365eef9660c7315a6fe/VariableSubstitutor.java/buggy/src/lib/com/izforge/izpack/installer/VariableSubstitutor.java
idata.getVariableValueMap ().setVariable (variable, trueValue);
idata.setVariable (variable, trueValue);
private boolean readCheckBox (Object [] field) { String variable = null; String trueValue = null; String falseValue = null; JCheckBox box = null; try { box = (JCheckBox)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; trueValue = (String)field [POS_TRUE]; if (trueValue == null) { trueValue = ""; } falseValue = (String)field [POS_FALSE]; if (falseValue == null) { falseValue = ""; } } catch (Throwable exception) { return (true); } if (box.isSelected ()) { idata.getVariableValueMap ().setVariable (variable, trueValue); entries.add (new TextValuePair (variable, trueValue)); } else { idata.getVariableValueMap ().setVariable (variable, falseValue); entries.add (new TextValuePair (variable, falseValue)); } return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
idata.getVariableValueMap ().setVariable (variable, falseValue);
idata.setVariable(variable, falseValue);
private boolean readCheckBox (Object [] field) { String variable = null; String trueValue = null; String falseValue = null; JCheckBox box = null; try { box = (JCheckBox)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; trueValue = (String)field [POS_TRUE]; if (trueValue == null) { trueValue = ""; } falseValue = (String)field [POS_FALSE]; if (falseValue == null) { falseValue = ""; } } catch (Throwable exception) { return (true); } if (box.isSelected ()) { idata.getVariableValueMap ().setVariable (variable, trueValue); entries.add (new TextValuePair (variable, trueValue)); } else { idata.getVariableValueMap ().setVariable (variable, falseValue); entries.add (new TextValuePair (variable, falseValue)); } return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
idata.getVariableValueMap ().setVariable (variable, value);
idata.setVariable(variable, value);
private boolean readComboBox (Object [] field) { String variable = null; String value = null; JComboBox comboBox = null; try { variable = (String)field [POS_VARIABLE]; comboBox = (JComboBox)field [POS_FIELD]; value = ((TextValuePair)comboBox.getSelectedItem ()).getValue (); } catch (Throwable exception) { return (true); } if ((variable == null) || (value == null)) { return (true); } idata.getVariableValueMap ().setVariable (variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
idata.getVariableValueMap ().setVariable (variable, group.getPassword ());
idata.setVariable(variable, group.getPassword ());
private boolean readPasswordField (Object [] field) { PasswordGroup group = null; String variable = null; String message = null; try { group = (PasswordGroup)field [POS_GROUP]; variable = (String)field [POS_VARIABLE]; message = (String)field [POS_MESSAGE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (passwordGroupsRead.contains (group))) { return (true); } passwordGroups.add (group); boolean success = group.validateContents (); if (!success) { JOptionPane.showMessageDialog (parent, message, parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.getVariableValueMap ().setVariable (variable, group.getPassword ()); entries.add (new TextValuePair (variable, group.getPassword ())); return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
idata.getVariableValueMap ().setVariable (variable, value);
idata.setVariable (variable, value);
private boolean readRadioButton (Object [] field) { String variable = null; String value = null; JRadioButton button = null; try { button = (JRadioButton)field [POS_FIELD]; if (!button.isSelected ()) { return (true); } variable = (String)field [POS_VARIABLE]; value = (String)field [POS_TRUE]; } catch (Throwable exception) { return (true); } idata.getVariableValueMap ().setVariable (variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
idata.getVariableValueMap ().setVariable (variable, ruleField.getText ());
idata.setVariable (variable, ruleField.getText ());
private boolean readRuleField (Object [] field) { RuleInputField ruleField = null; String variable = null; try { ruleField = (RuleInputField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; } catch (Throwable exception) { return (true); } if ((variable == null) || (ruleField == null)) { return (true); } boolean success = ruleField.validateContents (); if (!success) { JOptionPane.showMessageDialog (parent, (String)field [POS_MESSAGE], parent.langpack.getString ("UserInputPanel.error.caption"), JOptionPane.WARNING_MESSAGE); return (false); } idata.getVariableValueMap ().setVariable (variable, ruleField.getText ()); entries.add (new TextValuePair (variable, ruleField.getText ())); return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
idata.getVariableValueMap ().setVariable (variable, value);
idata.setVariable(variable, value);
private boolean readSearch (Object [] field) { String variable = null; String value = null; JComboBox comboBox = null; try { variable = (String)field [POS_VARIABLE]; comboBox = (JComboBox)field [POS_FIELD]; for (int i = 0; i < this.searchFields.size(); ++i) { SearchField sf = (SearchField)this.searchFields.elementAt (i); if (sf.belongsTo (comboBox)) { value = sf.getResult (); break; } } } catch (Throwable exception) { return (true); } if ((variable == null) || (value == null)) { return (true); } idata.getVariableValueMap ().setVariable (variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
idata.getVariableValueMap ().setVariable (variable, value);
idata.setVariable(variable, value);
private boolean readTextField (Object [] field) { JTextField textField = null; String variable = null; String value = null; try { textField = (JTextField)field [POS_FIELD]; variable = (String)field [POS_VARIABLE]; value = textField.getText (); } catch (Throwable exception) { return (true); } if ((variable == null) || (value == null)) { return (true); } idata.getVariableValueMap ().setVariable (variable, value); entries.add (new TextValuePair (variable, value)); return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/UserInputPanel.java/clean/src/lib/com/izforge/izpack/panels/UserInputPanel.java
else uninstaller[0].add( ul );
uninstaller[0].add( ul );
private List [] getListenerLists() throws Exception { ArrayList [] uninstaller = new ArrayList[] {new ArrayList(),new ArrayList()}; // Load listeners if exist InputStream in; ObjectInputStream objIn; in = getClass().getResourceAsStream("/uninstallerListeners"); if( in != null ) { objIn = new ObjectInputStream(in); List listeners = (List)objIn.readObject(); objIn.close(); Iterator iter = listeners.iterator(); while( iter != null && iter.hasNext()) { Class clazz = Class.forName(((String) iter.next())); UninstallerListener ul = (UninstallerListener) clazz.newInstance(); if( ul.isFileListener()) uninstaller[1].add( ul ); else uninstaller[0].add( ul ); } } return uninstaller; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/0a51150e3cd01a825af97d254087ae3b6dac6205/Destroyer.java/buggy/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
d.setVisible(true);
UIUtilities.centerAndShow(d);
public void removeEditor() { switch (model.getState()) { case DISCARDED: //case SAVE: throw new IllegalStateException("This method cannot be " + "invoked in the DISCARDED, SAVE state."); } Editor editor = model.getEditor(); if (editor != null) { if (editor.hasDataToSave()) { IconManager icons = IconManager.getInstance(); EditorSaverDialog d = new EditorSaverDialog(view, icons.getIcon(IconManager.QUESTION)); d.addPropertyChangeListener( EditorSaverDialog.SAVING_DATA_EDITOR_PROPERTY, controller); d.setVisible(true); return; } } model.setEditorType(NO_EDITOR); view.removeAllFromWorkingPane(); firePropertyChange(REMOVE_EDITOR_PROPERTY, Boolean.FALSE, Boolean.TRUE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bfed2063c1c7e290a2c934f62443f1300b6ed76b/TreeViewerComponent.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java
if (!url.getProtocol().equals("jar")) return null;
if (!"jar".equals(url.getProtocol())) return null;
public static File findJarFile(Class clazz) { String resource = clazz.getName().replace('.', '/') + ".class"; URL url = ClassLoader.getSystemResource(resource); if (!url.getProtocol().equals("jar")) return null; String path = url.getFile(); // starts at "file:..." (use getPath() as of 1.3) path = path.substring(0, path.lastIndexOf('!')); File file; // getSystemResource() returns a valid URL (eg. spaces are %20), but a // file // Constructed w/ it will expect "%20" in path. URI and File(URI) // properly // deal with escaping back and forth, but didn't exist until 1.4 if (JAVA_SPECIFICATION_VERSION < 1.4) file = new File(fromURI(path)); else file = new File(URI.create(path)); return file; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SelfModifier.java/clean/src/lib/com/izforge/izpack/uninstaller/SelfModifier.java
|| !params[0].getComponentType().getName().equals("java.lang.String"))
|| !"java.lang.String".equals(params[0].getComponentType().getName()))
private void initMethod(Method method) { int mod = method.getModifiers(); if ((mod & Modifier.PUBLIC) == 0 || (mod & Modifier.STATIC) == 0) throw new IllegalArgumentException("Method not public and static"); Class[] params = method.getParameterTypes(); if (params.length != 1 || !params[0].isArray() || !params[0].getComponentType().getName().equals("java.lang.String")) throw new IllegalArgumentException("Method must accept String array"); Class clazz = method.getDeclaringClass(); mod = clazz.getModifiers(); if ((mod & Modifier.PUBLIC) == 0 || (mod & Modifier.INTERFACE) != 0) throw new IllegalArgumentException("Method must be in a public class"); this.method = method; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SelfModifier.java/clean/src/lib/com/izforge/izpack/uninstaller/SelfModifier.java
if (!target.equalsIgnoreCase("xml"))
if (!"xml".equalsIgnoreCase(target))
protected void processPI() throws Exception { XMLUtil.skipWhitespace(this.reader, '&', null, null); String target = XMLUtil.scanIdentifier(this.reader, '&', this.entityResolver); XMLUtil.skipWhitespace(this.reader, '&', null, null); Reader reader = new ContentReader(this.reader, this.entityResolver, '&', StdXMLParser.END_OF_PI, true, ""); if (!target.equalsIgnoreCase("xml")) { this.builder.newProcessingInstruction(target, reader); } reader.close(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/StdXMLParser.java/clean/src/lib/net/n3/nanoxml/StdXMLParser.java
return;
protected void processSpecialTag(boolean allowCDATA) throws Exception { char ch = XMLUtil.read(this.reader, null, '&', this.entityResolver); switch (ch) { case '[': if (allowCDATA) { this.processCDATA(); } else { XMLUtil.skipTag(this.reader, '&', this.entityResolver); } return; case 'D': this.processDocType(); return; case '-': XMLUtil.skipComment(this.reader, this.entityResolver); return; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/StdXMLParser.java/clean/src/lib/net/n3/nanoxml/StdXMLParser.java
if( !(izPackDir.endsWith("/") ) ) izPackDir += "/";
public void setIzPackDir(String izPackDir) { this.izPackDir = izPackDir; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7dc3b59f3634d8eeb05612ed71392136dbb0f39d/IzPackTask.java/clean/src/lib/com/izforge/izpack/ant/IzPackTask.java
public ZipOutputStream addPack(int packNumber, String name, boolean required,
public ZipOutputStream addPack(int packNumber, String name, String targetOs, boolean required,
public ZipOutputStream addPack(int packNumber, String name, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); webJar.putNextEntry(entry); return webJar; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c3234416ca8408295e1d45c60daee2efe9c3f5db/WebPackager.java/buggy/src/lib/com/izforge/izpack/compiler/WebPackager.java
Pack pack = new Pack(name, description, required);
Pack pack = new Pack(name, description, targetOs, required);
public ZipOutputStream addPack(int packNumber, String name, boolean required, String description) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, required); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); webJar.putNextEntry(entry); return webJar; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c3234416ca8408295e1d45c60daee2efe9c3f5db/WebPackager.java/buggy/src/lib/com/izforge/izpack/compiler/WebPackager.java
log.debug("User successfully authorized.");
public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; final Assertion assertion = (Assertion) WebUtils.getRequiredSessionAttribute(request, AbstractCasFilter.CONST_ASSERTION); final Principal principal = assertion.getPrincipal(); final boolean authorized = this.decider .isAuthorizedToUseApplication(principal); if (!authorized) { response.setStatus(HttpServletResponse.SC_FORBIDDEN); throw new AuthorizationException(principal.getId() + " is not authorized to use this application."); } filterChain.doFilter(servletRequest, servletResponse); }
52448 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52448/44b8c865864662f073d1d0354ed13fe96341004e/AuthorizationFilter.java/buggy/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/AuthorizationFilter.java
if (config.evictInvalidFrequencyMillis > 0 && config.evictIdleMillis > config.evictInvalidFrequencyMillis) {
if (config.evictInvalidFrequencyMillis > 0 && config.evictIdleMillis < config.evictInvalidFrequencyMillis) {
private static Lender getLender(final FactoryConfig config) { final BorrowPolicy borrowPolicy = config.borrowPolicy; Lender lender; if (config.maxIdle != 0) { if (BorrowPolicy.FIFO.equals(borrowPolicy)) { lender = new FifoLender(); } else if (BorrowPolicy.LIFO.equals(borrowPolicy)) { lender = new LifoLender(); } else if (BorrowPolicy.SOFT_FIFO.equals(borrowPolicy)) { lender = new SoftLender(new FifoLender()); } else if (BorrowPolicy.SOFT_LIFO.equals(borrowPolicy)) { lender = new SoftLender(new LifoLender()); } else if (BorrowPolicy.NULL.equals(borrowPolicy)) { lender = new NullLender(); } else { throw new IllegalStateException("No clue what this borrow type is: " + borrowPolicy); } } else { lender = new NullLender(); } // If the lender is a NullLender then there is no point to evicting idle objects that aren't there. if (!(lender instanceof NullLender)) { // If the evictIdleMillis were less than evictInvalidFrequencyMillis // then the InvalidEvictorLender would never run. if (config.evictInvalidFrequencyMillis > 0 && config.evictIdleMillis > config.evictInvalidFrequencyMillis) { lender = new InvalidEvictorLender(lender); ((InvalidEvictorLender)lender).setValidationFrequencyMillis(config.evictInvalidFrequencyMillis); } if (config.evictIdleMillis > 0) { lender = new IdleEvictorLender(lender); ((IdleEvictorLender)lender).setIdleTimeoutMillis(config.evictIdleMillis); } } return lender; }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/7839ec6d3ef0aef3c516f62c5dd26f2f30a1ac28/CompositeObjectPoolFactory.java/clean/src/java/org/apache/commons/pool/composite/CompositeObjectPoolFactory.java
final Experimenter exp = localAdmin.lookupExperimenter(p.getName());
final Experimenter exp = localAdmin.userProxy(p.getName());
public void setCurrentDetails() { LocalAdmin localAdmin = (LocalAdmin) sf.getAdminService(); ITypes iTypes = sf.getTypesService(); IUpdate iUpdate = sf.getUpdateService(); clearCurrentDetails(); if (ec == null) throw new InternalException( "EventContext is null in EventContext. Invalid configuration."); if (ec.getPrincipal() == null) throw new InternalException( "Principal is null in EventContext. Security system failure."); if (ec.getPrincipal().getName() == null) throw new InternalException( "Principal.name is null in EventContext. Security system failure."); final Principal p = ec.getPrincipal(); // Experimenter final Experimenter exp = localAdmin.lookupExperimenter(p.getName()); exp.getGraphHolder().setToken(token, token); CurrentDetails.setOwner(exp); // Member of Groups List<Long> memberOfGroupsIds = exp .eachLinkedExperimenterGroup(new IdBlock()); CurrentDetails.setMemberOfGroups(memberOfGroupsIds); // Leader of Groups List<Long> leaderOfGroupsIds = localAdmin.getLeaderOfGroupIds(exp); CurrentDetails.setLeaderOfGroups(leaderOfGroupsIds); // Active group if (p.getGroup() == null) throw new InternalException( "Principal.group is null in EventContext. Security system failure."); ExperimenterGroup grp = localAdmin.groupProxy(p.getGroup()); grp.getGraphHolder().setToken(token, token); CurrentDetails.setGroup(grp); // isAdmin if (isSystemGroup(grp)) { CurrentDetails.setAdmin(true); } // Event if (p.getEventType() == null) throw new InternalException( "Principal.eventType is null in EventContext. Security system failure."); EventType type = iTypes.getEnumeration(EventType.class, p .getEventType()); type.getGraphHolder().setToken(token, token); CurrentDetails.newEvent(type, token); Event event = getCurrentEvent(); event.getGraphHolder().setToken(token, token); try { setCurrentEvent(iUpdate.saveAndReturnObject(event)); } catch (InvalidDataAccessApiUsageException ex) { // TODO check for read-only bef. exception log.warn("Attempt to save event in SecuritySystem failed. " + "Using unsaved.", ex); setCurrentEvent(event); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e17e319299999d5f384efd834d4873a29017e572/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
List<Long> memberOfGroupsIds = exp .eachLinkedExperimenterGroup(new IdBlock());
List<Long> memberOfGroupsIds = localAdmin.getMemberOfGroupIds(exp);
public void setCurrentDetails() { LocalAdmin localAdmin = (LocalAdmin) sf.getAdminService(); ITypes iTypes = sf.getTypesService(); IUpdate iUpdate = sf.getUpdateService(); clearCurrentDetails(); if (ec == null) throw new InternalException( "EventContext is null in EventContext. Invalid configuration."); if (ec.getPrincipal() == null) throw new InternalException( "Principal is null in EventContext. Security system failure."); if (ec.getPrincipal().getName() == null) throw new InternalException( "Principal.name is null in EventContext. Security system failure."); final Principal p = ec.getPrincipal(); // Experimenter final Experimenter exp = localAdmin.lookupExperimenter(p.getName()); exp.getGraphHolder().setToken(token, token); CurrentDetails.setOwner(exp); // Member of Groups List<Long> memberOfGroupsIds = exp .eachLinkedExperimenterGroup(new IdBlock()); CurrentDetails.setMemberOfGroups(memberOfGroupsIds); // Leader of Groups List<Long> leaderOfGroupsIds = localAdmin.getLeaderOfGroupIds(exp); CurrentDetails.setLeaderOfGroups(leaderOfGroupsIds); // Active group if (p.getGroup() == null) throw new InternalException( "Principal.group is null in EventContext. Security system failure."); ExperimenterGroup grp = localAdmin.groupProxy(p.getGroup()); grp.getGraphHolder().setToken(token, token); CurrentDetails.setGroup(grp); // isAdmin if (isSystemGroup(grp)) { CurrentDetails.setAdmin(true); } // Event if (p.getEventType() == null) throw new InternalException( "Principal.eventType is null in EventContext. Security system failure."); EventType type = iTypes.getEnumeration(EventType.class, p .getEventType()); type.getGraphHolder().setToken(token, token); CurrentDetails.newEvent(type, token); Event event = getCurrentEvent(); event.getGraphHolder().setToken(token, token); try { setCurrentEvent(iUpdate.saveAndReturnObject(event)); } catch (InvalidDataAccessApiUsageException ex) { // TODO check for read-only bef. exception log.warn("Attempt to save event in SecuritySystem failed. " + "Using unsaved.", ex); setCurrentEvent(event); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e17e319299999d5f384efd834d4873a29017e572/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
public ShellLink (int type, String name) throws Exception, IllegalArgumentException { if ((type < MIN_TYPE) || (type > MAX_TYPE) ) { throw (new IllegalArgumentException ("the type parameter used an illegal value")); } if (name == null) { throw (new IllegalArgumentException ("the name parameter was null")); } linkName = name; linkType = type; initialize (); if (GetLinkPath (linkType) != SL_OK) { throw (new Exception ("could not get a path for this type of link")); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShellLink.java/clean/src/lib/com/izforge/izpack/util/os/ShellLink.java
if (GetLinkPath (linkType) != SL_OK)
int result = GetLinkPath (linkType); if (result != SL_OK)
private void get () throws Exception { if (GetArguments () != SL_OK) { throw (new Exception ("could not get arguments")); } if (GetDescription () != SL_OK) { throw (new Exception ("could not get description")); } if (GetHotkey () != SL_OK) { throw (new Exception ("could not get hotkey")); } if (GetIconLocation () != SL_OK) { throw (new Exception ("could not get icon location")); } if (GetLinkPath (linkType) != SL_OK) { throw (new Exception ("could not get link path")); } if (GetPath () != SL_OK) { throw (new Exception ("could not get target path")); } if (GetShowCommand () != SL_OK) { throw (new Exception ("could not get show command")); } if (GetWorkingDirectory () != SL_OK) { throw (new Exception ("could not get working directory")); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShellLink.java/clean/src/lib/com/izforge/izpack/util/os/ShellLink.java
throw (new Exception ("could not get link path"));
if (result == SL_WRONG_DATA_TYPE) { throw (new Exception ("could not get link path, registry returned unexpected data type")); } else { throw (new Exception ("could not get link path")); }
private void get () throws Exception { if (GetArguments () != SL_OK) { throw (new Exception ("could not get arguments")); } if (GetDescription () != SL_OK) { throw (new Exception ("could not get description")); } if (GetHotkey () != SL_OK) { throw (new Exception ("could not get hotkey")); } if (GetIconLocation () != SL_OK) { throw (new Exception ("could not get icon location")); } if (GetLinkPath (linkType) != SL_OK) { throw (new Exception ("could not get link path")); } if (GetPath () != SL_OK) { throw (new Exception ("could not get target path")); } if (GetShowCommand () != SL_OK) { throw (new Exception ("could not get show command")); } if (GetWorkingDirectory () != SL_OK) { throw (new Exception ("could not get working directory")); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShellLink.java/clean/src/lib/com/izforge/izpack/util/os/ShellLink.java
private void get () throws Exception { if (GetArguments () != SL_OK) { throw (new Exception ("could not get arguments")); } if (GetDescription () != SL_OK) { throw (new Exception ("could not get description")); } if (GetHotkey () != SL_OK) { throw (new Exception ("could not get hotkey")); } if (GetIconLocation () != SL_OK) { throw (new Exception ("could not get icon location")); } if (GetLinkPath (linkType) != SL_OK) { throw (new Exception ("could not get link path")); } if (GetPath () != SL_OK) { throw (new Exception ("could not get target path")); } if (GetShowCommand () != SL_OK) { throw (new Exception ("could not get show command")); } if (GetWorkingDirectory () != SL_OK) { throw (new Exception ("could not get working directory")); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShellLink.java/clean/src/lib/com/izforge/izpack/util/os/ShellLink.java
linkDirectory = null;
linkDirectory = "";
public void save () throws Exception { // set all values on the native side set (); // make sure the target actually resolves int result = Resolve (); if (result != SL_OK) { throw (new Exception ("cannot resolve target")); } // make sure the directory exists File directory = new File (fullLinkPath (userType)); if (!directory.exists ()) { directory.mkdirs (); linkDirectory = directory.getPath (); } else { linkDirectory = null; } // perform the save operation String saveTo = fullLinkName (userType); result = saveLink (saveTo); if (result == SL_NO_IPERSIST) { throw (new Exception ("could not get handle for IPesist")); } else if (result == SL_NO_SAVE) { throw (new Exception ("the save operation failed")); } linkFileName = saveTo; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShellLink.java/clean/src/lib/com/izforge/izpack/util/os/ShellLink.java
result = saveLink (saveTo);
result = saveLink (saveTo);
public void save () throws Exception { // set all values on the native side set (); // make sure the target actually resolves int result = Resolve (); if (result != SL_OK) { throw (new Exception ("cannot resolve target")); } // make sure the directory exists File directory = new File (fullLinkPath (userType)); if (!directory.exists ()) { directory.mkdirs (); linkDirectory = directory.getPath (); } else { linkDirectory = null; } // perform the save operation String saveTo = fullLinkName (userType); result = saveLink (saveTo); if (result == SL_NO_IPERSIST) { throw (new Exception ("could not get handle for IPesist")); } else if (result == SL_NO_SAVE) { throw (new Exception ("the save operation failed")); } linkFileName = saveTo; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShellLink.java/clean/src/lib/com/izforge/izpack/util/os/ShellLink.java
installButton.setIcon(parent.icons.getImageIcon("empty"));
public void stopUnpack() { parent.releaseGUI(); parent.lockPrevButton(); parent.unlockNextButton(); installButton.setEnabled(false); progressBar.setString(parent.langpack.getString("InstallPanel.finished")); progressBar.setEnabled(false); opLabel.setText(""); opLabel.setEnabled(false); idata.installSuccess = true; idata.canClose = true; validated = true; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/24ab501f4d8488467fd8b63b1057fcc96217b3bf/InstallPanel.java/buggy/src/lib/com/izforge/izpack/panels/InstallPanel.java
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d2cee8f5165671d318a97cc2eed7768c8b3c691c/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d2cee8f5165671d318a97cc2eed7768c8b3c691c/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d2cee8f5165671d318a97cc2eed7768c8b3c691c/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String sysos = System.getProperty("os.name"); String syskey = "unix"; if (sysos.regionMatches(true, 0, "windows", 0, 7)) { syskey = "windows"; } else if (sysos.regionMatches(true, 0, "mac", 0, 3)) { syskey = "mac"; } String laf = null; if (installdata.guiPrefs.lookAndFeelMapping.containsKey(syskey)) { laf = (String) installdata.guiPrefs.lookAndFeelMapping.get(syskey); } // Let's use the system LAF // Resolve whether button icons should be used or not. boolean useButtonIcons = true; if(installdata.guiPrefs.modifier.containsKey("useButtonIcons") && ((String)installdata.guiPrefs.modifier. get("useButtonIcons")).equalsIgnoreCase("no") ) useButtonIcons = false; ButtonFactory.useButtonIcons(useButtonIcons); boolean useLabelIcons = true; if(installdata.guiPrefs.modifier.containsKey("useLabelIcons") && ((String)installdata.guiPrefs.modifier. get("useLabelIcons")).equalsIgnoreCase("no") ) useLabelIcons = false; LabelFactory.setUseLabelIcons(useLabelIcons); if (laf == null) { if (!syskey.equals("mac")) { String syslaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(syslaf); if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(182, 182, 204); } } lnf = "swing"; return; } // Kunststoff (http://www.incors.org/) if (laf.equals("kunststoff")) { ButtonFactory.useHighlightButtons(); // Reset the use button icons state because useHighlightButtons // make it always true. ButtonFactory.useButtonIcons(useButtonIcons); installdata.buttonsHColor = new Color(255, 255, 255); Class lafClass = Class .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel"); Class mtheme = Class.forName("javax.swing.plaf.metal.MetalTheme"); Class[] params = { mtheme}; Class theme = Class.forName("com.izforge.izpack.gui.IzPackKMetalTheme"); Method setCurrentThemeMethod = lafClass.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) lafClass.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = { ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; return; } // Liquid (http://liquidlnf.sourceforge.net/) if (laf.equals("liquid")) { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); lnf = "liquid"; Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("decorate.frames")) { String value = (String)params.get("decorate.frames"); if (value.equals("yes")) { JFrame.setDefaultLookAndFeelDecorated(true); } } if (params.containsKey("decorate.dialogs")) { String value = (String)params.get("decorate.dialogs"); if (value.equals("yes")) { JDialog.setDefaultLookAndFeelDecorated(true); } } return; } // Metouia (http://mlf.sourceforge.net/) if (laf.equals("metouia")) { UIManager.setLookAndFeel("net.sourceforge.mlf.metouia.MetouiaLookAndFeel"); lnf = "metouia"; return; } // JGoodies Looks (http://looks.dev.java.net/) if (laf.equals("looks")) { Map variants = new TreeMap(); variants.put("extwin", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel "); variants.put("plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel"); variants.put("plastic3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel"); variants.put("plasticXP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); String variant = (String)variants.get("plasticXP"); Map params = (Map)installdata.guiPrefs.lookAndFeelParams.get(laf); if (params.containsKey("variant")) { String param = (String)params.get("variant"); if (variants.containsKey(param)) { variant = (String)variants.get(param); } } UIManager.setLookAndFeel(variant); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d2cee8f5165671d318a97cc2eed7768c8b3c691c/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java