rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
imgPanel.add(iconLabel, BorderLayout.CENTER);
imgPanel.add(iconLabel, BorderLayout.NORTH);
private void buildGUI() { // Sets the frame icon setIconImage(icons.getImageIcon("JFrameIcon").getImage()); // Prepares the glass pane to block the gui interaction when needed JPanel glassPane = (JPanel) getGlassPane(); glassPane.addMouseListener(new MouseAdapter() { }); glassPane.addMouseMotionListener(new MouseMotionAdapter() { }); glassPane.addKeyListener(new KeyAdapter() { }); // We set the layout & prepare the constraint object contentPane = (JPanel) getContentPane(); contentPane.setLayout(new BorderLayout()); //layout); // We add the panels container panelsContainer = new JPanel(); panelsContainer.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); panelsContainer.setLayout(new GridLayout(1, 1)); contentPane.add(panelsContainer, BorderLayout.CENTER); // We put the first panel installdata.curPanelNumber = 0; IzPanel panel_0 = (IzPanel) installdata.panels.get(0); panelsContainer.add(panel_0); // We add the navigation buttons & labels NavigationHandler navHandler = new NavigationHandler(); JPanel navPanel = new JPanel(); navPanel.setLayout(new BoxLayout(navPanel, BoxLayout.X_AXIS)); navPanel.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder(8, 8, 8, 8), BorderFactory.createTitledBorder( new EtchedLineBorder(), langpack.getString("installer.madewith") + " "))); navPanel.add(Box.createHorizontalGlue()); prevButton = ButtonFactory.createButton( langpack.getString("installer.prev"), icons.getImageIcon("stepback"), installdata.buttonsHColor); navPanel.add(prevButton); prevButton.addActionListener(navHandler); navPanel.add(Box.createRigidArea(new Dimension(5, 0))); nextButton = ButtonFactory.createButton( langpack.getString("installer.next"), icons.getImageIcon("stepforward"), installdata.buttonsHColor); navPanel.add(nextButton); nextButton.addActionListener(navHandler); navPanel.add(Box.createRigidArea(new Dimension(5, 0))); quitButton = ButtonFactory.createButton( langpack.getString("installer.quit"), icons.getImageIcon("stop"), installdata.buttonsHColor); navPanel.add(quitButton); quitButton.addActionListener(navHandler); contentPane.add(navPanel, BorderLayout.SOUTH); try { ResourceManager rm = ResourceManager.getInstance(); ImageIcon icon = rm.getImageIconResource("Installer.image"); if (icon != null) { JPanel imgPanel = new JPanel(); imgPanel.setLayout(new BorderLayout()); imgPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); iconLabel = new JLabel(icon); iconLabel.setBorder(BorderFactory.createLoweredBevelBorder()); imgPanel.add(iconLabel, BorderLayout.CENTER); contentPane.add(imgPanel, BorderLayout.WEST); } } catch (Exception e) { //ignore } loadImage(0); getRootPane().setDefaultButton(nextButton); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
private void buildGUI() { // Sets the frame icon setIconImage(icons.getImageIcon("JFrameIcon").getImage()); // Prepares the glass pane to block the gui interaction when needed JPanel glassPane = (JPanel) getGlassPane(); glassPane.addMouseListener(new MouseAdapter() { }); glassPane.addMouseMotionListener(new MouseMotionAdapter() { }); glassPane.addKeyListener(new KeyAdapter() { }); // We set the layout & prepare the constraint object contentPane = (JPanel) getContentPane(); contentPane.setLayout(new BorderLayout()); //layout); // We add the panels container panelsContainer = new JPanel(); panelsContainer.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); panelsContainer.setLayout(new GridLayout(1, 1)); contentPane.add(panelsContainer, BorderLayout.CENTER); // We put the first panel installdata.curPanelNumber = 0; IzPanel panel_0 = (IzPanel) installdata.panels.get(0); panelsContainer.add(panel_0); // We add the navigation buttons & labels NavigationHandler navHandler = new NavigationHandler(); JPanel navPanel = new JPanel(); navPanel.setLayout(new BoxLayout(navPanel, BoxLayout.X_AXIS)); navPanel.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder(8, 8, 8, 8), BorderFactory.createTitledBorder( new EtchedLineBorder(), langpack.getString("installer.madewith") + " "))); navPanel.add(Box.createHorizontalGlue()); prevButton = ButtonFactory.createButton( langpack.getString("installer.prev"), icons.getImageIcon("stepback"), installdata.buttonsHColor); navPanel.add(prevButton); prevButton.addActionListener(navHandler); navPanel.add(Box.createRigidArea(new Dimension(5, 0))); nextButton = ButtonFactory.createButton( langpack.getString("installer.next"), icons.getImageIcon("stepforward"), installdata.buttonsHColor); navPanel.add(nextButton); nextButton.addActionListener(navHandler); navPanel.add(Box.createRigidArea(new Dimension(5, 0))); quitButton = ButtonFactory.createButton( langpack.getString("installer.quit"), icons.getImageIcon("stop"), installdata.buttonsHColor); navPanel.add(quitButton); quitButton.addActionListener(navHandler); contentPane.add(navPanel, BorderLayout.SOUTH); try { ResourceManager rm = ResourceManager.getInstance(); ImageIcon icon = rm.getImageIconResource("Installer.image"); if (icon != null) { JPanel imgPanel = new JPanel(); imgPanel.setLayout(new BorderLayout()); imgPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); iconLabel = new JLabel(icon); iconLabel.setBorder(BorderFactory.createLoweredBevelBorder()); imgPanel.add(iconLabel, BorderLayout.CENTER); contentPane.add(imgPanel, BorderLayout.WEST); } } catch (Exception e) { //ignore } loadImage(0); getRootPane().setDefaultButton(nextButton); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
String basePath = ""; ResourceManager rm = null;
String basePath = ""; ResourceManager rm = null;
public InputStream getResource(String res) { String basePath = ""; ResourceManager rm = null; try { rm = ResourceManager.getInstance(); basePath = rm.resourceBasePath; return this.getClass().getResourceAsStream(basePath+res); } catch (Exception e) { return null; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
rm = ResourceManager.getInstance(); basePath = rm.resourceBasePath; return this.getClass().getResourceAsStream(basePath+res);
rm = ResourceManager.getInstance(); basePath = rm.resourceBasePath; return this.getClass().getResourceAsStream(basePath+res);
public InputStream getResource(String res) { String basePath = ""; ResourceManager rm = null; try { rm = ResourceManager.getInstance(); basePath = rm.resourceBasePath; return this.getClass().getResourceAsStream(basePath+res); } catch (Exception e) { return null; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
ImageIcon icon = rm.getImageIconResource("Installer.image."+panelNo);
ImageIcon icon = rm.getImageIconResource("Installer.image." + panelNo);
private void loadImage(int panelNo) { try { ResourceManager rm = ResourceManager.getInstance(); ImageIcon icon = rm.getImageIconResource("Installer.image."+panelNo); if (icon != null) { iconLabel.setVisible(false); iconLabel.setIcon(icon); iconLabel.setVisible(true); } } catch (Exception e) { //ignore } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
}
}
private void loadImage(int panelNo) { try { ResourceManager rm = ResourceManager.getInstance(); ImageIcon icon = rm.getImageIconResource("Installer.image."+panelNo); if (icon != null) { iconLabel.setVisible(false); iconLabel.setIcon(icon); iconLabel.setVisible(true); } } catch (Exception e) { //ignore } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
if (isBack) { installdata.curPanelNumber--; switchPanel(installdata.curPanelNumber + 1); }else { installdata.curPanelNumber++; switchPanel(installdata.curPanelNumber - 1); }
if (isBack) { installdata.curPanelNumber--; switchPanel(installdata.curPanelNumber + 1); }else { installdata.curPanelNumber++; switchPanel(installdata.curPanelNumber - 1); }
public void skipPanel() { if (installdata.curPanelNumber < installdata.panels.size() - 1) { if (isBack) { installdata.curPanelNumber--; switchPanel(installdata.curPanelNumber + 1); }else { installdata.curPanelNumber++; switchPanel(installdata.curPanelNumber - 1); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
if (installdata.curPanelNumber<last) { isBack = true; }
if (installdata.curPanelNumber<last) { isBack = true; }
protected void switchPanel(int last) { if (installdata.curPanelNumber<last) { isBack = true; } panelsContainer.setVisible(false); IzPanel panel = (IzPanel) installdata.panels.get(installdata.curPanelNumber); IzPanel l_panel = (IzPanel) installdata.panels.get(last); l_panel.makeXMLData(installdata.xmlData.getChildAtIndex(last)); panelsContainer.remove(l_panel); panelsContainer.add(panel); if (installdata.curPanelNumber == 0) { prevButton.setVisible(false); lockPrevButton(); unlockNextButton(); // if we push the button back at the license panel } else if (installdata.curPanelNumber == installdata.panels.size() - 1) { prevButton.setVisible(false); nextButton.setVisible(false); lockNextButton(); } else { prevButton.setVisible(true); nextButton.setVisible(true); unlockPrevButton(); unlockNextButton(); } l_panel.panelDeactivate(); panel.panelActivate(); panelsContainer.setVisible(true); loadImage(installdata.curPanelNumber); isBack = false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
(IzPanel) installdata.panels.get(installdata.curPanelNumber);
(IzPanel) installdata.panels.get(installdata.curPanelNumber);
protected void switchPanel(int last) { if (installdata.curPanelNumber<last) { isBack = true; } panelsContainer.setVisible(false); IzPanel panel = (IzPanel) installdata.panels.get(installdata.curPanelNumber); IzPanel l_panel = (IzPanel) installdata.panels.get(last); l_panel.makeXMLData(installdata.xmlData.getChildAtIndex(last)); panelsContainer.remove(l_panel); panelsContainer.add(panel); if (installdata.curPanelNumber == 0) { prevButton.setVisible(false); lockPrevButton(); unlockNextButton(); // if we push the button back at the license panel } else if (installdata.curPanelNumber == installdata.panels.size() - 1) { prevButton.setVisible(false); nextButton.setVisible(false); lockNextButton(); } else { prevButton.setVisible(true); nextButton.setVisible(true); unlockPrevButton(); unlockNextButton(); } l_panel.panelDeactivate(); panel.panelActivate(); panelsContainer.setVisible(true); loadImage(installdata.curPanelNumber); isBack = false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
loadImage(installdata.curPanelNumber);
loadImage(installdata.curPanelNumber);
protected void switchPanel(int last) { if (installdata.curPanelNumber<last) { isBack = true; } panelsContainer.setVisible(false); IzPanel panel = (IzPanel) installdata.panels.get(installdata.curPanelNumber); IzPanel l_panel = (IzPanel) installdata.panels.get(last); l_panel.makeXMLData(installdata.xmlData.getChildAtIndex(last)); panelsContainer.remove(l_panel); panelsContainer.add(panel); if (installdata.curPanelNumber == 0) { prevButton.setVisible(false); lockPrevButton(); unlockNextButton(); // if we push the button back at the license panel } else if (installdata.curPanelNumber == installdata.panels.size() - 1) { prevButton.setVisible(false); nextButton.setVisible(false); lockNextButton(); } else { prevButton.setVisible(true); nextButton.setVisible(true); unlockPrevButton(); unlockNextButton(); } l_panel.panelDeactivate(); panel.panelActivate(); panelsContainer.setVisible(true); loadImage(installdata.curPanelNumber); isBack = false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
public XMLElement(String name)
public XMLElement()
public XMLElement(String name) { this(name, null, NO_LINE); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/cc08e5221fe76d27ad470bc55d89c8085ced3c98/XMLElement.java/buggy/src/lib/net/n3/nanoxml/XMLElement.java
this(name, null, NO_LINE);
this(null, null, NO_LINE);
public XMLElement(String name) { this(name, null, NO_LINE); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/cc08e5221fe76d27ad470bc55d89c8085ced3c98/XMLElement.java/buggy/src/lib/net/n3/nanoxml/XMLElement.java
public void makeXMLData(XMLElement panelRoot) { }
public void makeXMLData(XMLElement panelRoot) { }
public void makeXMLData(XMLElement panelRoot) { }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPanel.java/buggy/src/lib/com/izforge/izpack/installer/IzPanel.java
public void panelDeactivate() { }
public void panelDeactivate() { }
public void panelDeactivate() { }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPanel.java/buggy/src/lib/com/izforge/izpack/installer/IzPanel.java
public String getUninstallerJarFilename()
public synchronized String getUninstallerJarFilename()
public String getUninstallerJarFilename() { return uninstallerJarFilename; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UninstallData.java/buggy/src/lib/com/izforge/izpack/installer/UninstallData.java
public abstract Object makeObject();
public abstract Object makeObject() throws Exception;
public abstract Object makeObject();
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/0a89bcddbb9d1ce0d88185823be827ca474fd6ae/BasePoolableObjectFactory.java/buggy/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java
new LocaleDatabase(getClass().getResourceAsStream("/langpack.xml"));
new LocaleDatabase(UninstallerFrame.class.getResourceAsStream("/langpack.xml"));
public UninstallerFrame() throws Exception { super("IzPack - Uninstaller"); // Initializations langpack = new LocaleDatabase(getClass().getResourceAsStream("/langpack.xml")); getInstallPath(); icons = new IconsDatabase(); loadIcons(); UIManager.put( "OptionPane.yesButtonText", langpack.getString("installer.yes")); UIManager.put( "OptionPane.noButtonText", langpack.getString("installer.no")); UIManager.put( "OptionPane.cancelButtonText", langpack.getString("installer.cancel")); // Sets the frame icon setIconImage(icons.getImageIcon("JFrameIcon").getImage()); // We build the GUI & show it buildGUI(); addWindowListener(new WindowHandler()); pack(); centerFrame(this); setResizable(false); setVisible(true); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UninstallerFrame.java/buggy/src/lib/com/izforge/izpack/uninstaller/UninstallerFrame.java
InputStream in = getClass().getResourceAsStream("/install.log");
InputStream in = UninstallerFrame.class.getResourceAsStream("/install.log");
private void getInstallPath() throws Exception { InputStream in = getClass().getResourceAsStream("/install.log"); InputStreamReader inReader = new InputStreamReader(in); BufferedReader reader = new BufferedReader(inReader); installPath = reader.readLine(); reader.close(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UninstallerFrame.java/buggy/src/lib/com/izforge/izpack/uninstaller/UninstallerFrame.java
url = getClass().getResource("/img/trash.png");
url = UninstallerFrame.class.getResource("/img/trash.png");
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; // We load it url = getClass().getResource("/img/trash.png"); img = new ImageIcon(url); icons.put("delete", img); url = getClass().getResource("/img/stop.png"); img = new ImageIcon(url); icons.put("stop", img); url = getClass().getResource("/img/flag.png"); img = new ImageIcon(url); icons.put("warning", img); url = getClass().getResource("/img/JFrameIcon.png"); img = new ImageIcon(url); icons.put("JFrameIcon", img); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UninstallerFrame.java/buggy/src/lib/com/izforge/izpack/uninstaller/UninstallerFrame.java
url = getClass().getResource("/img/stop.png");
url = UninstallerFrame.class.getResource("/img/stop.png");
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; // We load it url = getClass().getResource("/img/trash.png"); img = new ImageIcon(url); icons.put("delete", img); url = getClass().getResource("/img/stop.png"); img = new ImageIcon(url); icons.put("stop", img); url = getClass().getResource("/img/flag.png"); img = new ImageIcon(url); icons.put("warning", img); url = getClass().getResource("/img/JFrameIcon.png"); img = new ImageIcon(url); icons.put("JFrameIcon", img); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UninstallerFrame.java/buggy/src/lib/com/izforge/izpack/uninstaller/UninstallerFrame.java
url = getClass().getResource("/img/flag.png");
url = UninstallerFrame.class.getResource("/img/flag.png");
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; // We load it url = getClass().getResource("/img/trash.png"); img = new ImageIcon(url); icons.put("delete", img); url = getClass().getResource("/img/stop.png"); img = new ImageIcon(url); icons.put("stop", img); url = getClass().getResource("/img/flag.png"); img = new ImageIcon(url); icons.put("warning", img); url = getClass().getResource("/img/JFrameIcon.png"); img = new ImageIcon(url); icons.put("JFrameIcon", img); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UninstallerFrame.java/buggy/src/lib/com/izforge/izpack/uninstaller/UninstallerFrame.java
url = getClass().getResource("/img/JFrameIcon.png");
url = UninstallerFrame.class.getResource("/img/JFrameIcon.png");
private void loadIcons() throws Exception { // Initialisations icons = new IconsDatabase(); URL url; ImageIcon img; // We load it url = getClass().getResource("/img/trash.png"); img = new ImageIcon(url); icons.put("delete", img); url = getClass().getResource("/img/stop.png"); img = new ImageIcon(url); icons.put("stop", img); url = getClass().getResource("/img/flag.png"); img = new ImageIcon(url); icons.put("warning", img); url = getClass().getResource("/img/JFrameIcon.png"); img = new ImageIcon(url); icons.put("JFrameIcon", img); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UninstallerFrame.java/buggy/src/lib/com/izforge/izpack/uninstaller/UninstallerFrame.java
return new AssertionImpl(new SimplePrincipal("test"), new HashMap());
return new AssertionImpl(new SimplePrincipal("test"), new HashMap(), new ProxyRetriever() { public String getProxyTicketIdFor(String proxyGrantingTicketId, Service targetService) { return "test"; } }, "proxyTicketId");
public void testAuthenticateWithProxy() throws Exception { this.context = new CasSecurityContext(new TicketValidator() { public Assertion validate(String ticketId, Service service) throws ValidationException { return new AssertionImpl(new SimplePrincipal("test"), new HashMap()); } }, new SimpleService("test")); this.context.getOpaqueCredentialsInstance().setCredentials("ticket"); this.context.authenticate(); assertEquals("test", this.context.getProxyTicket(new SimpleService("test"))); }
52448 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52448/e5310dd9275351acada19213eb754579f674d395/CasSecurityContextTests.java/buggy/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/CasSecurityContextTests.java
return new AssertionImpl(new SimplePrincipal("test"), new HashMap());
return new AssertionImpl(new SimplePrincipal("test"), new HashMap(), new ProxyRetriever() { public String getProxyTicketIdFor(String proxyGrantingTicketId, Service targetService) { return "test"; } }, "proxyTicketId");
public Assertion validate(String ticketId, Service service) throws ValidationException { return new AssertionImpl(new SimplePrincipal("test"), new HashMap()); }
52448 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52448/e5310dd9275351acada19213eb754579f674d395/CasSecurityContextTests.java/buggy/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/CasSecurityContextTests.java
if (!ok) return ok;
public boolean isValidated() { String installPath = textField.getText(); boolean ok = true; // We put a warning if the specified target is nameless if (installPath.length() == 0) { int res = JOptionPane.showConfirmDialog(this, parent.langpack.getString("TargetPanel.empty_target"), parent.langpack.getString("installer.warning"), JOptionPane.YES_NO_OPTION); ok = (res == JOptionPane.YES_OPTION); } // Normalize the path File path = new File(installPath); installPath = path.toString(); // We put a warning if the directory exists else we warn that it will be created if (path.exists()) { int res = JOptionPane.showConfirmDialog(this, parent.langpack.getString("TargetPanel.warn"), parent.langpack.getString("installer.warning"), JOptionPane.YES_NO_OPTION); ok = (res == JOptionPane.YES_OPTION); } else JOptionPane.showMessageDialog(this, parent.langpack.getString("TargetPanel.createdir") + "\n" + installPath); idata.setInstallPath(installPath); return ok; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/de2ccc5f057395ed3a33861dd4a237a06cb9408a/TargetPanel.java/buggy/src/lib/com/izforge/izpack/panels/TargetPanel.java
if (child.getName().equals(name)) {
if (cName != null && cName.equals(name)) {
public XMLElement getFirstChildNamed(String name) { Enumeration enum = this.children.elements(); while (enum.hasMoreElements()) { XMLElement child = (XMLElement) enum.nextElement(); if (child.getName().equals(name)) { return child; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/cc08e5221fe76d27ad470bc55d89c8085ced3c98/XMLElement.java/buggy/src/lib/net/n3/nanoxml/XMLElement.java
if(packsToInstall.contains(pack)); checkValues[i] =1;
if(packsToInstall.contains(pack)) checkValues[i] =1;
private void initvalues() { //name to pack position map namesPos = new HashMap(); for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); namesPos.put(pack.name,new Integer(i)); } //Init to the first values for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); if(packsToInstall.contains(pack)); checkValues[i] =1; } //Check out and disable the ones that are excluded by non fullfiled deps for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); if(checkValues[i] ==0) { List deps = pack.revDependencies; for (int j = 0;deps != null && j < deps.size(); j++) { String name = (String) deps.get(j); int pos = getPos(name); checkValues[pos] = -2; } } } // The required ones must propagate their required status to all the ones // that they depend on for (int i = 0; i < packs.size(); i++) { Pack pack = (Pack) packs.get(i); if(pack.required ==true) propRequirement(pack.name); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/a0753ec89a1ceb872dda529e95706e91b3cf1e3d/PacksModel.java/buggy/src/lib/com/izforge/izpack/panels/PacksModel.java
public static String toByteUnitsString(int bytes)
public static String toByteUnitsString(long bytes)
public static String toByteUnitsString(int bytes) { if (bytes < KILOBYTES) return String.valueOf(bytes) + " bytes"; else if (bytes < (MEGABYTES)) { double value = bytes / KILOBYTES; return formatter.format(value) + " KB"; } else if (bytes < (GIGABYTES)) { double value = bytes / MEGABYTES; return formatter.format(value) + " MB"; } else { double value = bytes / GIGABYTES; return formatter.format(value) + " GB"; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/458df5388598b1463abaab7f3fba01a728e5d095/Pack.java/buggy/src/lib/com/izforge/izpack/Pack.java
if (key.toString().equals("encoding")) { return str.substring(index, index2); }
if ("encoding".equals(key.toString())) { return str.substring(index, index2); }
protected String getEncoding(String str) { if (!str.startsWith("<?xml")) { return null; } int index = 5; while (index < str.length()) { StringBuffer key = new StringBuffer(); while ((index < str.length()) && (str.charAt(index) <= ' ')) { index++; } while ((index < str.length()) && (str.charAt(index) >= 'a') && (str.charAt(index) <= 'z')) { key.append(str.charAt(index)); index++; } while ((index < str.length()) && (str.charAt(index) <= ' ')) { index++; } if ((index >= str.length()) || (str.charAt(index) != '=')) { break; } while ((index < str.length()) && (str.charAt(index) != '\'') && (str.charAt(index) != '"')) { index++; } if (index >= str.length()) { break; } char delimiter = str.charAt(index); index++; int index2 = str.indexOf(delimiter, index); if (index2 < 0) { break; } if (key.toString().equals("encoding")) { return str.substring(index, index2); } index = index2 + 1; } return null; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/StdXMLReader.java/buggy/src/lib/net/n3/nanoxml/StdXMLReader.java
if (langpack != null && pack.id != null && !pack.id.equals(""))
if (langpack != null && pack.id != null && !"".equals(pack.id))
public String getSummaryBody() { StringBuffer retval = new StringBuffer(256); Iterator iter = idata.selectedPacks.iterator(); boolean first = true; while (iter.hasNext()) { if (!first) { retval.append("<br>"); } first = false; Pack pack = (Pack) iter.next(); if (langpack != null && pack.id != null && !pack.id.equals("")) { retval.append(langpack.getString(pack.id)); } else retval.append(pack.name); } return (retval.toString()); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PacksPanelBase.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanelBase.java
if (langpack != null && pack.id != null && !pack.id.equals(""))
if (langpack != null && pack.id != null && !"".equals(pack.id))
public void valueChanged(ListSelectionEvent e) { int i = packsTable.getSelectedRow(); if (i < 0) return; // Operations for the description if (descriptionArea != null) { Pack pack = (Pack) idata.availablePacks.get(i); String desc = ""; String key = pack.id + ".description"; if (langpack != null && pack.id != null && !pack.id.equals("")) { desc = langpack.getString(key); } if (desc.equals("") || key.equals(desc)) { desc = pack.description; } descriptionArea.setText(desc); } // Operation for the dependency listing if (dependencyArea != null) { Pack pack = (Pack) idata.availablePacks.get(i); List dep = pack.dependencies; String list = ""; for (int j = 0; dep != null && j < dep.size(); j++) { String name = (String) dep.get(j); // Internationalization code Pack childPack = (Pack) names.get(name); String childName = ""; String key = childPack.id; if (langpack != null && childPack.id != null && !childPack.id.equals("")) { childName = langpack.getString(key); } if (childName.equals("") || key.equals(childName)) { childName = childPack.name; } // End internationalization list += childName; if (j != dep.size() - 1) list += ", "; } dependencyArea.setText(list); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PacksPanelBase.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanelBase.java
if (desc.equals("") || key.equals(desc))
if ("".equals(desc) || key.equals(desc))
public void valueChanged(ListSelectionEvent e) { int i = packsTable.getSelectedRow(); if (i < 0) return; // Operations for the description if (descriptionArea != null) { Pack pack = (Pack) idata.availablePacks.get(i); String desc = ""; String key = pack.id + ".description"; if (langpack != null && pack.id != null && !pack.id.equals("")) { desc = langpack.getString(key); } if (desc.equals("") || key.equals(desc)) { desc = pack.description; } descriptionArea.setText(desc); } // Operation for the dependency listing if (dependencyArea != null) { Pack pack = (Pack) idata.availablePacks.get(i); List dep = pack.dependencies; String list = ""; for (int j = 0; dep != null && j < dep.size(); j++) { String name = (String) dep.get(j); // Internationalization code Pack childPack = (Pack) names.get(name); String childName = ""; String key = childPack.id; if (langpack != null && childPack.id != null && !childPack.id.equals("")) { childName = langpack.getString(key); } if (childName.equals("") || key.equals(childName)) { childName = childPack.name; } // End internationalization list += childName; if (j != dep.size() - 1) list += ", "; } dependencyArea.setText(list); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PacksPanelBase.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanelBase.java
if (langpack != null && childPack.id != null && !childPack.id.equals(""))
if (langpack != null && childPack.id != null && !"".equals(childPack.id))
public void valueChanged(ListSelectionEvent e) { int i = packsTable.getSelectedRow(); if (i < 0) return; // Operations for the description if (descriptionArea != null) { Pack pack = (Pack) idata.availablePacks.get(i); String desc = ""; String key = pack.id + ".description"; if (langpack != null && pack.id != null && !pack.id.equals("")) { desc = langpack.getString(key); } if (desc.equals("") || key.equals(desc)) { desc = pack.description; } descriptionArea.setText(desc); } // Operation for the dependency listing if (dependencyArea != null) { Pack pack = (Pack) idata.availablePacks.get(i); List dep = pack.dependencies; String list = ""; for (int j = 0; dep != null && j < dep.size(); j++) { String name = (String) dep.get(j); // Internationalization code Pack childPack = (Pack) names.get(name); String childName = ""; String key = childPack.id; if (langpack != null && childPack.id != null && !childPack.id.equals("")) { childName = langpack.getString(key); } if (childName.equals("") || key.equals(childName)) { childName = childPack.name; } // End internationalization list += childName; if (j != dep.size() - 1) list += ", "; } dependencyArea.setText(list); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PacksPanelBase.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanelBase.java
if (childName.equals("") || key.equals(childName))
if ("".equals(childName) || key.equals(childName))
public void valueChanged(ListSelectionEvent e) { int i = packsTable.getSelectedRow(); if (i < 0) return; // Operations for the description if (descriptionArea != null) { Pack pack = (Pack) idata.availablePacks.get(i); String desc = ""; String key = pack.id + ".description"; if (langpack != null && pack.id != null && !pack.id.equals("")) { desc = langpack.getString(key); } if (desc.equals("") || key.equals(desc)) { desc = pack.description; } descriptionArea.setText(desc); } // Operation for the dependency listing if (dependencyArea != null) { Pack pack = (Pack) idata.availablePacks.get(i); List dep = pack.dependencies; String list = ""; for (int j = 0; dep != null && j < dep.size(); j++) { String name = (String) dep.get(j); // Internationalization code Pack childPack = (Pack) names.get(name); String childName = ""; String key = childPack.id; if (langpack != null && childPack.id != null && !childPack.id.equals("")) { childName = langpack.getString(key); } if (childName.equals("") || key.equals(childName)) { childName = childPack.name; } // End internationalization list += childName; if (j != dep.size() - 1) list += ", "; } dependencyArea.setText(list); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/PacksPanelBase.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanelBase.java
return this.getClass().getResourceAsStream(resourcepath);
return ResourceManager.class.getResourceAsStream(resourcepath);
public InputStream getInputStream(String resource) throws ResourceNotFoundException { String resourcepath = this.getLanguageResourceString(resource); //System.out.println ("reading resource "+resourcepath); return this.getClass().getResourceAsStream(resourcepath); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/ResourceManager.java/buggy/src/lib/com/izforge/izpack/installer/ResourceManager.java
retval = extractLong(output[0], -3, 3, "%");
retval = extractLong(output[0], -3, 3, "%") * 1024;
public final static long getFreeSpace(String path) { long retval = -1; int state; if( IoHelper.getOSFamily() == WINDOWS ) { String[] params = {"CMD", "/C", "\"dir /D /-C \"" + path + "\"\""}; String[] output = new String[2]; FileExecutor fe = new FileExecutor(); state = fe.executeCommand(params, output); retval = extractLong(output[0], -3, 3, "%"); } else if( IoHelper.getOSFamily() == UNIX ) { String[] params = {"df", "-Pk", path}; String[] output = new String[2]; FileExecutor fe = new FileExecutor(); state = fe.executeCommand(params, output); retval = extractLong(output[0], -3, 3, "%"); } else if(IoHelper.getOSFamily() == MAC) { String[] params = {"df", "-k", path}; String[] output = new String[2]; FileExecutor fe = new FileExecutor(); state = fe.executeCommand(params, output); retval = extractLong(output[0], -3, 3, "%"); } return retval; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/8ed787013b97bfd7e4559ae7db96012b66f0afe0/IoHelper.java/buggy/src/lib/com/izforge/izpack/util/IoHelper.java
retval = extractLong(output[0], -3, 3, "%");
retval = extractLong(output[0], -3, 3, "%") * 1024;
public final static long getFreeSpace(String path) { long retval = -1; int state; if( IoHelper.getOSFamily() == WINDOWS ) { String[] params = {"CMD", "/C", "\"dir /D /-C \"" + path + "\"\""}; String[] output = new String[2]; FileExecutor fe = new FileExecutor(); state = fe.executeCommand(params, output); retval = extractLong(output[0], -3, 3, "%"); } else if( IoHelper.getOSFamily() == UNIX ) { String[] params = {"df", "-Pk", path}; String[] output = new String[2]; FileExecutor fe = new FileExecutor(); state = fe.executeCommand(params, output); retval = extractLong(output[0], -3, 3, "%"); } else if(IoHelper.getOSFamily() == MAC) { String[] params = {"df", "-k", path}; String[] output = new String[2]; FileExecutor fe = new FileExecutor(); state = fe.executeCommand(params, output); retval = extractLong(output[0], -3, 3, "%"); } return retval; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/8ed787013b97bfd7e4559ae7db96012b66f0afe0/IoHelper.java/buggy/src/lib/com/izforge/izpack/util/IoHelper.java
verifyDef(qd); QuantumStrategy strg = null; QuantumMap qMap = null; switch (qd.family) { case LINEAR: case POLYNOMIAL: qMap = new PolynomialMap(); break; case LOGARITHMIC: qMap = new LogarithmicMap(); break; case EXPONENTIAL: qMap = new ExponentialMap(); break; default: } strg = getQuantization(qd); strg.setMap(qMap); return strg;
verifyDef(qd); QuantumStrategy strg = null; strg = getQuantization(qd); if (strg == null) throw new IllegalArgumentException("Unsupported strategy"); return strg;
public static QuantumStrategy getStrategy(QuantumDef qd) { verifyDef(qd); QuantumStrategy strg = null; QuantumMap qMap = null; switch (qd.family) { case LINEAR: case POLYNOMIAL: qMap = new PolynomialMap(); break; case LOGARITHMIC: qMap = new LogarithmicMap(); break; case EXPONENTIAL: qMap = new ExponentialMap(); break; default: //Never reached, verifyDef throws exception if wrong family. } strg = getQuantization(qd); strg.setMap(qMap); return strg; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/QuantumFactory.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/quantum/QuantumFactory.java
verifyFamily(qd.family);
private static void verifyDef(QuantumDef qd) { if (qd == null) throw new NullPointerException("No quantum definition."); verifyFamily(qd.family); verifyBitResolution(qd.bitResolution); verifyPixelType(qd.pixelType); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5b83ecccd54946c2125525e83cea40c4c4dd36/QuantumFactory.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/quantum/QuantumFactory.java
vs = new VariableSubstitutor(idata.getVariableValueMap());
vs = new VariableSubstitutor(idata.getVariables());
public FinishPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); vs = new VariableSubstitutor(idata.getVariableValueMap()); // The 'super' layout GridBagLayout superLayout = new GridBagLayout(); setLayout(superLayout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(0, 0, 0, 0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.CENTER; // We initialize our 'real' layout centerPanel = new JPanel(); layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS); centerPanel.setLayout(layout); superLayout.addLayoutComponent(centerPanel, gbConstraints); add(centerPanel); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6822c9086a6716a2c03b2ad638f19542678f38a5/FinishPanel.java/clean/src/lib/com/izforge/izpack/panels/FinishPanel.java
assertNotNull(pool);
public void testVariousConstructors() throws Exception { { StackObjectPool pool = new StackObjectPool(); } { StackObjectPool pool = new StackObjectPool(10); } { StackObjectPool pool = new StackObjectPool(10,5); } { StackObjectPool pool = new StackObjectPool(null); } { StackObjectPool pool = new StackObjectPool(null,10); } { StackObjectPool pool = new StackObjectPool(null,10,5); } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/3af8cd1f6c73a88cdbc7976a676b4169778823d9/TestStackObjectPool.java/clean/src/test/org/apache/commons/pool/impl/TestStackObjectPool.java
public StackObjectPool(PoolableObjectFactory factory) { this(factory,DEFAULT_MAX_SLEEPING,DEFAULT_INIT_SLEEPING_CAPACITY);
public StackObjectPool() { this((PoolableObjectFactory)null,DEFAULT_MAX_SLEEPING,DEFAULT_INIT_SLEEPING_CAPACITY);
public StackObjectPool(PoolableObjectFactory factory) { this(factory,DEFAULT_MAX_SLEEPING,DEFAULT_INIT_SLEEPING_CAPACITY); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/StackObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/StackObjectPool.java
public MethodCall(final String name, final Object param) { this(name, Collections.singletonList(param));
public MethodCall(final String name) { this(name, null);
public MethodCall(final String name, final Object param) { this(name, Collections.singletonList(param)); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/MethodCall.java/buggy/src/test/org/apache/commons/pool/MethodCall.java
public TestObjectPoolFactory(final String name) {
protected TestObjectPoolFactory(final String name) {
public TestObjectPoolFactory(final String name) { super(name); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/0cbda9bdbe04f47a58b8b44c3115b516855caf78/TestObjectPoolFactory.java/clean/src/test/org/apache/commons/pool/TestObjectPoolFactory.java
protected ObjectPoolFactory makeFactory(PoolableObjectFactory objectFactory) throws UnsupportedOperationException { throw new UnsupportedOperationException("Subclass needs to override makeFactory method.");
protected ObjectPoolFactory makeFactory() throws UnsupportedOperationException { return makeFactory(new MethodCallPoolableObjectFactory());
protected ObjectPoolFactory makeFactory(PoolableObjectFactory objectFactory) throws UnsupportedOperationException { throw new UnsupportedOperationException("Subclass needs to override makeFactory method."); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/0cbda9bdbe04f47a58b8b44c3115b516855caf78/TestObjectPoolFactory.java/clean/src/test/org/apache/commons/pool/TestObjectPoolFactory.java
System.out.println("userObject "+node.getChildrenDisplay());
public void visit(TreeImageSet node) { Object userObject = node.getUserObject(); System.out.println("userObject "+node.getChildrenDisplay()); if ((userObject instanceof DatasetData) || (userObject instanceof CategoryData)) { System.out.println("userObject "+userObject); if (node.isChildrenLoaded()) foundNodes.add(userObject); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/154added43a4befdc2c1eead5c06fef208696d8a/RefreshVisitor.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/cmd/RefreshVisitor.java
System.out.println("userObject "+userObject);
public void visit(TreeImageSet node) { Object userObject = node.getUserObject(); System.out.println("userObject "+node.getChildrenDisplay()); if ((userObject instanceof DatasetData) || (userObject instanceof CategoryData)) { System.out.println("userObject "+userObject); if (node.isChildrenLoaded()) foundNodes.add(userObject); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/154added43a4befdc2c1eead5c06fef208696d8a/RefreshVisitor.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/cmd/RefreshVisitor.java
{
{
private void buildGUI() { Container c = getContentPane(); c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS)); getContentPane().add(player, BorderLayout.CENTER); pack(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/307b46abefd43070ad77e63095c151223a982ae5/Player.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/Player.java
pack(); }
pack(); }
private void buildGUI() { Container c = getContentPane(); c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS)); getContentPane().add(player, BorderLayout.CENTER); pack(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/307b46abefd43070ad77e63095c151223a982ae5/Player.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/Player.java
{
{
private void init(ViewerCtrl control, int maxT, int maxZ, MovieSettings settings) { int max = maxT; int s = settings.getStartT(), e = settings.getEndT(); if (maxT == 0) { s = settings.getStartZ(); e = settings.getEndZ(); max = maxZ; } PlayerManager manager = new PlayerManager(this, control, max, settings.getMovieIndex(), s, e); player = new PlayerUI(manager, control.getRegistry(), maxT, maxZ, settings); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/307b46abefd43070ad77e63095c151223a982ae5/Player.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/Player.java
}
}
private void init(ViewerCtrl control, int maxT, int maxZ, MovieSettings settings) { int max = maxT; int s = settings.getStartT(), e = settings.getEndT(); if (maxT == 0) { s = settings.getStartZ(); e = settings.getEndZ(); max = maxZ; } PlayerManager manager = new PlayerManager(this, control, max, settings.getMovieIndex(), s, e); player = new PlayerUI(manager, control.getRegistry(), maxT, maxZ, settings); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/307b46abefd43070ad77e63095c151223a982ae5/Player.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/Player.java
protected AbstractCasFilter(final String serverName, final String serviceUrl, final boolean useSession) { CommonUtils.assertTrue(CommonUtils.isNotBlank(serverName) || CommonUtils.isNotBlank(serviceUrl), "either serverName or serviceUrl must be set"); this.serverName = serverName; this.serviceUrl = serviceUrl; this.useSession = useSession;
protected AbstractCasFilter(final String serverName, final String serviceUrl) { this(serverName, serviceUrl, true);
protected AbstractCasFilter(final String serverName, final String serviceUrl, final boolean useSession) { CommonUtils.assertTrue(CommonUtils.isNotBlank(serverName) || CommonUtils.isNotBlank(serviceUrl), "either serverName or serviceUrl must be set"); this.serverName = serverName; this.serviceUrl = serviceUrl; this.useSession = useSession; }
52448 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52448/44b8c865864662f073d1d0354ed13fe96341004e/AbstractCasFilter.java/buggy/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/AbstractCasFilter.java
cmdline_len = cmdline_len + 11;
cmdline_len += 11;
public CompileResult perform(String compiler, ArrayList arguments) { Debug.trace("starting job " + this.name); // we have some maximum command line length - need to count int cmdline_len = 0; // used to collect the arguments for executing the compiler LinkedList args = new LinkedList(arguments); { Iterator arg_it = args.iterator(); while (arg_it.hasNext()) cmdline_len += ((String) arg_it.next()).length() + 1; } // add compiler in front of arguments args.add(0, compiler); cmdline_len += compiler.length() + 1; // construct classpath argument for compiler // - collect all classpaths StringBuffer classpath_sb = new StringBuffer(); Iterator cp_it = this.classpath.iterator(); while (cp_it.hasNext()) { String cp = (String) cp_it.next(); if (classpath_sb.length() > 0) classpath_sb.append(File.pathSeparatorChar); classpath_sb.append(new File(cp).getAbsolutePath()); } String classpath_str = classpath_sb.toString(); // - add classpath argument to command line if (classpath_str.length() > 0) { args.add("-classpath"); cmdline_len = cmdline_len + 11; args.add(classpath_str); cmdline_len += classpath_str.length() + 1; } // remember how many arguments we have which don't change for the // job int common_args_no = args.size(); // remember how long the common command line is int common_args_len = cmdline_len; // used for execution FileExecutor executor = new FileExecutor(); String output[] = new String[2]; // used for displaying the progress bar String jobfiles = ""; int fileno = 0; int last_fileno = 0; // now iterate over all files of this job Iterator file_it = this.files.iterator(); while (file_it.hasNext()) { File f = (File) file_it.next(); String fpath = f.getAbsolutePath(); Debug.trace("processing " + fpath); // we add the file _first_ to the arguments to have a better // chance to get something done if the command line is almost // MAX_CMDLINE_SIZE or even above fileno++; jobfiles += f.getName() + " "; args.add(fpath); cmdline_len += fpath.length(); // start compilation if maximum command line length reached if (cmdline_len >= MAX_CMDLINE_SIZE) { Debug.trace("compiling " + jobfiles); // display useful progress bar (avoid showing 100% while // still // compiling a lot) this.listener.progress(last_fileno, jobfiles); last_fileno = fileno; String[] full_cmdline = (String[]) args.toArray(output); int retval = executor.executeCommand(full_cmdline, output); // update progress bar: compilation of fileno files done this.listener.progress(fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult(this.langpack .getString("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError(result); if (!result.isContinue()) return result; } else { // verify that all files have been compiled successfully // I found that sometimes, no error code is returned // although // compilation failed. Iterator arg_it = args.listIterator(common_args_no); while (arg_it.hasNext()) { File java_file = new File((String) arg_it.next()); String basename = java_file.getName(); int dotpos = basename.lastIndexOf('.'); basename = basename.substring(0, dotpos) + ".class"; File class_file = new File(java_file.getParentFile(), basename); if (!class_file.exists()) { CompileResult result = new CompileResult(this.langpack .getString("CompilePanel.error.noclassfile") + java_file.getAbsolutePath(), full_cmdline, output[0], output[1]); this.listener.handleCompileError(result); if (!result.isContinue()) return result; // don't continue any further break; } } } // clean command line: remove files we just compiled for (int i = args.size() - 1; i >= common_args_no; i--) { args.removeLast(); } cmdline_len = common_args_len; jobfiles = ""; } } if (cmdline_len > common_args_len) { this.listener.progress(last_fileno, jobfiles); String[] full_cmdline = (String[]) args.toArray(output); int retval = executor.executeCommand(full_cmdline, output); this.listener.progress(fileno, jobfiles); if (retval != 0) { CompileResult result = new CompileResult(this.langpack .getString("CompilePanel.error"), full_cmdline, output[0], output[1]); this.listener.handleCompileError(result); if (!result.isContinue()) return result; } } Debug.trace("job " + this.name + " done (" + fileno + " files compiled)"); return new CompileResult(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
this.compilationThread = null;
Thread compilationThread = null;
public CompileWorker(AutomatedInstallData idata, CompileHandler handler) throws IOException { this.idata = idata; this.handler = handler; this.vs = new VariableSubstitutor(idata.getVariables()); this.compilationThread = null; if (!readSpec()) throw new IOException("Error reading compilation specification"); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
if (child.getName().equals("classpath"))
if ("classpath".equals(child.getName()))
private CompilationJob collectJobsRecursive(XMLElement node, ArrayList classpath) throws Exception { Enumeration toplevel_tags = node.enumerateChildren(); ArrayList ourclasspath = (ArrayList) classpath.clone(); ArrayList files = new ArrayList(); while (toplevel_tags.hasMoreElements()) { XMLElement child = (XMLElement) toplevel_tags.nextElement(); if (child.getName().equals("classpath")) { changeClassPath(ourclasspath, child); } else if (child.getName().equals("job")) { CompilationJob subjob = collectJobsRecursive(child, ourclasspath); if (subjob != null) this.jobs.add(subjob); } else if (child.getName().equals("directory")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.addAll(scanDirectory(new File(finalname))); } } else if (child.getName().equals("file")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.add(new File(finalname)); } } else if (child.getName().equals("packdepency")) { String name = child.getAttribute("name"); if (name == null) { System.out .println("invalid compilation spec: <packdepency> without name attribute"); return null; } // check whether the wanted pack was selected for installation Iterator pack_it = this.idata.selectedPacks.iterator(); boolean found = false; while (pack_it.hasNext()) { com.izforge.izpack.Pack pack = (com.izforge.izpack.Pack) pack_it.next(); if (pack.name.equals(name)) { found = true; break; } } if (!found) { Debug.trace("skipping job because pack " + name + " was not selected."); return null; } } } if (files.size() > 0) return new CompilationJob(this.handler, this.idata.langpack, (String) node .getAttribute("name"), files, ourclasspath); return null; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
else if (child.getName().equals("job"))
else if ("job".equals(child.getName()))
private CompilationJob collectJobsRecursive(XMLElement node, ArrayList classpath) throws Exception { Enumeration toplevel_tags = node.enumerateChildren(); ArrayList ourclasspath = (ArrayList) classpath.clone(); ArrayList files = new ArrayList(); while (toplevel_tags.hasMoreElements()) { XMLElement child = (XMLElement) toplevel_tags.nextElement(); if (child.getName().equals("classpath")) { changeClassPath(ourclasspath, child); } else if (child.getName().equals("job")) { CompilationJob subjob = collectJobsRecursive(child, ourclasspath); if (subjob != null) this.jobs.add(subjob); } else if (child.getName().equals("directory")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.addAll(scanDirectory(new File(finalname))); } } else if (child.getName().equals("file")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.add(new File(finalname)); } } else if (child.getName().equals("packdepency")) { String name = child.getAttribute("name"); if (name == null) { System.out .println("invalid compilation spec: <packdepency> without name attribute"); return null; } // check whether the wanted pack was selected for installation Iterator pack_it = this.idata.selectedPacks.iterator(); boolean found = false; while (pack_it.hasNext()) { com.izforge.izpack.Pack pack = (com.izforge.izpack.Pack) pack_it.next(); if (pack.name.equals(name)) { found = true; break; } } if (!found) { Debug.trace("skipping job because pack " + name + " was not selected."); return null; } } } if (files.size() > 0) return new CompilationJob(this.handler, this.idata.langpack, (String) node .getAttribute("name"), files, ourclasspath); return null; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
else if (child.getName().equals("directory"))
else if ("directory".equals(child.getName()))
private CompilationJob collectJobsRecursive(XMLElement node, ArrayList classpath) throws Exception { Enumeration toplevel_tags = node.enumerateChildren(); ArrayList ourclasspath = (ArrayList) classpath.clone(); ArrayList files = new ArrayList(); while (toplevel_tags.hasMoreElements()) { XMLElement child = (XMLElement) toplevel_tags.nextElement(); if (child.getName().equals("classpath")) { changeClassPath(ourclasspath, child); } else if (child.getName().equals("job")) { CompilationJob subjob = collectJobsRecursive(child, ourclasspath); if (subjob != null) this.jobs.add(subjob); } else if (child.getName().equals("directory")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.addAll(scanDirectory(new File(finalname))); } } else if (child.getName().equals("file")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.add(new File(finalname)); } } else if (child.getName().equals("packdepency")) { String name = child.getAttribute("name"); if (name == null) { System.out .println("invalid compilation spec: <packdepency> without name attribute"); return null; } // check whether the wanted pack was selected for installation Iterator pack_it = this.idata.selectedPacks.iterator(); boolean found = false; while (pack_it.hasNext()) { com.izforge.izpack.Pack pack = (com.izforge.izpack.Pack) pack_it.next(); if (pack.name.equals(name)) { found = true; break; } } if (!found) { Debug.trace("skipping job because pack " + name + " was not selected."); return null; } } } if (files.size() > 0) return new CompilationJob(this.handler, this.idata.langpack, (String) node .getAttribute("name"), files, ourclasspath); return null; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
else if (child.getName().equals("file"))
else if ("file".equals(child.getName()))
private CompilationJob collectJobsRecursive(XMLElement node, ArrayList classpath) throws Exception { Enumeration toplevel_tags = node.enumerateChildren(); ArrayList ourclasspath = (ArrayList) classpath.clone(); ArrayList files = new ArrayList(); while (toplevel_tags.hasMoreElements()) { XMLElement child = (XMLElement) toplevel_tags.nextElement(); if (child.getName().equals("classpath")) { changeClassPath(ourclasspath, child); } else if (child.getName().equals("job")) { CompilationJob subjob = collectJobsRecursive(child, ourclasspath); if (subjob != null) this.jobs.add(subjob); } else if (child.getName().equals("directory")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.addAll(scanDirectory(new File(finalname))); } } else if (child.getName().equals("file")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.add(new File(finalname)); } } else if (child.getName().equals("packdepency")) { String name = child.getAttribute("name"); if (name == null) { System.out .println("invalid compilation spec: <packdepency> without name attribute"); return null; } // check whether the wanted pack was selected for installation Iterator pack_it = this.idata.selectedPacks.iterator(); boolean found = false; while (pack_it.hasNext()) { com.izforge.izpack.Pack pack = (com.izforge.izpack.Pack) pack_it.next(); if (pack.name.equals(name)) { found = true; break; } } if (!found) { Debug.trace("skipping job because pack " + name + " was not selected."); return null; } } } if (files.size() > 0) return new CompilationJob(this.handler, this.idata.langpack, (String) node .getAttribute("name"), files, ourclasspath); return null; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
else if (child.getName().equals("packdepency"))
else if ("packdepency".equals(child.getName()))
private CompilationJob collectJobsRecursive(XMLElement node, ArrayList classpath) throws Exception { Enumeration toplevel_tags = node.enumerateChildren(); ArrayList ourclasspath = (ArrayList) classpath.clone(); ArrayList files = new ArrayList(); while (toplevel_tags.hasMoreElements()) { XMLElement child = (XMLElement) toplevel_tags.nextElement(); if (child.getName().equals("classpath")) { changeClassPath(ourclasspath, child); } else if (child.getName().equals("job")) { CompilationJob subjob = collectJobsRecursive(child, ourclasspath); if (subjob != null) this.jobs.add(subjob); } else if (child.getName().equals("directory")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.addAll(scanDirectory(new File(finalname))); } } else if (child.getName().equals("file")) { String name = child.getAttribute("name"); if (name != null) { // substitute variables String finalname = this.vs.substitute(name, "plain"); files.add(new File(finalname)); } } else if (child.getName().equals("packdepency")) { String name = child.getAttribute("name"); if (name == null) { System.out .println("invalid compilation spec: <packdepency> without name attribute"); return null; } // check whether the wanted pack was selected for installation Iterator pack_it = this.idata.selectedPacks.iterator(); boolean found = false; while (pack_it.hasNext()) { com.izforge.izpack.Pack pack = (com.izforge.izpack.Pack) pack_it.next(); if (pack.name.equals(name)) { found = true; break; } } if (!found) { Debug.trace("skipping job because pack " + name + " was not selected."); return null; } } } if (files.size() > 0) return new CompilationJob(this.handler, this.idata.langpack, (String) node .getAttribute("name"), files, ourclasspath); return null; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
this.compilationThread = new Thread(this, "compilation thread");
Thread compilationThread = new Thread(this, "compilation thread");
public void startThread() { this.compilationThread = new Thread(this, "compilation thread"); // will call this.run() this.compilationThread.start(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
this.compilationThread.start();
compilationThread.start();
public void startThread() { this.compilationThread = new Thread(this, "compilation thread"); // will call this.run() this.compilationThread.start(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/CompileWorker.java/clean/src/lib/com/izforge/izpack/installer/CompileWorker.java
public VariableSubstitutor(Map variables)
public VariableSubstitutor(Properties variables)
public VariableSubstitutor(Map variables) { this.variables = variables; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/53934d54deb48548655ceabb6147ed31c66365cd/VariableSubstitutor.java/buggy/src/lib/com/izforge/izpack/util/VariableSubstitutor.java
boolean preselected)
boolean preselected, boolean loose)
public Pack( String name, String id, String description, List osConstraints, boolean required, boolean preselected) { this.name = name; this.id = id; this.description = description; this.osConstraints = osConstraints; this.required = required; this.preselected = preselected; nbytes = 0; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/670d2dce35e3033459b7343ab34ed921bd2331ed/Pack.java/clean/src/lib/com/izforge/izpack/Pack.java
this.loose = loose;
public Pack( String name, String id, String description, List osConstraints, boolean required, boolean preselected) { this.name = name; this.id = id; this.description = description; this.osConstraints = osConstraints; this.required = required; this.preselected = preselected; nbytes = 0; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/670d2dce35e3033459b7343ab34ed921bd2331ed/Pack.java/clean/src/lib/com/izforge/izpack/Pack.java
public Destroyer(String installPath, boolean forceDestroy, AbstractUIProgressHandler handler)
public Destroyer( String installPath, boolean forceDestroy, AbstractUIProgressHandler handler)
public Destroyer(String installPath, boolean forceDestroy, AbstractUIProgressHandler handler) { super("IzPack - Destroyer"); this.installPath = installPath; this.forceDestroy = forceDestroy; this.handler = handler; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Destroyer.java/clean/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
} else if (forceDestroy) file.delete();
} else if (forceDestroy) file.delete();
private void cleanup(File file) throws Exception { if (file.isDirectory()) { File[] files = file.listFiles(); int size = files.length; for (int i = 0; i < size; i++) cleanup(files[i]); file.delete(); } else if (forceDestroy) file.delete(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Destroyer.java/clean/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
ObjectInputStream in = new ObjectInputStream(getClass().getResourceAsStream("/executables"));
ObjectInputStream in = new ObjectInputStream(getClass().getResourceAsStream("/executables"));
private ArrayList getExecutablesList() throws Exception { ArrayList executables = new ArrayList(); ObjectInputStream in = new ObjectInputStream(getClass().getResourceAsStream("/executables")); int num = in.readInt(); for(int i=0;i<num;i++) { ExecutableFile file = (ExecutableFile)in.readObject(); executables.add(file); } return executables; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Destroyer.java/clean/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
for(int i=0;i<num;i++)
for (int i = 0; i < num; i++)
private ArrayList getExecutablesList() throws Exception { ArrayList executables = new ArrayList(); ObjectInputStream in = new ObjectInputStream(getClass().getResourceAsStream("/executables")); int num = in.readInt(); for(int i=0;i<num;i++) { ExecutableFile file = (ExecutableFile)in.readObject(); executables.add(file); } return executables; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Destroyer.java/clean/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
ExecutableFile file = (ExecutableFile)in.readObject();
ExecutableFile file = (ExecutableFile) in.readObject();
private ArrayList getExecutablesList() throws Exception { ArrayList executables = new ArrayList(); ObjectInputStream in = new ObjectInputStream(getClass().getResourceAsStream("/executables")); int num = in.readInt(); for(int i=0;i<num;i++) { ExecutableFile file = (ExecutableFile)in.readObject(); executables.add(file); } return executables; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Destroyer.java/clean/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
handler.startAction ("destroy", size);
handler.startAction("destroy", size);
public void run() { try { // We get the list of the files to delete ArrayList executables = getExecutablesList(); FileExecutor executor = new FileExecutor(executables); executor.executeFiles(ExecutableFile.UNINSTALL, this.handler); ArrayList files = getFilesList(); int size = files.size(); handler.startAction ("destroy", size); // We destroy the files for (int i = 0; i < size; i++) { File file = (File) files.get(i); file.delete(); handler.progress(i, file.getAbsolutePath()); } // We make a complementary cleanup handler.progress(size, "[ cleanups ]"); cleanup(new File(installPath)); handler.stopAction (); } catch (Exception err) { handler.stopAction (); err.printStackTrace(); handler.emitError("exception caught", err.toString()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Destroyer.java/clean/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
handler.stopAction (); } catch (Exception err)
handler.stopAction(); } catch (Exception err)
public void run() { try { // We get the list of the files to delete ArrayList executables = getExecutablesList(); FileExecutor executor = new FileExecutor(executables); executor.executeFiles(ExecutableFile.UNINSTALL, this.handler); ArrayList files = getFilesList(); int size = files.size(); handler.startAction ("destroy", size); // We destroy the files for (int i = 0; i < size; i++) { File file = (File) files.get(i); file.delete(); handler.progress(i, file.getAbsolutePath()); } // We make a complementary cleanup handler.progress(size, "[ cleanups ]"); cleanup(new File(installPath)); handler.stopAction (); } catch (Exception err) { handler.stopAction (); err.printStackTrace(); handler.emitError("exception caught", err.toString()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Destroyer.java/clean/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
handler.stopAction ();
handler.stopAction();
public void run() { try { // We get the list of the files to delete ArrayList executables = getExecutablesList(); FileExecutor executor = new FileExecutor(executables); executor.executeFiles(ExecutableFile.UNINSTALL, this.handler); ArrayList files = getFilesList(); int size = files.size(); handler.startAction ("destroy", size); // We destroy the files for (int i = 0; i < size; i++) { File file = (File) files.get(i); file.delete(); handler.progress(i, file.getAbsolutePath()); } // We make a complementary cleanup handler.progress(size, "[ cleanups ]"); cleanup(new File(installPath)); handler.stopAction (); } catch (Exception err) { handler.stopAction (); err.printStackTrace(); handler.emitError("exception caught", err.toString()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/Destroyer.java/clean/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
this.stop = new Boolean(true);
this.stop = Boolean.valueOf(true);
public void doStop() { synchronized (this.stop) { this.stop = new Boolean(true); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/ProcessPanelWorker.java/buggy/src/lib/com/izforge/izpack/installer/ProcessPanelWorker.java
this.idata = idata;
public ProcessPanelWorker( AutomatedInstallData idata, AbstractUIProcessHandler handler) throws IOException { this.idata = idata; this.handler = handler; this.vs = new VariableSubstitutor(idata.getVariables()); if (!readSpec()) throw new IOException("Error reading processing specification"); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/ProcessPanelWorker.java/buggy/src/lib/com/izforge/izpack/installer/ProcessPanelWorker.java
public WebKunststoffPackager(String outputFilename, PackagerListener plistener) throws Exception
public WebKunststoffPackager( String outputFilename, PackagerListener plistener) throws Exception
public WebKunststoffPackager(String outputFilename, PackagerListener plistener) throws Exception { super(outputFilename, plistener); // Copies the Kunststoff library sendMsg("Copying the Kunststoff library ..."); ZipInputStream skeleton_is = new ZipInputStream (getClass().getResourceAsStream("/lib/kunststoff.jar")); if (skeleton_is == null) { skeleton_is = new JarInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "kunststoff.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry outJar.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, outJar); outJar.closeEntry(); skeleton_is.closeEntry(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebKunststoffPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebKunststoffPackager.java
ZipInputStream skeleton_is = new ZipInputStream (getClass().getResourceAsStream("/lib/kunststoff.jar"));
ZipInputStream skeleton_is = new ZipInputStream(getClass().getResourceAsStream("/lib/kunststoff.jar"));
public WebKunststoffPackager(String outputFilename, PackagerListener plistener) throws Exception { super(outputFilename, plistener); // Copies the Kunststoff library sendMsg("Copying the Kunststoff library ..."); ZipInputStream skeleton_is = new ZipInputStream (getClass().getResourceAsStream("/lib/kunststoff.jar")); if (skeleton_is == null) { skeleton_is = new JarInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "kunststoff.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry outJar.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, outJar); outJar.closeEntry(); skeleton_is.closeEntry(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebKunststoffPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebKunststoffPackager.java
skeleton_is = new JarInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "kunststoff.jar"));
skeleton_is = new JarInputStream( new FileInputStream( Compiler.IZPACK_HOME + "lib" + File.separator + "kunststoff.jar"));
public WebKunststoffPackager(String outputFilename, PackagerListener plistener) throws Exception { super(outputFilename, plistener); // Copies the Kunststoff library sendMsg("Copying the Kunststoff library ..."); ZipInputStream skeleton_is = new ZipInputStream (getClass().getResourceAsStream("/lib/kunststoff.jar")); if (skeleton_is == null) { skeleton_is = new JarInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "kunststoff.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry outJar.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, outJar); outJar.closeEntry(); skeleton_is.closeEntry(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebKunststoffPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebKunststoffPackager.java
public WebKunststoffPackager(String outputFilename, PackagerListener plistener) throws Exception { super(outputFilename, plistener); // Copies the Kunststoff library sendMsg("Copying the Kunststoff library ..."); ZipInputStream skeleton_is = new ZipInputStream (getClass().getResourceAsStream("/lib/kunststoff.jar")); if (skeleton_is == null) { skeleton_is = new JarInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "kunststoff.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry outJar.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, outJar); outJar.closeEntry(); skeleton_is.closeEntry(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebKunststoffPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebKunststoffPackager.java
public WebKunststoffPackager(String outputFilename, PackagerListener plistener) throws Exception { super(outputFilename, plistener); // Copies the Kunststoff library sendMsg("Copying the Kunststoff library ..."); ZipInputStream skeleton_is = new ZipInputStream (getClass().getResourceAsStream("/lib/kunststoff.jar")); if (skeleton_is == null) { skeleton_is = new JarInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "kunststoff.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry outJar.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, outJar); outJar.closeEntry(); skeleton_is.closeEntry(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebKunststoffPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebKunststoffPackager.java
public WebKunststoffPackager(String outputFilename, PackagerListener plistener) throws Exception { super(outputFilename, plistener); // Copies the Kunststoff library sendMsg("Copying the Kunststoff library ..."); ZipInputStream skeleton_is = new ZipInputStream (getClass().getResourceAsStream("/lib/kunststoff.jar")); if (skeleton_is == null) { skeleton_is = new JarInputStream (new FileInputStream ( Compiler.IZPACK_HOME + "lib" + File.separator + "kunststoff.jar")); } ZipEntry zentry; while ((zentry = skeleton_is.getNextEntry()) != null) { // Puts a new entry outJar.putNextEntry(new ZipEntry(zentry.getName())); // Copy the data copyStream(skeleton_is, outJar); outJar.closeEntry(); skeleton_is.closeEntry(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebKunststoffPackager.java/clean/src/lib/com/izforge/izpack/compiler/WebKunststoffPackager.java
public WebPackager(String outputFilename, PackagerListener plistener) throws Exception
public WebPackager(String outputFilename, PackagerListener plistener) throws Exception
public WebPackager(String outputFilename, PackagerListener plistener) throws Exception { packs = new ArrayList(); langpacks = new ArrayList(); setPackagerListener(plistener); sendStart(); // Sets up the zipped output stream FileOutputStream outFile = new FileOutputStream(outputFilename); outJar = new JarOutputStream(outFile); outJar.setLevel(9); // Sets up the web output jar stream outputFilename = outputFilename.substring(0, outputFilename.length() - 4) + "_web.jar"; outFile = new FileOutputStream(outputFilename); webJar = new JarOutputStream(outFile); webJar.setLevel(9); // Copies the skeleton installer sendMsg("Copying the skeleton installer ..."); writeSkeletonInstaller(webJar); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/buggy/src/lib/com/izforge/izpack/compiler/WebPackager.java
outputFilename = outputFilename.substring(0, outputFilename.length() - 4) + "_web.jar";
outputFilename = outputFilename.substring(0, outputFilename.length() - 4) + "_web.jar";
public WebPackager(String outputFilename, PackagerListener plistener) throws Exception { packs = new ArrayList(); langpacks = new ArrayList(); setPackagerListener(plistener); sendStart(); // Sets up the zipped output stream FileOutputStream outFile = new FileOutputStream(outputFilename); outJar = new JarOutputStream(outFile); outJar.setLevel(9); // Sets up the web output jar stream outputFilename = outputFilename.substring(0, outputFilename.length() - 4) + "_web.jar"; outFile = new FileOutputStream(outputFilename); webJar = new JarOutputStream(outFile); webJar.setLevel(9); // Copies the skeleton installer sendMsg("Copying the skeleton installer ..."); writeSkeletonInstaller(webJar); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/WebPackager.java/buggy/src/lib/com/izforge/izpack/compiler/WebPackager.java
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(_maxIdle > 0 && (_pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(obj)))) {
public void returnObject(Object obj) throws Exception { boolean success = true; if(_testOnReturn && !(_factory.validateObject(obj))) { success = false; } else {
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(_maxIdle > 0 && (_pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(obj)))) { try { _factory.passivateObject(obj); } catch(Exception e) { ; // ignored, we're throwing it out anway } _factory.destroyObject(obj); } else { try { _factory.passivateObject(obj); _pool.addFirst(new ObjectTimestampPair(obj)); } catch(Exception e) { _factory.destroyObject(obj); } } notifyAll(); // _numActive has changed }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/6d5eb8fcfd40a356f848c407c2429f711b97c0f4/GenericObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
; } _factory.destroyObject(obj); } else { try { _factory.passivateObject(obj); _pool.addFirst(new ObjectTimestampPair(obj)); } catch(Exception e) { _factory.destroyObject(obj);
success = false;
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(_maxIdle > 0 && (_pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(obj)))) { try { _factory.passivateObject(obj); } catch(Exception e) { ; // ignored, we're throwing it out anway } _factory.destroyObject(obj); } else { try { _factory.passivateObject(obj); _pool.addFirst(new ObjectTimestampPair(obj)); } catch(Exception e) { _factory.destroyObject(obj); } } notifyAll(); // _numActive has changed }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/6d5eb8fcfd40a356f848c407c2429f711b97c0f4/GenericObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
notifyAll();
boolean shouldDestroy = !success; synchronized(this) { _numActive--; if((_maxIdle > 0) && (_pool.size() >= _maxIdle)) { shouldDestroy = true; } else if(success) { _pool.addFirst(new ObjectTimestampPair(obj)); } notifyAll(); } if(shouldDestroy) { try { _factory.destroyObject(obj); } catch(Exception e) { } }
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(_maxIdle > 0 && (_pool.size() >= _maxIdle || (_testOnReturn && !_factory.validateObject(obj)))) { try { _factory.passivateObject(obj); } catch(Exception e) { ; // ignored, we're throwing it out anway } _factory.destroyObject(obj); } else { try { _factory.passivateObject(obj); _pool.addFirst(new ObjectTimestampPair(obj)); } catch(Exception e) { _factory.destroyObject(obj); } } notifyAll(); // _numActive has changed }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/6d5eb8fcfd40a356f848c407c2429f711b97c0f4/GenericObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
public RegistryLogItem(int type, int root, String key, String valueName, RegDataContainer newValue, RegDataContainer oldValue)
private RegistryLogItem()
public RegistryLogItem(int type, int root, String key, String valueName, RegDataContainer newValue, RegDataContainer oldValue) { this.type = type; this.root = root; this.key = key; this.valueName = valueName; this.newValue = newValue; this.oldValue = oldValue; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/65829be7fc5a410510ee8132076f9911c480d666/RegistryLogItem.java/clean/src/lib/com/coi/tools/os/win/RegistryLogItem.java
this.type = type; this.root = root; this.key = key; this.valueName = valueName; this.newValue = newValue; this.oldValue = oldValue;
super();
public RegistryLogItem(int type, int root, String key, String valueName, RegDataContainer newValue, RegDataContainer oldValue) { this.type = type; this.root = root; this.key = key; this.valueName = valueName; this.newValue = newValue; this.oldValue = oldValue; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/65829be7fc5a410510ee8132076f9911c480d666/RegistryLogItem.java/clean/src/lib/com/coi/tools/os/win/RegistryLogItem.java
return (worker != null ? true : false);
return (worker != null);
public boolean good() { return (worker != null ? true : false); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/OSClassHelper.java/clean/src/lib/com/izforge/izpack/util/OSClassHelper.java
public Object makeObject(Object key) {
public Object makeObject(Object key) {
protected KeyedObjectPool makeEmptyPool(int mincapacity) { GenericKeyedObjectPool pool = new GenericKeyedObjectPool( new KeyedPoolableObjectFactory() { HashMap map = new HashMap(); public Object makeObject(Object key) { int counter = 0; Integer Counter = (Integer)(map.get(key)); if(null != Counter) { counter = Counter.intValue(); } map.put(key,new Integer(counter + 1)); return String.valueOf(key) + String.valueOf(counter); } public void destroyObject(Object key, Object obj) { } public boolean validateObject(Object key, Object obj) { return true; } public void activateObject(Object key, Object obj) { } public void passivateObject(Object key, Object obj) { } } ); pool.setMaxActive(mincapacity); pool.setMaxIdle(mincapacity); return pool; }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/TestGenericKeyedObjectPool.java/clean/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
map.put(key,new Integer(counter + 1)); return String.valueOf(key) + String.valueOf(counter);
map.put(key,new Integer(counter + 1)); return String.valueOf(key) + String.valueOf(counter);
protected KeyedObjectPool makeEmptyPool(int mincapacity) { GenericKeyedObjectPool pool = new GenericKeyedObjectPool( new KeyedPoolableObjectFactory() { HashMap map = new HashMap(); public Object makeObject(Object key) { int counter = 0; Integer Counter = (Integer)(map.get(key)); if(null != Counter) { counter = Counter.intValue(); } map.put(key,new Integer(counter + 1)); return String.valueOf(key) + String.valueOf(counter); } public void destroyObject(Object key, Object obj) { } public boolean validateObject(Object key, Object obj) { return true; } public void activateObject(Object key, Object obj) { } public void passivateObject(Object key, Object obj) { } } ); pool.setMaxActive(mincapacity); pool.setMaxIdle(mincapacity); return pool; }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/TestGenericKeyedObjectPool.java/clean/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
public Object makeObject(Object key) {
public Object makeObject(Object key) {
public Object makeObject(Object key) { int counter = 0; Integer Counter = (Integer)(map.get(key)); if(null != Counter) { counter = Counter.intValue(); } map.put(key,new Integer(counter + 1)); return String.valueOf(key) + String.valueOf(counter); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/TestGenericKeyedObjectPool.java/clean/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
map.put(key,new Integer(counter + 1)); return String.valueOf(key) + String.valueOf(counter);
map.put(key,new Integer(counter + 1)); return String.valueOf(key) + String.valueOf(counter);
public Object makeObject(Object key) { int counter = 0; Integer Counter = (Integer)(map.get(key)); if(null != Counter) { counter = Counter.intValue(); } map.put(key,new Integer(counter + 1)); return String.valueOf(key) + String.valueOf(counter); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/TestGenericKeyedObjectPool.java/clean/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
public void testMaxTotal() throws Exception { pool.setMaxActive(2); pool.setMaxTotal(3); pool.setWhenExhaustedAction(GenericKeyedObjectPool.WHEN_EXHAUSTED_FAIL); Object o1 = pool.borrowObject("a"); assertNotNull(o1); Object o2 = pool.borrowObject("a"); assertNotNull(o2); Object o3 = pool.borrowObject("b"); assertNotNull(o3); try { pool.borrowObject("c"); fail("Expected NoSuchElementException"); } catch(NoSuchElementException e) { // expected } assertEquals(0, pool.getNumIdle()); pool.returnObject("b", o3); assertEquals(1, pool.getNumIdle()); assertEquals(1, pool.getNumIdle("b")); Object o4 = pool.borrowObject("b"); assertNotNull(o4); assertEquals(0, pool.getNumIdle()); assertEquals(0, pool.getNumIdle("b")); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/TestGenericKeyedObjectPool.java/clean/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
public void testWithInitiallyInvalid() throws Exception { GenericKeyedObjectPool pool = new GenericKeyedObjectPool(new SimpleFactory(false)); pool.setTestOnBorrow(true); try { pool.borrowObject("xyzzy"); fail("Expected NoSuchElementException"); } catch(NoSuchElementException e) { // expected } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/cac3e9bf504f5c9299e1d37535c1b3cb67dc7166/TestGenericKeyedObjectPool.java/clean/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
public synchronized int getNumIdle(Object key) { try { return((LinkedList)(_poolMap.get(key))).size(); } catch(Exception e) { return 0; }
public synchronized int getNumIdle() { return _totalIdle;
public synchronized int getNumIdle(Object key) { try { return((LinkedList)(_poolMap.get(key))).size(); } catch(Exception e) { return 0; } }
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
public synchronized int getNumActive(Object key) { return getActiveCount(key);
public synchronized int getNumActive() { return _totalActive;
public synchronized int getNumActive(Object key) { return getActiveCount(key); }
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
public synchronized void preparePool(Object key, boolean populateImmediately) { LinkedList pool = (LinkedList)(_poolMap.get(key)); if (null == pool) { pool = new LinkedList(); _poolMap.put(key,pool); } if (populateImmediately) { try { // Create the pooled objects ensureMinIdle(key); } catch (Exception e) { //Do nothing } } }
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
boolean isSelected, int row, int column)
boolean isSelected, int row, int column)
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { return getTableCellRendererComponent(table, value, isSelected, false, row, column); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/458df5388598b1463abaab7f3fba01a728e5d095/PacksPanelBase.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanelBase.java
boolean isSelected, boolean hasFocus, int row, int column)
boolean isSelected, boolean hasFocus, int row, int column)
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (isSelected) { display.setForeground(table.getSelectionForeground()); display.setBackground(table.getSelectionBackground()); } else { display.setForeground(table.getForeground()); display.setBackground(table.getBackground()); } int state = ((Integer) value).intValue(); display.setSelected((value != null && Math.abs(state) == 1)); display.setEnabled(state >= 0); return display; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/458df5388598b1463abaab7f3fba01a728e5d095/PacksPanelBase.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanelBase.java
GridBagConstraints constraints)
GridBagConstraints constraints)
protected JLabel createLabel(String msgId, String iconId, GridBagLayout layout, GridBagConstraints constraints) { JLabel label = LabelFactory.create(parent.langpack.getString(msgId), parent.icons .getImageIcon(iconId), JLabel.TRAILING); if (layout != null && constraints != null) layout.addLayoutComponent(label, constraints); add(label); return (label); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/458df5388598b1463abaab7f3fba01a728e5d095/PacksPanelBase.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanelBase.java