rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
flush(); clear();
public void test_experimenters_groups() throws Exception { Experimenter e = new Experimenter(); ExperimenterGroup g_1 = new ExperimenterGroup(); ExperimenterGroup g_2 = new ExperimenterGroup(); e.setOmeName("j.b."+System.currentTimeMillis()); e.setFirstName(" Joe "); e.setLastName(" Brown "); g_1.setName( "DEFAULT: "+System.currentTimeMillis()); g_2.setName( "NOTDEFAULT: "+System.currentTimeMillis()); GroupExperimenterMap m_1 = new GroupExperimenterMap(); m_1.setDefaultGroupLink( true ); m_1.link( g_1, e ); GroupExperimenterMap defaultLink = (GroupExperimenterMap) iUpdate.saveAndReturnObject( m_1 ); GroupExperimenterMap m_2 = new GroupExperimenterMap(); m_2.setDefaultGroupLink( false ); m_2.link( g_2, defaultLink.child() ); // Need the new exp.id here. GroupExperimenterMap notDefaultLink = (GroupExperimenterMap) iUpdate.saveAndReturnObject( m_2 ); flush(); clear(); Experimenter test = (Experimenter) iQuery.findByQuery( " select e from Experimenter e join fetch e.defaultGroupLink " + " where e.id = :id ", new Parameters().addId(defaultLink.child().getId())); assertNotNull(test.getDefaultGroupLink()); assertTrue(test.getDefaultGroupLink().parent().getName().startsWith("DEFAULT")); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1fa4aa1df076354d9e858cfea9c54d59ae47d22a/UpdateTest.java/buggy/components/server/test/ome/server/itests/update/UpdateTest.java
temp = temp + password [i - 1];
temp += password[i - 1];
public String process (ProcessingClient client) { if (client.getNumFields () < 1) { return (""); } char [] password = client.getFieldContents (0).toCharArray (); char [] result = new char [password.length]; int temp; for (int i = 0; i < password.length; i++) { temp = password [i] - 57; if (i > 0) { temp = temp + password [i - 1]; } if ((temp % 3) == 0) { temp = temp + 13; } if (temp < 0) { temp = temp + 193; } result [i] = (char)temp; } return (new String (result)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PWDEncryptor.java/buggy/src/lib/com/izforge/izpack/sample/PWDEncryptor.java
temp = temp + 13;
temp += 13;
public String process (ProcessingClient client) { if (client.getNumFields () < 1) { return (""); } char [] password = client.getFieldContents (0).toCharArray (); char [] result = new char [password.length]; int temp; for (int i = 0; i < password.length; i++) { temp = password [i] - 57; if (i > 0) { temp = temp + password [i - 1]; } if ((temp % 3) == 0) { temp = temp + 13; } if (temp < 0) { temp = temp + 193; } result [i] = (char)temp; } return (new String (result)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PWDEncryptor.java/buggy/src/lib/com/izforge/izpack/sample/PWDEncryptor.java
temp = temp + 193;
temp += 193;
public String process (ProcessingClient client) { if (client.getNumFields () < 1) { return (""); } char [] password = client.getFieldContents (0).toCharArray (); char [] result = new char [password.length]; int temp; for (int i = 0; i < password.length; i++) { temp = password [i] - 57; if (i > 0) { temp = temp + password [i - 1]; } if ((temp % 3) == 0) { temp = temp + 13; } if (temp < 0) { temp = temp + 193; } result [i] = (char)temp; } return (new String (result)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PWDEncryptor.java/buggy/src/lib/com/izforge/izpack/sample/PWDEncryptor.java
result.createForAll = new Boolean(createForAll.booleanValue());
result.createForAll = Boolean.valueOf(createForAll.booleanValue());
public Object clone() throws OutOfMemoryError { ShortcutData result = new ShortcutData(); result.type = type; result.userType = userType; result.iconIndex = iconIndex; result.initialState = initialState; result.addToGroup = addToGroup; result.name = cloneString(name); result.description = cloneString(description); result.target = cloneString(target); result.commandLine = cloneString(commandLine); result.subgroup = cloneString(subgroup); result.iconFile = cloneString(iconFile); result.workingDirectory = cloneString(workingDirectory); result.deskTopEntryLinux_MimeType = cloneString(deskTopEntryLinux_MimeType); result.deskTopEntryLinux_Terminal = cloneString(deskTopEntryLinux_Terminal); result.deskTopEntryLinux_TerminalOptions = cloneString(deskTopEntryLinux_TerminalOptions); result.deskTopEntryLinux_Type = cloneString(deskTopEntryLinux_Type); result.deskTopEntryLinux_URL = cloneString(deskTopEntryLinux_URL); result.deskTopEntryLinux_Encoding = cloneString(deskTopEntryLinux_Encoding); result.deskTopEntryLinux_X_KDE_SubstituteUID = cloneString(deskTopEntryLinux_X_KDE_SubstituteUID); result.createForAll = new Boolean(createForAll.booleanValue()); return (result); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/ShortcutData.java/clean/src/lib/com/izforge/izpack/panels/ShortcutData.java
return (new String(original));
return (original);
private String cloneString(String original) { if (original == null) { return (""); } else { return (new String(original)); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/ShortcutData.java/clean/src/lib/com/izforge/izpack/panels/ShortcutData.java
}
}
public Compiler(String filename, String basedir, String kind, String output) { // Default initialisation this.filename = filename; this.basedir = basedir; this.kind = kind; this.output = output; // Creates a temporary temp file for keeping empty directories try { keepDirFile = File.createTempFile("izpack-keepme", ".tmp"); keepDirFile.deleteOnExit(); } catch (Exception err) { err.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
String[] files = ds.getIncludedFiles();
String[] files = ds.getIncludedFiles();
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
File file = new File(absolutPath + File.separator + (String) files[i]);
File file = new File(absolutPath + File.separator + files[i]);
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code String newRelativePath = null; String absolutBasePath = test.getParentFile().getAbsolutePath(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParentFile().getAbsolutePath(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } */ // New working code (for files) String filePath, instPath, expPath; int pathLimit; File file; for (int i = 0; i < files.length; ++i) { filePath = path + File.separator + files[i]; expPath = relPath + File.separator + files[i]; file = new File(filePath); pathLimit = expPath.indexOf(file.getName()); if (pathLimit > 0) instPath = expPath.substring(0, pathLimit); else instPath = relPath; addFile(file, instPath, targetOs, true, list); } // Empty directories are left by the previous code section, so we need to // take care of them for (int i = 0; i < dirs.length; ++i) { expPath = path + File.separator + dirs[i]; File dir = new File(expPath); if (dir.list().length == 0) { instPath = relPath + File.separator + dirs[i]; pathLimit = instPath.indexOf(dir.getName()); instPath = instPath.substring(0, pathLimit); addFile(dir, instPath, targetOs, true, list); } } } else throw new Exception("\"dir\" attribute of fileset is not valid: " + path); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
int size;
public void executeCompiler() throws Exception { // Usefull variables int size; int i; String str; InputStream inStream; // We get the XML data tree XMLElement data = getXMLTree(); // We get the Packager Packager packager = getPackager(); // We add the variable declaration packager.setVariables(getVariables(data)); // We add the info packager.setInfo(getInfo(data)); // We add the GUIPrefs packager.setGUIPrefs(getGUIPrefs(data)); // We add the language packs ArrayList langpacks = getLangpacksCodes(data); Iterator iter = langpacks.iterator(); while (iter.hasNext()) { str = (String) iter.next(); // The language pack inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "installer" + File.separator + str + ".xml"); packager.addLangPack(str, inStream); // The flag inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "flags" + File.separator + str + ".gif"); packager.addResource("flag." + str, inStream); } // We add the resources ArrayList resources = getResources(data); iter = resources.iterator(); while (iter.hasNext()) { Resource res = (Resource) iter.next(); if (res.parse) { if (null != varMap) { File resFile = new File(res.src); FileInputStream inFile = new FileInputStream(resFile); BufferedInputStream bin = new BufferedInputStream(inFile, 5120); File parsedFile = File.createTempFile("izpp", null, resFile.getParentFile()); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream bout = new BufferedOutputStream(outFile, 5120); VariableSubstitutor vs = new VariableSubstitutor(varMap); vs.substitute(bin, bout, res.type, res.encoding); bin.close(); bout.close(); inFile = new FileInputStream(parsedFile); packager.addResource(res.id, inFile); inFile.close(); parsedFile.delete(); } else { System.err.println("ERROR: no variable is defined. " + res.src + " is not parsed."); inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } else { inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } // We add the native libraries ArrayList natives = getNativeLibraries(data); iter = natives.iterator(); while (iter.hasNext()) { NativeLibrary nat = (NativeLibrary) iter.next(); inStream = new FileInputStream(nat.path); packager.addNativeLibrary(nat.name, inStream); } // We add the additionnal jar files content ArrayList jars = getJars(data); iter = jars.iterator(); while (iter.hasNext()) packager.addJarContent((String) iter.next()); // We add the panels ArrayList panels = getPanels(data); ArrayList panelsOrder = new ArrayList(panels.size()); TreeSet panelsCache = new TreeSet(); iter = panels.iterator(); while (iter.hasNext()) { // We locate the panel classes directory str = (String) iter.next(); File dir = new File(Compiler.IZPACK_HOME + "bin" + File.separator + "panels" + File.separator + str); if (!dir.exists()) throw new Exception(str + " panel does not exist"); // We add the panel in the order array panelsOrder.add(str); // We add each file in the panel folder if (panelsCache.contains(str)) continue; panelsCache.add(str); File[] files = dir.listFiles(); int nf = files.length; for (int j = 0; j < nf; j++) { if (files[j].isDirectory()) continue; FileInputStream inClass = new FileInputStream(files[j]); packager.addPanelClass(files[j].getName(), inClass); } } // We set the panels order packager.setPanelsOrder(panelsOrder); // We add the packs i = 0; ArrayList packs = getPacks(data); iter = packs.iterator(); while (iter.hasNext()) { Pack pack = (Pack) iter.next(); ZipOutputStream zipOut = packager.addPack(i++, pack.name, pack.required, pack.description); ObjectOutputStream objOut = new ObjectOutputStream(zipOut); // We write the pack data objOut.writeInt(pack.packFiles.size()); Iterator iter2 = pack.packFiles.iterator(); long packageBytes = 0; while (iter2.hasNext()) { // Initialisations PackSource p = (PackSource) iter2.next(); File f = new File(p.src); FileInputStream in = new FileInputStream(f); long nbytes = f.length(); String targetFilename = p.targetdir + "/" + f.getName(); // Writing objOut.writeObject(new PackFile(targetFilename, p.os, nbytes, p.override)); byte[] buffer = new byte[5120]; long bytesWritten = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { objOut.write(buffer, 0, bytesInBuffer); bytesWritten += bytesInBuffer; } if (bytesWritten != nbytes) throw new IOException ("File size mismatch when reading " + f); packageBytes += bytesWritten; in.close(); } packager.packAdded(i - 1, packageBytes); // Write out information about parsable files objOut.writeInt(pack.parsables.size()); iter2 = pack.parsables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Write out information about executable files objOut.writeInt(pack.executables.size()); iter2 = pack.executables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Cleanup objOut.flush(); zipOut.closeEntry(); } // We ask the packager to finish packager.finish(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
}
public void executeCompiler() throws Exception { // Usefull variables int size; int i; String str; InputStream inStream; // We get the XML data tree XMLElement data = getXMLTree(); // We get the Packager Packager packager = getPackager(); // We add the variable declaration packager.setVariables(getVariables(data)); // We add the info packager.setInfo(getInfo(data)); // We add the GUIPrefs packager.setGUIPrefs(getGUIPrefs(data)); // We add the language packs ArrayList langpacks = getLangpacksCodes(data); Iterator iter = langpacks.iterator(); while (iter.hasNext()) { str = (String) iter.next(); // The language pack inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "installer" + File.separator + str + ".xml"); packager.addLangPack(str, inStream); // The flag inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "flags" + File.separator + str + ".gif"); packager.addResource("flag." + str, inStream); } // We add the resources ArrayList resources = getResources(data); iter = resources.iterator(); while (iter.hasNext()) { Resource res = (Resource) iter.next(); if (res.parse) { if (null != varMap) { File resFile = new File(res.src); FileInputStream inFile = new FileInputStream(resFile); BufferedInputStream bin = new BufferedInputStream(inFile, 5120); File parsedFile = File.createTempFile("izpp", null, resFile.getParentFile()); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream bout = new BufferedOutputStream(outFile, 5120); VariableSubstitutor vs = new VariableSubstitutor(varMap); vs.substitute(bin, bout, res.type, res.encoding); bin.close(); bout.close(); inFile = new FileInputStream(parsedFile); packager.addResource(res.id, inFile); inFile.close(); parsedFile.delete(); } else { System.err.println("ERROR: no variable is defined. " + res.src + " is not parsed."); inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } else { inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } // We add the native libraries ArrayList natives = getNativeLibraries(data); iter = natives.iterator(); while (iter.hasNext()) { NativeLibrary nat = (NativeLibrary) iter.next(); inStream = new FileInputStream(nat.path); packager.addNativeLibrary(nat.name, inStream); } // We add the additionnal jar files content ArrayList jars = getJars(data); iter = jars.iterator(); while (iter.hasNext()) packager.addJarContent((String) iter.next()); // We add the panels ArrayList panels = getPanels(data); ArrayList panelsOrder = new ArrayList(panels.size()); TreeSet panelsCache = new TreeSet(); iter = panels.iterator(); while (iter.hasNext()) { // We locate the panel classes directory str = (String) iter.next(); File dir = new File(Compiler.IZPACK_HOME + "bin" + File.separator + "panels" + File.separator + str); if (!dir.exists()) throw new Exception(str + " panel does not exist"); // We add the panel in the order array panelsOrder.add(str); // We add each file in the panel folder if (panelsCache.contains(str)) continue; panelsCache.add(str); File[] files = dir.listFiles(); int nf = files.length; for (int j = 0; j < nf; j++) { if (files[j].isDirectory()) continue; FileInputStream inClass = new FileInputStream(files[j]); packager.addPanelClass(files[j].getName(), inClass); } } // We set the panels order packager.setPanelsOrder(panelsOrder); // We add the packs i = 0; ArrayList packs = getPacks(data); iter = packs.iterator(); while (iter.hasNext()) { Pack pack = (Pack) iter.next(); ZipOutputStream zipOut = packager.addPack(i++, pack.name, pack.required, pack.description); ObjectOutputStream objOut = new ObjectOutputStream(zipOut); // We write the pack data objOut.writeInt(pack.packFiles.size()); Iterator iter2 = pack.packFiles.iterator(); long packageBytes = 0; while (iter2.hasNext()) { // Initialisations PackSource p = (PackSource) iter2.next(); File f = new File(p.src); FileInputStream in = new FileInputStream(f); long nbytes = f.length(); String targetFilename = p.targetdir + "/" + f.getName(); // Writing objOut.writeObject(new PackFile(targetFilename, p.os, nbytes, p.override)); byte[] buffer = new byte[5120]; long bytesWritten = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { objOut.write(buffer, 0, bytesInBuffer); bytesWritten += bytesInBuffer; } if (bytesWritten != nbytes) throw new IOException ("File size mismatch when reading " + f); packageBytes += bytesWritten; in.close(); } packager.packAdded(i - 1, packageBytes); // Write out information about parsable files objOut.writeInt(pack.parsables.size()); iter2 = pack.parsables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Write out information about executable files objOut.writeInt(pack.executables.size()); iter2 = pack.executables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Cleanup objOut.flush(); zipOut.closeEntry(); } // We ask the packager to finish packager.finish(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
Vector v;
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
ArrayList argList = null;
ArrayList argList = new ArrayList();
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
includes[j] = (String) xclude.getAttribute("name");
includes[j] = xclude.getAttribute("name");
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
excludes[j] = (String) xclude.getAttribute("name");
excludes[j] = xclude.getAttribute("name");
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
setExistFiles(JDKPathPanel.testFiles);
setExistFiles(JDKPathPanel.testFiles);
public JDKPathPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setMustExist(true); if(!OsVersion.IS_OSX) setExistFiles(JDKPathPanel.testFiles); setMinVersion(idata.getVariable("JDKPathPanel.minVersion")); setMaxVersion(idata.getVariable("JDKPathPanel.maxVersion")); setVariableName("JDKPath"); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/e9ecfce2fdf6943ab20fd038a190d1d3bfe2c415/JDKPathPanel.java/buggy/src/lib/com/izforge/izpack/panels/JDKPathPanel.java
int curVal; int neededVal;
int curVal = 0; int neededVal = 0;
private final boolean compareVersions(String in, String template, boolean isMin, int assumedPlace, int halfRange, String useNotIdentifier) { StringTokenizer st = new StringTokenizer(in, " \t\n\r\f\""); int i; int currentRange = 0; String[] interestedEntries = new String[halfRange + halfRange]; for (i = 0; i < assumedPlace - halfRange; ++i) if (st.hasMoreTokens()) st.nextToken(); // Forget this entries. for (i = 0; i < halfRange + halfRange; ++i) { // Put the interesting Strings into an intermediaer array. if (st.hasMoreTokens()) { interestedEntries[i] = st.nextToken(); currentRange++; } } for (i = 0; i < currentRange; ++i) { if (useNotIdentifier != null && interestedEntries[i].indexOf(useNotIdentifier) > -1) continue; if (Character.getType(interestedEntries[i].charAt(0)) != Character.DECIMAL_DIGIT_NUMBER) continue; break; } if (i == currentRange) { detectedVersion = "<not found>"; return (false); } detectedVersion = interestedEntries[i]; StringTokenizer current = new StringTokenizer(interestedEntries[i], "._-"); StringTokenizer needed = new StringTokenizer(template, "._-"); while (needed.hasMoreTokens()) { // Current can have no more tokens if needed has more // and if a privious token was not accepted as good version. // e.g. 1.4.2_02 needed, 1.4.2 current. The false return // will be right here. Only if e.g. needed is 1.4.2_00 the // return value will be false, but zero should not b e used // at the last version part. if (!current.hasMoreTokens()) return (false); String cur = current.nextToken(); String nee = needed.nextToken(); int curVal; int neededVal; try { curVal = Integer.parseInt(cur); neededVal = Integer.parseInt(nee); } catch (NumberFormatException nfe) { // A number format exception will be raised if // there is a non numeric part in the version, // e.g. 1.5.0_beta. The verification runs only into // this deep area of version number (fourth sub place) // if all other are equal to the given limit. Then // it is right to return false because e.g. // the minimal needed version will be 1.5.0.2. return (false); } if (curVal < neededVal) if (isMin) return (false); else return (true); if (Integer.parseInt(cur) > Integer.parseInt(nee)) if (isMin) return (true); else return (false); } return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/e9ecfce2fdf6943ab20fd038a190d1d3bfe2c415/JDKPathPanel.java/buggy/src/lib/com/izforge/izpack/panels/JDKPathPanel.java
public void test_using_ServiceFactory() throws Exception { ServiceFactory basicSF = new ServiceFactory(); ServiceFactory loginSF = new ServiceFactory( new Login( "bar", "ome" )); Properties p = new Properties(); p.setProperty( Login.OMERO_USER, "bax" ); ServiceFactory propsSF = new ServiceFactory( p ); Principal basicP = (Principal) basicSF.getContext().getBean( "principal" ); Principal loginP = (Principal) loginSF.getContext().getBean( "principal" ); Principal propsP = (Principal) propsSF.getContext().getBean( "principal" ); assertTrue( loginP.getName().equals( "bar" )); assertTrue( propsP.getName().equals( "bax" )); // It's difficult to know what the real user name is. assertFalse( basicP.getName().equals( "bar" )); assertFalse( basicP.getName().equals( "bax" )); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b0dd5bda152f884a9502f0d8c5cb8cb95ace53d/Preferences3Test.java/clean/components/client/test/ome/client/utests/Preferences3Test.java
this.releaseGUI(true);
this.releaseGUI(result.isReconfigure());
public void stopAction () { CompileResult result = this.worker.getResult (); this.releaseGUI(true); if (result.isContinue()) { parent.lockPrevButton(); packProgressBar.setString(parent.langpack.getString("CompilePanel.progress.finished")); packProgressBar.setEnabled(false); packProgressBar.setValue (packProgressBar.getMaximum()); overallProgressBar.setValue (this.noOfJobs); String no_of_jobs = Integer.toString (this.noOfJobs); overallProgressBar.setString (no_of_jobs + " / " + no_of_jobs); overallProgressBar.setEnabled (false); opLabel.setText(" "); opLabel.setEnabled(false); validated = true; idata.installSuccess = true; if (idata.panels.indexOf(this) != (idata.panels.size() - 1)) parent.unlockNextButton(); } else { idata.installSuccess = false; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/dbf34fdee25210594c4ed38bcf7160d68489622c/CompilePanel.java/clean/src/lib/com/izforge/izpack/panels/CompilePanel.java
console2 = new ConsoleWriter(this);
ConsoleWriter console2 = new ConsoleWriter(this);
public ConsoleTextArea() { super(); history = new java.util.Vector(); console1 = new ConsoleWriter(this); console2 = new ConsoleWriter(this); out = new PrintStream(console1); err = new PrintStream(console2); PipedOutputStream outPipe = new PipedOutputStream(); inPipe = new PrintWriter(outPipe); in = new PipedInputStream(); try { outPipe.connect(in); } catch (IOException exc) { exc.printStackTrace(); } getDocument().addDocumentListener(this); addKeyListener(this); setLineWrap(true); setFont(new Font("Monospaced", 0, 12)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Console.java/buggy/src/lib/com/izforge/izpack/util/Console.java
; } try { ensureMinIdle(); } catch (Exception e) {
public void run() { while(!_cancelled) { long sleeptime = 0L; synchronized(GenericKeyedObjectPool.this) { sleeptime = _timeBetweenEvictionRunsMillis; } try { Thread.sleep(sleeptime); } catch(Exception e) { ; // ignored } try { evict(); } catch(Exception e) { ; // ignored } } synchronized(GenericKeyedObjectPool.this) { if(null != _evictionCursor) { _evictionCursor.close(); _evictionCursor = null; } if(null != _evictionKeyCursor) { _evictionKeyCursor.close(); _evictionKeyCursor = null; } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/GenericKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
if( ((CursorableLinkedList)(_poolMap.get(key))).isEmpty() ) {
if ((_minIdle == 0) && (((CursorableLinkedList)(_poolMap.get(key))).isEmpty())) {
public synchronized void evict() throws Exception { Object key = null; for(int i=0,m=getNumTests();i<m;i++) { if(_poolMap.size() > 0) { // if we don't have a key cursor, then create one, and close any object cursor if(null == _evictionKeyCursor) { _evictionKeyCursor = _poolList.cursor(); key = null; if(null != _evictionCursor) { _evictionCursor.close(); _evictionCursor = null; } } // if we don't have an object cursor if(null == _evictionCursor) { // if the _evictionKeyCursor has a next value, then use it if(_evictionKeyCursor.hasNext()) { key = _evictionKeyCursor.next(); CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); _evictionCursor = pool.cursor(pool.size()); } else { // else close the key cursor and loop back around if(null != _evictionKeyCursor) { _evictionKeyCursor.close(); _evictionKeyCursor = _poolList.cursor(); if(null != _evictionCursor) { _evictionCursor.close(); _evictionCursor = null; } } continue; } } // if the _evictionCursor has a previous object, then test it if(_evictionCursor.hasPrevious()) { ObjectTimestampPair pair = (ObjectTimestampPair)(_evictionCursor.previous()); boolean removeObject=false; if(_minEvictableIdleTimeMillis > 0 && System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis) { removeObject=true; } else if(_testWhileIdle) { boolean active = false; try { _factory.activateObject(key,pair.value); active = true; } catch(Exception e) { removeObject=true; } if(active) { if(!_factory.validateObject(key,pair.value)) { removeObject=true; } else { try { _factory.passivateObject(key,pair.value); } catch(Exception e) { removeObject=true; } } } } if(removeObject) { try { _evictionCursor.remove(); _totalIdle--; _factory.destroyObject(key,pair.value); // if that was the last object for that key, drop that pool if( ((CursorableLinkedList)(_poolMap.get(key))).isEmpty() ) { _poolMap.remove(key); _poolList.remove(key); } } catch(Exception e) { ; // ignored } } } else { // else the _evictionCursor is done, so close it and loop around if(_evictionCursor != null) { _evictionCursor.close(); _evictionCursor = null; } } } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/GenericKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
setMinIdle(conf.minIdle);
public synchronized void setConfig(GenericKeyedObjectPool.Config conf) { setMaxIdle(conf.maxIdle); setMaxActive(conf.maxActive); setMaxTotal(conf.maxTotal); setMaxWait(conf.maxWait); setWhenExhaustedAction(conf.whenExhaustedAction); setTestOnBorrow(conf.testOnBorrow); setTestOnReturn(conf.testOnReturn); setTestWhileIdle(conf.testWhileIdle); setNumTestsPerEvictionRun(conf.numTestsPerEvictionRun); setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis); setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/GenericKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
done = false;
boolean done = false;
public void runAutomated(AutomatedInstallData idata, XMLElement panelRoot) { Unpacker unpacker = new Unpacker(idata, this); unpacker.start(); done = false; while (!done && unpacker.isAlive()) { try { Thread.sleep(100); } catch (InterruptedException e) { // ignore it, we're waiting for the unpacker to finish... } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InstallPanelAutomationHelper.java/clean/src/lib/com/izforge/izpack/panels/InstallPanelAutomationHelper.java
done = true;
boolean done = true;
public void stopAction() { System.out.println("[ Unpacking finished. ]"); done = true; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InstallPanelAutomationHelper.java/clean/src/lib/com/izforge/izpack/panels/InstallPanelAutomationHelper.java
input = getClass ().getResourceAsStream (key);
input = TargetFactory.class.getResourceAsStream (key);
public String getDefaultInstallPath (String appName) { String path = null; InputStream input = null; String keyFragment = "/res/" + INSTALL_PATH_RESOURCE_KEY [GENERIC][STANDARD]; // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is specific to the target OS // ---------------------------------------------------- input = getClass ().getResourceAsStream ("/res/" + INSTALL_PATH_RESOURCE_KEY [os][osFlavor]); // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is made specific to the target // OS by using the string returned by // System.getProperty ("os.name").toLowerCase () // ---------------------------------------------------- if (input == null) { String key = osName.replace (' ', '_'); // avoid spaces in file names key = keyFragment + key.toLowerCase (); // for consistency among TargetPanel res files input = getClass ().getResourceAsStream (key); } // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is not specific to any target OS // ---------------------------------------------------- if (input == null) { input = getClass ().getResourceAsStream (keyFragment); } // ---------------------------------------------------- // If we got an input stream try to read the path // from the file // ---------------------------------------------------- if (input != null) { InputStreamReader streamReader = null; BufferedReader reader = null; String line = null; try { streamReader = new InputStreamReader (input); reader = new BufferedReader (streamReader); line = reader.readLine (); while (line != null) { line = line.trim (); if (!line.equals ("")) { break; } line = reader.readLine (); } path = line; } catch (Throwable exception) { } finally { try { reader.close (); } catch (Throwable exception) { } } } // ---------------------------------------------------- // if we were unable to obtain a path from a resource, // use the default for the traget operating system. // ---------------------------------------------------- if ((path == null) || (path.equals (""))) { path = ""; // -------------------------------------------------- // if we run on windows, we need a valid drive letter // to put in front of the path. The drive that // contains the user's home directory is usually the // drive that also contains the install directory, // so this seems the best choice here. // -------------------------------------------------- if (os == WINDOWS) { String home = System.getProperty ("user.home"); // take everything up to and including the first '\' path = home.substring (0, (home.indexOf (File.separatorChar) + 1)); } path = path + INSTALL_PATH_FRAGMENT [os] + appName; } return (path); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/TargetFactory.java/buggy/src/lib/com/izforge/izpack/util/TargetFactory.java
input = getClass ().getResourceAsStream (keyFragment);
input = TargetFactory.class.getResourceAsStream (keyFragment);
public String getDefaultInstallPath (String appName) { String path = null; InputStream input = null; String keyFragment = "/res/" + INSTALL_PATH_RESOURCE_KEY [GENERIC][STANDARD]; // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is specific to the target OS // ---------------------------------------------------- input = getClass ().getResourceAsStream ("/res/" + INSTALL_PATH_RESOURCE_KEY [os][osFlavor]); // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is made specific to the target // OS by using the string returned by // System.getProperty ("os.name").toLowerCase () // ---------------------------------------------------- if (input == null) { String key = osName.replace (' ', '_'); // avoid spaces in file names key = keyFragment + key.toLowerCase (); // for consistency among TargetPanel res files input = getClass ().getResourceAsStream (key); } // ---------------------------------------------------- // attempt to get an input stream through a resource // based on a key which is not specific to any target OS // ---------------------------------------------------- if (input == null) { input = getClass ().getResourceAsStream (keyFragment); } // ---------------------------------------------------- // If we got an input stream try to read the path // from the file // ---------------------------------------------------- if (input != null) { InputStreamReader streamReader = null; BufferedReader reader = null; String line = null; try { streamReader = new InputStreamReader (input); reader = new BufferedReader (streamReader); line = reader.readLine (); while (line != null) { line = line.trim (); if (!line.equals ("")) { break; } line = reader.readLine (); } path = line; } catch (Throwable exception) { } finally { try { reader.close (); } catch (Throwable exception) { } } } // ---------------------------------------------------- // if we were unable to obtain a path from a resource, // use the default for the traget operating system. // ---------------------------------------------------- if ((path == null) || (path.equals (""))) { path = ""; // -------------------------------------------------- // if we run on windows, we need a valid drive letter // to put in front of the path. The drive that // contains the user's home directory is usually the // drive that also contains the install directory, // so this seems the best choice here. // -------------------------------------------------- if (os == WINDOWS) { String home = System.getProperty ("user.home"); // take everything up to and including the first '\' path = home.substring (0, (home.indexOf (File.separatorChar) + 1)); } path = path + INSTALL_PATH_FRAGMENT [os] + appName; } return (path); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/TargetFactory.java/buggy/src/lib/com/izforge/izpack/util/TargetFactory.java
this.outputScrollPane = new JScrollPane(this.outputPane); subpanel.add(this.outputScrollPane);
JScrollPane outputScrollPane = new JScrollPane(this.outputPane); subpanel.add(outputScrollPane);
public ProcessPanel(InstallerFrame parent, InstallData idata) throws IOException { super(parent, idata); this.worker = new ProcessPanelWorker(idata, this); JLabel heading = new JLabel(); Font font = heading.getFont(); font = font.deriveFont(Font.BOLD, font.getSize() * 2.0f); heading.setFont(font); heading.setHorizontalAlignment(SwingConstants.CENTER); heading.setText(parent.langpack.getString("ProcessPanel.heading")); heading.setVerticalAlignment(SwingConstants.TOP); setLayout(new BorderLayout()); add(heading, BorderLayout.NORTH); // put everything but the heading into it's own panel // (to center it vertically) JPanel subpanel = new JPanel(); subpanel.setAlignmentX(0.5f); subpanel.setLayout(new BoxLayout(subpanel, BoxLayout.Y_AXIS)); this.processLabel = new JLabel(); this.processLabel.setAlignmentX(0.5f); this.processLabel.setText(" "); subpanel.add(this.processLabel); this.overallProgressBar = new JProgressBar(); this.overallProgressBar.setAlignmentX(0.5f); this.overallProgressBar.setStringPainted(true); subpanel.add(this.overallProgressBar); this.outputPane = new JTextArea(); this.outputPane.setEditable(false); this.outputScrollPane = new JScrollPane(this.outputPane); subpanel.add(this.outputScrollPane); add(subpanel, BorderLayout.CENTER); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/ProcessPanel.java/buggy/src/lib/com/izforge/izpack/panels/ProcessPanel.java
dim.width = dim.width - (dim.width / 4);
dim.width -= (dim.width / 4);
public void panelActivate() { // We clip the panel Dimension dim = parent.getPanelsContainerSize(); dim.width = dim.width - (dim.width / 4); dim.height = 150; setMinimumSize(dim); setMaximumSize(dim); setPreferredSize(dim); parent.lockNextButton(); this.worker.startThread(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/ProcessPanel.java/buggy/src/lib/com/izforge/izpack/panels/ProcessPanel.java
public void computeLocationStats(PlaneDef pd)
private static void computeLocationStats(Pixels pixels, List<ChannelBinding> cbs, PlaneDef planeDef, PixelBuffer buf)
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
if (pd == null)
if (planeDef == null)
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
ChannelBinding[] cb = getChannelBindings();
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); )
List<Channel> channels = pixels.getChannels(); for (Channel channel : channels)
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue();
ChannelBinding cb = cbs.get(w); double gMin = channel.getStatsInfo().getGlobalMin(); double gMax = channel.getStatsInfo().getGlobalMax();
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
sf.computeLocationStats(metadata, buffer, pd, w);
sf.computeLocationStats(pixels, buf, planeDef, w);
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue();
cb.setNoiseReduction(Boolean.TRUE); float start = cb.getInputStart(); float end = cb.getInputEnd();
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd()));
cb.setInputStart(new Float(sf.getInputStart())); cb.setInputEnd(new Float(sf.getInputEnd())); w++;
public void computeLocationStats(PlaneDef pd) { if (pd == null) throw new NullPointerException("No plane definition."); ChannelBinding[] cb = getChannelBindings(); StatsFactory sf = new StatsFactory(); int w = 0; for (Iterator i = getMetadata().getChannels().iterator(); i.hasNext(); ) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. Channel channel = (Channel) i.next(); double gMin = channel.getStatsInfo().getGlobalMin().doubleValue(); double gMax = channel.getStatsInfo().getGlobalMax().doubleValue(); //Test sf.computeLocationStats(metadata, buffer, pd, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb[w].setNoiseReduction(Boolean.TRUE); float start = cb[w].getInputStart().floatValue(); float end = cb[w].getInputEnd().floatValue(); //TODO: find a better way. if (gMax == end && gMin == start) cb[w].setInputStart(new Float(sf.getInputStart())); cb[w].setInputEnd(new Float(sf.getInputEnd())); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
PlaneDef pd = new PlaneDef(PlaneDef.XY, rndDef.getDefaultT().intValue()); pd.setZ(rndDef.getDefaultZ().intValue());
PlaneDef pd = new PlaneDef(PlaneDef.XY, rndDef.getDefaultT()); pd.setZ(rndDef.getDefaultZ());
public PlaneDef getDefaultPlaneDef() { PlaneDef pd = new PlaneDef(PlaneDef.XY, rndDef.getDefaultT().intValue()); pd.setZ(rndDef.getDefaultZ().intValue()); return pd; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
IPixels iPixels)
IPixels iPixels, PixelBuffer buffer)
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
StatsInfo stats = channel.getStatsInfo();
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax()));
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
computeLocationStats(pixels, channelBindings, planeDef, buffer);
private static void resetChannelBindings(RenderingDef def, Pixels pixels, IPixels iPixels) { // The actual channel bindings we are returning List<ChannelBinding> channelBindings = def.getWaveRendering(); List<Channel> channels = pixels.getChannels(); int i = 0; for (Channel channel : channels) { StatsInfo stats = channel.getStatsInfo(); Family family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); ChannelBinding channelBinding = channelBindings.get(i); channelBinding.setFamily(family); channelBinding.setCoefficient(new Double(1)); // FIXME: Lost of precision, downcast from Double to Float channelBinding.setInputStart(new Float(stats.getGlobalMin())); channelBinding.setInputEnd(new Float(stats.getGlobalMax())); // If we have more than one channel set each of the first three // active, otherwise only activate the first. if (i < 3) channelBinding.setActive(true); channelBinding.setColor(ColorsFactory.getColor(i, channel)); channelBinding.setNoiseReduction(false); i++; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
{}
{ Debug.trace(exception); }
public PacksPanelBase(InstallerFrame parent, InstallData idata) { super(parent, idata); // Load langpack. try { this.langpack = parent.langpack; } catch (Throwable exception) {} // init the map computePacks(idata.availablePacks); createNormalLayout(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ac2ba20f61963cc3eb7a71824379a6d580aa2236/PacksPanelBase.java/clean/src/lib/com/izforge/izpack/panels/PacksPanelBase.java
okButton = new JButton("OK");
JButton okButton = new JButton("OK");
public LanguageDialog(JFrame frame, Object[] items) { super(frame); try { loadLookAndFeel(); } catch (Exception err) { err.printStackTrace(); } // We build the GUI addWindowListener(new WindowHandler()); JPanel contentPane = (JPanel) getContentPane(); setTitle("Language selection"); GridBagLayout layout = new GridBagLayout(); contentPane.setLayout(layout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.gridx = 0; gbConstraints.weightx = 1.0; gbConstraints.weighty = 1.0; ImageIcon img = getImage(); JLabel imgLabel = new JLabel(img); gbConstraints.gridy = 0; contentPane.add(imgLabel); gbConstraints.fill = GridBagConstraints.HORIZONTAL; String firstMessage = "Please select your language"; if (getLangType().equals(LANGUAGE_DISPLAY_TYPES[0])) // iso3 firstMessage = "Please select your language (ISO3 code)"; JLabel label1 = new JLabel(firstMessage, SwingConstants.CENTER); gbConstraints.gridy = 1; gbConstraints.insets = new Insets(5, 5, 0, 5); layout.addLayoutComponent(label1, gbConstraints); contentPane.add(label1); JLabel label2 = new JLabel("for install instructions:", SwingConstants.CENTER); gbConstraints.gridy = 2; gbConstraints.insets = new Insets(0, 5, 5, 5); layout.addLayoutComponent(label2, gbConstraints); contentPane.add(label2); gbConstraints.insets = new Insets(5, 5, 5, 5); items = reviseItems(items); comboBox = new JComboBox(items); if (useFlags()) comboBox.setRenderer(new FlagRenderer()); gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.gridy = 3; layout.addLayoutComponent(comboBox, gbConstraints); contentPane.add(comboBox); okButton = new JButton("OK"); okButton.addActionListener(this); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.gridy = 4; gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(okButton, gbConstraints); contentPane.add(okButton); getRootPane().setDefaultButton(okButton); // Packs and centers // Fix for bug "Installer won't show anything on OSX" if (System.getProperty("mrj.version") == null) pack(); else setSize(getPreferredSize()); Dimension frameSize = getSize(); Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint(); setLocation(center.x - frameSize.width / 2, center.y - frameSize.height / 2 - 10); setResizable(true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
&& ((String) installdata.guiPrefs.modifier.get("useButtonIcons")) .equalsIgnoreCase("no")) useButtonIcons = false;
&& "no".equalsIgnoreCase((String) installdata.guiPrefs.modifier.get("useButtonIcons"))) useButtonIcons = false;
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { 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/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
&& ((String) installdata.guiPrefs.modifier.get("useLabelIcons")) .equalsIgnoreCase("no")) useLabelIcons = false;
&& "no".equalsIgnoreCase((String) installdata.guiPrefs.modifier.get("useLabelIcons"))) useLabelIcons = false;
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { 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/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
if (!syskey.equals("mac"))
if (!"mac".equals(syskey))
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { 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/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
if (laf.equals("kunststoff"))
if ("kunststoff".equals(laf))
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { 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/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
if (laf.equals("liquid"))
if ("liquid".equals(laf))
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { 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/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
if (value.equals("yes"))
if ("yes".equals(value))
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { 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/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
if (value.equals("yes"))
if ("yes".equals(value))
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { 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/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
if (laf.equals("metouia"))
if ("metouia".equals(laf))
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { 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/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
if (laf.equals("looks"))
if ("looks".equals(laf))
protected void loadLookAndFeel() throws Exception { // Do we have any preference for this OS ? String syskey = "unix"; if (OsVersion.IS_WINDOWS) { syskey = "windows"; } else if (OsVersion.IS_OSX) { 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/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
&& ((String) installdata.guiPrefs.modifier.get("useFlags")).equalsIgnoreCase("no"))
&& "no".equalsIgnoreCase((String) installdata.guiPrefs.modifier.get("useFlags")))
protected boolean useFlags() { if (installdata.guiPrefs.modifier.containsKey("useFlags") && ((String) installdata.guiPrefs.modifier.get("useFlags")).equalsIgnoreCase("no")) return (false); return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/GUIInstaller.java/buggy/src/lib/com/izforge/izpack/installer/GUIInstaller.java
final String suiteName, final Map parameters, final String annotationType) { super(true);
final String suiteName, final Map parameters, final String annotationType, final int logLevel) { super(true);
public CustomSuite(final String projectName, final String suiteName, final Map parameters, final String annotationType) { super(true); m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK_ANNOTATION_TYPE; } }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK_ANNOTATION_TYPE; }
m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE;
public CustomSuite(final String projectName, final String suiteName, final Map parameters, final String annotationType) { super(true); m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK_ANNOTATION_TYPE; } }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
else { m_annotationType= TestNG.JDK_ANNOTATION_TYPE; } m_logLevel= logLevel; }
public CustomSuite(final String projectName, final String suiteName, final Map parameters, final String annotationType) { super(true); m_projectName= projectName; m_suiteName= suiteName; m_parameters= parameters; if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { m_annotationType= TestNG.JAVADOC_ANNOTATION_TYPE; } else { m_annotationType= TestNG.JDK_ANNOTATION_TYPE; } }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\"");
XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\"");
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs);
Properties attrs= new Properties(); attrs.setProperty("name", getSuiteName()); suiteBuffer.push("suite", attrs);
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); }
if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext();) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.addEmptyElement("parameter", paramAttrs);
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
initContentBuffer(suiteBuffer);
initContentBuffer(suiteBuffer);
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
suiteBuffer.pop("suite");
suiteBuffer.pop("suite");
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
return suiteBuffer; }
return suiteBuffer; }
protected XMLStringBuffer createContentBuffer() { XMLStringBuffer suiteBuffer= new XMLStringBuffer(""); //$NON-NLS-1$ suiteBuffer.setDocType("suite SYSTEM \"" + Parser.TESTNG_DTD_URL + "\""); Properties attrs= new Properties(); attrs.setProperty("name", m_suiteName); suiteBuffer.push("suite", attrs); if(m_parameters != null) { for(Iterator it= m_parameters.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry= (Map.Entry) it.next(); Properties paramAttrs= new Properties(); paramAttrs.setProperty("name", (String) entry.getKey()); paramAttrs.setProperty("value", (String) entry.getValue()); suiteBuffer.push("parameter", paramAttrs); suiteBuffer.pop("parameter"); } } initContentBuffer(suiteBuffer); suiteBuffer.pop("suite"); return suiteBuffer; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
if(null == m_suiteBuffer) { m_suiteBuffer= createContentBuffer(); }
if(null == m_suiteBuffer) { m_suiteBuffer= createContentBuffer(); }
private XMLStringBuffer getSuiteBuffer() { if(null == m_suiteBuffer) { m_suiteBuffer= createContentBuffer(); } return m_suiteBuffer; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
return m_suiteBuffer; }
return m_suiteBuffer; }
private XMLStringBuffer getSuiteBuffer() { if(null == m_suiteBuffer) { m_suiteBuffer= createContentBuffer(); } return m_suiteBuffer; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
protected abstract void initContentBuffer(XMLStringBuffer suiteBuffer);
protected void initContentBuffer(XMLStringBuffer suiteBuffer) { Properties testAttrs= new Properties(); testAttrs.setProperty("name", getTestName()); if(m_annotationType != null) { testAttrs.setProperty("annotations", m_annotationType); } testAttrs.setProperty("verbose", String.valueOf(m_logLevel)); suiteBuffer.push("test", testAttrs); groupsElement(suiteBuffer); packagesElement(suiteBuffer); classesElement(suiteBuffer); suiteBuffer.pop("test"); }
protected abstract void initContentBuffer(XMLStringBuffer suiteBuffer);
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
final File suiteFile= new File(directory, "temp-testng-customsuite.xml");
final File suiteFile= new File(directory, "temp-testng-customsuite.xml");
public File save(File directory) { final File suiteFile= new File(directory, "temp-testng-customsuite.xml"); saveSuiteContent(suiteFile, getSuiteBuffer()); return suiteFile; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
saveSuiteContent(suiteFile, getSuiteBuffer());
saveSuiteContent(suiteFile, getSuiteBuffer());
public File save(File directory) { final File suiteFile= new File(directory, "temp-testng-customsuite.xml"); saveSuiteContent(suiteFile, getSuiteBuffer()); return suiteFile; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
return suiteFile; }
return suiteFile; }
public File save(File directory) { final File suiteFile= new File(directory, "temp-testng-customsuite.xml"); saveSuiteContent(suiteFile, getSuiteBuffer()); return suiteFile; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
FileWriter fw= null; BufferedWriter bw= null; try { fw= new FileWriter(file); bw= new BufferedWriter(fw); bw.write(content.getStringBuffer().toString()); bw.flush();
FileWriter fw= null; BufferedWriter bw= null; try { fw= new FileWriter(file); bw= new BufferedWriter(fw); bw.write(content.getStringBuffer().toString()); bw.flush(); } catch(IOException ioe) { } finally { if(null != bw) { try { bw.close(); } catch(IOException ioe) { }
protected void saveSuiteContent(final File file, final XMLStringBuffer content) { FileWriter fw= null; BufferedWriter bw= null; try { fw= new FileWriter(file); bw= new BufferedWriter(fw); bw.write(content.getStringBuffer().toString()); bw.flush(); } catch(IOException ioe) { } finally { if(null != bw) { try { bw.close(); } catch(IOException ioe) { } } if(null != fw) { try { fw.close(); } catch(IOException ioe) { } } } }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
catch(IOException ioe) { } finally { if(null != bw) { try { bw.close(); } catch(IOException ioe) { }
if(null != fw) { try { fw.close();
protected void saveSuiteContent(final File file, final XMLStringBuffer content) { FileWriter fw= null; BufferedWriter bw= null; try { fw= new FileWriter(file); bw= new BufferedWriter(fw); bw.write(content.getStringBuffer().toString()); bw.flush(); } catch(IOException ioe) { } finally { if(null != bw) { try { bw.close(); } catch(IOException ioe) { } } if(null != fw) { try { fw.close(); } catch(IOException ioe) { } } } }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
if(null != fw) { try { fw.close(); } catch(IOException ioe) { }
catch(IOException ioe) {
protected void saveSuiteContent(final File file, final XMLStringBuffer content) { FileWriter fw= null; BufferedWriter bw= null; try { fw= new FileWriter(file); bw= new BufferedWriter(fw); bw.write(content.getStringBuffer().toString()); bw.flush(); } catch(IOException ioe) { } finally { if(null != bw) { try { bw.close(); } catch(IOException ioe) { } } if(null != fw) { try { fw.close(); } catch(IOException ioe) { } } } }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
}
protected void saveSuiteContent(final File file, final XMLStringBuffer content) { FileWriter fw= null; BufferedWriter bw= null; try { fw= new FileWriter(file); bw= new BufferedWriter(fw); bw.write(content.getStringBuffer().toString()); bw.flush(); } catch(IOException ioe) { } finally { if(null != bw) { try { bw.close(); } catch(IOException ioe) { } } if(null != fw) { try { fw.close(); } catch(IOException ioe) { } } } }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/CustomSuite.java/buggy/src/main/org/testng/eclipse/util/CustomSuite.java
m_classText.getText(),
Utils.stringToList(m_classText.getText().trim()),
public void performApply(ILaunchConfigurationWorkingCopy configuration) { ConfigurationHelper.updateLaunchConfiguration(configuration, new ConfigurationHelper.LaunchInfo(m_projectText.getText(), m_typeOfTestRun, m_classText.getText(), m_groupMap, m_suiteText.getText(), m_complianceLevelCombo.getText(), m_logLevelCombo.getText())); }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/d42cff6078dc81fdbe15ceb2b18037f7fa09bb58/TestNGMainTab.java/clean/src/main/org/testng/eclipse/launch/TestNGMainTab.java
ButtonFactory.useButtonIcons(); ButtonFactory.useHighlightButtons();
private void buildGUI() throws Exception { // Window events handler addWindowListener(new WindowHandler()); // Sets the frame icon setIconImage(icons.getImageIcon("JFrameIcon").getImage()); // Sets the menubar menuBar = new FrontendMenuBar(actions, icons, langpack); setJMenuBar(menuBar); // Sets the toolbar toolBar = new FrontendToolBar(actions, icons, langpack); contentPane.add(toolBar, BorderLayout.NORTH); // Creates the tabbed pane tabbedPane = new JTabbedPane(); tabbedPane.addTab(langpack.getString("tabs.info.title"), icons.getImageIcon("information"), new FrontendInfoTab(installation, icons, langpack)); tabbedPane.addTab(langpack.getString("tabs.loc.title"), icons.getImageIcon("search"), new FrontendLocTab(installation, icons, langpack)); tabbedPane.addTab(langpack.getString("tabs.res.title"), icons.getImageIcon("properties"), new FrontendResTab(installation, icons, langpack)); tabbedPane.addTab(langpack.getString("tabs.pan.title"), icons.getImageIcon("paste"), new FrontendPanTab(installation, icons, langpack)); tabbedPane.addTab(langpack.getString("tabs.packs.title"), icons.getImageIcon("preferences"), new FrontendPacksTab(installation, icons, langpack)); contentPane.add(tabbedPane, BorderLayout.CENTER); // Fills the tab array & make the tabs use the XML data int ntabs = tabbedPane.getTabCount(); tabs = new ArrayList(ntabs); for (int i = 0; i < ntabs; i++) { FrontendTab tab = (FrontendTab) tabbedPane.getComponentAt(i); tabs.add(tab); tab.updateComponents(); } // Filenaming curFilename = langpack.getString("frontend.untitled"); updateTitle(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d2ff7483bcda125043303ef0aa208a83c0d2456d/FrontendFrame.java/buggy/src/lib/com/izforge/izpack/frontend/FrontendFrame.java
try { readShortcutSpec(); } catch (Throwable exception) { System.out.println("could not read shortcut spec!"); exception.printStackTrace(); }
public ShortcutPanel(InstallerFrame parent, InstallData installData) { super(parent, installData, "link16x16"); try { readShortcutSpec(); } catch (Throwable exception) { System.out.println("could not read shortcut spec!"); exception.printStackTrace(); } layout = new GridBagLayout(); constraints = new GridBagConstraints(); setLayout(layout); // Create the UI elements try { shortcut = (Shortcut) (TargetFactory.getInstance() .makeObject("com.izforge.izpack.util.os.Shortcut")); shortcut.initialize(Shortcut.APPLICATIONS, "-"); } catch (Throwable exception) { System.out.println("could not create shortcut instance"); exception.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
layout = new GridBagLayout(); constraints = new GridBagConstraints(); setLayout(layout); try { shortcut = (Shortcut) (TargetFactory.getInstance() .makeObject("com.izforge.izpack.util.os.Shortcut")); shortcut.initialize(Shortcut.APPLICATIONS, "-"); } catch (Throwable exception) { System.out.println("could not create shortcut instance"); exception.printStackTrace(); }
layout = (GridBagLayout) super.getLayout(); constraints = super.defaultGridBagConstraints; setLayout(super.getLayout());
public ShortcutPanel(InstallerFrame parent, InstallData installData) { super(parent, installData, "link16x16"); try { readShortcutSpec(); } catch (Throwable exception) { System.out.println("could not read shortcut spec!"); exception.printStackTrace(); } layout = new GridBagLayout(); constraints = new GridBagConstraints(); setLayout(layout); // Create the UI elements try { shortcut = (Shortcut) (TargetFactory.getInstance() .makeObject("com.izforge.izpack.util.os.Shortcut")); shortcut.initialize(Shortcut.APPLICATIONS, "-"); } catch (Throwable exception) { System.out.println("could not create shortcut instance"); exception.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
public void actionPerformed(ActionEvent event) { Object eventSource = event.getSource(); // ---------------------------------------------------- // create shortcut for the current user was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- if (eventSource.equals(currentUser)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.CURRENT_USER)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.CURRENT_USER); } // ---------------------------------------------------- // create shortcut for all users was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- else if (eventSource.equals(allUsers)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.ALL_USERS)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.ALL_USERS); } // ---------------------------------------------------- // The reset button was pressed. // - clear the selection in the list box, because the // selection is no longer valid // - refill the program group edit control with the // suggested program group name // ---------------------------------------------------- else if (eventSource.equals(defaultButton)) { groupList.getSelectionModel().clearSelection(); programGroup.setText(suggestedProgramGroup); } // ---------------------------------------------------- // the save button was pressed. This is a request to // save shortcut information to a text file. // ---------------------------------------------------- else if (eventSource.equals(saveButton)) { saveToFile(); // add the file to the uninstaller addToUninstaller(); } else if (eventSource.equals(createShortcuts)) { create = createShortcuts.isSelected(); groupList.setEnabled(create); programGroup.setEnabled(create); currentUser.setEnabled(create); defaultButton.setEnabled(create); allowDesktopShortcut.setEnabled(create); if( isRootUser ) allUsers.setEnabled(create); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
public void actionPerformed(ActionEvent event) { Object eventSource = event.getSource(); // ---------------------------------------------------- // create shortcut for the current user was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- if (eventSource.equals(currentUser)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.CURRENT_USER)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.CURRENT_USER); } // ---------------------------------------------------- // create shortcut for all users was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- else if (eventSource.equals(allUsers)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.ALL_USERS)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.ALL_USERS); } // ---------------------------------------------------- // The reset button was pressed. // - clear the selection in the list box, because the // selection is no longer valid // - refill the program group edit control with the // suggested program group name // ---------------------------------------------------- else if (eventSource.equals(defaultButton)) { groupList.getSelectionModel().clearSelection(); programGroup.setText(suggestedProgramGroup); } // ---------------------------------------------------- // the save button was pressed. This is a request to // save shortcut information to a text file. // ---------------------------------------------------- else if (eventSource.equals(saveButton)) { saveToFile(); // add the file to the uninstaller addToUninstaller(); } else if (eventSource.equals(createShortcuts)) { create = createShortcuts.isSelected(); groupList.setEnabled(create); programGroup.setEnabled(create); currentUser.setEnabled(create); defaultButton.setEnabled(create); allowDesktopShortcut.setEnabled(create); if( isRootUser ) allUsers.setEnabled(create); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
groupList.setEnabled(create);
if (groupList != null) { groupList.setEnabled(create); }
public void actionPerformed(ActionEvent event) { Object eventSource = event.getSource(); // ---------------------------------------------------- // create shortcut for the current user was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- if (eventSource.equals(currentUser)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.CURRENT_USER)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.CURRENT_USER); } // ---------------------------------------------------- // create shortcut for all users was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- else if (eventSource.equals(allUsers)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.ALL_USERS)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.ALL_USERS); } // ---------------------------------------------------- // The reset button was pressed. // - clear the selection in the list box, because the // selection is no longer valid // - refill the program group edit control with the // suggested program group name // ---------------------------------------------------- else if (eventSource.equals(defaultButton)) { groupList.getSelectionModel().clearSelection(); programGroup.setText(suggestedProgramGroup); } // ---------------------------------------------------- // the save button was pressed. This is a request to // save shortcut information to a text file. // ---------------------------------------------------- else if (eventSource.equals(saveButton)) { saveToFile(); // add the file to the uninstaller addToUninstaller(); } else if (eventSource.equals(createShortcuts)) { create = createShortcuts.isSelected(); groupList.setEnabled(create); programGroup.setEnabled(create); currentUser.setEnabled(create); defaultButton.setEnabled(create); allowDesktopShortcut.setEnabled(create); if( isRootUser ) allUsers.setEnabled(create); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
currentUser.setEnabled(create);
currentUser.setEnabled(create);
public void actionPerformed(ActionEvent event) { Object eventSource = event.getSource(); // ---------------------------------------------------- // create shortcut for the current user was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- if (eventSource.equals(currentUser)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.CURRENT_USER)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.CURRENT_USER); } // ---------------------------------------------------- // create shortcut for all users was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- else if (eventSource.equals(allUsers)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.ALL_USERS)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.ALL_USERS); } // ---------------------------------------------------- // The reset button was pressed. // - clear the selection in the list box, because the // selection is no longer valid // - refill the program group edit control with the // suggested program group name // ---------------------------------------------------- else if (eventSource.equals(defaultButton)) { groupList.getSelectionModel().clearSelection(); programGroup.setText(suggestedProgramGroup); } // ---------------------------------------------------- // the save button was pressed. This is a request to // save shortcut information to a text file. // ---------------------------------------------------- else if (eventSource.equals(saveButton)) { saveToFile(); // add the file to the uninstaller addToUninstaller(); } else if (eventSource.equals(createShortcuts)) { create = createShortcuts.isSelected(); groupList.setEnabled(create); programGroup.setEnabled(create); currentUser.setEnabled(create); defaultButton.setEnabled(create); allowDesktopShortcut.setEnabled(create); if( isRootUser ) allUsers.setEnabled(create); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
allowDesktopShortcut.setEnabled(create); if( isRootUser )
if (allowDesktopShortcut != null) { allowDesktopShortcut.setEnabled(create); } if (isRootUser) {
public void actionPerformed(ActionEvent event) { Object eventSource = event.getSource(); // ---------------------------------------------------- // create shortcut for the current user was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- if (eventSource.equals(currentUser)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.CURRENT_USER)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.CURRENT_USER); } // ---------------------------------------------------- // create shortcut for all users was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- else if (eventSource.equals(allUsers)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.ALL_USERS)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.ALL_USERS); } // ---------------------------------------------------- // The reset button was pressed. // - clear the selection in the list box, because the // selection is no longer valid // - refill the program group edit control with the // suggested program group name // ---------------------------------------------------- else if (eventSource.equals(defaultButton)) { groupList.getSelectionModel().clearSelection(); programGroup.setText(suggestedProgramGroup); } // ---------------------------------------------------- // the save button was pressed. This is a request to // save shortcut information to a text file. // ---------------------------------------------------- else if (eventSource.equals(saveButton)) { saveToFile(); // add the file to the uninstaller addToUninstaller(); } else if (eventSource.equals(createShortcuts)) { create = createShortcuts.isSelected(); groupList.setEnabled(create); programGroup.setEnabled(create); currentUser.setEnabled(create); defaultButton.setEnabled(create); allowDesktopShortcut.setEnabled(create); if( isRootUser ) allUsers.setEnabled(create); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
}
public void actionPerformed(ActionEvent event) { Object eventSource = event.getSource(); // ---------------------------------------------------- // create shortcut for the current user was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- if (eventSource.equals(currentUser)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.CURRENT_USER)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.CURRENT_USER); } // ---------------------------------------------------- // create shortcut for all users was selected // refresh the list of program groups accordingly and // reset the program group to the default setting. // ---------------------------------------------------- else if (eventSource.equals(allUsers)) { groupList.setListData(shortcut.getProgramGroups(Shortcut.ALL_USERS)); programGroup.setText(suggestedProgramGroup); shortcut.setUserType(itsUserType = Shortcut.ALL_USERS); } // ---------------------------------------------------- // The reset button was pressed. // - clear the selection in the list box, because the // selection is no longer valid // - refill the program group edit control with the // suggested program group name // ---------------------------------------------------- else if (eventSource.equals(defaultButton)) { groupList.getSelectionModel().clearSelection(); programGroup.setText(suggestedProgramGroup); } // ---------------------------------------------------- // the save button was pressed. This is a request to // save shortcut information to a text file. // ---------------------------------------------------- else if (eventSource.equals(saveButton)) { saveToFile(); // add the file to the uninstaller addToUninstaller(); } else if (eventSource.equals(createShortcuts)) { create = createShortcuts.isSelected(); groupList.setEnabled(create); programGroup.setEnabled(create); currentUser.setEnabled(create); defaultButton.setEnabled(create); allowDesktopShortcut.setEnabled(create); if( isRootUser ) allUsers.setEnabled(create); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
int groupLocation;
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp;
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue;
if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) { continue; } if (!checkConditions(shortcutSpec)) { continue; }
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP);
data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP, "");
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null);
data.deskTopEntryLinux_URL = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_URL, "");
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null);
data.createForAll = new Boolean(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); data.target = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.commandLine = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.iconFile = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, ""));
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null);
data.workingDirectory = fixSeparatorChar(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_WORKING_DIR, ""));
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
continue; }
data.target = ""; }
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; }
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP))
if (XMLHelper.attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP))
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS))
if (XMLHelper.attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS))
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU))
if (XMLHelper.attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU))
private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java