rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
Debug.log("can install pack with id " + packid + "?");
Debug.trace("can install pack with id " + packid + "?");
public boolean canInstallPack(String packid, Properties variables) { Debug.log("can install pack with id " + packid + "?"); if (!this.packconditions.containsKey(packid)) { Debug.log("no condition, can install pack"); return true; } Debug.log("there is a condition"); Condition condition = (Condition) conditionsmap.get(this.packconditions.get(packid)); if (condition != null) { return condition.isTrue(variables, this.installdata.selectedPacks); } return false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("no condition, can install pack");
Debug.trace("no condition, can install pack");
public boolean canInstallPack(String packid, Properties variables) { Debug.log("can install pack with id " + packid + "?"); if (!this.packconditions.containsKey(packid)) { Debug.log("no condition, can install pack"); return true; } Debug.log("there is a condition"); Condition condition = (Condition) conditionsmap.get(this.packconditions.get(packid)); if (condition != null) { return condition.isTrue(variables, this.installdata.selectedPacks); } return false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("there is a condition");
Debug.trace("there is a condition");
public boolean canInstallPack(String packid, Properties variables) { Debug.log("can install pack with id " + packid + "?"); if (!this.packconditions.containsKey(packid)) { Debug.log("no condition, can install pack"); return true; } Debug.log("there is a condition"); Condition condition = (Condition) conditionsmap.get(this.packconditions.get(packid)); if (condition != null) { return condition.isTrue(variables, this.installdata.selectedPacks); } return false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("can install pack optional with id " + packid + "?");
Debug.trace("can install pack optional with id " + packid + "?");
public boolean canInstallPackOptional(String packid, Properties variables) { Debug.log("can install pack optional with id " + packid + "?"); if (!this.optionalpackconditions.containsKey(packid)) { Debug.log("not in optionalpackconditions."); return false; } else { Debug.log("optional install possible"); return true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("not in optionalpackconditions.");
Debug.trace("not in optionalpackconditions.");
public boolean canInstallPackOptional(String packid, Properties variables) { Debug.log("can install pack optional with id " + packid + "?"); if (!this.optionalpackconditions.containsKey(packid)) { Debug.log("not in optionalpackconditions."); return false; } else { Debug.log("optional install possible"); return true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("optional install possible");
Debug.trace("optional install possible");
public boolean canInstallPackOptional(String packid, Properties variables) { Debug.log("can install pack optional with id " + packid + "?"); if (!this.optionalpackconditions.containsKey(packid)) { Debug.log("not in optionalpackconditions."); return false; } else { Debug.log("optional install possible"); return true; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("can show panel with id " + panelid + " ?");
Debug.trace("can show panel with id " + panelid + " ?");
public boolean canShowPanel(String panelid, Properties variables) { Debug.log("can show panel with id " + panelid + " ?"); if (!this.panelconditions.containsKey(panelid)) { Debug.log("no condition, show panel"); return true; } Debug.log("there is a condition"); Condition condition = (Condition) conditionsmap.get(this.panelconditions.get(panelid)); if (condition != null) { return condition.isTrue(variables, this.installdata.selectedPacks); } return false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("no condition, show panel");
Debug.trace("no condition, show panel");
public boolean canShowPanel(String panelid, Properties variables) { Debug.log("can show panel with id " + panelid + " ?"); if (!this.panelconditions.containsKey(panelid)) { Debug.log("no condition, show panel"); return true; } Debug.log("there is a condition"); Condition condition = (Condition) conditionsmap.get(this.panelconditions.get(panelid)); if (condition != null) { return condition.isTrue(variables, this.installdata.selectedPacks); } return false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("there is a condition");
Debug.trace("there is a condition");
public boolean canShowPanel(String panelid, Properties variables) { Debug.log("can show panel with id " + panelid + " ?"); if (!this.panelconditions.containsKey(panelid)) { Debug.log("no condition, show panel"); return true; } Debug.log("there is a condition"); Condition condition = (Condition) conditionsmap.get(this.panelconditions.get(panelid)); if (condition != null) { return condition.isTrue(variables, this.installdata.selectedPacks); } return false; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("Element " + element + " has to specify an attribute " + attribute);
Debug.trace("Element " + element + " has to specify an attribute " + attribute);
protected boolean checkAttribute(String val, String attribute, String element) { if ((val != null) && (val.length() > 0)) { return true; } else { Debug.log("Element " + element + " has to specify an attribute " + attribute); return false; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("Condition (" + id + ") not found.");
Debug.trace("Condition (" + id + ") not found.");
public boolean isConditionTrue(String id, Properties variables) { Condition cond = (Condition) conditionsmap.get(id); if (cond == null) { Debug.log("Condition (" + id + ") not found."); return true; } else { Debug.log("Checking condition"); return cond.isTrue(variables, this.installdata.selectedPacks); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
Debug.log("Checking condition");
Debug.trace("Checking condition");
public boolean isConditionTrue(String id, Properties variables) { Condition cond = (Condition) conditionsmap.get(id); if (cond == null) { Debug.log("Condition (" + id + ") not found."); return true; } else { Debug.log("Checking condition"); return cond.isTrue(variables, this.installdata.selectedPacks); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
if (this.conditionsspec == null){ Debug.trace("No specification for conditions found."); return; }
protected void readConditions() { try { if (this.conditionsspec.hasChildren()) { // read in the condition specs Vector childs = this.conditionsspec.getChildrenNamed("condition"); for (int i = 0; i < childs.size(); i++) { XMLElement condition = (XMLElement) childs.get(i); Condition cond = analyzeCondition(condition); if (cond != null) { // this.conditionslist.add(cond); String condid = cond.getId(); if ((condid != null) && !("UNKNOWN".equals(condid))) { conditionsmap.put(condid, cond); } } } Vector panelconditionels = this.conditionsspec.getChildrenNamed("panelcondition"); for (int i = 0; i < panelconditionels.size(); i++) { XMLElement panelel = (XMLElement) panelconditionels.get(i); String panelid = panelel.getAttribute("panelid"); String conditionid = panelel.getAttribute("conditionid"); this.panelconditions.put(panelid, conditionid); } Vector packconditionels = this.conditionsspec.getChildrenNamed("packcondition"); for (int i = 0; i < packconditionels.size(); i++) { XMLElement panelel = (XMLElement) packconditionels.get(i); String panelid = panelel.getAttribute("packid"); String conditionid = panelel.getAttribute("conditionid"); this.packconditions.put(panelid, conditionid); // optional install allowed, if condition is not met? String optional = panelel.getAttribute("optional"); if (optional != null) { boolean optionalinstall = Boolean.valueOf(optional).booleanValue(); if (optionalinstall) { // optional installation is allowed this.optionalpackconditions.put(panelid, conditionid); } } } } } catch (Exception e) { e.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/bbb22dc9cbe26e32540414e5f1a113931118b944/RulesEngine.java/buggy/src/lib/com/izforge/izpack/rules/RulesEngine.java
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(null == _factory || _factory.validateObject(obj)) { if(null != _factory) { try { _factory.passivateObject(obj); } catch(Exception e) { _factory.destroyObject(obj); return; }
public void returnObject(Object obj) throws Exception { boolean success = true; if(!(_factory.validateObject(obj))) { success = false; } else { try { _factory.passivateObject(obj); } catch(Exception e) { success = false;
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(null == _factory || _factory.validateObject(obj)) { if(null != _factory) { try { _factory.passivateObject(obj); } catch(Exception e) { _factory.destroyObject(obj); return; } } if(_pool.size() < _maxSleeping) { _pool.push(obj); } else { if(null != _factory) { _factory.destroyObject(obj); } } } else { if(null != _factory) { _factory.destroyObject(obj); } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/6d5eb8fcfd40a356f848c407c2429f711b97c0f4/StackObjectPool.java/clean/src/java/org/apache/commons/pool/impl/StackObjectPool.java
if(_pool.size() < _maxSleeping) {
} boolean shouldDestroy = !success; synchronized(this) { _numActive--; if(_pool.size() >= _maxSleeping) { shouldDestroy = true; } else if(success) {
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(null == _factory || _factory.validateObject(obj)) { if(null != _factory) { try { _factory.passivateObject(obj); } catch(Exception e) { _factory.destroyObject(obj); return; } } if(_pool.size() < _maxSleeping) { _pool.push(obj); } else { if(null != _factory) { _factory.destroyObject(obj); } } } else { if(null != _factory) { _factory.destroyObject(obj); } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/6d5eb8fcfd40a356f848c407c2429f711b97c0f4/StackObjectPool.java/clean/src/java/org/apache/commons/pool/impl/StackObjectPool.java
} else { if(null != _factory) { _factory.destroyObject(obj); }
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(null == _factory || _factory.validateObject(obj)) { if(null != _factory) { try { _factory.passivateObject(obj); } catch(Exception e) { _factory.destroyObject(obj); return; } } if(_pool.size() < _maxSleeping) { _pool.push(obj); } else { if(null != _factory) { _factory.destroyObject(obj); } } } else { if(null != _factory) { _factory.destroyObject(obj); } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/6d5eb8fcfd40a356f848c407c2429f711b97c0f4/StackObjectPool.java/clean/src/java/org/apache/commons/pool/impl/StackObjectPool.java
} else { if(null != _factory) {
notifyAll(); } if(shouldDestroy) { try {
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(null == _factory || _factory.validateObject(obj)) { if(null != _factory) { try { _factory.passivateObject(obj); } catch(Exception e) { _factory.destroyObject(obj); return; } } if(_pool.size() < _maxSleeping) { _pool.push(obj); } else { if(null != _factory) { _factory.destroyObject(obj); } } } else { if(null != _factory) { _factory.destroyObject(obj); } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/6d5eb8fcfd40a356f848c407c2429f711b97c0f4/StackObjectPool.java/clean/src/java/org/apache/commons/pool/impl/StackObjectPool.java
} catch(Exception e) {
public synchronized void returnObject(Object obj) throws Exception { _numActive--; if(null == _factory || _factory.validateObject(obj)) { if(null != _factory) { try { _factory.passivateObject(obj); } catch(Exception e) { _factory.destroyObject(obj); return; } } if(_pool.size() < _maxSleeping) { _pool.push(obj); } else { if(null != _factory) { _factory.destroyObject(obj); } } } else { if(null != _factory) { _factory.destroyObject(obj); } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/6d5eb8fcfd40a356f848c407c2429f711b97c0f4/StackObjectPool.java/clean/src/java/org/apache/commons/pool/impl/StackObjectPool.java
if (todo.equals("TOP"))
if ("TOP".equals(todo))
public void completeGridBagLayout() { String todo = idata.getVariable("IzPanel.LayoutType"); if (todo == null) // No command, no work. return; if (todo.equals("TOP")) { // Make a footer to push the rest to the top. Filler dummy = new Filler(); GridBagConstraints gbConstraint = getNextYGridBagConstraints(); gbConstraint.weighty = 1.0; gbConstraint.fill = GridBagConstraints.BOTH; gbConstraint.anchor = GridBagConstraints.WEST; this.add(dummy, gbConstraint); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/IzPanel.java/clean/src/lib/com/izforge/izpack/installer/IzPanel.java
if (todo.equals("BOTTOM"))
if ("BOTTOM".equals(todo))
public void startGridBagLayout() { if (gridBagLayoutStarted) return; gridBagLayoutStarted = true; GridBagLayout layout = new GridBagLayout(); defaultGridBagConstraints.insets = new Insets(0, 0, 20, 0); defaultGridBagConstraints.anchor = GridBagConstraints.WEST; setLayout(layout); String todo = idata.getVariable("IzPanel.LayoutType"); if (todo == null) // No command, no work. return; if (todo.equals("BOTTOM")) { // Make a header to push the rest to the bottom. Filler dummy = new Filler(); GridBagConstraints gbConstraint = getNextYGridBagConstraints(); gbConstraint.weighty = 1.0; gbConstraint.fill = GridBagConstraints.BOTH; gbConstraint.anchor = GridBagConstraints.WEST; this.add(dummy, gbConstraint); } // TODO: impl for layout type CENTER, ... }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/IzPanel.java/clean/src/lib/com/izforge/izpack/installer/IzPanel.java
;
public void afterDelete(File file, AbstractUIProgressHandler handler) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleUninstallerListener.java/buggy/src/lib/com/izforge/izpack/event/SimpleUninstallerListener.java
;
public void afterDeletion(List files, AbstractUIProgressHandler handler) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleUninstallerListener.java/buggy/src/lib/com/izforge/izpack/event/SimpleUninstallerListener.java
;
public void beforeDelete(File file, AbstractUIProgressHandler handler) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleUninstallerListener.java/buggy/src/lib/com/izforge/izpack/event/SimpleUninstallerListener.java
;
public void beforeDeletion(List files, AbstractUIProgressHandler handler) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleUninstallerListener.java/buggy/src/lib/com/izforge/izpack/event/SimpleUninstallerListener.java
if (oldDim.height != colConstraints[i].component.getPreferredSize().height && oldOnceAgain == onceAgain) onceAgain++;
if (oldOnceAgain == onceAgain) onceAgain++;
public void layoutContainer(Container parent) { if (!needNewLayout(parent)) { fastLayoutContainer(parent); return; } prefLayoutDim = null; preferredLayoutSize(parent); Dimension realSizeDim = parent.getSize(); Insets insets = parent.getInsets(); int rowHeight; int onceAgain = 0; int[] generellOffset = new int[] { 0, 0}; // int generellYOffset = 0; // int generellXOffset = 0; int maxWidth = 0; int overallHeight = 0; int anchorNeedsReEval = 0; Rectangle curRect = new Rectangle(); while (anchorNeedsReEval < 2) { int ypos = insets.top; int row = 0; int minWidth = 0xffff; int minHeight = 0xffff; maxWidth = 0; overallHeight = 0; while (row < rows()) { int outerRowHeight = 0; int xpos = insets.left; rowHeight = rowHeight(row); int col = 0; IzPanelConstraints[] colConstraints = new IzPanelConstraints[columns()]; int usedWidth = 0; Dimension curDim; while (col < columns()) { resolveDefaultSettings(col, row); IzPanelConstraints currentConst = getConstraint(col, row); colConstraints[col] = currentConst; Component currentComp = currentConst.component; curDim = currentComp.getPreferredSize(); int curWidth = minimumColumnWidth(col); col++; if (currentConst.getXWeight() > 1) { int weight = currentConst.getXWeight(); while (weight > 1 && col < columns()) { colConstraints[col] = getConstraint(col, row); if (!(colConstraints[col].component instanceof FillerComponent)) break; curWidth += minimumColumnWidth(col); col++; weight--; } } // width known int adaptedXPos = getAdaptedXPos(xpos, curWidth, curDim, currentConst); int adaptedYPos = getAdaptedYPos(ypos, rowHeight, curDim, currentConst); currentComp.setBounds(adaptedXPos + generellOffset[0], adaptedYPos + currentConst.getYGap() + generellOffset[1], curWidth, rowHeight); currentComp.getBounds(curRect); if (!(currentComp instanceof FillerComponent)) { if (curRect.x < minWidth) minWidth = curRect.x; if (curRect.y < minHeight) minHeight = curRect.y; } int curMax = (int) curRect.getMaxX(); if (curMax - minWidth > maxWidth) maxWidth = curMax - minWidth; curMax = (int) curRect.getMaxY(); currentConst.setBounds(curRect); if (curMax - minHeight > overallHeight) overallHeight = curMax - minHeight; xpos += currentComp.getSize().width + currentConst.getXGap(); usedWidth += curWidth; if (outerRowHeight < rowHeight + currentConst.getYGap()) outerRowHeight = rowHeight + currentConst.getYGap(); } // Now we have made a row, but may be there are place across or/and a component // needs a reevaluation. double rowStretch = 0.0; int i; // Determine hole stretch of this row. for (i = 0; i < colConstraints.length; ++i) { if (colConstraints[i].getStretch() == FULL_LINE_STRETCH) colConstraints[i].setStretch(IzPanelLayout.getFullLineStretch()); rowStretch += colConstraints[i].getStretch(); } // Modify rowStretch depending on the current X-Stretch type. if (rowStretch > 0.0) { switch (IzPanelLayout.getXStretchType()) { case RELATIVE_STRETCH: break; case ABSOLUTE_STRETCH: rowStretch = 1.0; break; case NO_STRETCH: default: rowStretch = 0.0; break; } } if (realSizeDim.width - insets.right > xpos && rowStretch > 0.0) { // Compute only if there is space to share and at least one control should be // stretched. int pixel = realSizeDim.width - insets.right - xpos; // How many pixel we // can use for stretching. int offset = 0; int oldOnceAgain = onceAgain; for (i = 0; i < colConstraints.length; ++i) { int curPixel = (int) ((colConstraints[i].getStretch() / rowStretch) * pixel); Rectangle curBounds = colConstraints[i].component.getBounds(); int newWidth = curPixel + curBounds.width; Dimension oldDim = colConstraints[i].component.getPreferredSize(); colConstraints[i].component.setBounds(curBounds.x + offset, curBounds.y, newWidth, curBounds.height); colConstraints[i].component.getBounds(curRect); if (curRect.x > 0 && curRect.x < minWidth) minWidth = curRect.x; if (curRect.y > 0 && curRect.y < minHeight) minHeight = curRect.y; int curMax = (int) curRect.getMaxX(); if (curMax - minWidth > maxWidth) maxWidth = curMax - minWidth; curMax = (int) curRect.getMaxY(); colConstraints[i].setBounds(curRect); if (curMax - minHeight > overallHeight) overallHeight = curMax - minHeight; offset += curPixel; if (needsReEvaluation(colConstraints[i].component)) { if (oldDim.height != colConstraints[i].component.getPreferredSize().height && oldOnceAgain == onceAgain) onceAgain++; } } } // Seems so that height has changed. Reevaluate only one time else it is possible // to go in a endless loop. if (onceAgain == 1) continue; onceAgain = 0; ypos = ypos + outerRowHeight; row++; } anchorNeedsReEval += resolveGenerellOffsets(generellOffset, realSizeDim, insets, maxWidth, overallHeight); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/790ac4c46b740187250469f253751a20d840eb05/IzPanelLayout.java/buggy/src/lib/com/izforge/izpack/gui/IzPanelLayout.java
public void layoutContainer(Container parent) { if (!needNewLayout(parent)) { fastLayoutContainer(parent); return; } prefLayoutDim = null; preferredLayoutSize(parent); Dimension realSizeDim = parent.getSize(); Insets insets = parent.getInsets(); int rowHeight; int onceAgain = 0; int[] generellOffset = new int[] { 0, 0}; // int generellYOffset = 0; // int generellXOffset = 0; int maxWidth = 0; int overallHeight = 0; int anchorNeedsReEval = 0; Rectangle curRect = new Rectangle(); while (anchorNeedsReEval < 2) { int ypos = insets.top; int row = 0; int minWidth = 0xffff; int minHeight = 0xffff; maxWidth = 0; overallHeight = 0; while (row < rows()) { int outerRowHeight = 0; int xpos = insets.left; rowHeight = rowHeight(row); int col = 0; IzPanelConstraints[] colConstraints = new IzPanelConstraints[columns()]; int usedWidth = 0; Dimension curDim; while (col < columns()) { resolveDefaultSettings(col, row); IzPanelConstraints currentConst = getConstraint(col, row); colConstraints[col] = currentConst; Component currentComp = currentConst.component; curDim = currentComp.getPreferredSize(); int curWidth = minimumColumnWidth(col); col++; if (currentConst.getXWeight() > 1) { int weight = currentConst.getXWeight(); while (weight > 1 && col < columns()) { colConstraints[col] = getConstraint(col, row); if (!(colConstraints[col].component instanceof FillerComponent)) break; curWidth += minimumColumnWidth(col); col++; weight--; } } // width known int adaptedXPos = getAdaptedXPos(xpos, curWidth, curDim, currentConst); int adaptedYPos = getAdaptedYPos(ypos, rowHeight, curDim, currentConst); currentComp.setBounds(adaptedXPos + generellOffset[0], adaptedYPos + currentConst.getYGap() + generellOffset[1], curWidth, rowHeight); currentComp.getBounds(curRect); if (!(currentComp instanceof FillerComponent)) { if (curRect.x < minWidth) minWidth = curRect.x; if (curRect.y < minHeight) minHeight = curRect.y; } int curMax = (int) curRect.getMaxX(); if (curMax - minWidth > maxWidth) maxWidth = curMax - minWidth; curMax = (int) curRect.getMaxY(); currentConst.setBounds(curRect); if (curMax - minHeight > overallHeight) overallHeight = curMax - minHeight; xpos += currentComp.getSize().width + currentConst.getXGap(); usedWidth += curWidth; if (outerRowHeight < rowHeight + currentConst.getYGap()) outerRowHeight = rowHeight + currentConst.getYGap(); } // Now we have made a row, but may be there are place across or/and a component // needs a reevaluation. double rowStretch = 0.0; int i; // Determine hole stretch of this row. for (i = 0; i < colConstraints.length; ++i) { if (colConstraints[i].getStretch() == FULL_LINE_STRETCH) colConstraints[i].setStretch(IzPanelLayout.getFullLineStretch()); rowStretch += colConstraints[i].getStretch(); } // Modify rowStretch depending on the current X-Stretch type. if (rowStretch > 0.0) { switch (IzPanelLayout.getXStretchType()) { case RELATIVE_STRETCH: break; case ABSOLUTE_STRETCH: rowStretch = 1.0; break; case NO_STRETCH: default: rowStretch = 0.0; break; } } if (realSizeDim.width - insets.right > xpos && rowStretch > 0.0) { // Compute only if there is space to share and at least one control should be // stretched. int pixel = realSizeDim.width - insets.right - xpos; // How many pixel we // can use for stretching. int offset = 0; int oldOnceAgain = onceAgain; for (i = 0; i < colConstraints.length; ++i) { int curPixel = (int) ((colConstraints[i].getStretch() / rowStretch) * pixel); Rectangle curBounds = colConstraints[i].component.getBounds(); int newWidth = curPixel + curBounds.width; Dimension oldDim = colConstraints[i].component.getPreferredSize(); colConstraints[i].component.setBounds(curBounds.x + offset, curBounds.y, newWidth, curBounds.height); colConstraints[i].component.getBounds(curRect); if (curRect.x > 0 && curRect.x < minWidth) minWidth = curRect.x; if (curRect.y > 0 && curRect.y < minHeight) minHeight = curRect.y; int curMax = (int) curRect.getMaxX(); if (curMax - minWidth > maxWidth) maxWidth = curMax - minWidth; curMax = (int) curRect.getMaxY(); colConstraints[i].setBounds(curRect); if (curMax - minHeight > overallHeight) overallHeight = curMax - minHeight; offset += curPixel; if (needsReEvaluation(colConstraints[i].component)) { if (oldDim.height != colConstraints[i].component.getPreferredSize().height && oldOnceAgain == onceAgain) onceAgain++; } } } // Seems so that height has changed. Reevaluate only one time else it is possible // to go in a endless loop. if (onceAgain == 1) continue; onceAgain = 0; ypos = ypos + outerRowHeight; row++; } anchorNeedsReEval += resolveGenerellOffsets(generellOffset, realSizeDim, insets, maxWidth, overallHeight); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/790ac4c46b740187250469f253751a20d840eb05/IzPanelLayout.java/buggy/src/lib/com/izforge/izpack/gui/IzPanelLayout.java
if (gapId <= GAP_LOAD_MARKER || gapId >= DEFAULT_X_GAPS.length)
if ( gapId >= DEFAULT_X_GAPS.length)
public static int verifyGapId(int gapId) { if (gapId < 0) gapId = -gapId; if (gapId <= GAP_LOAD_MARKER || gapId >= DEFAULT_X_GAPS.length) throw new IndexOutOfBoundsException("gapId is not in the default gap container."); return (gapId); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/790ac4c46b740187250469f253751a20d840eb05/IzPanelLayout.java/buggy/src/lib/com/izforge/izpack/gui/IzPanelLayout.java
if (retval == null || retval.equals(fullkey))
if (retval == null || retval.startsWith(fullkey))
public String getI18nStringForClass(String subkey, String alternateClass) { String curClassName = this.getClass().getName(); int nameStart = curClassName.lastIndexOf('.') + 1; curClassName = curClassName.substring(nameStart, curClassName.length()); StringBuffer buf = new StringBuffer(); buf.append(curClassName).append(".").append(subkey); String fullkey = buf.toString(); String retval = parent.langpack.getString(fullkey); if (retval == null || retval.equals(fullkey)) { buf.delete(0, buf.length()); buf.append(alternateClass).append(".").append(subkey); retval = parent.langpack.getString(buf.toString()); } return (retval); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91bfeafc3265323a5f71aef073a52845e68294b0/IzPanel.java/buggy/src/lib/com/izforge/izpack/installer/IzPanel.java
public boolean findUserByEmail(UserEdit edit, String email) { // lets not get messed up with spaces or cases String test = email.toLowerCase().trim(); // if the email ends with "umich.edu" (even if it's from [email protected]) // use the local part as a user id. if (!test.endsWith(m_domain)) return false; // split the string once at the first "@" String parts[] = StringUtil.splitFirst(test, "@"); edit.setId(parts[0]); return getUser(edit); } // findUserByEmail
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/dd446cd5cf5f931e5e5f748fcad0d0719db3038a/KerberosUserDirectoryProvider.java/buggy/kerberos/src/java/org/sakaiproject/component/kerberos/user/KerberosUserDirectoryProvider.java
edit.setId(parts[0]);
edit.setEid(parts[0]);
public boolean findUserByEmail(UserEdit edit, String email) { // lets not get messed up with spaces or cases String test = email.toLowerCase().trim(); // if the email ends with "umich.edu" (even if it's from [email protected]) // use the local part as a user id. if (!test.endsWith(m_domain)) return false; // split the string once at the first "@" String parts[] = StringUtil.splitFirst(test, "@"); edit.setId(parts[0]); return getUser(edit); } // findUserByEmail
50587 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50587/dd446cd5cf5f931e5e5f748fcad0d0719db3038a/KerberosUserDirectoryProvider.java/buggy/kerberos/src/java/org/sakaiproject/component/kerberos/user/KerberosUserDirectoryProvider.java
layout = new GridBagLayout(); gbConstraints = new GridBagConstraints();
GridBagLayout layout = new GridBagLayout(); GridBagConstraints gbConstraints = new GridBagConstraints();
public HTMLInfoPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We add the components infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons .getImageIcon("edit"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); try { textArea = new JEditorPane(); textArea.setEditable(false); textArea.addHyperlinkListener(this); JScrollPane scroller = new JScrollPane(textArea); textArea.setPage(loadInfo()); parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 1.0); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); } catch (Exception err) { err.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/HTMLInfoPanel.java/buggy/src/lib/com/izforge/izpack/panels/HTMLInfoPanel.java
infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
JLabel infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
public HTMLInfoPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We add the components infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons .getImageIcon("edit"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); try { textArea = new JEditorPane(); textArea.setEditable(false); textArea.addHyperlinkListener(this); JScrollPane scroller = new JScrollPane(textArea); textArea.setPage(loadInfo()); parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 1.0); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); } catch (Exception err) { err.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/HTMLInfoPanel.java/buggy/src/lib/com/izforge/izpack/panels/HTMLInfoPanel.java
if(!p.targetdir.endsWith(File.separator)) { p.targetdir = p.targetdir+File.separatorChar; }
public void executeCompiler() throws Exception { // Usefull variables int i; String str; InputStream inStream; // We get the XML data tree XMLElement data = getXMLTree(); // We get the Packager Packager packager = getPackager(); // We add the variable declaration packager.setVariables(getVariables(data)); // We add the info packager.setInfo(getInfo(data)); // We add the GUIPrefs packager.setGUIPrefs(getGUIPrefs(data)); // We add the language packs ArrayList langpacks = getLangpacksCodes(data); Iterator iter = langpacks.iterator(); while (iter.hasNext()) { str = (String) iter.next(); // The language pack inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "installer" + File.separator + str + ".xml"); packager.addLangPack(str, inStream); // The flag inStream = new FileInputStream(Compiler.IZPACK_HOME + "bin" + File.separator + "langpacks" + File.separator + "flags" + File.separator + str + ".gif"); packager.addResource("flag." + str, inStream); } // We add the resources ArrayList resources = getResources(data); iter = resources.iterator(); while (iter.hasNext()) { Resource res = (Resource) iter.next(); if (res.parse) { if (null != varMap) { File resFile = new File(res.src); FileInputStream inFile = new FileInputStream(resFile); BufferedInputStream bin = new BufferedInputStream(inFile, 5120); File parsedFile = File.createTempFile("izpp", null, resFile.getParentFile()); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream bout = new BufferedOutputStream(outFile, 5120); VariableSubstitutor vs = new VariableSubstitutor(varMap); vs.substitute(bin, bout, res.type, res.encoding); bin.close(); bout.close(); inFile = new FileInputStream(parsedFile); packager.addResource(res.id, inFile); inFile.close(); parsedFile.delete(); } else { System.err.println("ERROR: no variable is defined. " + res.src + " is not parsed."); inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } else { inStream = new FileInputStream(res.src); packager.addResource(res.id, inStream); } } // We add the native libraries ArrayList natives = getNativeLibraries(data); iter = natives.iterator(); while (iter.hasNext()) { NativeLibrary nat = (NativeLibrary) iter.next(); inStream = new FileInputStream(nat.path); packager.addNativeLibrary(nat.name, inStream); } // We add the additionnal jar files content ArrayList jars = getJars(data); iter = jars.iterator(); while (iter.hasNext()) packager.addJarContent((String) iter.next()); // We add the panels ArrayList panels = getPanels(data); ArrayList panelsOrder = new ArrayList(panels.size()); TreeSet panelsCache = new TreeSet(); iter = panels.iterator(); while (iter.hasNext()) { // We locate the panel classes directory str = (String) iter.next(); File dir = new File(Compiler.IZPACK_HOME + "bin" + File.separator + "panels" + File.separator + str); if (!dir.exists()) throw new Exception(str + " panel does not exist"); // We add the panel in the order array panelsOrder.add(str); // We add each file in the panel folder if (panelsCache.contains(str)) continue; panelsCache.add(str); File[] files = dir.listFiles(); int nf = files.length; for (int j = 0; j < nf; j++) { if (files[j].isDirectory()) continue; FileInputStream inClass = new FileInputStream(files[j]); packager.addPanelClass(files[j].getName(), inClass); } } // We set the panels order packager.setPanelsOrder(panelsOrder); // We add the packs i = 0; ArrayList packs = getPacks(data); iter = packs.iterator(); while (iter.hasNext()) { Pack pack = (Pack) iter.next(); ZipOutputStream zipOut = packager.addPack(i++, pack.name, pack.os, pack.required, pack.description); ObjectOutputStream objOut = new ObjectOutputStream(zipOut); // We write the pack data objOut.writeInt(pack.packFiles.size()); Iterator iter2 = pack.packFiles.iterator(); long packageBytes = 0; while (iter2.hasNext()) { // Initialisations PackSource p = (PackSource) iter2.next(); File f = new File(p.src); FileInputStream in = new FileInputStream(f); long nbytes = f.length(); // p.targetdir will always end with separator String targetFilename = p.targetdir + f.getName(); // pack paths in canonical (unix) form regardless of current host o/s: if('/' != File.separatorChar) { targetFilename = targetFilename.replace(File.separatorChar, '/'); } // Writing objOut.writeObject(new PackFile(targetFilename, p.os, nbytes, p.override)); byte[] buffer = new byte[5120]; long bytesWritten = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { objOut.write(buffer, 0, bytesInBuffer); bytesWritten += bytesInBuffer; } if (bytesWritten != nbytes) throw new IOException ("File size mismatch when reading " + f); packageBytes += bytesWritten; in.close(); } packager.packAdded(i - 1, packageBytes); // Write out information about parsable files objOut.writeInt(pack.parsables.size()); iter2 = pack.parsables.iterator(); while (iter2.hasNext()) objOut.writeObject(iter2.next()); // Write out information about executable files objOut.writeInt(pack.executables.size()); iter2 = pack.executables.iterator(); while (iter2.hasNext()) { objOut.writeObject(iter2.next()); } // Cleanup objOut.flush(); zipOut.closeEntry(); } // We ask the packager to finish packager.finish(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c8cdcf2da72afb3e236ad262b093befb9677249b/Compiler.java/clean/src/lib/com/izforge/izpack/compiler/Compiler.java
String targetFile = p.getAttribute("targetfile");
String targetFile = p.getAttribute("targetfile");
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.os = el.getAttribute("os"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); String targetFile = p.getAttribute("targetfile"); pack.parsables.add (new ParsableFile(targetFile, p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; else if ("uninstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.UNINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = new ArrayList(); XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } String targetFile = e.getAttribute("targetfile"); pack.executables.add(new ExecutableFile(targetFile, executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = xclude.getAttribute("name"); } } String targetDir = f.getAttribute("targetdir"); addFileSet(path, includes, excludes, targetDir, f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c8cdcf2da72afb3e236ad262b093befb9677249b/Compiler.java/clean/src/lib/com/izforge/izpack/compiler/Compiler.java
String targetFile = e.getAttribute("targetfile");
String targetFile = e.getAttribute("targetfile");
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.os = el.getAttribute("os"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); String targetFile = p.getAttribute("targetfile"); pack.parsables.add (new ParsableFile(targetFile, p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; else if ("uninstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.UNINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = new ArrayList(); XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } String targetFile = e.getAttribute("targetfile"); pack.executables.add(new ExecutableFile(targetFile, executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = xclude.getAttribute("name"); } } String targetDir = f.getAttribute("targetdir"); addFileSet(path, includes, excludes, targetDir, f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c8cdcf2da72afb3e236ad262b093befb9677249b/Compiler.java/clean/src/lib/com/izforge/izpack/compiler/Compiler.java
String targetDir = f.getAttribute("targetdir");
String targetDir = f.getAttribute("targetdir");
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.os = el.getAttribute("os"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); String targetFile = p.getAttribute("targetfile"); pack.parsables.add (new ParsableFile(targetFile, p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; else if ("uninstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.UNINSTALL; // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; // get arguments for this executable ArrayList argList = new ArrayList(); XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } String targetFile = e.getAttribute("targetfile"); pack.executables.add(new ExecutableFile(targetFile, executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); // get includes and excludes Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = xclude.getAttribute("name"); } } String targetDir = f.getAttribute("targetdir"); addFileSet(path, includes, excludes, targetDir, f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/c8cdcf2da72afb3e236ad262b093befb9677249b/Compiler.java/clean/src/lib/com/izforge/izpack/compiler/Compiler.java
InputStream in = getClass().getResourceAsStream("/res/IzPack.uninstaller");
InputStream in = Unpacker.class.getResourceAsStream("/res/IzPack.uninstaller");
private void putUninstaller() throws Exception { // get the uninstaller base, returning if not found so that // idata.uninstallOutJar remains null InputStream in = getClass().getResourceAsStream("/res/IzPack.uninstaller"); if (in == null) return; // Me make the .uninstaller directory String dest = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller"; String jar = dest + File.separator + "uninstaller.jar"; File pathMaker = new File(dest); pathMaker.mkdirs(); // We log the uninstaller deletion information udata.setUninstallerJarFilename(jar); udata.setUninstallerPath(dest); // We open our final jar file FileOutputStream out = new FileOutputStream(jar); ZipOutputStream outJar = new ZipOutputStream(out); idata.uninstallOutJar = outJar; outJar.setLevel(9); udata.addFile(jar); // We copy the uninstaller ZipInputStream inRes = new ZipInputStream(in); ZipEntry zentry = inRes.getNextEntry(); while (zentry != null) { // Puts a new entry outJar.putNextEntry(new ZipEntry(zentry.getName())); // Byte to byte copy int unc = inRes.read(); while (unc != -1) { outJar.write(unc); unc = inRes.read(); } // Next one please inRes.closeEntry(); outJar.closeEntry(); zentry = inRes.getNextEntry(); } inRes.close(); // We put the langpack in = getClass().getResourceAsStream("/langpacks/" + idata.localeISO3 + ".xml"); outJar.putNextEntry(new ZipEntry("langpack.xml")); int read = in.read(); while (read != -1) { outJar.write(read); read = in.read(); } outJar.closeEntry(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/Unpacker.java/buggy/src/lib/com/izforge/izpack/installer/Unpacker.java
wait(_maxWait);
final long elapsed = (System.currentTimeMillis() - starttime); final long waitTime = _maxWait - elapsed; if (waitTime > 0) { wait(waitTime); }
public synchronized Object borrowObject() throws Exception { assertOpen(); long starttime = System.currentTimeMillis(); boolean newlyCreated = false; for(;;) { ObjectTimestampPair pair = null; // if there are any sleeping, just grab one of those try { pair = (ObjectTimestampPair)(_pool.removeFirst()); } catch(NoSuchElementException e) { ; /* ignored */ } // otherwise if(null == pair) { // check if we can create one // (note we know that the num sleeping is 0, else we wouldn't be here) if(_maxActive < 0 || _numActive < _maxActive) { // allow new object to be created } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: // allow new object to be created break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException("Pool exhausted"); case WHEN_EXHAUSTED_BLOCK: try { if(_maxWait <= 0) { wait(); } else { wait(_maxWait); } } catch(InterruptedException e) { // ignored } if(_maxWait > 0 && ((System.currentTimeMillis() - starttime) >= _maxWait)) { throw new NoSuchElementException("Timeout waiting for idle object"); } else { continue; // keep looping } default: throw new IllegalArgumentException("WhenExhaustedAction property " + _whenExhaustedAction + " not recognized."); } } } _numActive++; // create new object when needed if(null == pair) { try { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } catch (Throwable e) { // object cannot be created _numActive--; notifyAll(); if (e instanceof Exception) { throw (Exception) e; } else if (e instanceof Error) { throw (Error) e; } else { throw new Exception(e); } } } // activate & validate the object try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("ValidateObject failed"); } return pair.value; } catch (Throwable e) { // object cannot be activated or is invalid _numActive--; notifyAll(); try { _factory.destroyObject(pair.value); } catch (Throwable e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object, cause: " + e.getMessage()); } else { continue; // keep looping } } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/afe8ded20e5e0c03af85d3a451353ef19c9a9ac3/GenericObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
if(_minEvictableIdleTimeMillis > 0 && System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis) { removeObject = true;
long idleTimeMilis = System.currentTimeMillis() - pair.tstamp; if ((_minEvictableIdleTimeMillis > 0) && (idleTimeMilis > _minEvictableIdleTimeMillis)) { removeObject = true; } else if ((_softMinEvictableIdleTimeMillis > 0) && (idleTimeMilis > _softMinEvictableIdleTimeMillis) && (getNumIdle() > getMinIdle())) { removeObject = true;
public synchronized void evict() throws Exception { assertOpen(); if(!_pool.isEmpty()) { if(null == _evictionCursor) { _evictionCursor = (_pool.cursor(_pool.size())); } else if(!_evictionCursor.hasPrevious()) { _evictionCursor.close(); _evictionCursor = (_pool.cursor(_pool.size())); } for(int i=0,m=getNumTests();i<m;i++) { if(!_evictionCursor.hasPrevious()) { _evictionCursor.close(); _evictionCursor = (_pool.cursor(_pool.size())); } else { boolean removeObject = false; ObjectTimestampPair pair = (ObjectTimestampPair)(_evictionCursor.previous()); if(_minEvictableIdleTimeMillis > 0 && System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis) { removeObject = true; } else if(_testWhileIdle) { boolean active = false; try { _factory.activateObject(pair.value); active = true; } catch(Exception e) { removeObject=true; } if(active) { if(!_factory.validateObject(pair.value)) { removeObject=true; } else { try { _factory.passivateObject(pair.value); } catch(Exception e) { removeObject=true; } } } } if(removeObject) { try { _evictionCursor.remove(); _factory.destroyObject(pair.value); } catch(Exception e) { ; // ignored } } } } } // if !empty }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/4fadf07be4cd99a579ef09bcc137bc857f2e50ae/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
if (inheritAll == true)
if (inheritAll)
public void execute() throws org.apache.tools.ant.BuildException { // Either the input attribute or config element must be specified if (input == null && config == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "input_must_be_specified")); if (output == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "output_must_be_specified")); // if (installerType == null) now optional if (basedir == null) throw new BuildException(ResourceBundle.getBundle( "com/izforge/izpack/ant/langpacks/messages").getString( "basedir_must_be_specified")); // if (izPackDir == null) // throw new // BuildException(java.util.ResourceBundle.getBundle("com/izforge/izpack/ant/langpacks/messages").getString("izPackDir_must_be_specified")); String kind = (installerType == null ? null : installerType.getValue()); CompilerConfig c = null; String configText = null; if(config != null ) {// Pass in the embedded configuration configText = config.getText(); input = null; } try { // else use external configuration referenced by the input attribute c = new CompilerConfig(input, basedir, kind, output, compression, compressionLevel, this, configText); } catch (CompilerException e1) { throw new BuildException(e1); } CompilerConfig.setIzpackHome(izPackDir); if (properties != null) { Enumeration e = properties.keys(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = properties.getProperty(name); c.addProperty(name, value); } } if (inheritAll == true) { Hashtable projectProps = getProject().getProperties(); Enumeration e = projectProps.keys(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = (String) projectProps.get(name); c.addProperty(name, value); } } try { c.executeCompiler(); } catch (Exception e) { throw new BuildException(e);// Throw an exception if compilation // failed } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/IzPackTask.java/buggy/src/lib/com/izforge/izpack/ant/IzPackTask.java
public CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, int compr_level, PackagerListener listener, String installText) throws CompilerException
public CompilerConfig(String filename, String basedir, String kind, String output) throws CompilerException
public CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, int compr_level, PackagerListener listener, String installText) throws CompilerException { this.filename = filename; this.installText = installText; this.basedir = basedir; this.compiler = new Compiler(basedir, kind, output, compr_format, compr_level); compiler.setPackagerListener(listener); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/458df5388598b1463abaab7f3fba01a728e5d095/CompilerConfig.java/buggy/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
this.filename = filename; this.installText = installText; this.basedir = basedir; this.compiler = new Compiler(basedir, kind, output, compr_format, compr_level); compiler.setPackagerListener(listener);
this(filename, basedir, kind, output, (PackagerListener) null);
public CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, int compr_level, PackagerListener listener, String installText) throws CompilerException { this.filename = filename; this.installText = installText; this.basedir = basedir; this.compiler = new Compiler(basedir, kind, output, compr_format, compr_level); compiler.setPackagerListener(listener); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/458df5388598b1463abaab7f3fba01a728e5d095/CompilerConfig.java/buggy/src/lib/com/izforge/izpack/compiler/CompilerConfig.java
public void addConfiguredPropertyset(PropertySet ps)
public void addConfiguredPropertyset(Property ps)
public void addConfiguredPropertyset(PropertySet ps) { if (properties == null) properties = new Properties(); properties.putAll(ps.getProperties()); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6006516f2ca6a755f3d82508f16b86f8e753723c/IzPackTask.java/buggy/src/lib/com/izforge/izpack/ant/IzPackTask.java
headingLabels[i] = new JLabel();
private void createHeadingLabels(int headingLines, Color back) { // headingLabels are an array which contains the labels for header (0), // description lines and the icon (last). headingLabels = new JLabel[headingLines + 1]; headingLabels[0] = new JLabel(""); // First line ist the "main heading" which should be bold. headingLabels[0].setFont(headingLabels[0].getFont().deriveFont(Font.BOLD)); if (installdata.guiPrefs.modifier.containsKey("headingFontSize")) { float fontSize = Float.parseFloat((String) installdata.guiPrefs.modifier .get("headingFontSize")); if (fontSize > 0.0 && fontSize <= 5.0) { float currentSize = headingLabels[0].getFont().getSize2D(); headingLabels[0].setFont(headingLabels[0].getFont().deriveFont( currentSize * fontSize)); } } for (int i = 1; i < headingLines; ++i) { // Minor headings should be a little bit more to the right. headingLabels[i].setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/824d19753f9b673667d8b30cca9a3269b56fe7af/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
err.printStackTrace();
public void run() { try { // We get the list of the files to delete ArrayList files = getFilesList(); int size = files.size(); listener.destroyerStart(0, size); // We destroy the files for (int i = 0; i < size; i++) { File file = (File) files.get(i); if (file.exists()) file.delete(); listener.destroyerProgress(i, file.getAbsolutePath()); } // We make a complementary cleanup listener.destroyerProgress(size, "[ cleanups ]"); cleanup(new File(installPath)); askUninstallerRemoval(); listener.destroyerStop(); } catch (Exception err) { listener.destroyerStop(); listener.destroyerError(err.toString()); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Destroyer.java/buggy/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
;
public void afterDir(File dir, PackFile pf) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleInstallerListener.java/clean/src/lib/com/izforge/izpack/event/SimpleInstallerListener.java
;
public void afterFile(File file, PackFile pf) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleInstallerListener.java/clean/src/lib/com/izforge/izpack/event/SimpleInstallerListener.java
;
public void afterPacks(AutomatedInstallData idata, AbstractUIProgressHandler handler) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleInstallerListener.java/clean/src/lib/com/izforge/izpack/event/SimpleInstallerListener.java
;
public void beforeDir(File dir, PackFile pf) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleInstallerListener.java/clean/src/lib/com/izforge/izpack/event/SimpleInstallerListener.java
;
public void beforeFile(File file, PackFile pf) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleInstallerListener.java/clean/src/lib/com/izforge/izpack/event/SimpleInstallerListener.java
;
public void beforePack(Pack pack, Integer i, AbstractUIProgressHandler handler) throws Exception { // Do nothing ; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SimpleInstallerListener.java/clean/src/lib/com/izforge/izpack/event/SimpleInstallerListener.java
temp = temp + indent;
temp += indent;
private int minimumBothColumnsWidth(Container parent) { Component component = null; TwoColumnConstraints constraints = null; int width = 0; int temp = 0; if (title != null) { component = title.component; width = (int) component.getMinimumSize().getWidth(); } for (int i = 0; i < components[LEFT].size(); i++) { constraints = (TwoColumnConstraints) components[LEFT].elementAt(i); if ((constraints != null) && (constraints.position == TwoColumnConstraints.BOTH)) { component = constraints.component; temp = (int) component.getMinimumSize().getWidth(); if (constraints.indent) { temp = temp + indent; } if (temp > width) { width = temp; } } } return (width); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/TwoColumnLayout.java/clean/src/lib/com/izforge/izpack/gui/TwoColumnLayout.java
height = height + rowHeight(i);
height += rowHeight(i);
private int minimumClusterHeight() { int height = 0; for (int i = 0; i < rows(); i++) { height = height + rowHeight(i); } return (height); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/TwoColumnLayout.java/clean/src/lib/com/izforge/izpack/gui/TwoColumnLayout.java
temp = temp + indent;
temp += indent;
private int minimumColumnWidth(int column, Container parent) { Component component = null; TwoColumnConstraints constraints = null; int width = 0; int temp = 0; for (int i = 0; i < components[column].size(); i++) { constraints = (TwoColumnConstraints) components[column].elementAt(i); if ((constraints != null) && (constraints.position != TwoColumnConstraints.BOTH)) { component = constraints.component; temp = (int) component.getMinimumSize().getWidth(); if (constraints.indent) { temp = temp + indent; } if (temp > width) { width = temp; } } } return (width); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/TwoColumnLayout.java/clean/src/lib/com/izforge/izpack/gui/TwoColumnLayout.java
width = width - indent; x = x + indent;
width -= indent; x += indent;
private void positionComponent(int y, int row, int column, Container parent) { TwoColumnConstraints constraints = null; try { constraints = (TwoColumnConstraints) (components[column].elementAt(row)); } catch (Throwable exception) { return; } int x = 0; if (constraints != null) { Component component = constraints.component; int width = (int) component.getPreferredSize().getWidth(); int height = (int) component.getPreferredSize().getHeight(); // -------------------------------------------------- // set x to the appropriate rule. The only need to // modify this is for indent // -------------------------------------------------- if (column == LEFT) { x = leftRule; } else { x = centerRule; } if (component != null) { // -------------------------------------------------- // set the width for stretch based on BOTH, LEFT and // RIGHT positionsing // -------------------------------------------------- if ((constraints.stretch) && (constraints.position == TwoColumnConstraints.BOTH)) { width = rightRule - leftRule; x = leftRule; } else if ((constraints.stretch) && (column == LEFT)) { width = centerRule - leftRule; } else if ((constraints.stretch) && (column == RIGHT)) { width = rightRule - centerRule; } // -------------------------------------------------- // if we straddle both columns but are not stretching // use the preferred width as long as it is less then // the width of both columns combined. Also set the x // position to left, just to be sure. // -------------------------------------------------- else if (constraints.position == TwoColumnConstraints.BOTH) { if (width > (rightRule - leftRule)) { width = rightRule - leftRule; } x = leftRule; } // -------------------------------------------------- // correct for indent if this option is set // -------------------------------------------------- if (constraints.indent) { width = width - indent; x = x + indent; } component.setBounds(x, y, width, height); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/TwoColumnLayout.java/clean/src/lib/com/izforge/izpack/gui/TwoColumnLayout.java
y = y + leftHeight;
y += leftHeight;
private void positionComponents(Container parent) { int usedHeight = titleHeight + minimumClusterHeight(); int topBuffer = topBuffer(usedHeight, parent); int leftHeight = 0; int rightHeight = 0; if (topBuffer < 0) { topBuffer = 0; } int y = titleHeight + topBuffer; for (int i = 0; i < rows(); i++) { leftHeight = height(i, LEFT); rightHeight = height(i, RIGHT); if (leftHeight > rightHeight) { int offset = (leftHeight - rightHeight) / 2; positionComponent(y, i, LEFT, parent); positionComponent((y + offset), i, RIGHT, parent); y = y + leftHeight; } else if (leftHeight < rightHeight) { int offset = (rightHeight - leftHeight) / 2; positionComponent((y + offset), i, LEFT, parent); positionComponent(y, i, RIGHT, parent); y = y + rightHeight; } else { positionComponent(y, i, LEFT, parent); positionComponent(y, i, RIGHT, parent); y = y + leftHeight; } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/TwoColumnLayout.java/clean/src/lib/com/izforge/izpack/gui/TwoColumnLayout.java
y = y + rightHeight;
y += rightHeight;
private void positionComponents(Container parent) { int usedHeight = titleHeight + minimumClusterHeight(); int topBuffer = topBuffer(usedHeight, parent); int leftHeight = 0; int rightHeight = 0; if (topBuffer < 0) { topBuffer = 0; } int y = titleHeight + topBuffer; for (int i = 0; i < rows(); i++) { leftHeight = height(i, LEFT); rightHeight = height(i, RIGHT); if (leftHeight > rightHeight) { int offset = (leftHeight - rightHeight) / 2; positionComponent(y, i, LEFT, parent); positionComponent((y + offset), i, RIGHT, parent); y = y + leftHeight; } else if (leftHeight < rightHeight) { int offset = (rightHeight - leftHeight) / 2; positionComponent((y + offset), i, LEFT, parent); positionComponent(y, i, RIGHT, parent); y = y + rightHeight; } else { positionComponent(y, i, LEFT, parent); positionComponent(y, i, RIGHT, parent); y = y + leftHeight; } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/TwoColumnLayout.java/clean/src/lib/com/izforge/izpack/gui/TwoColumnLayout.java
y = y + leftHeight;
y += leftHeight;
private void positionComponents(Container parent) { int usedHeight = titleHeight + minimumClusterHeight(); int topBuffer = topBuffer(usedHeight, parent); int leftHeight = 0; int rightHeight = 0; if (topBuffer < 0) { topBuffer = 0; } int y = titleHeight + topBuffer; for (int i = 0; i < rows(); i++) { leftHeight = height(i, LEFT); rightHeight = height(i, RIGHT); if (leftHeight > rightHeight) { int offset = (leftHeight - rightHeight) / 2; positionComponent(y, i, LEFT, parent); positionComponent((y + offset), i, RIGHT, parent); y = y + leftHeight; } else if (leftHeight < rightHeight) { int offset = (rightHeight - leftHeight) / 2; positionComponent((y + offset), i, LEFT, parent); positionComponent(y, i, RIGHT, parent); y = y + rightHeight; } else { positionComponent(y, i, LEFT, parent); positionComponent(y, i, RIGHT, parent); y = y + leftHeight; } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/TwoColumnLayout.java/clean/src/lib/com/izforge/izpack/gui/TwoColumnLayout.java
public Object clone ()
public Object clone () throws CloneNotSupportedException
public Object clone () { TwoColumnConstraints newObject = new TwoColumnConstraints (); newObject.position = position; newObject.align = align; newObject.indent = indent; newObject.stretch = stretch; newObject.component = component; return (newObject); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/TwoColumnConstraints.java/buggy/src/lib/com/izforge/izpack/gui/TwoColumnConstraints.java
super.clone();
public Object clone () { TwoColumnConstraints newObject = new TwoColumnConstraints (); newObject.position = position; newObject.align = align; newObject.indent = indent; newObject.stretch = stretch; newObject.component = component; return (newObject); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/TwoColumnConstraints.java/buggy/src/lib/com/izforge/izpack/gui/TwoColumnConstraints.java
layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
BoxLayout layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
public SelectPrinterPanel(InstallerFrame parent, InstallData id) { super(parent, id); iData = id; // The 'super' layout GridBagLayout superLayout = new GridBagLayout(); setLayout(superLayout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(0, 0, 0, 0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.CENTER; // We initialize our 'real' layout JPanel centerPanel = new JPanel(); layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS); centerPanel.setLayout(layout); superLayout.addLayoutComponent(centerPanel, gbConstraints); add(centerPanel); cbPrinters = new JComboBox(); pServices = PrintServiceLookup.lookupPrintServices(null, null); iData.setVariable("SELECTED_PRINTER", pServices[0].getName()); for (int i = 0; i < pServices.length; i++) { cbPrinters.addItem(pServices[i].getName()); } cbPrinters.addActionListener(this); // We create and put the labels String str; centerPanel.add(Box.createVerticalStrut(10)); str = parent.langpack.getString("PrinterSelectPanel.select_printer"); selectLabel = LabelFactory.create(str, JLabel.LEADING); selectLabel.setAlignmentX(JLabel.LEADING); centerPanel.add(selectLabel); centerPanel.add(Box.createVerticalStrut(20)); centerPanel.add(cbPrinters); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SelectPrinterPanel.java/clean/src/lib/com/izforge/izpack/panels/SelectPrinterPanel.java
pServices = PrintServiceLookup.lookupPrintServices(null, null);
PrintService[] pServices = PrintServiceLookup.lookupPrintServices(null, null);
public SelectPrinterPanel(InstallerFrame parent, InstallData id) { super(parent, id); iData = id; // The 'super' layout GridBagLayout superLayout = new GridBagLayout(); setLayout(superLayout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(0, 0, 0, 0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.CENTER; // We initialize our 'real' layout JPanel centerPanel = new JPanel(); layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS); centerPanel.setLayout(layout); superLayout.addLayoutComponent(centerPanel, gbConstraints); add(centerPanel); cbPrinters = new JComboBox(); pServices = PrintServiceLookup.lookupPrintServices(null, null); iData.setVariable("SELECTED_PRINTER", pServices[0].getName()); for (int i = 0; i < pServices.length; i++) { cbPrinters.addItem(pServices[i].getName()); } cbPrinters.addActionListener(this); // We create and put the labels String str; centerPanel.add(Box.createVerticalStrut(10)); str = parent.langpack.getString("PrinterSelectPanel.select_printer"); selectLabel = LabelFactory.create(str, JLabel.LEADING); selectLabel.setAlignmentX(JLabel.LEADING); centerPanel.add(selectLabel); centerPanel.add(Box.createVerticalStrut(20)); centerPanel.add(cbPrinters); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SelectPrinterPanel.java/clean/src/lib/com/izforge/izpack/panels/SelectPrinterPanel.java
selectLabel = LabelFactory.create(str, JLabel.LEADING);
JLabel selectLabel = LabelFactory.create(str, JLabel.LEADING);
public SelectPrinterPanel(InstallerFrame parent, InstallData id) { super(parent, id); iData = id; // The 'super' layout GridBagLayout superLayout = new GridBagLayout(); setLayout(superLayout); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(0, 0, 0, 0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.CENTER; // We initialize our 'real' layout JPanel centerPanel = new JPanel(); layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS); centerPanel.setLayout(layout); superLayout.addLayoutComponent(centerPanel, gbConstraints); add(centerPanel); cbPrinters = new JComboBox(); pServices = PrintServiceLookup.lookupPrintServices(null, null); iData.setVariable("SELECTED_PRINTER", pServices[0].getName()); for (int i = 0; i < pServices.length; i++) { cbPrinters.addItem(pServices[i].getName()); } cbPrinters.addActionListener(this); // We create and put the labels String str; centerPanel.add(Box.createVerticalStrut(10)); str = parent.langpack.getString("PrinterSelectPanel.select_printer"); selectLabel = LabelFactory.create(str, JLabel.LEADING); selectLabel.setAlignmentX(JLabel.LEADING); centerPanel.add(selectLabel); centerPanel.add(Box.createVerticalStrut(20)); centerPanel.add(cbPrinters); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SelectPrinterPanel.java/clean/src/lib/com/izforge/izpack/panels/SelectPrinterPanel.java
return;
public void actionPerformed(ActionEvent event) { String sPrinter = (String) cbPrinters.getSelectedItem(); iData.setVariable("SELECTED_PRINTER", sPrinter); return; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/SelectPrinterPanel.java/clean/src/lib/com/izforge/izpack/panels/SelectPrinterPanel.java
public TestKeyedObjectPoolFactory(final String name) {
protected TestKeyedObjectPoolFactory(final String name) {
public TestKeyedObjectPoolFactory(final String name) { super(name); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/0cbda9bdbe04f47a58b8b44c3115b516855caf78/TestKeyedObjectPoolFactory.java/buggy/src/test/org/apache/commons/pool/TestKeyedObjectPoolFactory.java
protected KeyedObjectPoolFactory makeFactory(KeyedPoolableObjectFactory objectFactory) throws UnsupportedOperationException{ throw new UnsupportedOperationException("Subclass needs to override makeFactory method.");
protected KeyedObjectPoolFactory makeFactory() throws UnsupportedOperationException { return makeFactory(createObjectFactory());
protected KeyedObjectPoolFactory makeFactory(KeyedPoolableObjectFactory 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/TestKeyedObjectPoolFactory.java/buggy/src/test/org/apache/commons/pool/TestKeyedObjectPoolFactory.java
public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory) { this(factory,StackKeyedObjectPool.DEFAULT_MAX_SLEEPING,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
public StackKeyedObjectPoolFactory() { this((KeyedPoolableObjectFactory)null,StackKeyedObjectPool.DEFAULT_MAX_SLEEPING,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
public StackKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory) { this(factory,StackKeyedObjectPool.DEFAULT_MAX_SLEEPING,StackKeyedObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/StackKeyedObjectPoolFactory.java/buggy/src/java/org/apache/commons/pool/impl/StackKeyedObjectPoolFactory.java
thumb.setMimeType("image");
thumb.setMimeType(DEFAULT_MIME_TYPE);
private Thumbnail createThumbnailMetadata(Pixels p, int sizeX, int sizeY) { Thumbnail thumb = new Thumbnail(); thumb.setPixels(p); thumb.setMimeType("image"); // FIXME: Hack thumb.setSizeX(sizeX); thumb.setSizeY(sizeY); return iUpdate.saveAndReturnObject(thumb); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/ThumbImpl.java/buggy/components/server/src/ome/logic/ThumbImpl.java
Thumbnail thumb = (Thumbnail) iQuery.findByQuery("select t from Thumbnail as t where t.pixels.id = :id", new Parameters().addId(p.getId()));
Parameters param = new Parameters(); param.addId(p.getId()); param.addInteger("x", sizeX); param.addInteger("y", sizeY); Thumbnail thumb = iQuery.findByQuery( "select t from Thumbnail as t where t.pixels.id = :id and " + "t.sizeX = :x and t.sizeY = :y", param);
private Thumbnail getThumbnailMetadata(Pixels p, int sizeX, int sizeY) { // FIXME: We need dimensions here. Thumbnail thumb = (Thumbnail) iQuery.findByQuery("select t from Thumbnail as t where t.pixels.id = :id", new Parameters().addId(p.getId())); return thumb; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/725d5581a5805696002bff1ec2ecb359495503f5/ThumbImpl.java/buggy/components/server/src/ome/logic/ThumbImpl.java
public Object clone () throws CloneNotSupportedException
public Object clone ()
public Object clone () throws CloneNotSupportedException { super.clone(); TwoColumnConstraints newObject = new TwoColumnConstraints (); newObject.position = position; newObject.align = align; newObject.indent = indent; newObject.stretch = stretch; newObject.component = component; return (newObject); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d11fc845a2a89fc77729603e3e46364815b8de54/TwoColumnConstraints.java/clean/src/lib/com/izforge/izpack/gui/TwoColumnConstraints.java
super.clone();
public Object clone () throws CloneNotSupportedException { super.clone(); TwoColumnConstraints newObject = new TwoColumnConstraints (); newObject.position = position; newObject.align = align; newObject.indent = indent; newObject.stretch = stretch; newObject.component = component; return (newObject); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d11fc845a2a89fc77729603e3e46364815b8de54/TwoColumnConstraints.java/clean/src/lib/com/izforge/izpack/gui/TwoColumnConstraints.java
Boolean selected = new Boolean (idata.selectedPacks.contains (pack));
Boolean selected = Boolean.valueOf(idata.selectedPacks.contains (pack));
public void makeXMLData(AutomatedInstallData idata, XMLElement panelRoot) { // We add each pack to the panelRoot element for (int i = 0; i < idata.availablePacks.size(); i++) { Pack pack = (Pack) idata.availablePacks.get(i); XMLElement el = new XMLElement("pack"); el.setAttribute ("index", new Integer(i).toString()); el.setAttribute ("name", pack.name); Boolean selected = new Boolean (idata.selectedPacks.contains (pack)); el.setAttribute ("selected", selected.toString ()); panelRoot.addChild(el); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/PacksPanelAutomationHelper.java/clean/src/lib/com/izforge/izpack/panels/PacksPanelAutomationHelper.java
Boolean selected = new Boolean (el.getAttribute ("selected"));
Boolean selected = Boolean.valueOf(el.getAttribute ("selected"));
public void runAutomated(AutomatedInstallData idata, XMLElement panelRoot) { // We get the packs markups Vector pm = panelRoot.getChildrenNamed("pack"); // We figure out the selected ones int size = pm.size(); idata.selectedPacks.clear(); for (int i = 0; i < size; i++) { XMLElement el = (XMLElement) pm.get(i); Boolean selected = new Boolean (el.getAttribute ("selected")); if (selected.booleanValue ()) { String index_str = el.getAttribute("index"); // be liberal in what we accept // (For example, this allows auto-installer files to be fitted to automatically // generated installers, yes I need this! tisc.) if (index_str != null) { try { int index = Integer.parseInt(index_str); if ((index >= 0 ) && (index < idata.availablePacks.size())) { idata.selectedPacks.add(idata.availablePacks.get(index)); } else { System.err.println ("Invalid pack index \""+index_str+"\" in line "+el.getLineNr()); } } catch (NumberFormatException e) { System.err.println ("Invalid pack index \""+index_str+"\" in line "+el.getLineNr()); } } else { String name = el.getAttribute ("name"); if (name != null) { // search for pack with that name Iterator pack_it = idata.availablePacks.iterator (); boolean found = false; while ((! found) && pack_it.hasNext ()) { Pack pack = (Pack)pack_it.next(); if (pack.name.equals (name)) { idata.selectedPacks.add (pack); found = true; } } if (! found) { System.err.println ("Could not find selected pack named \""+name+"\" in line "+el.getLineNr()); } } } } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/PacksPanelAutomationHelper.java/clean/src/lib/com/izforge/izpack/panels/PacksPanelAutomationHelper.java
logger.setOutputPrintStream(System.out); logger.setErrorPrintStream(System.err);
if (logFile != null) { PrintStream printStream; try { printStream = new PrintStream(new FileOutputStream(logFile)); logger.setOutputPrintStream(printStream); logger.setErrorPrintStream(printStream); } catch (FileNotFoundException e) { logger.setOutputPrintStream(System.out); logger.setErrorPrintStream(System.err); } } else { logger.setOutputPrintStream(System.out); logger.setErrorPrintStream(System.err); }
private BuildLogger createLogger() { int msgOutputLevel = 2; if (verbose) msgOutputLevel = 4; else if (quiet) msgOutputLevel = 1; BuildLogger logger = new DefaultLogger(); logger.setMessageOutputLevel(msgOutputLevel); logger.setOutputPrintStream(System.out); logger.setErrorPrintStream(System.err); return logger; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/46e0594a602b14dea0a425f307980fc2d210779c/AntAction.java/clean/src/lib/com/izforge/izpack/event/AntAction.java
if (family.equals("windows"))
if ("windows".equals(family))
public boolean matchCurrentSystem() { boolean match = true; String osName = System.getProperty("os.name").toLowerCase(); if (arch != null && arch.length() != 0) { match = System.getProperty("os.arch").toLowerCase().equals(arch); } if (match && version != null && version.length() != 0) { match = System.getProperty("os.version").toLowerCase().equals(version); } if (match && name != null && name.length() != 0) { match = osName.equals(name); } if (match && family != null) { if (family.equals("windows")) { match = OsVersion.IS_WINDOWS; } else if (family.equals("mac") || family.equals("osx")) { match = OsVersion.IS_OSX; } else if (family.equals("unix")) { match = OsVersion.IS_UNIX; } } return match && (family != null || name != null || version != null || arch != null); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/OsConstraint.java/clean/src/lib/com/izforge/izpack/util/OsConstraint.java
else if (family.equals("mac") || family.equals("osx"))
else if ("mac".equals(family) || "osx".equals(family))
public boolean matchCurrentSystem() { boolean match = true; String osName = System.getProperty("os.name").toLowerCase(); if (arch != null && arch.length() != 0) { match = System.getProperty("os.arch").toLowerCase().equals(arch); } if (match && version != null && version.length() != 0) { match = System.getProperty("os.version").toLowerCase().equals(version); } if (match && name != null && name.length() != 0) { match = osName.equals(name); } if (match && family != null) { if (family.equals("windows")) { match = OsVersion.IS_WINDOWS; } else if (family.equals("mac") || family.equals("osx")) { match = OsVersion.IS_OSX; } else if (family.equals("unix")) { match = OsVersion.IS_UNIX; } } return match && (family != null || name != null || version != null || arch != null); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/OsConstraint.java/clean/src/lib/com/izforge/izpack/util/OsConstraint.java
else if (family.equals("unix"))
else if ("unix".equals(family))
public boolean matchCurrentSystem() { boolean match = true; String osName = System.getProperty("os.name").toLowerCase(); if (arch != null && arch.length() != 0) { match = System.getProperty("os.arch").toLowerCase().equals(arch); } if (match && version != null && version.length() != 0) { match = System.getProperty("os.version").toLowerCase().equals(version); } if (match && name != null && name.length() != 0) { match = osName.equals(name); } if (match && family != null) { if (family.equals("windows")) { match = OsVersion.IS_WINDOWS; } else if (family.equals("mac") || family.equals("osx")) { match = OsVersion.IS_OSX; } else if (family.equals("unix")) { match = OsVersion.IS_UNIX; } } return match && (family != null || name != null || version != null || arch != null); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/OsConstraint.java/clean/src/lib/com/izforge/izpack/util/OsConstraint.java
retval.append(" family " + family); retval.append(" name " + name); retval.append(" version " + version); retval.append(" arch " + arch);
retval.append(" family ").append(family); retval.append(" name ").append(name); retval.append(" version ").append(version); retval.append(" arch ").append(arch);
public String toString() { StringBuffer retval = new StringBuffer(); retval.append("[Os "); retval.append(" family " + family); retval.append(" name " + name); retval.append(" version " + version); retval.append(" arch " + arch); retval.append(" ]"); return retval.toString(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/OsConstraint.java/clean/src/lib/com/izforge/izpack/util/OsConstraint.java
hlp.append("Comment[" + userLanguage + "]=" + $Comment + N);
hlp.append("Comment[").append(userLanguage).append("]=" + $Comment + N);
public Unix_Shortcut() { StringBuffer hlp = new StringBuffer(); String userLanguage = System.getProperty("user.language", "en"); hlp.append("[Desktop Entry]" + N); hlp.append("Comment=" + $Comment + N); hlp.append("Comment[" + userLanguage + "]=" + $Comment + N); hlp.append("Encoding=" + $Encoding + N); hlp.append("Exec="+ $E_QUOT + $Exec + $E_QUOT + S + $Arguments + N); hlp.append("GenericName=" + $GenericName + N); hlp.append("GenericName[" + userLanguage + "]=" + $GenericName + N); hlp.append("Icon=" + $Icon + N); hlp.append("MimeType=" + $MimeType + N); hlp.append("Name=" + $Name + N); hlp.append("Name[" + userLanguage + "]=" + $Name + N); hlp.append("Path="+ $P_QUOT + $Path + $P_QUOT + N); hlp.append("ServiceTypes=" + $ServiceTypes + N); hlp.append("SwallowExec=" + $SwallowExec + N); hlp.append("SwallowTitle=" + $SwallowTitle + N); hlp.append("Terminal=" + $Terminal + N); hlp.append("TerminalOptions=" + $Options_For_Terminal + N); hlp.append("Type=" + $Type + N); hlp.append("URL=" + $URL + N); hlp.append("X-KDE-SubstituteUID=" + $X_KDE_SubstituteUID + N); hlp.append("X-KDE-Username=" + $X_KDE_Username + N); hlp.append(N); hlp.append(C + "created by" + S + getClass().getName() + S + rev + N ); hlp.append(C + version ); template = hlp.toString(); props = new Properties(); initProps(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
hlp.append("GenericName[" + userLanguage + "]=" + $GenericName + N);
hlp.append("GenericName[").append(userLanguage).append("]=" + $GenericName + N);
public Unix_Shortcut() { StringBuffer hlp = new StringBuffer(); String userLanguage = System.getProperty("user.language", "en"); hlp.append("[Desktop Entry]" + N); hlp.append("Comment=" + $Comment + N); hlp.append("Comment[" + userLanguage + "]=" + $Comment + N); hlp.append("Encoding=" + $Encoding + N); hlp.append("Exec="+ $E_QUOT + $Exec + $E_QUOT + S + $Arguments + N); hlp.append("GenericName=" + $GenericName + N); hlp.append("GenericName[" + userLanguage + "]=" + $GenericName + N); hlp.append("Icon=" + $Icon + N); hlp.append("MimeType=" + $MimeType + N); hlp.append("Name=" + $Name + N); hlp.append("Name[" + userLanguage + "]=" + $Name + N); hlp.append("Path="+ $P_QUOT + $Path + $P_QUOT + N); hlp.append("ServiceTypes=" + $ServiceTypes + N); hlp.append("SwallowExec=" + $SwallowExec + N); hlp.append("SwallowTitle=" + $SwallowTitle + N); hlp.append("Terminal=" + $Terminal + N); hlp.append("TerminalOptions=" + $Options_For_Terminal + N); hlp.append("Type=" + $Type + N); hlp.append("URL=" + $URL + N); hlp.append("X-KDE-SubstituteUID=" + $X_KDE_SubstituteUID + N); hlp.append("X-KDE-Username=" + $X_KDE_Username + N); hlp.append(N); hlp.append(C + "created by" + S + getClass().getName() + S + rev + N ); hlp.append(C + version ); template = hlp.toString(); props = new Properties(); initProps(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
hlp.append("Name[" + userLanguage + "]=" + $Name + N);
hlp.append("Name[").append(userLanguage).append("]=" + $Name + N);
public Unix_Shortcut() { StringBuffer hlp = new StringBuffer(); String userLanguage = System.getProperty("user.language", "en"); hlp.append("[Desktop Entry]" + N); hlp.append("Comment=" + $Comment + N); hlp.append("Comment[" + userLanguage + "]=" + $Comment + N); hlp.append("Encoding=" + $Encoding + N); hlp.append("Exec="+ $E_QUOT + $Exec + $E_QUOT + S + $Arguments + N); hlp.append("GenericName=" + $GenericName + N); hlp.append("GenericName[" + userLanguage + "]=" + $GenericName + N); hlp.append("Icon=" + $Icon + N); hlp.append("MimeType=" + $MimeType + N); hlp.append("Name=" + $Name + N); hlp.append("Name[" + userLanguage + "]=" + $Name + N); hlp.append("Path="+ $P_QUOT + $Path + $P_QUOT + N); hlp.append("ServiceTypes=" + $ServiceTypes + N); hlp.append("SwallowExec=" + $SwallowExec + N); hlp.append("SwallowTitle=" + $SwallowTitle + N); hlp.append("Terminal=" + $Terminal + N); hlp.append("TerminalOptions=" + $Options_For_Terminal + N); hlp.append("Type=" + $Type + N); hlp.append("URL=" + $URL + N); hlp.append("X-KDE-SubstituteUID=" + $X_KDE_SubstituteUID + N); hlp.append("X-KDE-Username=" + $X_KDE_Username + N); hlp.append(N); hlp.append(C + "created by" + S + getClass().getName() + S + rev + N ); hlp.append(C + version ); template = hlp.toString(); props = new Properties(); initProps(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
hlp.append(C + "created by" + S + getClass().getName() + S + rev + N ); hlp.append(C + version );
hlp.append(C + "created by" + S).append(getClass().getName()).append(S).append(rev).append(N); hlp.append(C).append(version);
public Unix_Shortcut() { StringBuffer hlp = new StringBuffer(); String userLanguage = System.getProperty("user.language", "en"); hlp.append("[Desktop Entry]" + N); hlp.append("Comment=" + $Comment + N); hlp.append("Comment[" + userLanguage + "]=" + $Comment + N); hlp.append("Encoding=" + $Encoding + N); hlp.append("Exec="+ $E_QUOT + $Exec + $E_QUOT + S + $Arguments + N); hlp.append("GenericName=" + $GenericName + N); hlp.append("GenericName[" + userLanguage + "]=" + $GenericName + N); hlp.append("Icon=" + $Icon + N); hlp.append("MimeType=" + $MimeType + N); hlp.append("Name=" + $Name + N); hlp.append("Name[" + userLanguage + "]=" + $Name + N); hlp.append("Path="+ $P_QUOT + $Path + $P_QUOT + N); hlp.append("ServiceTypes=" + $ServiceTypes + N); hlp.append("SwallowExec=" + $SwallowExec + N); hlp.append("SwallowTitle=" + $SwallowTitle + N); hlp.append("Terminal=" + $Terminal + N); hlp.append("TerminalOptions=" + $Options_For_Terminal + N); hlp.append("Type=" + $Type + N); hlp.append("URL=" + $URL + N); hlp.append("X-KDE-SubstituteUID=" + $X_KDE_SubstituteUID + N); hlp.append("X-KDE-Username=" + $X_KDE_Username + N); hlp.append(N); hlp.append(C + "created by" + S + getClass().getName() + S + rev + N ); hlp.append(C + version ); template = hlp.toString(); props = new Properties(); initProps(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
result = new File(System.getProperty("user.home").toString() + File.separator + ".kde");
result = new File(System.getProperty("user.home") + File.separator + ".kde");
private File getKdeBase(int userType) { File result = null; if (userType == Shortcut.ALL_USERS) { FileExecutor fe = new FileExecutor(); String[] execOut = new String[2]; int execResult = fe.executeCommand(new String[] { "/usr/bin/env", "kde-config", "--prefix"}, execOut); result = new File(execOut[0].trim()); } else { result = new File(System.getProperty("user.home").toString() + File.separator + ".kde"); } return result; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
String result = new String();
String result = "";
public String getProgramsFolder(int current_user) { String result = new String(); // result = getKdeShareApplnkFolder(current_user).toString(); return result; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this.itsType = aType;
int itsType = aType;
public void initialize(int aType, String aName) throws Exception { this.itsType = aType; this.itsName = aName; props.put($Name, aName); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this.itsArguments = args;
String itsArguments = args;
public void setArguments(String args) { this.itsArguments = args; props.put($Arguments, args); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this.itsDescription = description;
String itsDescription = description;
public void setDescription(String description) { this.itsDescription = description; props.put($Comment, description); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this.itsIconPath = path; this.itsIconIndex = index;
String itsIconPath = path; int itsIconIndex = index;
public void setIconLocation(String path, int index) { this.itsIconPath = path; this.itsIconIndex = index; props.put($Icon, path); // }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this.itsType = aType;
int itsType = aType;
public void setLinkType(int aType) throws IllegalArgumentException { this.itsType = aType; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this.itsShow = show;
int itsShow = show;
public void setShowCommand(int show) { this.itsShow = show; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this.itsTargetPath = aPath;
String itsTargetPath = aPath;
public void setTargetPath(String aPath) { this.itsTargetPath = aPath; StringTokenizer whiteSpaceTester = new StringTokenizer( aPath ); if( whiteSpaceTester.countTokens() > 1 ) props.put( $E_QUOT,QM ); props.put($Exec, aPath); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this.itsWorkingDirectory = aDirectory;
String itsWorkingDirectory = aDirectory;
public void setWorkingDirectory(String aDirectory) { this.itsWorkingDirectory = aDirectory; StringTokenizer whiteSpaceTester = new StringTokenizer( aDirectory ); if( whiteSpaceTester.countTokens() > 1 ) props.put( $P_QUOT,QM ); props.put($Path, aDirectory); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
File targetPath = new File(target.toString().substring(0, target.toString().lastIndexOf(File.separatorChar)));
File targetPath = new File(target.substring(0, target.lastIndexOf(File.separatorChar)));
private File writeShortCut(String target, String shortCutDef) { File targetPath = new File(target.toString().substring(0, target.toString().lastIndexOf(File.separatorChar))); if (!targetPath.exists()) { targetPath.mkdirs(); this.createdDirectory = targetPath.toString(); } File targetFileName = new File( target ); File backupFile = new File( targetPath + File.separator + "." + targetFileName.getName() + System.currentTimeMillis() ); if( targetFileName.exists() ) { try { // create a hidden backup.file of the existing shortcut with a timestamp name. copyTo( targetFileName, backupFile );// + System.e ); targetFileName.delete(); } catch (IOException e3) { System.out.println("cannot create backup file " + backupFile + " of " + targetFileName );// e3.printStackTrace(); } } FileWriter fileWriter = null; try { fileWriter = new FileWriter( targetFileName ); } catch (IOException e1) { System.out.println( e1.getMessage() ); } try { fileWriter.write(shortCutDef); } catch (IOException e) { e.printStackTrace(); } try { fileWriter.close(); } catch (IOException e2) { e2.printStackTrace(); } return targetFileName; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Unix_Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java
this(null,DEFAULT_MAX_ACTIVE,DEFAULT_WHEN_EXHAUSTED_ACTION,DEFAULT_MAX_WAIT,DEFAULT_MAX_IDLE,DEFAULT_TEST_ON_BORROW,DEFAULT_TEST_ON_RETURN,DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,DEFAULT_NUM_TESTS_PER_EVICTION_RUN,DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,DEFAULT_TEST_WHILE_IDLE);
this(null,DEFAULT_MAX_ACTIVE,DEFAULT_WHEN_EXHAUSTED_ACTION,DEFAULT_MAX_WAIT,DEFAULT_MAX_IDLE,DEFAULT_MIN_IDLE,DEFAULT_TEST_ON_BORROW,DEFAULT_TEST_ON_RETURN,DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,DEFAULT_NUM_TESTS_PER_EVICTION_RUN,DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,DEFAULT_TEST_WHILE_IDLE);
public GenericObjectPool() { this(null,DEFAULT_MAX_ACTIVE,DEFAULT_WHEN_EXHAUSTED_ACTION,DEFAULT_MAX_WAIT,DEFAULT_MAX_IDLE,DEFAULT_TEST_ON_BORROW,DEFAULT_TEST_ON_RETURN,DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,DEFAULT_NUM_TESTS_PER_EVICTION_RUN,DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,DEFAULT_TEST_WHILE_IDLE); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/684114d9473e6098081a2f519788cf4e0a78c7c3/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
} int objectDeficit = getMinIdle() - getNumIdle(); if (_maxActive > 0) { int growLimit = Math.max(0, getMaxActive() - getNumActive() - getNumIdle()); objectDeficit = Math.min(objectDeficit, growLimit); } for ( int j = 0; j < objectDeficit; j++ ) { addObject();
public synchronized void evict() throws Exception { assertOpen(); if(!_pool.isEmpty()) { if(null == _evictionCursor) { _evictionCursor = (_pool.cursor(_pool.size())); } else if(!_evictionCursor.hasPrevious()) { _evictionCursor.close(); _evictionCursor = (_pool.cursor(_pool.size())); } for(int i=0,m=getNumTests();i<m;i++) { if(!_evictionCursor.hasPrevious()) { _evictionCursor.close(); _evictionCursor = (_pool.cursor(_pool.size())); } else { boolean removeObject = false; ObjectTimestampPair pair = (ObjectTimestampPair)(_evictionCursor.previous()); if(_minEvictableIdleTimeMillis > 0 && System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis) { removeObject = true; } else if(_testWhileIdle) { boolean active = false; try { _factory.activateObject(pair.value); active = true; } catch(Exception e) { removeObject=true; } if(active) { if(!_factory.validateObject(pair.value)) { removeObject=true; } else { try { _factory.passivateObject(pair.value); } catch(Exception e) { removeObject=true; } } } } if(removeObject) { try { _evictionCursor.remove(); _factory.destroyObject(pair.value); } catch(Exception e) { ; // ignored } } } } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/684114d9473e6098081a2f519788cf4e0a78c7c3/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
setMinIdle(conf.minIdle);
public synchronized void setConfig(GenericObjectPool.Config conf) { setMaxIdle(conf.maxIdle); setMaxActive(conf.maxActive); setMaxWait(conf.maxWait); setWhenExhaustedAction(conf.whenExhaustedAction); setTestOnBorrow(conf.testOnBorrow); setTestOnReturn(conf.testOnReturn); setTestWhileIdle(conf.testWhileIdle); setNumTestsPerEvictionRun(conf.numTestsPerEvictionRun); setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis); setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis); notifyAll(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/684114d9473e6098081a2f519788cf4e0a78c7c3/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
infoLabel = new JLabel(parent.langpack.getString("InfoPanel.info"), parent.icons.getImageIcon("edit"), JLabel.TRAILING);
infoLabel = new JLabel( parent.langpack.getString("InfoPanel.info"), parent.icons.getImageIcon("edit"), JLabel.TRAILING);
public XInfoPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We add the components infoLabel = new JLabel(parent.langpack.getString("InfoPanel.info"), parent.icons.getImageIcon("edit"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); textArea = new JTextArea(); textArea.setEditable(false); JScrollPane scroller = new JScrollPane(textArea); parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9); gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/XInfoPanel.java/clean/src/lib/com/izforge/izpack/panels/XInfoPanel.java
} catch (Exception err)
} catch (Exception err)
private void loadInfo() { try { // We read it info = ResourceManager.getInstance().getTextResource("XInfoPanel.info"); } catch (Exception err) { info = "Error : could not load the info text !"; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/XInfoPanel.java/clean/src/lib/com/izforge/izpack/panels/XInfoPanel.java
VariableSubstitutor vs = new VariableSubstitutor (idata.getVariableValueMap());
VariableSubstitutor vs = new VariableSubstitutor(idata.getVariableValueMap());
private void parseText() { try { // Initialize the variable substitutor VariableSubstitutor vs = new VariableSubstitutor (idata.getVariableValueMap()); // Parses the info text info = vs.substitute(info, null); } catch (Exception err) { err.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/XInfoPanel.java/clean/src/lib/com/izforge/izpack/panels/XInfoPanel.java
} catch (Exception err)
} catch (Exception err)
private void parseText() { try { // Initialize the variable substitutor VariableSubstitutor vs = new VariableSubstitutor (idata.getVariableValueMap()); // Parses the info text info = vs.substitute(info, null); } catch (Exception err) { err.printStackTrace(); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/XInfoPanel.java/clean/src/lib/com/izforge/izpack/panels/XInfoPanel.java