rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
Debug.log( CLASS + myClass + ".setLinkName() '" + name + "'" );
public void setLinkName(String name) { shortcut.setLinkName(name); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Win_Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Win_Shortcut.java
public void setLinkType(int type) throws IllegalArgumentException
public void setLinkType(int type) throws IllegalArgumentException, UnsupportedEncodingException
public void setLinkType(int type) throws IllegalArgumentException { switch (type) { case DESKTOP: { shortcut.setLinkType(ShellLink.DESKTOP); break; } case APPLICATIONS: { shortcut.setLinkType(ShellLink.PROGRAM_MENU); break; } case START_MENU: { shortcut.setLinkType(ShellLink.START_MENU); break; } case START_UP: { shortcut.setLinkType(ShellLink.STARTUP); break; } default: { throw (new IllegalArgumentException(type + "is not recognized as a valid link type")); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Win_Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Win_Shortcut.java
Debug.log( CLASS + myClass + ".setLinkType() '" + type + "'" );
public void setLinkType(int type) throws IllegalArgumentException { switch (type) { case DESKTOP: { shortcut.setLinkType(ShellLink.DESKTOP); break; } case APPLICATIONS: { shortcut.setLinkType(ShellLink.PROGRAM_MENU); break; } case START_MENU: { shortcut.setLinkType(ShellLink.START_MENU); break; } case START_UP: { shortcut.setLinkType(ShellLink.STARTUP); break; } default: { throw (new IllegalArgumentException(type + "is not recognized as a valid link type")); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Win_Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Win_Shortcut.java
shortcut.setProgramGroup(groupName);
Debug.log( CLASS + myClass + ".setProgramGroup() '" + groupName + "'" ); shortcut.setProgramGroup(groupName);
public void setProgramGroup(String groupName) { shortcut.setProgramGroup(groupName); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Win_Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Win_Shortcut.java
Debug.log( CLASS + myClass + ".setShowCommand() '" + Integer.toString(show) + "'" );
public void setShowCommand(int show) throws IllegalArgumentException { switch (show) { case HIDE: { shortcut.setShowCommand(ShellLink.MINNOACTIVE); break; } case NORMAL: { shortcut.setShowCommand(ShellLink.NORMAL); break; } case MINIMIZED: { shortcut.setShowCommand(ShellLink.MINNOACTIVE); break; } case MAXIMIZED: { shortcut.setShowCommand(ShellLink.MAXIMIZED); break; } default: { throw (new IllegalArgumentException(show + "is not recognized as a show command")); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Win_Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Win_Shortcut.java
Debug.log( CLASS + myClass + ".setTargetPath() '" + path + "'" );
public void setTargetPath(String path) { shortcut.setTargetPath(path); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Win_Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Win_Shortcut.java
Debug.log( CLASS + myClass + ".setUserType() '" + type + "'" );
public void setUserType(int type) { if (type == CURRENT_USER) { if (shortcut.getcurrentUserLinkPath().length() > 0) { shortcut.setUserType(ShellLink.CURRENT_USER); } } else if (type == ALL_USERS) { if (shortcut.getallUsersLinkPath().length() > 0) { shortcut.setUserType(ShellLink.ALL_USERS); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Win_Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Win_Shortcut.java
Debug.log( CLASS + myClass + ".setWorkingDirectory() '" + dir + "'" );
public void setWorkingDirectory(String dir) { shortcut.setWorkingDirectory(dir); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Win_Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Win_Shortcut.java
{ return (true);
{ Debug.log( CLASS + myClass + ".supported() '" + SUPPORTED + "'" ); return( SUPPORTED );
public boolean supported() { return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Win_Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Win_Shortcut.java
b[off+0] = (byte)value;
b[off] = (byte)value;
private static void set16(byte[] b, int off, int value) { b[off+0] = (byte)value; b[off+1] = (byte)(value >> 8); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/JarOutputStream.java/buggy/src/lib/com/izforge/izpack/util/JarOutputStream.java
public synchronized void clear(Object key) { LinkedList pool = (LinkedList)(_poolMap.remove(key)); if(null == pool) { return; } else { for(Iterator it = pool.iterator(); it.hasNext(); ) {
public synchronized void clear() { for(Iterator keyiter = _poolMap.keySet().iterator(); keyiter.hasNext(); ) { Object key = keyiter.next(); final LinkedList list = (LinkedList)(_poolMap.get(key)); for(Iterator it = list.iterator(); it.hasNext(); ) {
public synchronized void clear(Object key) { LinkedList pool = (LinkedList)(_poolMap.remove(key)); if(null == pool) { return; } else { for(Iterator it = pool.iterator(); it.hasNext(); ) { try { _factory.destroyObject(key,((ObjectTimestampPair)(it.next())).value); } catch(Exception e) { // ignore error, keep destroying the rest } it.remove(); _totalIdle--; } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/040416e9a1f3dc7bd49171b76ed6a766164e6fed/GenericKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
_totalIdle--;
public synchronized void clear(Object key) { LinkedList pool = (LinkedList)(_poolMap.remove(key)); if(null == pool) { return; } else { for(Iterator it = pool.iterator(); it.hasNext(); ) { try { _factory.destroyObject(key,((ObjectTimestampPair)(it.next())).value); } catch(Exception e) { // ignore error, keep destroying the rest } it.remove(); _totalIdle--; } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/040416e9a1f3dc7bd49171b76ed6a766164e6fed/GenericKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
_poolMap.clear(); if (_recentlyEvictedKeys != null) { _recentlyEvictedKeys.clear(); } _totalIdle = 0;
public synchronized void clear(Object key) { LinkedList pool = (LinkedList)(_poolMap.remove(key)); if(null == pool) { return; } else { for(Iterator it = pool.iterator(); it.hasNext(); ) { try { _factory.destroyObject(key,((ObjectTimestampPair)(it.next())).value); } catch(Exception e) { // ignore error, keep destroying the rest } it.remove(); _totalIdle--; } } notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/040416e9a1f3dc7bd49171b76ed6a766164e6fed/GenericKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
URLClassLoader ucl = new URLClassLoader( new URL[] {url} );
URLClassLoader ucl = new URLClassLoader( new URL[] {url}, CompilerListener.class.getClassLoader() );
private Object [] getCompilerListenerInstance( XMLElement var ) throws Exception { final String defaultRootPath = "com.izforge.izpack."; final String defaultCompilerPath = "compiler."; String className = var.getAttribute("compiler"); Class listener = null; Object instance = null; if( className == null ) return(null); // CustomAction files come in jars packaged IzPack String jarPath = "bin/customActions/" + className + ".jar"; URL url = findIzPackResource(jarPath, "CustomAction jar file", var); String fullName = getFullClassName(url, className); if( url != null ) { if(getClass().getResource("/" + jarPath) != null ) { // Oops, standalone, URLClassLoader will not work ... // Write the jar to a temp file. InputStream in = null; FileOutputStream outFile = null; byte[] buffer = new byte[5120]; File tf = null; try { tf = File. createTempFile("izpj", ".jar"); tf.deleteOnExit(); outFile = new FileOutputStream(tf); in = getClass().getResourceAsStream("/" + jarPath); long bytesCopied = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { outFile.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } } finally { if( in != null ) in.close(); if( outFile != null ) outFile.close(); } url = tf.toURL(); } URLClassLoader ucl = new URLClassLoader( new URL[] {url} ); listener = ucl.loadClass(fullName); } if( listener != null ) instance = listener.newInstance(); else parseError(var, "Cannot find defined compiler listener " + className); if( ! CompilerListener.class.isInstance(instance) ) parseError(var, "'" + className + "' must be implemented " + CompilerListener.class.toString()); List constraints = OsConstraint.getOsList(var); return( new Object[] {instance, className, constraints} ); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6ecf4c684709c205660b52029f360e1b20e07957/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
private Object [] getCompilerListenerInstance( XMLElement var ) throws Exception { final String defaultRootPath = "com.izforge.izpack."; final String defaultCompilerPath = "compiler."; String className = var.getAttribute("compiler"); Class listener = null; Object instance = null; if( className == null ) return(null); // CustomAction files come in jars packaged IzPack String jarPath = "bin/customActions/" + className + ".jar"; URL url = findIzPackResource(jarPath, "CustomAction jar file", var); String fullName = getFullClassName(url, className); if( url != null ) { if(getClass().getResource("/" + jarPath) != null ) { // Oops, standalone, URLClassLoader will not work ... // Write the jar to a temp file. InputStream in = null; FileOutputStream outFile = null; byte[] buffer = new byte[5120]; File tf = null; try { tf = File. createTempFile("izpj", ".jar"); tf.deleteOnExit(); outFile = new FileOutputStream(tf); in = getClass().getResourceAsStream("/" + jarPath); long bytesCopied = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { outFile.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } } finally { if( in != null ) in.close(); if( outFile != null ) outFile.close(); } url = tf.toURL(); } URLClassLoader ucl = new URLClassLoader( new URL[] {url} ); listener = ucl.loadClass(fullName); } if( listener != null ) instance = listener.newInstance(); else parseError(var, "Cannot find defined compiler listener " + className); if( ! CompilerListener.class.isInstance(instance) ) parseError(var, "'" + className + "' must be implemented " + CompilerListener.class.toString()); List constraints = OsConstraint.getOsList(var); return( new Object[] {instance, className, constraints} ); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6ecf4c684709c205660b52029f360e1b20e07957/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java
float percentage = ((float)val)*100.0f/(float)this.job_max;
double percentage = ((double)val)*100.0d/(double)this.job_max;
public void progress(int val, String msg) { float percentage = ((float)val)*100.0f/(float)this.job_max; String percent = (new Integer ((int)percentage)).toString()+'%'; String line = this.job_name + ": " + percent; int line_len = line.length(); System.out.print ("\r"+line); for (int i = line_len; i < this.last_line_len; i++) System.out.print (' '); this.last_line_len = line_len; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/CompilePanelAutomationHelper.java/buggy/src/lib/com/izforge/izpack/panels/CompilePanelAutomationHelper.java
createButton.setEnabled(false);
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 (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 (Shortcut.ALL_USERS); } // ---------------------------------------------------- // The create button was pressed. // go ahead and create the shortcut(s) // ---------------------------------------------------- else if (eventSource.equals (createButton)) { try { groupName = programGroup.getText (); } catch (Throwable exception) { groupName = ""; } createShortcuts (); // add files and directories to the uninstaller addToUninstaller (); // Disables the createButton createButton.setEnabled(false); // when finished unlock the next button and lock // the previous button //parent.unlockNextButton (); parent.lockPrevButton (); } // ---------------------------------------------------- // 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 (); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
parent.unlockNextButton ();
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 (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 (Shortcut.ALL_USERS); } // ---------------------------------------------------- // The create button was pressed. // go ahead and create the shortcut(s) // ---------------------------------------------------- else if (eventSource.equals (createButton)) { try { groupName = programGroup.getText (); } catch (Throwable exception) { groupName = ""; } createShortcuts (); // add files and directories to the uninstaller addToUninstaller (); // Disables the createButton createButton.setEnabled(false); // when finished unlock the next button and lock // the previous button //parent.unlockNextButton (); parent.lockPrevButton (); } // ---------------------------------------------------- // 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 (); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
data.addToGroup = false;
private void analyzeShortcutSpec () { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } // ---------------------------------------------------- // 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; } 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.getVariableValueMap ()); 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); data = new ShortcutData (); data.addToGroup = false; data.name = shortcutSpec.getAttribute (SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute (SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute (SPEC_ATTRIBUTE_DESCRIPTION, ""); 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; } // without a target we can not create a shortcut 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.type = Shortcut.DESKTOP; shortcuts.add (data.clone ()); } if (attributeIsTrue (shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.type = Shortcut.APPLICATIONS; shortcuts.add (data.clone ()); } if (attributeIsTrue (shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.type = Shortcut.START_MENU; shortcuts.add (data.clone ()); } if (attributeIsTrue (shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { 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/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
data.addToGroup = false;
private void analyzeShortcutSpec () { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } // ---------------------------------------------------- // 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; } 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.getVariableValueMap ()); 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); data = new ShortcutData (); data.addToGroup = false; data.name = shortcutSpec.getAttribute (SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute (SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute (SPEC_ATTRIBUTE_DESCRIPTION, ""); 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; } // without a target we can not create a shortcut 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.type = Shortcut.DESKTOP; shortcuts.add (data.clone ()); } if (attributeIsTrue (shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.type = Shortcut.APPLICATIONS; shortcuts.add (data.clone ()); } if (attributeIsTrue (shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.type = Shortcut.START_MENU; shortcuts.add (data.clone ()); } if (attributeIsTrue (shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { 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/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
shortcutsCreationDone = true;
parent.unlockNextButton();
private void createShortcuts () { ShortcutData data; for (int i = 0; i < shortcuts.size (); i++) { data = (ShortcutData)shortcuts.elementAt (i); try { groupName = groupName + data.subgroup; shortcut.setLinkName (data.name); shortcut.setLinkType (data.type); shortcut.setArguments (data.commandLine); shortcut.setDescription (data.description); shortcut.setIconLocation (data.iconFile, data.iconIndex); shortcut.setShowCommand (data.initialState); shortcut.setTargetPath (data.target); shortcut.setWorkingDirectory (data.workingDirectory); if (data.addToGroup) { shortcut.setProgramGroup (groupName); } else { shortcut.setProgramGroup (""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ( (data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut.isSelected ()) ) { // save the shortcut shortcut.save (); // add the file and directory name to the file list String fileName = shortcut.getFileName (); String directoryName = shortcut.getDirectoryCreated (); files.add (fileName); if (!(directoryName == null)) { files.add (directoryName); } } } catch (Exception exception) { } } catch (Throwable exception) { continue; } } //parent.unlockNextButton(); shortcutsCreationDone = true; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
!shortcutsCreationDone ||
public void makeXMLData (XMLElement panelRoot) { // ---------------------------------------------------- // if there are no shortcuts to create, shortcuts are // not supported, or we should simulate that they are // not supported, then we have nothing to add. Just // return // ---------------------------------------------------- if (!shortcutsToCreate || !shortcut.supported () || !shortcutsCreationDone || simulteNotSupported ) { return; } ShortcutData data; XMLElement dataElement; // ---------------------------------------------------- // add the item that defines the name of the program group // ---------------------------------------------------- dataElement = new XMLElement (AUTO_KEY_PROGRAM_GROUP); dataElement.setAttribute (AUTO_ATTRIBUTE_NAME, groupName); panelRoot.addChild (dataElement); // ---------------------------------------------------- // add the details for each of the shortcuts // ---------------------------------------------------- for (int i = 0; i < shortcuts.size (); i++) { data = (ShortcutData)shortcuts.elementAt (i); dataElement = new XMLElement (AUTO_KEY_SHORTCUT); dataElement.setAttribute (AUTO_ATTRIBUTE_NAME, data.name); dataElement.setAttribute (AUTO_ATTRIBUTE_GROUP, new Boolean (data.addToGroup).toString ()); dataElement.setAttribute (AUTO_ATTRIBUTE_TYPE, Integer.toString (data.type)); dataElement.setAttribute (AUTO_ATTRIBUTE_COMMAND, data.commandLine); dataElement.setAttribute (AUTO_ATTRIBUTE_DESCRIPTION, data.description); dataElement.setAttribute (AUTO_ATTRIBUTE_ICON, data.iconFile); dataElement.setAttribute (AUTO_ATTRIBUTE_ICON_INDEX, Integer.toString (data.iconIndex)); dataElement.setAttribute (AUTO_ATTRIBUTE_INITIAL_STATE, Integer.toString (data.initialState)); dataElement.setAttribute (AUTO_ATTRIBUTE_TARGET, data.target); dataElement.setAttribute (AUTO_ATTRIBUTE_WORKING_DIR, data.workingDirectory); // ---------------------------------------------- // add the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ( (data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut.isSelected ()) ) { panelRoot.addChild (dataElement); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
parent.lockNextButton ();
public void panelActivate () { analyzeShortcutSpec (); if (shortcutsToCreate) { if (shortcut.supported () && !simulteNotSupported) { //parent.lockNextButton (); buildUI (shortcut.getProgramGroups (ShellLink.CURRENT_USER), true); // always start out with the current user } else { buildAlternateUI (); parent.unlockNextButton (); parent.lockPrevButton (); } } else { parent.skipPanel (); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/80e14fc27a7fb67b4c5101aace4a3e9167e551e3/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
layout = new GridBagLayout(); gbConstraints = new GridBagConstraints();
GridBagLayout layout = new GridBagLayout(); GridBagConstraints gbConstraints = new GridBagConstraints();
public XInfoPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We add the components infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons .getImageIcon("edit"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); textArea = new JTextArea(); textArea.setEditable(false); JScrollPane scroller = new JScrollPane(textArea); parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9); gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/XInfoPanel.java/clean/src/lib/com/izforge/izpack/panels/XInfoPanel.java
infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
JLabel infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
public XInfoPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We add the components infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons .getImageIcon("edit"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); textArea = new JTextArea(); textArea.setEditable(false); JScrollPane scroller = new JScrollPane(textArea); parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9); gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/XInfoPanel.java/clean/src/lib/com/izforge/izpack/panels/XInfoPanel.java
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { // We avoid that the icon is gray while the combo isn't deployed if (index == -1) isSelected = true; // We put the label String iso3 = (String) value; setText(iso3); if (isSelected) { if (lnf.equalsIgnoreCase("swing")) setOpaque(true); else if (index == -1) setOpaque(false); else setOpaque(true); setForeground(list.getSelectionForeground()); setBackground(list.getSelectionBackground()); } else setOpaque(false); // We put the icon if (!icons.containsKey(iso3)) { ImageIcon icon = new ImageIcon(this.getClass().getResource("/res/flag." + iso3)); icons.put(iso3, icon); grayIcons.put(iso3, new ImageIcon(GrayFilter.createDisabledImage(icon.getImage()))); } if (isSelected) setIcon((ImageIcon) icons.get(iso3)); else setIcon((ImageIcon) grayIcons.get(iso3)); // We return return this; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
} else
} else
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { // We avoid that the icon is gray while the combo isn't deployed if (index == -1) isSelected = true; // We put the label String iso3 = (String) value; setText(iso3); if (isSelected) { if (lnf.equalsIgnoreCase("swing")) setOpaque(true); else if (index == -1) setOpaque(false); else setOpaque(true); setForeground(list.getSelectionForeground()); setBackground(list.getSelectionBackground()); } else setOpaque(false); // We put the icon if (!icons.containsKey(iso3)) { ImageIcon icon = new ImageIcon(this.getClass().getResource("/res/flag." + iso3)); icons.put(iso3, icon); grayIcons.put(iso3, new ImageIcon(GrayFilter.createDisabledImage(icon.getImage()))); } if (isSelected) setIcon((ImageIcon) icons.get(iso3)); else setIcon((ImageIcon) grayIcons.get(iso3)); // We return return this; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
ImageIcon icon = new ImageIcon(this.getClass().getResource("/res/flag." + iso3));
ImageIcon icon = new ImageIcon(this.getClass().getResource("/res/flag." + iso3));
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { // We avoid that the icon is gray while the combo isn't deployed if (index == -1) isSelected = true; // We put the label String iso3 = (String) value; setText(iso3); if (isSelected) { if (lnf.equalsIgnoreCase("swing")) setOpaque(true); else if (index == -1) setOpaque(false); else setOpaque(true); setForeground(list.getSelectionForeground()); setBackground(list.getSelectionBackground()); } else setOpaque(false); // We put the icon if (!icons.containsKey(iso3)) { ImageIcon icon = new ImageIcon(this.getClass().getResource("/res/flag." + iso3)); icons.put(iso3, icon); grayIcons.put(iso3, new ImageIcon(GrayFilter.createDisabledImage(icon.getImage()))); } if (isSelected) setIcon((ImageIcon) icons.get(iso3)); else setIcon((ImageIcon) grayIcons.get(iso3)); // We return return this; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
grayIcons.put(iso3, new ImageIcon(GrayFilter.createDisabledImage(icon.getImage())));
grayIcons.put( iso3, new ImageIcon(GrayFilter.createDisabledImage(icon.getImage())));
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { // We avoid that the icon is gray while the combo isn't deployed if (index == -1) isSelected = true; // We put the label String iso3 = (String) value; setText(iso3); if (isSelected) { if (lnf.equalsIgnoreCase("swing")) setOpaque(true); else if (index == -1) setOpaque(false); else setOpaque(true); setForeground(list.getSelectionForeground()); setBackground(list.getSelectionBackground()); } else setOpaque(false); // We put the icon if (!icons.containsKey(iso3)) { ImageIcon icon = new ImageIcon(this.getClass().getResource("/res/flag." + iso3)); icons.put(iso3, icon); grayIcons.put(iso3, new ImageIcon(GrayFilter.createDisabledImage(icon.getImage()))); } if (isSelected) setIcon((ImageIcon) icons.get(iso3)); else setIcon((ImageIcon) grayIcons.get(iso3)); // We return return this; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
catch (Exception err) { }
public LanguageDialog(Object[] items) { super(); try { loadLookAndFeel(); } catch (Exception err) { } // 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; JLabel label1 = new JLabel("Please select your language (ISO3 code)", 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); comboBox = new JComboBox(items); 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(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2 - 10); setResizable(true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
JLabel label1 = new JLabel("Please select your language (ISO3 code)", SwingConstants.CENTER);
JLabel label1 = new JLabel( "Please select your language (ISO3 code)", SwingConstants.CENTER);
public LanguageDialog(Object[] items) { super(); try { loadLookAndFeel(); } catch (Exception err) { } // 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; JLabel label1 = new JLabel("Please select your language (ISO3 code)", 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); comboBox = new JComboBox(items); 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(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2 - 10); setResizable(true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
JLabel label2 = new JLabel("for install instructions:", SwingConstants.CENTER);
JLabel label2 = new JLabel("for install instructions:", SwingConstants.CENTER);
public LanguageDialog(Object[] items) { super(); try { loadLookAndFeel(); } catch (Exception err) { } // 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; JLabel label1 = new JLabel("Please select your language (ISO3 code)", 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); comboBox = new JComboBox(items); 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(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2 - 10); setResizable(true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
setLocation((screenSize.width - frameSize.width) / 2,
setLocation( (screenSize.width - frameSize.width) / 2,
public LanguageDialog(Object[] items) { super(); try { loadLookAndFeel(); } catch (Exception err) { } // 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; JLabel label1 = new JLabel("Please select your language (ISO3 code)", 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); comboBox = new JComboBox(items); 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(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2 - 10); setResizable(true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
img = new ImageIcon(this.getClass().getResource( "/res/installer.langsel.img")); } catch (NullPointerException err)
img = new ImageIcon( this.getClass().getResource("/res/installer.langsel.img")); } catch (NullPointerException err)
public ImageIcon getImage() { ImageIcon img; try { img = new ImageIcon(this.getClass().getResource( "/res/installer.langsel.img")); } catch (NullPointerException err) { img = null; } return img; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
this.installdata = new InstallData();
this.installdata = new InstallData();
public GUIInstaller() throws Exception { super(); this.installdata = new InstallData(); // Loads the installation data loadInstallData(installdata); // add the GUI install data loadGUIInstallData(); // Checks the Java version checkJavaVersion(); // Sets up the GUI L&F loadLookAndFeel(); // Loads the suitable langpack loadLangPack(); // create the resource manager (after the language selection!) ResourceManager.create (this.installdata); // We launch the installer GUI loadGUI(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
loadGUIInstallData();
loadGUIInstallData();
public GUIInstaller() throws Exception { super(); this.installdata = new InstallData(); // Loads the installation data loadInstallData(installdata); // add the GUI install data loadGUIInstallData(); // Checks the Java version checkJavaVersion(); // Sets up the GUI L&F loadLookAndFeel(); // Loads the suitable langpack loadLangPack(); // create the resource manager (after the language selection!) ResourceManager.create (this.installdata); // We launch the installer GUI loadGUI(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
ResourceManager.create (this.installdata);
ResourceManager.create(this.installdata);
public GUIInstaller() throws Exception { super(); this.installdata = new InstallData(); // Loads the installation data loadInstallData(installdata); // add the GUI install data loadGUIInstallData(); // Checks the Java version checkJavaVersion(); // Sets up the GUI L&F loadLookAndFeel(); // Loads the suitable langpack loadLangPack(); // create the resource manager (after the language selection!) ResourceManager.create (this.installdata); // We launch the installer GUI loadGUI(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
System.out.println("> The minimum Java version required is " + required);
System.out.println("> The minimum Java version required is " + required);
private void checkJavaVersion() throws Exception { String version = System.getProperty("java.version"); String required = this.installdata.info.getJavaVersion(); if (version.compareTo(required) < 0) { System.out.println("Can't install !"); System.out.println("> The minimum Java version required is " + required); System.out.println("> Your version is " + version); System.out.println("Please upgrade to the minimum version."); System.exit(1); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
UIManager.put("OptionPane.yesButtonText", installdata.langpack.getString("installer.yes")); UIManager.put("OptionPane.noButtonText", installdata.langpack.getString("installer.no")); UIManager.put("OptionPane.cancelButtonText", installdata.langpack.getString("installer.cancel"));
UIManager.put( "OptionPane.yesButtonText", installdata.langpack.getString("installer.yes")); UIManager.put( "OptionPane.noButtonText", installdata.langpack.getString("installer.no")); UIManager.put( "OptionPane.cancelButtonText", installdata.langpack.getString("installer.cancel"));
private void loadGUI() throws Exception { UIManager.put("OptionPane.yesButtonText", installdata.langpack.getString("installer.yes")); UIManager.put("OptionPane.noButtonText", installdata.langpack.getString("installer.no")); UIManager.put("OptionPane.cancelButtonText", installdata.langpack.getString("installer.cancel")); String title = installdata.langpack.getString("installer.title") + this.installdata.info.getAppName(); new InstallerFrame(title, this.installdata); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
String title = installdata.langpack.getString("installer.title") + this.installdata.info.getAppName();
String title = installdata.langpack.getString("installer.title") + this.installdata.info.getAppName();
private void loadGUI() throws Exception { UIManager.put("OptionPane.yesButtonText", installdata.langpack.getString("installer.yes")); UIManager.put("OptionPane.noButtonText", installdata.langpack.getString("installer.no")); UIManager.put("OptionPane.cancelButtonText", installdata.langpack.getString("installer.cancel")); String title = installdata.langpack.getString("installer.title") + this.installdata.info.getAppName(); new InstallerFrame(title, this.installdata); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
public void loadGUIInstallData() throws Exception
public void loadGUIInstallData() throws Exception
public void loadGUIInstallData() throws Exception { InputStream in = getClass().getResourceAsStream("/GUIPrefs"); ObjectInputStream objIn = new ObjectInputStream(in); this.installdata.guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
InputStream in = getClass().getResourceAsStream("/GUIPrefs"); ObjectInputStream objIn = new ObjectInputStream(in); this.installdata.guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); }
InputStream in = getClass().getResourceAsStream("/GUIPrefs"); ObjectInputStream objIn = new ObjectInputStream(in); this.installdata.guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); }
public void loadGUIInstallData() throws Exception { InputStream in = getClass().getResourceAsStream("/GUIPrefs"); ObjectInputStream objIn = new ObjectInputStream(in); this.installdata.guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
} else
} else
private void loadLangPack() throws Exception { // Initialisations ArrayList availableLangPacks = getAvailableLangPacks(); int npacks = availableLangPacks.size(); if (npacks == 0) throw new Exception("no language pack available"); String selectedPack; // We get the langpack name if (npacks != 1) { LanguageDialog picker = new LanguageDialog(availableLangPacks.toArray()); picker.setSelection(Locale.getDefault().getISO3Country().toLowerCase()); picker.setModal(true); picker.show(); selectedPack = (String) picker.getSelection(); if (selectedPack == null) throw new Exception("installation canceled"); } else selectedPack = (String) availableLangPacks.get(0); // We add an xml data information this.installdata.xmlData.setAttribute("langpack", selectedPack); // We load the langpack installdata.localeISO3 = selectedPack; installdata.setVariable(ScriptParser.ISO3_LANG, installdata.localeISO3); InputStream in = getClass().getResourceAsStream("/langpacks/" + selectedPack + ".xml"); this.installdata.langpack = new LocaleDatabase(in); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
InputStream in = getClass().getResourceAsStream("/langpacks/" + selectedPack + ".xml");
InputStream in = getClass().getResourceAsStream("/langpacks/" + selectedPack + ".xml");
private void loadLangPack() throws Exception { // Initialisations ArrayList availableLangPacks = getAvailableLangPacks(); int npacks = availableLangPacks.size(); if (npacks == 0) throw new Exception("no language pack available"); String selectedPack; // We get the langpack name if (npacks != 1) { LanguageDialog picker = new LanguageDialog(availableLangPacks.toArray()); picker.setSelection(Locale.getDefault().getISO3Country().toLowerCase()); picker.setModal(true); picker.show(); selectedPack = (String) picker.getSelection(); if (selectedPack == null) throw new Exception("installation canceled"); } else selectedPack = (String) availableLangPacks.get(0); // We add an xml data information this.installdata.xmlData.setAttribute("langpack", selectedPack); // We load the langpack installdata.localeISO3 = selectedPack; installdata.setVariable(ScriptParser.ISO3_LANG, installdata.localeISO3); InputStream in = getClass().getResourceAsStream("/langpacks/" + selectedPack + ".xml"); this.installdata.langpack = new LocaleDatabase(in); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
if (this.installdata.kind.equalsIgnoreCase("standard") || this.installdata.kind.equalsIgnoreCase("web"))
if (this.installdata.kind.equalsIgnoreCase("standard") || this.installdata.kind.equalsIgnoreCase("web"))
protected void loadLookAndFeel() throws Exception { if (this.installdata.kind.equalsIgnoreCase("standard") || this.installdata.kind.equalsIgnoreCase("web")) { if (getClass().getResourceAsStream("/res/useNativeLAF") != null) { String nlaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(nlaf); } if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { // We simply put our nice theme MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); this.installdata.buttonsHColor = new Color(182, 182, 204); } lnf = "swing"; } else if (this.installdata.kind.equalsIgnoreCase("standard-kunststoff") || this.installdata.kind.equalsIgnoreCase("web-kunststoff")) { ButtonFactory.useHighlightButtons(); // We change the highlight color for the buttons this.installdata.buttonsHColor = new Color(255, 255, 255); // Some reflection ... Class laf = 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 = laf.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) laf.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = {ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; } ButtonFactory.useButtonIcons(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); this.installdata.buttonsHColor = new Color(182, 182, 204);
if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); this.installdata.buttonsHColor = new Color(182, 182, 204);
protected void loadLookAndFeel() throws Exception { if (this.installdata.kind.equalsIgnoreCase("standard") || this.installdata.kind.equalsIgnoreCase("web")) { if (getClass().getResourceAsStream("/res/useNativeLAF") != null) { String nlaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(nlaf); } if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { // We simply put our nice theme MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); this.installdata.buttonsHColor = new Color(182, 182, 204); } lnf = "swing"; } else if (this.installdata.kind.equalsIgnoreCase("standard-kunststoff") || this.installdata.kind.equalsIgnoreCase("web-kunststoff")) { ButtonFactory.useHighlightButtons(); // We change the highlight color for the buttons this.installdata.buttonsHColor = new Color(255, 255, 255); // Some reflection ... Class laf = 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 = laf.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) laf.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = {ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; } ButtonFactory.useButtonIcons(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
} else if (this.installdata.kind.equalsIgnoreCase("standard-kunststoff") || this.installdata.kind.equalsIgnoreCase("web-kunststoff"))
} else if ( this.installdata.kind.equalsIgnoreCase("standard-kunststoff") || this.installdata.kind.equalsIgnoreCase("web-kunststoff"))
protected void loadLookAndFeel() throws Exception { if (this.installdata.kind.equalsIgnoreCase("standard") || this.installdata.kind.equalsIgnoreCase("web")) { if (getClass().getResourceAsStream("/res/useNativeLAF") != null) { String nlaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(nlaf); } if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { // We simply put our nice theme MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); this.installdata.buttonsHColor = new Color(182, 182, 204); } lnf = "swing"; } else if (this.installdata.kind.equalsIgnoreCase("standard-kunststoff") || this.installdata.kind.equalsIgnoreCase("web-kunststoff")) { ButtonFactory.useHighlightButtons(); // We change the highlight color for the buttons this.installdata.buttonsHColor = new Color(255, 255, 255); // Some reflection ... Class laf = 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 = laf.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) laf.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = {ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; } ButtonFactory.useButtonIcons(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
ButtonFactory.useHighlightButtons();
ButtonFactory.useHighlightButtons();
protected void loadLookAndFeel() throws Exception { if (this.installdata.kind.equalsIgnoreCase("standard") || this.installdata.kind.equalsIgnoreCase("web")) { if (getClass().getResourceAsStream("/res/useNativeLAF") != null) { String nlaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(nlaf); } if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { // We simply put our nice theme MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); this.installdata.buttonsHColor = new Color(182, 182, 204); } lnf = "swing"; } else if (this.installdata.kind.equalsIgnoreCase("standard-kunststoff") || this.installdata.kind.equalsIgnoreCase("web-kunststoff")) { ButtonFactory.useHighlightButtons(); // We change the highlight color for the buttons this.installdata.buttonsHColor = new Color(255, 255, 255); // Some reflection ... Class laf = 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 = laf.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) laf.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = {ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; } ButtonFactory.useButtonIcons(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
Class laf = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel");
Class laf = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel");
protected void loadLookAndFeel() throws Exception { if (this.installdata.kind.equalsIgnoreCase("standard") || this.installdata.kind.equalsIgnoreCase("web")) { if (getClass().getResourceAsStream("/res/useNativeLAF") != null) { String nlaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(nlaf); } if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { // We simply put our nice theme MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); this.installdata.buttonsHColor = new Color(182, 182, 204); } lnf = "swing"; } else if (this.installdata.kind.equalsIgnoreCase("standard-kunststoff") || this.installdata.kind.equalsIgnoreCase("web-kunststoff")) { ButtonFactory.useHighlightButtons(); // We change the highlight color for the buttons this.installdata.buttonsHColor = new Color(255, 255, 255); // Some reflection ... Class laf = 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 = laf.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) laf.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = {ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; } ButtonFactory.useButtonIcons(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
Class[] params = {mtheme};
Class[] params = { mtheme };
protected void loadLookAndFeel() throws Exception { if (this.installdata.kind.equalsIgnoreCase("standard") || this.installdata.kind.equalsIgnoreCase("web")) { if (getClass().getResourceAsStream("/res/useNativeLAF") != null) { String nlaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(nlaf); } if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { // We simply put our nice theme MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); this.installdata.buttonsHColor = new Color(182, 182, 204); } lnf = "swing"; } else if (this.installdata.kind.equalsIgnoreCase("standard-kunststoff") || this.installdata.kind.equalsIgnoreCase("web-kunststoff")) { ButtonFactory.useHighlightButtons(); // We change the highlight color for the buttons this.installdata.buttonsHColor = new Color(255, 255, 255); // Some reflection ... Class laf = 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 = laf.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) laf.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = {ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; } ButtonFactory.useButtonIcons(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
Object[] kparams = {ktheme};
Object[] kparams = { ktheme };
protected void loadLookAndFeel() throws Exception { if (this.installdata.kind.equalsIgnoreCase("standard") || this.installdata.kind.equalsIgnoreCase("web")) { if (getClass().getResourceAsStream("/res/useNativeLAF") != null) { String nlaf = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(nlaf); } if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { // We simply put our nice theme MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); ButtonFactory.useHighlightButtons(); this.installdata.buttonsHColor = new Color(182, 182, 204); } lnf = "swing"; } else if (this.installdata.kind.equalsIgnoreCase("standard-kunststoff") || this.installdata.kind.equalsIgnoreCase("web-kunststoff")) { ButtonFactory.useHighlightButtons(); // We change the highlight color for the buttons this.installdata.buttonsHColor = new Color(255, 255, 255); // Some reflection ... Class laf = 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 = laf.getMethod("setCurrentTheme", params); // We invoke and place Kunststoff as our L&F LookAndFeel kunststoff = (LookAndFeel) laf.newInstance(); MetalTheme ktheme = (MetalTheme) theme.newInstance(); Object[] kparams = {ktheme}; UIManager.setLookAndFeel(kunststoff); setCurrentThemeMethod.invoke(kunststoff, kparams); lnf = "kunststoff"; } ButtonFactory.useButtonIcons(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/GUIInstaller.java/clean/src/lib/com/izforge/izpack/installer/GUIInstaller.java
private final boolean compareVersions(String in, String template, boolean isMin,
private boolean compareVersions(String in, String template, boolean isMin,
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 = 0; int neededVal = 0; 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/9619b3a25f43787dc92011111668210e06c00c71/JDKPathPanel.java/clean/src/lib/com/izforge/izpack/panels/JDKPathPanel.java
if (chosenPath.length() > 0 && var != null && var.equalsIgnoreCase("yes"))
if (chosenPath.length() > 0 && var != null && "yes".equalsIgnoreCase(var))
public void panelActivate() { // Resolve the default for chosenPath super.panelActivate(); String chosenPath; // The variable will be exist if we enter this panel // second time. We would maintain the previos // selected path. if (idata.getVariable(getVariableName()) != null) chosenPath = idata.getVariable(getVariableName()); else // Try the JAVA_HOME as child dir of the jdk path chosenPath = (new File(idata.getVariable("JAVA_HOME"))).getParent(); // Set the path for method pathIsValid ... pathSelectionPanel.setPath(chosenPath); if (!pathIsValid() || !verifyVersion()) chosenPath = ""; // Set the default to the path selection panel. pathSelectionPanel.setPath(chosenPath); String var = idata.getVariable("JDKPathPanel.skipIfValid"); // Should we skip this panel? if (chosenPath.length() > 0 && var != null && var.equalsIgnoreCase("yes")) { idata.setVariable(getVariableName(), chosenPath); parent.skipPanel(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/JDKPathPanel.java/clean/src/lib/com/izforge/izpack/panels/JDKPathPanel.java
private final boolean verifyVersion()
private boolean verifyVersion()
private final boolean verifyVersion() { String min = getMinVersion(); String max = getMaxVersion(); // No min and max, version always ok. if (min == null && max == null) return (true); if (!pathIsValid()) return (false); // No get the version ... // We cannot look to the version of this vm because we should // test the given JDK VM. String[] params = { pathSelectionPanel.getPath() + File.separator + "bin" + File.separator + "java", "-version"}; String[] output = new String[2]; FileExecutor fe = new FileExecutor(); fe.executeCommand(params, output); // "My" VM writes the version on stderr :-( String vs = (output[0].length() > 0) ? output[0] : output[1]; if (min != null) { if (!compareVersions(vs, min, true, 4, 4, "__NO_NOT_IDENTIFIER_")) return (false); } if (max != null) if (!compareVersions(vs, max, false, 4, 4, "__NO_NOT_IDENTIFIER_")) return (false); return (true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/JDKPathPanel.java/clean/src/lib/com/izforge/izpack/panels/JDKPathPanel.java
hlp.append("Exec='" + $Exec + "'" + S + $Arguments + N);
hlp.append("Exec="+ $E_QUOT + $Exec + $E_QUOT + S + $Arguments + N);
public Unix_Shortcut() { StringBuffer hlp = new StringBuffer(); String userLanguage = System.getProperty("user.language", "en"); hlp.append("[Desktop Entry]" + N); hlp.append("Comment=" + $Comment + N); hlp.append("Comment[" + userLanguage + "]=" + $Comment + N); hlp.append("Encoding=" + $Encoding + N); hlp.append("Exec='" + $Exec + "'" + S + $Arguments + N); hlp.append("GenericName=" + $GenericName + N); hlp.append("GenericName[" + userLanguage + "]=" + $GenericName + N); hlp.append("Icon=" + $Icon + N); hlp.append("MimeType=" + $MimeType + N); hlp.append("Name=" + $Name + N); hlp.append("Name[" + userLanguage + "]=" + $Name + N); hlp.append("Path='" + $Path + "'" + N); hlp.append("ServiceTypes=" + $ServiceTypes + N); hlp.append("SwallowExec=" + $SwallowExec + N); hlp.append("SwallowTitle=" + $SwallowTitle + N); hlp.append("Terminal=" + $Terminal + N); hlp.append("TerminalOptions=" + $Options_For_Terminal + N); hlp.append("Type=" + $Type + N); hlp.append("URL=" + $URL + N); hlp.append("X-KDE-SubstituteUID=" + $X_KDE_SubstituteUID + N); hlp.append("X-KDE-Username=" + $X_KDE_Username + N); template = hlp.toString(); props = new Properties(); initProps(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
hlp.append("Path='" + $Path + "'" + N);
hlp.append("Path="+ $P_QUOT + $Path + $P_QUOT + N);
public Unix_Shortcut() { StringBuffer hlp = new StringBuffer(); String userLanguage = System.getProperty("user.language", "en"); hlp.append("[Desktop Entry]" + N); hlp.append("Comment=" + $Comment + N); hlp.append("Comment[" + userLanguage + "]=" + $Comment + N); hlp.append("Encoding=" + $Encoding + N); hlp.append("Exec='" + $Exec + "'" + S + $Arguments + N); hlp.append("GenericName=" + $GenericName + N); hlp.append("GenericName[" + userLanguage + "]=" + $GenericName + N); hlp.append("Icon=" + $Icon + N); hlp.append("MimeType=" + $MimeType + N); hlp.append("Name=" + $Name + N); hlp.append("Name[" + userLanguage + "]=" + $Name + N); hlp.append("Path='" + $Path + "'" + N); hlp.append("ServiceTypes=" + $ServiceTypes + N); hlp.append("SwallowExec=" + $SwallowExec + N); hlp.append("SwallowTitle=" + $SwallowTitle + N); hlp.append("Terminal=" + $Terminal + N); hlp.append("TerminalOptions=" + $Options_For_Terminal + N); hlp.append("Type=" + $Type + N); hlp.append("URL=" + $URL + N); hlp.append("X-KDE-SubstituteUID=" + $X_KDE_SubstituteUID + N); hlp.append("X-KDE-Username=" + $X_KDE_Username + N); template = hlp.toString(); props = new Properties(); initProps(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
hlp.append(N); hlp.append(C + "created by" + S + getClass().getName() + S + rev + N ); hlp.append(C + version );
public Unix_Shortcut() { StringBuffer hlp = new StringBuffer(); String userLanguage = System.getProperty("user.language", "en"); hlp.append("[Desktop Entry]" + N); hlp.append("Comment=" + $Comment + N); hlp.append("Comment[" + userLanguage + "]=" + $Comment + N); hlp.append("Encoding=" + $Encoding + N); hlp.append("Exec='" + $Exec + "'" + S + $Arguments + N); hlp.append("GenericName=" + $GenericName + N); hlp.append("GenericName[" + userLanguage + "]=" + $GenericName + N); hlp.append("Icon=" + $Icon + N); hlp.append("MimeType=" + $MimeType + N); hlp.append("Name=" + $Name + N); hlp.append("Name[" + userLanguage + "]=" + $Name + N); hlp.append("Path='" + $Path + "'" + N); hlp.append("ServiceTypes=" + $ServiceTypes + N); hlp.append("SwallowExec=" + $SwallowExec + N); hlp.append("SwallowTitle=" + $SwallowTitle + N); hlp.append("Terminal=" + $Terminal + N); hlp.append("TerminalOptions=" + $Options_For_Terminal + N); hlp.append("Type=" + $Type + N); hlp.append("URL=" + $URL + N); hlp.append("X-KDE-SubstituteUID=" + $X_KDE_SubstituteUID + N); hlp.append("X-KDE-Username=" + $X_KDE_Username + N); template = hlp.toString(); props = new Properties(); initProps(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
return this.createdDirectory;
return this.createdDirectory;
public String getDirectoryCreated() { return this.createdDirectory; // while not stored... }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
String FS = File.separator;
public Vector getProgramGroups(int userType) { // if( userType > CURRENT_USER ) // if( System.getProperty( "user.name" ).equals( "root" ) ) String FS = File.separator; // System.out.println( "userType" + userType ); Vector groups = new Vector(); File homedir = new File(System.getProperty("user.home")); File kdeHomeShareApplnk; try { File kdeHome = new File(homedir.toString() + FS + ".kde"); if (!kdeHome.exists()) return (groups); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); if (!kdeHomeShare.exists()) return (groups); kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + "applnk"); String[] applnkFolders = { "applnk-mdk", "applnk-redhat", "applnk"}; for (int i = 0; i < applnkFolders.length; i++) { kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + applnkFolders[i]); if (kdeHomeShareApplnk.exists()) { itsApplnkFolder = applnkFolders[i]; break; } } if (!kdeHomeShareApplnk.exists()) return (groups); } catch (Exception e1) { // e1.printStackTrace(); return (groups); } try { File[] listing = kdeHomeShareApplnk.listFiles(); for (int i = 0; i < listing.length; i++) { if (listing[i].isDirectory()) { groups.add(listing[i].getName()); } } } catch (Exception e) { // ignore and return an empty vector. } return (groups); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
File homedir = new File(System.getProperty("user.home")); File kdeHomeShareApplnk; try { File kdeHome = new File(homedir.toString() + FS + ".kde"); if (!kdeHome.exists()) return (groups); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); if (!kdeHomeShare.exists()) return (groups); kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + "applnk"); String[] applnkFolders = { "applnk-mdk", "applnk-redhat", "applnk"}; for (int i = 0; i < applnkFolders.length; i++) { kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + applnkFolders[i]); if (kdeHomeShareApplnk.exists()) { itsApplnkFolder = applnkFolders[i]; break; } } if (!kdeHomeShareApplnk.exists()) return (groups); } catch (Exception e1) { e1.printStackTrace(); return (groups); }
File kdeShareApplnk = getKdeShareApplnkFolder(userType);
public Vector getProgramGroups(int userType) { // if( userType > CURRENT_USER ) // if( System.getProperty( "user.name" ).equals( "root" ) ) String FS = File.separator; // System.out.println( "userType" + userType ); Vector groups = new Vector(); File homedir = new File(System.getProperty("user.home")); File kdeHomeShareApplnk; try { File kdeHome = new File(homedir.toString() + FS + ".kde"); if (!kdeHome.exists()) return (groups); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); if (!kdeHomeShare.exists()) return (groups); kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + "applnk"); String[] applnkFolders = { "applnk-mdk", "applnk-redhat", "applnk"}; for (int i = 0; i < applnkFolders.length; i++) { kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + applnkFolders[i]); if (kdeHomeShareApplnk.exists()) { itsApplnkFolder = applnkFolders[i]; break; } } if (!kdeHomeShareApplnk.exists()) return (groups); } catch (Exception e1) { // e1.printStackTrace(); return (groups); } try { File[] listing = kdeHomeShareApplnk.listFiles(); for (int i = 0; i < listing.length; i++) { if (listing[i].isDirectory()) { groups.add(listing[i].getName()); } } } catch (Exception e) { // ignore and return an empty vector. } return (groups); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
File[] listing = kdeHomeShareApplnk.listFiles();
File[] listing = kdeShareApplnk.listFiles();
public Vector getProgramGroups(int userType) { // if( userType > CURRENT_USER ) // if( System.getProperty( "user.name" ).equals( "root" ) ) String FS = File.separator; // System.out.println( "userType" + userType ); Vector groups = new Vector(); File homedir = new File(System.getProperty("user.home")); File kdeHomeShareApplnk; try { File kdeHome = new File(homedir.toString() + FS + ".kde"); if (!kdeHome.exists()) return (groups); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); if (!kdeHomeShare.exists()) return (groups); kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + "applnk"); String[] applnkFolders = { "applnk-mdk", "applnk-redhat", "applnk"}; for (int i = 0; i < applnkFolders.length; i++) { kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + applnkFolders[i]); if (kdeHomeShareApplnk.exists()) { itsApplnkFolder = applnkFolders[i]; break; } } if (!kdeHomeShareApplnk.exists()) return (groups); } catch (Exception e1) { // e1.printStackTrace(); return (groups); } try { File[] listing = kdeHomeShareApplnk.listFiles(); for (int i = 0; i < listing.length; i++) { if (listing[i].isDirectory()) { groups.add(listing[i].getName()); } } } catch (Exception e) { // ignore and return an empty vector. } return (groups); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
public Vector getProgramGroups(int userType) { // if( userType > CURRENT_USER ) // if( System.getProperty( "user.name" ).equals( "root" ) ) String FS = File.separator; // System.out.println( "userType" + userType ); Vector groups = new Vector(); File homedir = new File(System.getProperty("user.home")); File kdeHomeShareApplnk; try { File kdeHome = new File(homedir.toString() + FS + ".kde"); if (!kdeHome.exists()) return (groups); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); if (!kdeHomeShare.exists()) return (groups); kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + "applnk"); String[] applnkFolders = { "applnk-mdk", "applnk-redhat", "applnk"}; for (int i = 0; i < applnkFolders.length; i++) { kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + applnkFolders[i]); if (kdeHomeShareApplnk.exists()) { itsApplnkFolder = applnkFolders[i]; break; } } if (!kdeHomeShareApplnk.exists()) return (groups); } catch (Exception e1) { // e1.printStackTrace(); return (groups); } try { File[] listing = kdeHomeShareApplnk.listFiles(); for (int i = 0; i < listing.length; i++) { if (listing[i].isDirectory()) { groups.add(listing[i].getName()); } } } catch (Exception e) { // ignore and return an empty vector. } return (groups); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
$Type, $X_KDE_SubstituteUID, $X_KDE_Username, $Icon, $URL};
$Type, $X_KDE_SubstituteUID, $X_KDE_Username, $Icon, $URL, $E_QUOT, $P_QUOT };
private void initProps() { String[] propsArray = { $Comment, $$LANG_Comment, $Encoding, $Exec, $Arguments, $GenericName, $$LANG_GenericName, $MimeType, $Name, $$LANG_Name, $Path, $ServiceTypes, $SwallowExec, $SwallowTitle, $Terminal, $Options_For_Terminal, $Type, $X_KDE_SubstituteUID, $X_KDE_Username, $Icon, $URL}; for (int i = 0; i < propsArray.length; i++) { props.put(propsArray[i], ""); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
public String replace() { String result = new String(template); Enumeration enum = props.keys(); while (enum.hasMoreElements()) { String key = (String) enum.nextElement(); // **DEBUG: System.out.println(key+"="+props.getProperty( key )); result = StringTool.replace(result, key, props.getProperty(key)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
if ((this.itsGroupName == null) || ("".equals(this.itsGroupName)))
boolean rootUser4All = this.getUserType() == Shortcut.ALL_USERS; boolean create4All = this.getCreateForAll().booleanValue(); if ("".equals(this.itsGroupName) && this.getLinkType() == Shortcut.DESKTOP)
public void save() throws Exception { String FS = File.separator; String target = null; String shortCutDef = this.replace(); if ((this.itsGroupName == null) || ("".equals(this.itsGroupName))) { target = System.getProperty("user.home") + FS + "Desktop" + FS + this.itsName + DESKTOP_EXT; } else { File homedir = new File(System.getProperty("user.home")); File kdeHome = new File(homedir.toString() + FS + ".kde"); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); File kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + itsApplnkFolder); target = kdeHomeShareApplnk.toString() + FS + this.itsGroupName + FS + this.itsName + DESKTOP_EXT; } File targetPath = new File(target.toString().substring(0, target.toString().lastIndexOf(File.separatorChar))); if (!targetPath.exists()) { targetPath.mkdirs(); this.createdDirectory = targetPath.toString(); } this.itsFileName = new String(target); File targetFileName = new File(target); FileWriter fileWriter = null; try { fileWriter = new FileWriter(targetFileName); } catch (IOException e1) { e1.printStackTrace(); } try { fileWriter.write(shortCutDef); } catch (IOException e) { e.printStackTrace(); } try { fileWriter.close(); } catch (IOException e2) { e2.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
File homedir = new File(System.getProperty("user.home")); File kdeHome = new File(homedir.toString() + FS + ".kde"); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); File kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + itsApplnkFolder);
File kdeHomeShareApplnk = getKdeShareApplnkFolder(this.getUserType());
public void save() throws Exception { String FS = File.separator; String target = null; String shortCutDef = this.replace(); if ((this.itsGroupName == null) || ("".equals(this.itsGroupName))) { target = System.getProperty("user.home") + FS + "Desktop" + FS + this.itsName + DESKTOP_EXT; } else { File homedir = new File(System.getProperty("user.home")); File kdeHome = new File(homedir.toString() + FS + ".kde"); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); File kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + itsApplnkFolder); target = kdeHomeShareApplnk.toString() + FS + this.itsGroupName + FS + this.itsName + DESKTOP_EXT; } File targetPath = new File(target.toString().substring(0, target.toString().lastIndexOf(File.separatorChar))); if (!targetPath.exists()) { targetPath.mkdirs(); this.createdDirectory = targetPath.toString(); } this.itsFileName = new String(target); File targetFileName = new File(target); FileWriter fileWriter = null; try { fileWriter = new FileWriter(targetFileName); } catch (IOException e1) { e1.printStackTrace(); } try { fileWriter.write(shortCutDef); } catch (IOException e) { e.printStackTrace(); } try { fileWriter.close(); } catch (IOException e2) { e2.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
} File targetPath = new File(target.toString().substring(0, target.toString().lastIndexOf(File.separatorChar))); if (!targetPath.exists()) { targetPath.mkdirs(); this.createdDirectory = targetPath.toString(); }
this.itsFileName = new String(target);
public void save() throws Exception { String FS = File.separator; String target = null; String shortCutDef = this.replace(); if ((this.itsGroupName == null) || ("".equals(this.itsGroupName))) { target = System.getProperty("user.home") + FS + "Desktop" + FS + this.itsName + DESKTOP_EXT; } else { File homedir = new File(System.getProperty("user.home")); File kdeHome = new File(homedir.toString() + FS + ".kde"); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); File kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + itsApplnkFolder); target = kdeHomeShareApplnk.toString() + FS + this.itsGroupName + FS + this.itsName + DESKTOP_EXT; } File targetPath = new File(target.toString().substring(0, target.toString().lastIndexOf(File.separatorChar))); if (!targetPath.exists()) { targetPath.mkdirs(); this.createdDirectory = targetPath.toString(); } this.itsFileName = new String(target); File targetFileName = new File(target); FileWriter fileWriter = null; try { fileWriter = new FileWriter(targetFileName); } catch (IOException e1) { e1.printStackTrace(); } try { fileWriter.write(shortCutDef); } catch (IOException e) { e.printStackTrace(); } try { fileWriter.close(); } catch (IOException e2) { e2.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this.itsFileName = new String(target); File targetFileName = new File(target); FileWriter fileWriter = null; try { fileWriter = new FileWriter(targetFileName); } catch (IOException e1) { e1.printStackTrace(); } try { fileWriter.write(shortCutDef); } catch (IOException e) { e.printStackTrace(); } try { fileWriter.close(); } catch (IOException e2) { e2.printStackTrace();
if (rootUser4All && !create4All) { return; } writeShortCut(target, shortCutDef);
public void save() throws Exception { String FS = File.separator; String target = null; String shortCutDef = this.replace(); if ((this.itsGroupName == null) || ("".equals(this.itsGroupName))) { target = System.getProperty("user.home") + FS + "Desktop" + FS + this.itsName + DESKTOP_EXT; } else { File homedir = new File(System.getProperty("user.home")); File kdeHome = new File(homedir.toString() + FS + ".kde"); File kdeHomeShare = new File(kdeHome.toString() + FS + "share"); File kdeHomeShareApplnk = new File(kdeHomeShare.toString() + FS + itsApplnkFolder); target = kdeHomeShareApplnk.toString() + FS + this.itsGroupName + FS + this.itsName + DESKTOP_EXT; } File targetPath = new File(target.toString().substring(0, target.toString().lastIndexOf(File.separatorChar))); if (!targetPath.exists()) { targetPath.mkdirs(); this.createdDirectory = targetPath.toString(); } this.itsFileName = new String(target); File targetFileName = new File(target); FileWriter fileWriter = null; try { fileWriter = new FileWriter(targetFileName); } catch (IOException e1) { e1.printStackTrace(); } try { fileWriter.write(shortCutDef); } catch (IOException e) { e.printStackTrace(); } try { fileWriter.close(); } catch (IOException e2) { e2.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
public void setIconLocation(String path, int index) { this.itsIconPath = path; this.itsIconIndex = index; props.put($Icon, path); // }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
StringTokenizer whiteSpaceTester = new StringTokenizer( aPath ); if( whiteSpaceTester.countTokens() > 1 ) props.put( $E_QUOT,QM );
public void setTargetPath(String aPath) { this.itsTargetPath = aPath; props.put($Exec, aPath); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
StringTokenizer whiteSpaceTester = new StringTokenizer( aDirectory ); if( whiteSpaceTester.countTokens() > 1 ) props.put( $P_QUOT,QM );
public void setWorkingDirectory(String aDirectory) { this.itsWorkingDirectory = aDirectory; props.put($Path, aDirectory); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d111fa07f5ac6767b0c3f0110542d9ef7e81b5c8/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
el.getAttribute("os"),
public void updateComponents() { // We get our base root XMLElement root = installation.getFirstChildNamed("packs"); // We fill our vector packs = new Vector(); files = new Vector(); Vector v = root.getChildrenNamed("pack"); int size = v.size(); for (int i = 0; i < size; i++) { XMLElement el = (XMLElement) v.get(i); Pack p = new Pack(el.getAttribute("name"), el.getFirstChildNamed("description").getContent(), el.getAttribute("required").equalsIgnoreCase("yes")); packs.add(p); } // We fill the lists packsList.setListData(packs); if (curPack != -1) packsList.setSelectedIndex(curPack); filesList.setListData(files); if (curFile != -1) filesList.setSelectedIndex(curFile); parsableCheckBox.setSelected(false); scriptPropsButton.setEnabled(false); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c3234416ca8408295e1d45c60daee2efe9c3f5db/FrontendPacksTab.java/clean/src/lib/com/izforge/izpack/frontend/FrontendPacksTab.java
if("1.5".equals(annotationType) || TestNG.JDK5_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JDK5_ANNOTATION_TYPE;
AnnotationTypeEnum annoType= AnnotationTypeEnum.JDK; try { annoType= AnnotationTypeEnum.valueOf(annotationType);
private static String convert(String annotationType) { if("1.5".equals(annotationType) || TestNG.JDK5_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JDK5_ANNOTATION_TYPE; } if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JAVADOC_ANNOTATION_TYPE; } TestNGPlugin.log(new Status(IStatus.INFO, TestNGPlugin.PLUGIN_ID, 1, "Unknown annotation type '" + annotationType + "' Using default: " + TestNG.JDK5_ANNOTATION_TYPE , null) ); return TestNG.JDK5_ANNOTATION_TYPE; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/1bed3276c436b35c725a944299219be0d85ab7c1/SuiteBuilder.java/clean/src/main/org/testng/eclipse/util/SuiteBuilder.java
if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JAVADOC_ANNOTATION_TYPE;
catch(RuntimeException re) { TestNGPlugin.log(new Status(IStatus.INFO, TestNGPlugin.PLUGIN_ID, 1, "Unknown annotation type '" + annotationType + "' Using default: " + TestNG.JDK_ANNOTATION_TYPE, null));
private static String convert(String annotationType) { if("1.5".equals(annotationType) || TestNG.JDK5_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JDK5_ANNOTATION_TYPE; } if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JAVADOC_ANNOTATION_TYPE; } TestNGPlugin.log(new Status(IStatus.INFO, TestNGPlugin.PLUGIN_ID, 1, "Unknown annotation type '" + annotationType + "' Using default: " + TestNG.JDK5_ANNOTATION_TYPE , null) ); return TestNG.JDK5_ANNOTATION_TYPE; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/1bed3276c436b35c725a944299219be0d85ab7c1/SuiteBuilder.java/clean/src/main/org/testng/eclipse/util/SuiteBuilder.java
TestNGPlugin.log(new Status(IStatus.INFO, TestNGPlugin.PLUGIN_ID, 1, "Unknown annotation type '" + annotationType + "' Using default: " + TestNG.JDK5_ANNOTATION_TYPE , null) );
private static String convert(String annotationType) { if("1.5".equals(annotationType) || TestNG.JDK5_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JDK5_ANNOTATION_TYPE; } if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JAVADOC_ANNOTATION_TYPE; } TestNGPlugin.log(new Status(IStatus.INFO, TestNGPlugin.PLUGIN_ID, 1, "Unknown annotation type '" + annotationType + "' Using default: " + TestNG.JDK5_ANNOTATION_TYPE , null) ); return TestNG.JDK5_ANNOTATION_TYPE; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/1bed3276c436b35c725a944299219be0d85ab7c1/SuiteBuilder.java/clean/src/main/org/testng/eclipse/util/SuiteBuilder.java
return TestNG.JDK5_ANNOTATION_TYPE;
return annoType.toString();
private static String convert(String annotationType) { if("1.5".equals(annotationType) || TestNG.JDK5_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JDK5_ANNOTATION_TYPE; } if("1.4".equals(annotationType) || TestNG.JAVADOC_ANNOTATION_TYPE.equals(annotationType)) { return TestNG.JAVADOC_ANNOTATION_TYPE; } TestNGPlugin.log(new Status(IStatus.INFO, TestNGPlugin.PLUGIN_ID, 1, "Unknown annotation type '" + annotationType + "' Using default: " + TestNG.JDK5_ANNOTATION_TYPE , null) ); return TestNG.JDK5_ANNOTATION_TYPE; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/1bed3276c436b35c725a944299219be0d85ab7c1/SuiteBuilder.java/clean/src/main/org/testng/eclipse/util/SuiteBuilder.java
} else if(IJavaElement.TYPE == ije.getElementType()) {
} else if(IJavaElement.TYPE == ije.getElementType()) {
public static File createSuite(IJavaProject ijp, IType[] types, IJavaElement ije) { XMLStringBuffer xmlSuite = getSuiteBuffer(ije.getElementName()); if(IJavaElement.COMPILATION_UNIT == ije.getElementType()) { createClassTest(types, ije, xmlSuite); } else if(IJavaElement.TYPE == ije.getElementType()) { createClassTest(types, ije, xmlSuite); } else if(IJavaElement.METHOD == ije.getElementType()) { createMethodTest(types, ije, xmlSuite); } xmlSuite.pop("suite"); final String projectPath = ijp.getProject().getLocation().toOSString(); File file = new File(projectPath, ije.getElementName() + ".xml"); ppp("saving to file " + file.getAbsolutePath()); saveFileContent(file, xmlSuite); return file; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/1bed3276c436b35c725a944299219be0d85ab7c1/SuiteBuilder.java/clean/src/main/org/testng/eclipse/util/SuiteBuilder.java
} else if(IJavaElement.METHOD == ije.getElementType()) {
} else if(IJavaElement.METHOD == ije.getElementType()) {
public static File createSuite(IJavaProject ijp, IType[] types, IJavaElement ije) { XMLStringBuffer xmlSuite = getSuiteBuffer(ije.getElementName()); if(IJavaElement.COMPILATION_UNIT == ije.getElementType()) { createClassTest(types, ije, xmlSuite); } else if(IJavaElement.TYPE == ije.getElementType()) { createClassTest(types, ije, xmlSuite); } else if(IJavaElement.METHOD == ije.getElementType()) { createMethodTest(types, ije, xmlSuite); } xmlSuite.pop("suite"); final String projectPath = ijp.getProject().getLocation().toOSString(); File file = new File(projectPath, ije.getElementName() + ".xml"); ppp("saving to file " + file.getAbsolutePath()); saveFileContent(file, xmlSuite); return file; }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/1bed3276c436b35c725a944299219be0d85ab7c1/SuiteBuilder.java/clean/src/main/org/testng/eclipse/util/SuiteBuilder.java
int red, int green, int blue, int alpha, boolean active)
int red, int green, int blue, int alpha, boolean active, int family, double curveCoefficient)
public ChannelBindings(int index, double inputStart, double inputEnd, int red, int green, int blue, int alpha, boolean active) { this.index = index; setInputWindow(inputStart, inputEnd); rgba = new int[4]; setRGBA(red, green, blue, alpha); this.active = active; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/ChannelBindings.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/defs/ChannelBindings.java
this.family = family; this.curveCoefficient = curveCoefficient;
public ChannelBindings(int index, double inputStart, double inputEnd, int red, int green, int blue, int alpha, boolean active) { this.index = index; setInputWindow(inputStart, inputEnd); rgba = new int[4]; setRGBA(red, green, blue, alpha); this.active = active; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/ChannelBindings.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/defs/ChannelBindings.java
{ ChannelBindings cb = new ChannelBindings(); cb.index = this.index; cb.active = this.active; cb.inputStart = this.inputStart; cb.inputEnd = this.inputEnd; cb.rgba = getRGBA(); return cb; }
{ ChannelBindings cb = new ChannelBindings(); cb.index = this.index; cb.active = this.active; cb.family = this.family; cb.curveCoefficient = this.curveCoefficient; cb.inputStart = this.inputStart; cb.inputEnd = this.inputEnd; cb.rgba = getRGBA(); cb.stats = getStats(); return cb; }
ChannelBindings copy() { ChannelBindings cb = new ChannelBindings(); cb.index = this.index; cb.active = this.active; //Will work b/c the objects are read-only: Integer, Float, etc. cb.inputStart = this.inputStart; cb.inputEnd = this.inputEnd; cb.rgba = getRGBA(); return cb; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/ChannelBindings.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/defs/ChannelBindings.java
{ if (c < COLOR_MIN || COLOR_MAX < c) throw new IllegalArgumentException("Value must be in [0,255]."); }
{ if (c < COLOR_MIN || COLOR_MAX < c) throw new IllegalArgumentException("Value must be in [0,255]."); }
private void verifyColorComponent(int c) { if (c < COLOR_MIN || COLOR_MAX < c) throw new IllegalArgumentException("Value must be in [0,255]."); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/ChannelBindings.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/defs/ChannelBindings.java
retval.append("\tparams: " + params[i]);
retval.append("\tparams: ").append(params[i]);
public int executeCommand(String[] params, String[] output) { StringBuffer retval = new StringBuffer(); retval.append("executeCommand\n"); if (params != null) { for (int i = 0; i < params.length; i++) { retval.append("\tparams: " + params[i]); retval.append("\n"); } } Process process = null; MonitorInputStream outMonitor = null; MonitorInputStream errMonitor = null; Thread t1 = null; Thread t2 = null; int exitStatus = -1; Debug.trace(retval); try { // execute command process = Runtime.getRuntime().exec(params); boolean console = false;// TODO: impl from xml <execute // in_console=true ...>, but works already // if this flag is true if (console) { Console c = new Console(process); // save command output output[0] = c.getOutputData(); output[1] = c.getErrorData(); exitStatus = process.exitValue(); } else { StringWriter outWriter = new StringWriter(); StringWriter errWriter = new StringWriter(); InputStreamReader or = new InputStreamReader(process.getInputStream()); InputStreamReader er = new InputStreamReader(process.getErrorStream()); outMonitor = new MonitorInputStream(or, outWriter); errMonitor = new MonitorInputStream(er, errWriter); t1 = new Thread(outMonitor); t2 = new Thread(errMonitor); t1.setDaemon(true); t2.setDaemon(true); t1.start(); t2.start(); // wait for command to complete exitStatus = process.waitFor(); t1.join(); t2.join(); // save command output output[0] = outWriter.toString(); Debug.trace("stdout:"); Debug.trace(output[0]); output[1] = errWriter.toString(); Debug.trace("stderr:"); Debug.trace(output[1]); } Debug.trace("exit status: " + Integer.toString(exitStatus)); } catch (InterruptedException e) { if (Debug.tracing()) e.printStackTrace(System.err); stopThread(t1, outMonitor); stopThread(t2, errMonitor); output[0] = ""; output[1] = e.getMessage() + "\n"; process.destroy(); } catch (IOException e) { if (Debug.tracing()) e.printStackTrace(System.err); output[0] = ""; output[1] = e.getMessage() + "\n"; } return exitStatus; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/FileExecutor.java/clean/src/lib/com/izforge/izpack/util/FileExecutor.java
} catch (ZipException zerr)
} catch (ZipException zerr)
public void addJarContent(String file) throws Exception { sendMsg("Adding a jar file content ..."); JarFile jar = new JarFile(file); Enumeration entries = jar.entries(); while (entries.hasMoreElements()) { // Puts a new entry ZipEntry zentry = (ZipEntry) entries.nextElement(); try { InputStream zin = jar.getInputStream(zentry); outJar.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(zin, outJar); outJar.closeEntry(); zin.close(); } catch (ZipException zerr) { } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebPackager.java
public ZipOutputStream addPack(int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception
public ZipOutputStream addPack( int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception
public ZipOutputStream addPack(int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, osConstraints, required, preselected); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); webJar.putNextEntry(entry); return webJar; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebPackager.java
Pack pack = new Pack(name, description, osConstraints, required, preselected);
Pack pack = new Pack(name, description, osConstraints, required, preselected);
public ZipOutputStream addPack(int packNumber, String name, List osConstraints, boolean required, String description, boolean preselected) throws Exception { sendMsg("Adding pack #" + packNumber + " : " + name + " ..."); // Adds it in the packs array Pack pack = new Pack(name, description, osConstraints, required, preselected); packs.add(packNumber, pack); // Returns the suiting output stream String entryName = "packs/pack" + packNumber; ZipEntry entry = new ZipEntry(entryName); webJar.putNextEntry(entry); return webJar; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebPackager.java
public void addPanelClass(String classFilename, InputStream input) throws Exception
public void addPanelClass(String classFilename, InputStream input) throws Exception
public void addPanelClass(String classFilename, InputStream input) throws Exception { sendMsg("Adding the (sub)classes for " + classFilename + " ..."); outJar.putNextEntry(new ZipEntry("com/izforge/izpack/panels/" + classFilename)); copyStream(input, outJar); outJar.closeEntry(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebPackager.java
outJar.putNextEntry(new ZipEntry("com/izforge/izpack/panels/" + classFilename));
outJar.putNextEntry( new ZipEntry("com/izforge/izpack/panels/" + classFilename));
public void addPanelClass(String classFilename, InputStream input) throws Exception { sendMsg("Adding the (sub)classes for " + classFilename + " ..."); outJar.putNextEntry(new ZipEntry("com/izforge/izpack/panels/" + classFilename)); copyStream(input, outJar); outJar.closeEntry(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebPackager.java
return false;
return false;
public boolean allowPackFileBackReferences() { return false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebPackager.java
sendMsg("Setting the panels order ...");
sendMsg("Setting the panels order ...");
public void setPanelsOrder(ArrayList order) throws Exception { sendMsg("Setting the panels order ..."); outJar.putNextEntry(new ZipEntry("panelsOrder")); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(order); objOut.flush(); outJar.closeEntry(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebPackager.java
outJar.putNextEntry(new ZipEntry("panelsOrder")); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(order); objOut.flush(); outJar.closeEntry();
outJar.putNextEntry(new ZipEntry("panelsOrder")); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(order); objOut.flush(); outJar.closeEntry();
public void setPanelsOrder(ArrayList order) throws Exception { sendMsg("Setting the panels order ..."); outJar.putNextEntry(new ZipEntry("panelsOrder")); ObjectOutputStream objOut = new ObjectOutputStream(outJar); objOut.writeObject(order); objOut.flush(); outJar.closeEntry(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebPackager.java
if (!"".equals(processorClass))
if (processorClass != null && !"".equals(processorClass))
private void addComboBox (XMLElement spec) { Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed (SPEC); String variable = spec.getAttribute (VARIABLE); TextValuePair listItem = null; JComboBox field = new JComboBox (); JLabel label; // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel (getText (element)); Vector choices = element.getChildrenNamed (COMBO_CHOICE); if (choices == null) { return; } for (int i = 0; i < choices.size (); i++) { String processorClass = ((XMLElement)choices.elementAt (i)).getAttribute("processor"); if (!"".equals(processorClass)) { String choiceValues = ""; try { choiceValues = ((Processor) Class.forName(processorClass).newInstance()).process(null); } catch (Throwable t) { t.printStackTrace(); } String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set == null) { set = ""; } StringTokenizer tokenizer = new StringTokenizer(choiceValues, ":"); int counter = 0; while (tokenizer.hasMoreTokens()){ String token = tokenizer.nextToken(); listItem = new TextValuePair(token, token); field.addItem(listItem); if (set.equals(token)){ field.setSelectedIndex (field.getItemCount()-1); } counter++; } } else { listItem = new TextValuePair (getText ((XMLElement)choices.elementAt (i)), ((XMLElement)choices.elementAt (i)).getAttribute (COMBO_VALUE)); field.addItem (listItem); String set = ((XMLElement)choices.elementAt (i)).getAttribute (SET); if (set != null) { if (set.equals (TRUE)) { field.setSelectedIndex (i); } } } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed (DESCRIPTION); addDescription (element, forPacks, forOs); TwoColumnConstraints constraints = new TwoColumnConstraints (); constraints.position = TwoColumnConstraints.WEST; uiElements.add (new Object [] {null, FIELD_LABEL, null, constraints, label, forPacks, forOs}); TwoColumnConstraints constraints2 = new TwoColumnConstraints (); constraints2.position = TwoColumnConstraints.EAST; uiElements.add (new Object [] {null, COMBO_FIELD, variable, constraints2, field, forPacks, forOs}); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/51b4130f814c399ea973648823bddd3f297207d7/UserInputPanel.java/buggy/src/lib/com/izforge/izpack/panels/UserInputPanel.java
public NativeInstallerListener(boolean useSpecHelper)
public NativeInstallerListener()
public NativeInstallerListener(boolean useSpecHelper) { super(useSpecHelper); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/65829be7fc5a410510ee8132076f9911c480d666/NativeInstallerListener.java/clean/src/lib/com/izforge/izpack/event/NativeInstallerListener.java
super(useSpecHelper);
super();
public NativeInstallerListener(boolean useSpecHelper) { super(useSpecHelper); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/65829be7fc5a410510ee8132076f9911c480d666/NativeInstallerListener.java/clean/src/lib/com/izforge/izpack/event/NativeInstallerListener.java
suite.addTest(org.apache.commons.pool.composite.TestAll.suite());
public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(org.apache.commons.pool.TestBaseObjectPool.suite()); suite.addTest(org.apache.commons.pool.TestBaseKeyedObjectPool.suite()); suite.addTest(org.apache.commons.pool.TestBasePoolableObjectFactory.suite()); suite.addTest(org.apache.commons.pool.TestBaseKeyedPoolableObjectFactory.suite()); suite.addTest(org.apache.commons.pool.TestPoolUtils.suite()); suite.addTest(org.apache.commons.pool.impl.TestAll.suite()); return suite; }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/c533b17f67a27066967191311fa5512bef24cbc8/TestAll.java/clean/src/test/org/apache/commons/pool/TestAll.java
if (token.equals("N"))
if ("N".equals(token))
public FieldSpec(String spec) throws Exception { StringTokenizer tokenizer = new StringTokenizer(spec, ":"); if ((tokenizer.countTokens() >= MIN_TOKENS) && (tokenizer.countTokens() <= MAX_TOKENS)) { String token = tokenizer.nextToken().toUpperCase(); // ------------------------------------------------ // test the first token for a valid type identifier // if it's valid assign the token to the type. // ------------------------------------------------ if (token.equals("N")) { type = RuleTextField.N; } else if (token.equals("H")) { type = RuleTextField.H; } else if (token.equals("A")) { type = RuleTextField.A; } else if (token.equals("O")) { type = RuleTextField.O; } else if (token.equals("AN")) { type = RuleTextField.AN; } else { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the size // of the field and assing to columns. // ------------------------------------------------ try { token = tokenizer.nextToken(); columns = Integer.parseInt(token); } catch (Throwable exception) { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the edit // length and assign to editLength. If this fails // test for identifier for unlimited edit length. // If this works, set unlimitedEdit to true. // ------------------------------------------------ try { token = tokenizer.nextToken().toUpperCase(); editLength = Integer.parseInt(token); } catch (Throwable exception) { if (token.equals("U")) { unlimitedEdit = true; } else { throw (new Exception()); } } } else { throw (new Exception()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RuleInputField.java/clean/src/lib/com/izforge/izpack/panels/RuleInputField.java
else if (token.equals("H"))
else if ("H".equals(token))
public FieldSpec(String spec) throws Exception { StringTokenizer tokenizer = new StringTokenizer(spec, ":"); if ((tokenizer.countTokens() >= MIN_TOKENS) && (tokenizer.countTokens() <= MAX_TOKENS)) { String token = tokenizer.nextToken().toUpperCase(); // ------------------------------------------------ // test the first token for a valid type identifier // if it's valid assign the token to the type. // ------------------------------------------------ if (token.equals("N")) { type = RuleTextField.N; } else if (token.equals("H")) { type = RuleTextField.H; } else if (token.equals("A")) { type = RuleTextField.A; } else if (token.equals("O")) { type = RuleTextField.O; } else if (token.equals("AN")) { type = RuleTextField.AN; } else { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the size // of the field and assing to columns. // ------------------------------------------------ try { token = tokenizer.nextToken(); columns = Integer.parseInt(token); } catch (Throwable exception) { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the edit // length and assign to editLength. If this fails // test for identifier for unlimited edit length. // If this works, set unlimitedEdit to true. // ------------------------------------------------ try { token = tokenizer.nextToken().toUpperCase(); editLength = Integer.parseInt(token); } catch (Throwable exception) { if (token.equals("U")) { unlimitedEdit = true; } else { throw (new Exception()); } } } else { throw (new Exception()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RuleInputField.java/clean/src/lib/com/izforge/izpack/panels/RuleInputField.java
else if (token.equals("A"))
else if ("A".equals(token))
public FieldSpec(String spec) throws Exception { StringTokenizer tokenizer = new StringTokenizer(spec, ":"); if ((tokenizer.countTokens() >= MIN_TOKENS) && (tokenizer.countTokens() <= MAX_TOKENS)) { String token = tokenizer.nextToken().toUpperCase(); // ------------------------------------------------ // test the first token for a valid type identifier // if it's valid assign the token to the type. // ------------------------------------------------ if (token.equals("N")) { type = RuleTextField.N; } else if (token.equals("H")) { type = RuleTextField.H; } else if (token.equals("A")) { type = RuleTextField.A; } else if (token.equals("O")) { type = RuleTextField.O; } else if (token.equals("AN")) { type = RuleTextField.AN; } else { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the size // of the field and assing to columns. // ------------------------------------------------ try { token = tokenizer.nextToken(); columns = Integer.parseInt(token); } catch (Throwable exception) { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the edit // length and assign to editLength. If this fails // test for identifier for unlimited edit length. // If this works, set unlimitedEdit to true. // ------------------------------------------------ try { token = tokenizer.nextToken().toUpperCase(); editLength = Integer.parseInt(token); } catch (Throwable exception) { if (token.equals("U")) { unlimitedEdit = true; } else { throw (new Exception()); } } } else { throw (new Exception()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RuleInputField.java/clean/src/lib/com/izforge/izpack/panels/RuleInputField.java
else if (token.equals("O"))
else if ("O".equals(token))
public FieldSpec(String spec) throws Exception { StringTokenizer tokenizer = new StringTokenizer(spec, ":"); if ((tokenizer.countTokens() >= MIN_TOKENS) && (tokenizer.countTokens() <= MAX_TOKENS)) { String token = tokenizer.nextToken().toUpperCase(); // ------------------------------------------------ // test the first token for a valid type identifier // if it's valid assign the token to the type. // ------------------------------------------------ if (token.equals("N")) { type = RuleTextField.N; } else if (token.equals("H")) { type = RuleTextField.H; } else if (token.equals("A")) { type = RuleTextField.A; } else if (token.equals("O")) { type = RuleTextField.O; } else if (token.equals("AN")) { type = RuleTextField.AN; } else { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the size // of the field and assing to columns. // ------------------------------------------------ try { token = tokenizer.nextToken(); columns = Integer.parseInt(token); } catch (Throwable exception) { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the edit // length and assign to editLength. If this fails // test for identifier for unlimited edit length. // If this works, set unlimitedEdit to true. // ------------------------------------------------ try { token = tokenizer.nextToken().toUpperCase(); editLength = Integer.parseInt(token); } catch (Throwable exception) { if (token.equals("U")) { unlimitedEdit = true; } else { throw (new Exception()); } } } else { throw (new Exception()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RuleInputField.java/clean/src/lib/com/izforge/izpack/panels/RuleInputField.java
else if (token.equals("AN"))
else if ("AN".equals(token))
public FieldSpec(String spec) throws Exception { StringTokenizer tokenizer = new StringTokenizer(spec, ":"); if ((tokenizer.countTokens() >= MIN_TOKENS) && (tokenizer.countTokens() <= MAX_TOKENS)) { String token = tokenizer.nextToken().toUpperCase(); // ------------------------------------------------ // test the first token for a valid type identifier // if it's valid assign the token to the type. // ------------------------------------------------ if (token.equals("N")) { type = RuleTextField.N; } else if (token.equals("H")) { type = RuleTextField.H; } else if (token.equals("A")) { type = RuleTextField.A; } else if (token.equals("O")) { type = RuleTextField.O; } else if (token.equals("AN")) { type = RuleTextField.AN; } else { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the size // of the field and assing to columns. // ------------------------------------------------ try { token = tokenizer.nextToken(); columns = Integer.parseInt(token); } catch (Throwable exception) { throw (new Exception()); } // ------------------------------------------------ // test for a valid integer to define the edit // length and assign to editLength. If this fails // test for identifier for unlimited edit length. // If this works, set unlimitedEdit to true. // ------------------------------------------------ try { token = tokenizer.nextToken().toUpperCase(); editLength = Integer.parseInt(token); } catch (Throwable exception) { if (token.equals("U")) { unlimitedEdit = true; } else { throw (new Exception()); } } } else { throw (new Exception()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RuleInputField.java/clean/src/lib/com/izforge/izpack/panels/RuleInputField.java