rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
public ColorChooser(ChannelBindings cb) { int[] rgba = cb.getRGBA(); int v = (int) (rgba[ALPHA]*100/255); Color c = new Color(rgba[RED], rgba[GREEN], rgba[BLUE], rgba[ALPHA]); ccManager = new ColorChooserManager(this, rgba, v); cp = new ColorPalette(ccManager); Container contentPane = super.getContentPane(); initButtons(); initSlider(v); initTextBoxes(rgba, v); initColorPanel(c); buildGUI(); contents.setSize(WIN_W, WIN_H); contentPane.add(contents); ccManager.attachListeners(); setResizable(false); setSize(WIN_W+W_EXTRA, WIN_H+H_EXTRA); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooser.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooser.java |
||
setResizable(false); | public ColorChooser(ChannelBindings cb) { int[] rgba = cb.getRGBA(); int v = (int) (rgba[ALPHA]*100/255); Color c = new Color(rgba[RED], rgba[GREEN], rgba[BLUE], rgba[ALPHA]); ccManager = new ColorChooserManager(this, rgba, v); cp = new ColorPalette(ccManager); Container contentPane = super.getContentPane(); initButtons(); initSlider(v); initTextBoxes(rgba, v); initColorPanel(c); buildGUI(); contents.setSize(WIN_W, WIN_H); contentPane.add(contents); ccManager.attachListeners(); setResizable(false); setSize(WIN_W+W_EXTRA, WIN_H+H_EXTRA); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooser.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooser.java |
|
saveButton.setBounds(WBUTTON+3, 0, WBUTTON, 20); cancelButton.setBounds(2*(WBUTTON+3), 0, WBUTTON, 20); | cancelButton.setBounds(WBUTTON+3, 0, WBUTTON, 20); | private JPanel builButtonPanel() { JPanel p = new JPanel(); p.setLayout(null); applyButton.setBounds(0, 0, WBUTTON, 20); saveButton.setBounds(WBUTTON+3, 0, WBUTTON, 20); cancelButton.setBounds(2*(WBUTTON+3), 0, WBUTTON, 20); p.add(applyButton); p.add(saveButton); p.add(cancelButton); p.setBounds(BORDER, ColorPalette.HEIGHT_LP+2*(HEIGHT_BOX+VSPACE), 220, HEIGHT_BOX); return p; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooser.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooser.java |
p.add(saveButton); | private JPanel builButtonPanel() { JPanel p = new JPanel(); p.setLayout(null); applyButton.setBounds(0, 0, WBUTTON, 20); saveButton.setBounds(WBUTTON+3, 0, WBUTTON, 20); cancelButton.setBounds(2*(WBUTTON+3), 0, WBUTTON, 20); p.add(applyButton); p.add(saveButton); p.add(cancelButton); p.setBounds(BORDER, ColorPalette.HEIGHT_LP+2*(HEIGHT_BOX+VSPACE), 220, HEIGHT_BOX); return p; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooser.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooser.java |
|
p.setBounds(3*BORDER, ColorPalette.HEIGHT_LP+HEIGHT_BOX+VSPACE, | p.setBounds(4*BORDER, ColorPalette.HEIGHT_LP+HEIGHT_BOX+VSPACE, | private JPanel buildAlphaPanel() { JPanel p = new JPanel(); JLabel label = new JLabel("Alpha "); p.setLayout(null); int size = ColorPalette.WIDTH_PANEL-2*WIDTH_BOX; label.setBounds(0, 0, WLABEL, HEIGHT_BOX); alphaTextField.setBounds(WLABEL, 0, WIDTH_BOX, HEIGHT_BOX); alphaSlider.setBounds(WLABEL+WIDTH_BOX+2*BOX_SPACE, 0, size, HEIGHT_BOX); p.add(label); p.add(alphaTextField); p.add(alphaSlider); p.setBounds(3*BORDER, ColorPalette.HEIGHT_LP+HEIGHT_BOX+VSPACE, ColorPalette.WIDTH_PANEL+2*HSPACE, HEIGHT_BOX); return p; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooser.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooser.java |
saveButton = new JButton("Save"); | private void initButtons() { saveButton = new JButton("Save"); applyButton = new JButton("Apply"); applyButton.setEnabled(false); cancelButton = new JButton("Cancel"); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooser.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooser.java |
|
applyButton.setEnabled(false); | private void initButtons() { saveButton = new JButton("Save"); applyButton = new JButton("Apply"); applyButton.setEnabled(false); cancelButton = new JButton("Cancel"); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooser.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooser.java |
|
this.runtime = ruby; | public UnmarshalStream(Ruby ruby, InputStream in) throws IOException { super(in); this.runtime = ruby; in.read(); // Major in.read(); // Minor } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/034747585fcabe56272dd07acab0ab42ce8450d5/UnmarshalStream.java/clean/org/jruby/runtime/marshal/UnmarshalStream.java |
|
} if (javaClass.isArray()) { | } else if (javaClass.isArray()) { | public static Object convertRubyToJava(Ruby ruby, RubyObject rubyObject, Class javaClass) { if (rubyObject == ruby.getNil()) { return null; } if (javaClass.isArray()) { try { Class arrayClass = javaClass.getComponentType(); int len = (int)((RubyArray)rubyObject).length(); Object javaObject = Array.newInstance(arrayClass, len); for (int i = 0; i < len; i++) { Object item = convertRubyToJava(ruby, ((RubyArray)rubyObject).entry(i), arrayClass); Array.set(javaObject, i, item); } return javaObject; } catch (NegativeArraySizeException ex) { } } if (javaClass == Object.class) { javaClass = rubyObject.getJavaClass(); } if (javaClass == Boolean.TYPE || javaClass == Boolean.class) { return new Boolean(rubyObject.isTrue()); } if (javaClass == Integer.TYPE || javaClass == Integer.class) { return new Integer((int)((RubyFixnum)rubyObject).getLongValue()); } if (javaClass == Long.TYPE || javaClass == Long.class) { return new Long(((RubyFixnum)rubyObject).getLongValue()); } if (javaClass == Float.TYPE || javaClass == Float.class) { return new Float((float)((RubyFloat)rubyObject).getDoubleValue()); } if (javaClass == Double.TYPE || javaClass == Double.class) { return new Double(((RubyFloat)rubyObject).getDoubleValue()); } if (javaClass == String.class) { return ((RubyString)rubyObject).getValue(); } return ((RubyJavaObject)rubyObject).getValue(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/59743974f1f8d5a50153b05647dac2d75d510976/JavaUtil.java/buggy/org/jruby/javasupport/JavaUtil.java |
if (javaClass == Object.class) { javaClass = rubyObject.getJavaClass(); } if (javaClass == Boolean.TYPE || javaClass == Boolean.class) { return new Boolean(rubyObject.isTrue()); } if (javaClass == Integer.TYPE || javaClass == Integer.class) { return new Integer((int)((RubyFixnum)rubyObject).getLongValue()); } if (javaClass == Long.TYPE || javaClass == Long.class) { return new Long(((RubyFixnum)rubyObject).getLongValue()); } if (javaClass == Float.TYPE || javaClass == Float.class) { return new Float((float)((RubyFloat)rubyObject).getDoubleValue()); } if (javaClass == Double.TYPE || javaClass == Double.class) { return new Double(((RubyFloat)rubyObject).getDoubleValue()); } if (javaClass == String.class) { return ((RubyString)rubyObject).getValue(); } return ((RubyJavaObject)rubyObject).getValue(); | return rubyObject.toString(); | public static Object convertRubyToJava(Ruby ruby, RubyObject rubyObject, Class javaClass) { if (rubyObject == ruby.getNil()) { return null; } if (javaClass.isArray()) { try { Class arrayClass = javaClass.getComponentType(); int len = (int)((RubyArray)rubyObject).length(); Object javaObject = Array.newInstance(arrayClass, len); for (int i = 0; i < len; i++) { Object item = convertRubyToJava(ruby, ((RubyArray)rubyObject).entry(i), arrayClass); Array.set(javaObject, i, item); } return javaObject; } catch (NegativeArraySizeException ex) { } } if (javaClass == Object.class) { javaClass = rubyObject.getJavaClass(); } if (javaClass == Boolean.TYPE || javaClass == Boolean.class) { return new Boolean(rubyObject.isTrue()); } if (javaClass == Integer.TYPE || javaClass == Integer.class) { return new Integer((int)((RubyFixnum)rubyObject).getLongValue()); } if (javaClass == Long.TYPE || javaClass == Long.class) { return new Long(((RubyFixnum)rubyObject).getLongValue()); } if (javaClass == Float.TYPE || javaClass == Float.class) { return new Float((float)((RubyFloat)rubyObject).getDoubleValue()); } if (javaClass == Double.TYPE || javaClass == Double.class) { return new Double(((RubyFloat)rubyObject).getDoubleValue()); } if (javaClass == String.class) { return ((RubyString)rubyObject).getValue(); } return ((RubyJavaObject)rubyObject).getValue(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/59743974f1f8d5a50153b05647dac2d75d510976/JavaUtil.java/buggy/org/jruby/javasupport/JavaUtil.java |
view.getTField().setText(""+val); | view.getTField().setText(""+val); view.repaint(); | private void synch(int val) { curT = val; view.getTField().setText(""+val); //doesn't fire ActionEvent manager.onTChange(curT); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b52b1735c990029c4d2115a33258acf4d3c82ae5/TNavigatorManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/TNavigatorManager.java |
assert head instanceof ListNode; return list_concat((ListNode) head, tail); | if(head instanceof StrNode){ ((DStrNode)tail).childNodes().add(0, head); return tail; } else { return list_concat((ListNode) head, tail); } | public Node literal_concat(ISourcePosition position, Node head, Node tail) { if (head == null) { assert tail == null || tail instanceof Node; return (Node) tail; } if (tail == null) { return head; } if (head instanceof EvStrNode) { head = new DStrNode(position).add(head); } if (tail instanceof StrNode) { if (head instanceof StrNode) { head = new StrNode(union(head, (Node) tail), ((StrNode) head).getValue() + ((StrNode) tail).getValue()); } else { ((ListNode) head).add((Node) tail); } } else if (tail instanceof DStrNode) { // Ruby actually has a special case for StrNode, but I cannot actually get one to // occur. I am asserting on ListNode to help flag the case. assert head instanceof ListNode; return list_concat((ListNode) head, tail); } else if (tail instanceof EvStrNode) { if (head instanceof StrNode) { head = new DStrNode(head.getPosition()).add(head); } ((DStrNode) head).add(tail); } return head; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9bc3fc4d3c31f09ac9bc48080c0cf90ac710fe34/ParserSupport.java/buggy/src/org/jruby/parser/ParserSupport.java |
iPojos = (IPojos) applicationContext.getBean("pojosService"); | iPojos = factory.getPojosService(); | protected void onSetUp() throws Exception { super.onSetUp(); DataSource dataSource = (DataSource) applicationContext.getBean("dataSource"); data = new OMEData(); data.setDataSource(dataSource); iPojos = (IPojos) applicationContext.getBean("pojosService"); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/PojosServiceTest.java/clean/components/server/test/ome/server/itests/PojosServiceTest.java |
super(ruby, ruby.getClasses().getNilClass()); } | super(ruby, ruby.getClasses().getNilClass()); } | public Nil(Ruby ruby) { super(ruby, ruby.getClasses().getNilClass()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
switch (bodyNode.getType()) { case Constants.NODE_CFUNC: return RubyFixnum.m_newFixnum(getRuby(), -1); case Constants.NODE_ZSUPER: return RubyFixnum.m_newFixnum(getRuby(), -1); case Constants.NODE_ATTRSET: return RubyFixnum.one(getRuby()); case Constants.NODE_IVAR: return RubyFixnum.zero(getRuby()); default: Node body = bodyNode.getNextNode(); /* skip NODE_SCOPE */ if (body instanceof BlockNode) { body = body.getHeadNode(); } if (body == null) { return RubyFixnum.zero(getRuby()); } int n = body.getCount(); if (body.getOptNode() != null || body.getRest() != -1) { n = -n-1; } return RubyFixnum.m_newFixnum(getRuby(), n); } } | switch (bodyNode.getType()) { case Constants.NODE_CFUNC: return RubyFixnum.m_newFixnum(getRuby(), -1); case Constants.NODE_ZSUPER: return RubyFixnum.m_newFixnum(getRuby(), -1); case Constants.NODE_ATTRSET: return RubyFixnum.one(getRuby()); case Constants.NODE_IVAR: return RubyFixnum.zero(getRuby()); default: Node body = bodyNode.getNextNode(); /* skip NODE_SCOPE */ if (body instanceof BlockNode) { body = body.getHeadNode(); } if (body == null) { return RubyFixnum.zero(getRuby()); } int n = body.getCount(); if (body.getOptNode() != null || body.getRest() != -1) { n = -n-1; } return RubyFixnum.m_newFixnum(getRuby(), n); } } | public RubyFixnum arity() { switch (bodyNode.getType()) { case Constants.NODE_CFUNC: return RubyFixnum.m_newFixnum(getRuby(), -1); case Constants.NODE_ZSUPER: return RubyFixnum.m_newFixnum(getRuby(), -1); case Constants.NODE_ATTRSET: return RubyFixnum.one(getRuby()); case Constants.NODE_IVAR: return RubyFixnum.zero(getRuby()); default: Node body = bodyNode.getNextNode(); /* skip NODE_SCOPE */ if (body instanceof BlockNode) { body = body.getHeadNode(); } if (body == null) { return RubyFixnum.zero(getRuby()); } int n = body.getCount(); if (body.getOptNode() != null || body.getRest() != -1) { n = -n-1; } return RubyFixnum.m_newFixnum(getRuby(), n); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
return bodyNode; } | return bodyNode; } | public Node getBodyNode() { return bodyNode; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
return methodId; } | return methodId; } | public RubyId getMethodId() { return methodId; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
return originalClass; } | return originalClass; } | public RubyClass getOriginalClass() { return originalClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
return originalId; } | return originalId; } | public RubyId getOriginalId() { return originalId; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
return receiver; } | return receiver; } | public RubyObject getReceiver() { return receiver; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
return receiverClass; } | return receiverClass; } | public RubyClass getReceiverClass() { return receiverClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
obj.funcall(getRuby().intern("initialize"), args); | obj.callInit( args); | public RubyObject m_new(RubyObject[] args) { if (isSingleton()) { throw new RubyTypeException("can't create instance of virtual class"); } RubyObject obj = new RubyObject(getRuby(), this); // PUSH_ITER(rb_block_given_p()?ITER_PRE:ITER_NOT); obj.funcall(getRuby().intern("initialize"), args); // POP_ITER(); return obj; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/12847c6fd28fea4e223d132ced46eb1b4cb9de9a/RubyClass.java/clean/org/jruby/RubyClass.java |
return "DatasetAnnotation"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); | return "DatasetAnnotation"+(attributeId==null ? ":Hash_"+this.hashCode() : ":Id_"+attributeId); | public String toString(){ return "DatasetAnnotation"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/DatasetAnnotation.java/buggy/components/common/src/ome/model/DatasetAnnotation.java |
isName = false; | DatasetEditorManager(DatasetEditor view, DataManagerCtrl agentCtrl, DatasetData model) { this.view = view; this.agentCtrl = agentCtrl; this.model = model; nameChange = false; isName = false; imagesToRemove = new ArrayList(); imagesToAdd = new ArrayList(); imagesToAddToRemove = new ArrayList(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/DatasetEditorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/editors/dataset/DatasetEditorManager.java |
|
nameField.addMouseListener(this); | void initListeners() { //buttons attachButtonListener(view.getViewButton(), VIEW); attachButtonListener(view.getSaveButton(), SAVE); attachButtonListener(view.getAddButton(), ADD); attachButtonListener(view.getRemoveButton(), REMOVE); attachButtonListener(view.getResetButton(), RESET); attachButtonListener(view.getRemoveToAddButton(), REMOVE_ADDED); attachButtonListener(view.getResetToAddButton(), RESET_ADDED); //textfields JTextArea nameField = view.getNameArea(); nameField.getDocument().addDocumentListener(this); nameField.addMouseListener(this); JTextArea descriptionArea = view.getDescriptionArea(); descriptionArea.getDocument().addDocumentListener(this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/DatasetEditorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/editors/dataset/DatasetEditorManager.java |
|
view.getSaveButton().setEnabled(isName); | view.getSaveButton().setEnabled(true); | public void insertUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/DatasetEditorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/editors/dataset/DatasetEditorManager.java |
view.getSaveButton().setEnabled(isName); | view.getSaveButton().setEnabled(true); | public void removeUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/DatasetEditorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/editors/dataset/DatasetEditorManager.java |
Debug.log(" - Logger initialized at '"+ new Date( System.currentTimeMillis() )+ "'."); Debug.log(" - commandline args: " + StringTool.stringArrayToSpaceSeparatedString(args) ); | public static void main(String[] args) { // OS X tweakings if (System.getProperty("mrj.version") != null) { System.setProperty("com.apple.mrj.application.apple.menu.about.name", "IzPack"); System.setProperty("com.apple.mrj.application.growbox.intrudes", "false"); System.setProperty("com.apple.mrj.application.live-resize", "true"); } try { if (args.length == 0) { // can't load the GUIInstaller class on headless machines, // so we use Class.forName to force lazy loading. Class.forName("com.izforge.izpack.installer.GUIInstaller").newInstance(); } else { new AutomatedInstaller(args[0]); } } catch (Exception e) { System.err.println("- Error -"); System.err.println(e.toString()); e.printStackTrace(); System.exit(0); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/901691ffcae75af212c9a08281f3593d9a560a39/Installer.java/clean/src/lib/com/izforge/izpack/installer/Installer.java |
|
if( LOG == true ) | if(LOG ) | public static void log( Object o ) { //if LOG was given if( LOG == true ) { if( ( logfile = getLogFile( ) ) == null ) { logfile = createLogFile( ); } if( logfile != null ) { if( o == null ) { o = "null"; } logfile.println( o ); if( o instanceof Throwable ) { ( (Throwable) o ).printStackTrace( logfile ); } logfile.flush( ); //logfile.close(); //logFile = null; } else { System.err.println( "Cannot write into logfile: (" + logfile + ") <- '" + o + "'" ); } } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Debug.java/buggy/src/lib/com/izforge/izpack/util/Debug.java |
if( ( logfile = getLogFile( ) ) == null ) { logfile = createLogFile( ); } | PrintWriter logfile; if( ( logfile = getLogFile( ) ) == null ) { logfile = createLogFile( ); } | public static void log( Object o ) { //if LOG was given if( LOG == true ) { if( ( logfile = getLogFile( ) ) == null ) { logfile = createLogFile( ); } if( logfile != null ) { if( o == null ) { o = "null"; } logfile.println( o ); if( o instanceof Throwable ) { ( (Throwable) o ).printStackTrace( logfile ); } logfile.flush( ); //logfile.close(); //logFile = null; } else { System.err.println( "Cannot write into logfile: (" + logfile + ") <- '" + o + "'" ); } } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Debug.java/buggy/src/lib/com/izforge/izpack/util/Debug.java |
AutomatedInstallData idata = new AutomatedInstallData(); | public AutomatedInstaller(String inputFilename) throws Exception { super(); File input = new File(inputFilename); // Loads the installation data AutomatedInstallData idata = new AutomatedInstallData(); // Loads the installation data loadInstallData(idata); // Loads the xml data idata.xmlData = getXMLData(input); // Loads the langpack idata.localeISO3 = idata.xmlData.getAttribute("langpack", "eng"); InputStream in = getClass().getResourceAsStream("/langpacks/" + idata.localeISO3 + ".xml"); idata.langpack = new LocaleDatabase(in); idata.setVariable(ScriptParser.ISO3_LANG, idata.localeISO3); // create the resource manager singleton ResourceManager.create (idata); this.panelInstanceCount = new TreeMap(); doInstall(idata); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/buggy/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java |
|
InputStream in = getClass().getResourceAsStream("/langpacks/" + idata.localeISO3 + ".xml"); | InputStream in = getClass().getResourceAsStream("/langpacks/" + idata.localeISO3 + ".xml"); | public AutomatedInstaller(String inputFilename) throws Exception { super(); File input = new File(inputFilename); // Loads the installation data AutomatedInstallData idata = new AutomatedInstallData(); // Loads the installation data loadInstallData(idata); // Loads the xml data idata.xmlData = getXMLData(input); // Loads the langpack idata.localeISO3 = idata.xmlData.getAttribute("langpack", "eng"); InputStream in = getClass().getResourceAsStream("/langpacks/" + idata.localeISO3 + ".xml"); idata.langpack = new LocaleDatabase(in); idata.setVariable(ScriptParser.ISO3_LANG, idata.localeISO3); // create the resource manager singleton ResourceManager.create (idata); this.panelInstanceCount = new TreeMap(); doInstall(idata); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/buggy/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java |
ResourceManager.create (idata); | ResourceManager.create(idata); | public AutomatedInstaller(String inputFilename) throws Exception { super(); File input = new File(inputFilename); // Loads the installation data AutomatedInstallData idata = new AutomatedInstallData(); // Loads the installation data loadInstallData(idata); // Loads the xml data idata.xmlData = getXMLData(input); // Loads the langpack idata.localeISO3 = idata.xmlData.getAttribute("langpack", "eng"); InputStream in = getClass().getResourceAsStream("/langpacks/" + idata.localeISO3 + ".xml"); idata.langpack = new LocaleDatabase(in); idata.setVariable(ScriptParser.ISO3_LANG, idata.localeISO3); // create the resource manager singleton ResourceManager.create (idata); this.panelInstanceCount = new TreeMap(); doInstall(idata); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6629f6e7b4d88c756f0670c257942fdabc2ec0f1/AutomatedInstaller.java/buggy/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java |
public SoftReferenceObjectPool(PoolableObjectFactory factory) { | public SoftReferenceObjectPool() { | public SoftReferenceObjectPool(PoolableObjectFactory factory) { _pool = new ArrayList(); _factory = factory; } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/SoftReferenceObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java |
_factory = factory; | _factory = null; | public SoftReferenceObjectPool(PoolableObjectFactory factory) { _pool = new ArrayList(); _factory = factory; } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/SoftReferenceObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java |
public void run() { instances.add(this); try { listener.startUnpack(); String currentOs = System.getProperty("os.name").toLowerCase(); // // Initialisations FileOutputStream out = null; ArrayList parsables = new ArrayList(); ArrayList executables = new ArrayList(); List packs = idata.selectedPacks; int npacks = packs.size(); udata = UninstallData.getInstance(); // Specific to the web installers if (idata.kind.equalsIgnoreCase("web") || idata.kind.equalsIgnoreCase("web-kunststoff")) { InputStream kin = getClass().getResourceAsStream("/res/WebInstallers.url"); BufferedReader kreader = new BufferedReader(new InputStreamReader(kin)); jarLocation = kreader.readLine(); } // We unpack the selected packs for (int i = 0; i < npacks; i++) { // We get the pack stream int n = idata.availablePacks.indexOf(packs.get(i)); ObjectInputStream objIn = new ObjectInputStream(getPackAsStream(n)); // We unpack the files int nfiles = objIn.readInt(); listener.changeUnpack(0, nfiles, ((Pack) packs.get(i)).name); for (int j = 0; j < nfiles; j++) { // We read the header PackFile pf = (PackFile) objIn.readObject(); if (null == pf.os || currentOs.indexOf(pf.os.toLowerCase()) > -1) { // We translate & build the path String path = translatePath(pf.targetPath); File pathFile = new File(path); String fname = pathFile.getName(); int z = fname.length(); File dest = pathFile.getParentFile(); if (!dest.exists()) dest.mkdirs(); // We add the path to the log, udata.addFile(path); listener.progressUnpack(j, path); //if this file exists and shouldnot override skip this file if (((pf.override == false) && (pathFile.exists()))) { objIn.skip(pf.length); continue; } // We copy the file out = new FileOutputStream(path); byte[] buffer = new byte[5120]; long bytesCopied = 0; while (bytesCopied < pf.length) { int maxBytes = (pf.length - bytesCopied < buffer.length ? (int) (pf.length - bytesCopied) : buffer.length); int bytesInBuffer = objIn.read(buffer, 0, maxBytes); if (bytesInBuffer == -1) throw new IOException("Unexpected end of stream"); out.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } // Cleanings out.close(); // Empty dirs restoring String _n = pathFile.getName(); if (_n.startsWith("izpack-keepme") && _n.endsWith(".tmp")) pathFile.delete(); } else objIn.skip(pf.length); } // Load information about parsable files int numParsables = objIn.readInt(); int k; for (k = 0; k < numParsables; k++) { ParsableFile pf = (ParsableFile) objIn.readObject(); pf.path = translatePath(pf.path); parsables.add(pf); } // Load information about executable files int numExecutables = objIn.readInt(); for (k = 0; k < numExecutables; k++) { ExecutableFile ef = (ExecutableFile) objIn.readObject(); ef.path = translatePath(ef.path); if (null != ef.argList && !ef.argList.isEmpty()) { String arg = null; for (int j = 0; j < ef.argList.size(); j++) { arg = (String) ef.argList.get(j); arg = translatePath(arg); ef.argList.set(j, arg); } } executables.add(ef); } objIn.close(); } // We use the scripts parser ScriptParser parser = new ScriptParser(parsables, vs); parser.parseFiles(); // We use the file executor FileExecutor executor = new FileExecutor(executables); if (executor.executeFiles() != 0) javax.swing.JOptionPane.showMessageDialog( null, "The installation was not completed.", "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); // We put the uninstaller putUninstaller(); // The end :-) listener.stopUnpack(); } catch (Exception err) { listener.stopUnpack(); listener.errorUnpack(err.toString()); } instances.remove(instances.indexOf(this)); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Unpacker.java/buggy/src/lib/com/izforge/izpack/installer/Unpacker.java |
||
if (executor.executeFiles() != 0) | if (executor.executeFiles(ExecutableFile.POSTINSTALL) != 0) | public void run() { instances.add(this); try { listener.startUnpack(); String currentOs = System.getProperty("os.name").toLowerCase(); // // Initialisations FileOutputStream out = null; ArrayList parsables = new ArrayList(); ArrayList executables = new ArrayList(); List packs = idata.selectedPacks; int npacks = packs.size(); udata = UninstallData.getInstance(); // Specific to the web installers if (idata.kind.equalsIgnoreCase("web") || idata.kind.equalsIgnoreCase("web-kunststoff")) { InputStream kin = getClass().getResourceAsStream("/res/WebInstallers.url"); BufferedReader kreader = new BufferedReader(new InputStreamReader(kin)); jarLocation = kreader.readLine(); } // We unpack the selected packs for (int i = 0; i < npacks; i++) { // We get the pack stream int n = idata.availablePacks.indexOf(packs.get(i)); ObjectInputStream objIn = new ObjectInputStream(getPackAsStream(n)); // We unpack the files int nfiles = objIn.readInt(); listener.changeUnpack(0, nfiles, ((Pack) packs.get(i)).name); for (int j = 0; j < nfiles; j++) { // We read the header PackFile pf = (PackFile) objIn.readObject(); if (null == pf.os || currentOs.indexOf(pf.os.toLowerCase()) > -1) { // We translate & build the path String path = translatePath(pf.targetPath); File pathFile = new File(path); String fname = pathFile.getName(); int z = fname.length(); File dest = pathFile.getParentFile(); if (!dest.exists()) dest.mkdirs(); // We add the path to the log, udata.addFile(path); listener.progressUnpack(j, path); //if this file exists and shouldnot override skip this file if (((pf.override == false) && (pathFile.exists()))) { objIn.skip(pf.length); continue; } // We copy the file out = new FileOutputStream(path); byte[] buffer = new byte[5120]; long bytesCopied = 0; while (bytesCopied < pf.length) { int maxBytes = (pf.length - bytesCopied < buffer.length ? (int) (pf.length - bytesCopied) : buffer.length); int bytesInBuffer = objIn.read(buffer, 0, maxBytes); if (bytesInBuffer == -1) throw new IOException("Unexpected end of stream"); out.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; } // Cleanings out.close(); // Empty dirs restoring String _n = pathFile.getName(); if (_n.startsWith("izpack-keepme") && _n.endsWith(".tmp")) pathFile.delete(); } else objIn.skip(pf.length); } // Load information about parsable files int numParsables = objIn.readInt(); int k; for (k = 0; k < numParsables; k++) { ParsableFile pf = (ParsableFile) objIn.readObject(); pf.path = translatePath(pf.path); parsables.add(pf); } // Load information about executable files int numExecutables = objIn.readInt(); for (k = 0; k < numExecutables; k++) { ExecutableFile ef = (ExecutableFile) objIn.readObject(); ef.path = translatePath(ef.path); if (null != ef.argList && !ef.argList.isEmpty()) { String arg = null; for (int j = 0; j < ef.argList.size(); j++) { arg = (String) ef.argList.get(j); arg = translatePath(arg); ef.argList.set(j, arg); } } executables.add(ef); } objIn.close(); } // We use the scripts parser ScriptParser parser = new ScriptParser(parsables, vs); parser.parseFiles(); // We use the file executor FileExecutor executor = new FileExecutor(executables); if (executor.executeFiles() != 0) javax.swing.JOptionPane.showMessageDialog( null, "The installation was not completed.", "Installation warning", javax.swing.JOptionPane.WARNING_MESSAGE); // We put the uninstaller putUninstaller(); // The end :-) listener.stopUnpack(); } catch (Exception err) { listener.stopUnpack(); listener.errorUnpack(err.toString()); } instances.remove(instances.indexOf(this)); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/Unpacker.java/buggy/src/lib/com/izforge/izpack/installer/Unpacker.java |
if (! OsConstraint.oneMatchesCurrentSystem (pfile.osConstraints)) | if (!OsConstraint.oneMatchesCurrentSystem(pfile.osConstraints)) | public void parseFiles() throws Exception { // Parses the files Iterator iter = files.iterator(); while (iter.hasNext()) { // Create a temporary file for the parsed data // (Use the same directory so that renaming works later) ParsableFile pfile = (ParsableFile) iter.next(); // check whether the OS matches if (! OsConstraint.oneMatchesCurrentSystem (pfile.osConstraints)) { continue; } File file = new File(pfile.path); File parsedFile = File.createTempFile("izpp", null, file.getParentFile()); // Parses the file // (Use buffering because substitutor processes byte at a time) FileInputStream inFile = new FileInputStream(file); BufferedInputStream in = new BufferedInputStream(inFile, 5120); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream out = new BufferedOutputStream(outFile, 5120); vs.substitute(in, out, pfile.type, pfile.encoding); in.close(); out.close(); // Replace the original file with the parsed one file.delete(); if (!parsedFile.renameTo(file)) throw new IOException ("Could not rename file " + parsedFile + " to " + file); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/ScriptParser.java/buggy/src/lib/com/izforge/izpack/installer/ScriptParser.java |
File parsedFile = File.createTempFile("izpp", null, file.getParentFile()); | File parsedFile = File.createTempFile("izpp", null, file.getParentFile()); | public void parseFiles() throws Exception { // Parses the files Iterator iter = files.iterator(); while (iter.hasNext()) { // Create a temporary file for the parsed data // (Use the same directory so that renaming works later) ParsableFile pfile = (ParsableFile) iter.next(); // check whether the OS matches if (! OsConstraint.oneMatchesCurrentSystem (pfile.osConstraints)) { continue; } File file = new File(pfile.path); File parsedFile = File.createTempFile("izpp", null, file.getParentFile()); // Parses the file // (Use buffering because substitutor processes byte at a time) FileInputStream inFile = new FileInputStream(file); BufferedInputStream in = new BufferedInputStream(inFile, 5120); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream out = new BufferedOutputStream(outFile, 5120); vs.substitute(in, out, pfile.type, pfile.encoding); in.close(); out.close(); // Replace the original file with the parsed one file.delete(); if (!parsedFile.renameTo(file)) throw new IOException ("Could not rename file " + parsedFile + " to " + file); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/ScriptParser.java/buggy/src/lib/com/izforge/izpack/installer/ScriptParser.java |
throw new IOException ("Could not rename file " + parsedFile + " to " + file); | throw new IOException( "Could not rename file " + parsedFile + " to " + file); | public void parseFiles() throws Exception { // Parses the files Iterator iter = files.iterator(); while (iter.hasNext()) { // Create a temporary file for the parsed data // (Use the same directory so that renaming works later) ParsableFile pfile = (ParsableFile) iter.next(); // check whether the OS matches if (! OsConstraint.oneMatchesCurrentSystem (pfile.osConstraints)) { continue; } File file = new File(pfile.path); File parsedFile = File.createTempFile("izpp", null, file.getParentFile()); // Parses the file // (Use buffering because substitutor processes byte at a time) FileInputStream inFile = new FileInputStream(file); BufferedInputStream in = new BufferedInputStream(inFile, 5120); FileOutputStream outFile = new FileOutputStream(parsedFile); BufferedOutputStream out = new BufferedOutputStream(outFile, 5120); vs.substitute(in, out, pfile.type, pfile.encoding); in.close(); out.close(); // Replace the original file with the parsed one file.delete(); if (!parsedFile.renameTo(file)) throw new IOException ("Could not rename file " + parsedFile + " to " + file); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/ScriptParser.java/buggy/src/lib/com/izforge/izpack/installer/ScriptParser.java |
message = new String("Failed to execute " + file.toString() + "."); | message = "Failed to execute " + file.toString() + "."; | public int executeFiles(int currentStage, AbstractUIHandler handler) { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); //String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; String permissions = "a+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { ExecutableFile efile = (ExecutableFile) efileIterator.next(); boolean deleteAfterwards = ! efile.keepFile; File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // skip file if not for current OS (it might not have been installed at all) if (! OsConstraint.oneMatchesCurrentSystem (efile.osList)) continue; if(currentStage!=ExecutableFile.UNINSTALL) { // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); if (exitStatus != 0) { handler.emitError("file execution error", "Error executing \n"+ params[0]+" "+params[1]+" "+params[2]); continue; } } } // execute command in POSTINSTALL stage if ((exitStatus == 0) && ((currentStage == ExecutableFile.POSTINSTALL && efile.executionStage == ExecutableFile.POSTINSTALL) || (currentStage==ExecutableFile.UNINSTALL && efile.executionStage == ExecutableFile.UNINSTALL))) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp"); paramList.add(file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) { // CHECKME: let the user decide or abort anyway? handler.emitError("file execution error", message); } else if (efile.onFailure == ExecutableFile.WARN) { // CHECKME: let the user decide or abort anyway? handler.emitWarning ("file execution error", message); exitStatus = 0; } else { if (handler.askQuestion (null, "Continue?", AbstractUIHandler.CHOICES_YES_NO) == AbstractUIHandler.ANSWER_YES) exitStatus = 0; } } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/FileExecutor.java/buggy/src/lib/com/izforge/izpack/util/FileExecutor.java |
int getNumActive() throws UnsupportedOperationException; | int getNumActive(Object key) throws UnsupportedOperationException; | int getNumActive() throws UnsupportedOperationException; | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/KeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/KeyedObjectPool.java |
int getNumIdle() throws UnsupportedOperationException; | int getNumIdle(Object key) throws UnsupportedOperationException; | int getNumIdle() throws UnsupportedOperationException; | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/KeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/KeyedObjectPool.java |
public static ObjectPool adapt(final KeyedObjectPool keyedPool) throws IllegalArgumentException { return adapt(keyedPool, new Object()); | public static PoolableObjectFactory adapt(final KeyedPoolableObjectFactory keyedFactory) throws IllegalArgumentException { return adapt(keyedFactory, new Object()); | public static ObjectPool adapt(final KeyedObjectPool keyedPool) throws IllegalArgumentException { return adapt(keyedPool, new Object()); } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
public static TimerTask checkMinIdle(final KeyedObjectPool keyedPool, final Object key, final int minIdle, final long period) throws IllegalArgumentException { if (keyedPool == null) { | public static TimerTask checkMinIdle(final ObjectPool pool, final int minIdle, final long period) throws IllegalArgumentException { if (pool == null) { | public static TimerTask checkMinIdle(final KeyedObjectPool keyedPool, final Object key, final int minIdle, final long period) throws IllegalArgumentException { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } if (key == null) { throw new IllegalArgumentException("key must not be null."); } if (minIdle < 0) { throw new IllegalArgumentException("minIdle must be non-negative."); } final TimerTask task = new KeyedObjectPoolMinIdleTimerTask(keyedPool, key, minIdle); getMinIdleTimer().schedule(task, 0L, period); return task; } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
} if (key == null) { throw new IllegalArgumentException("key must not be null."); | public static TimerTask checkMinIdle(final KeyedObjectPool keyedPool, final Object key, final int minIdle, final long period) throws IllegalArgumentException { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } if (key == null) { throw new IllegalArgumentException("key must not be null."); } if (minIdle < 0) { throw new IllegalArgumentException("minIdle must be non-negative."); } final TimerTask task = new KeyedObjectPoolMinIdleTimerTask(keyedPool, key, minIdle); getMinIdleTimer().schedule(task, 0L, period); return task; } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
|
final TimerTask task = new KeyedObjectPoolMinIdleTimerTask(keyedPool, key, minIdle); | final TimerTask task = new ObjectPoolMinIdleTimerTask(pool, minIdle); | public static TimerTask checkMinIdle(final KeyedObjectPool keyedPool, final Object key, final int minIdle, final long period) throws IllegalArgumentException { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } if (key == null) { throw new IllegalArgumentException("key must not be null."); } if (minIdle < 0) { throw new IllegalArgumentException("minIdle must be non-negative."); } final TimerTask task = new KeyedObjectPoolMinIdleTimerTask(keyedPool, key, minIdle); getMinIdleTimer().schedule(task, 0L, period); return task; } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory) { this(factory,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); | public GenericKeyedObjectPool() { 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); | public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory) { this(factory,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/040416e9a1f3dc7bd49171b76ed6a766164e6fed/GenericKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java |
public GenericObjectPool(PoolableObjectFactory factory) { this(factory,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_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(PoolableObjectFactory factory) { this(factory,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); } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/040416e9a1f3dc7bd49171b76ed6a766164e6fed/GenericObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
public static KeyedObjectPool checkedPool(final KeyedObjectPool keyedPool, final Class type) { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); | public static ObjectPool checkedPool(final ObjectPool pool, final Class type) { if (pool == null) { throw new IllegalArgumentException("pool must not be null."); | public static KeyedObjectPool checkedPool(final KeyedObjectPool keyedPool, final Class type) { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } if (type == null) { throw new IllegalArgumentException("type must not be null."); } return new CheckedKeyedObjectPool(keyedPool, type); } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
return new CheckedKeyedObjectPool(keyedPool, type); | return new CheckedObjectPool(pool, type); | public static KeyedObjectPool checkedPool(final KeyedObjectPool keyedPool, final Class type) { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } if (type == null) { throw new IllegalArgumentException("type must not be null."); } return new CheckedKeyedObjectPool(keyedPool, type); } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
public static KeyedObjectPool erodingPool(final KeyedObjectPool keyedPool) { return erodingPool(keyedPool, 1f); | public static ObjectPool erodingPool(final ObjectPool pool) { return erodingPool(pool, 1f); | public static KeyedObjectPool erodingPool(final KeyedObjectPool keyedPool) { return erodingPool(keyedPool, 1f); } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
public static void prefill(final KeyedObjectPool keyedPool, final Object key, final int count) throws Exception, IllegalArgumentException { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } if (key == null) { throw new IllegalArgumentException("key must not be null."); | public static void prefill(final ObjectPool pool, final int count) throws Exception, IllegalArgumentException { if (pool == null) { throw new IllegalArgumentException("pool must not be null."); | public static void prefill(final KeyedObjectPool keyedPool, final Object key, final int count) throws Exception, IllegalArgumentException { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } if (key == null) { throw new IllegalArgumentException("key must not be null."); } for (int i = 0; i < count; i++) { keyedPool.addObject(key); } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
keyedPool.addObject(key); | pool.addObject(); | public static void prefill(final KeyedObjectPool keyedPool, final Object key, final int count) throws Exception, IllegalArgumentException { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } if (key == null) { throw new IllegalArgumentException("key must not be null."); } for (int i = 0; i < count; i++) { keyedPool.addObject(key); } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
public static KeyedObjectPool synchronizedPool(final KeyedObjectPool keyedPool) { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); | public static ObjectPool synchronizedPool(final ObjectPool pool) { if (pool == null) { throw new IllegalArgumentException("pool must not be null."); | public static KeyedObjectPool synchronizedPool(final KeyedObjectPool keyedPool) { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } assert !(keyedPool instanceof GenericKeyedObjectPool) : "GenericKeyedObjectPool is already thread-safe"; assert !(keyedPool instanceof StackKeyedObjectPool) : "StackKeyedObjectPool is already thread-safe"; assert !"org.apache.commons.pool.composite.CompositeKeyedObjectPool".equals(keyedPool.getClass().getName()) : "CompositeKeyedObjectPools are already thread-safe"; return new SynchronizedKeyedObjectPool(keyedPool); } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
assert !(keyedPool instanceof GenericKeyedObjectPool) : "GenericKeyedObjectPool is already thread-safe"; assert !(keyedPool instanceof StackKeyedObjectPool) : "StackKeyedObjectPool is already thread-safe"; assert !"org.apache.commons.pool.composite.CompositeKeyedObjectPool".equals(keyedPool.getClass().getName()) : "CompositeKeyedObjectPools are already thread-safe"; return new SynchronizedKeyedObjectPool(keyedPool); | assert !(pool instanceof GenericObjectPool) : "GenericObjectPool is already thread-safe"; assert !(pool instanceof SoftReferenceObjectPool) : "SoftReferenceObjectPool is already thread-safe"; assert !(pool instanceof StackObjectPool) : "StackObjectPool is already thread-safe"; assert !"org.apache.commons.pool.composite.CompositeObjectPool".equals(pool.getClass().getName()) : "CompositeObjectPools are already thread-safe"; return new SynchronizedObjectPool(pool); | public static KeyedObjectPool synchronizedPool(final KeyedObjectPool keyedPool) { if (keyedPool == null) { throw new IllegalArgumentException("keyedPool must not be null."); } assert !(keyedPool instanceof GenericKeyedObjectPool) : "GenericKeyedObjectPool is already thread-safe"; assert !(keyedPool instanceof StackKeyedObjectPool) : "StackKeyedObjectPool is already thread-safe"; assert !"org.apache.commons.pool.composite.CompositeKeyedObjectPool".equals(keyedPool.getClass().getName()) : "CompositeKeyedObjectPools are already thread-safe"; return new SynchronizedKeyedObjectPool(keyedPool); } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
public static KeyedPoolableObjectFactory synchronizedPoolableFactory(final KeyedPoolableObjectFactory keyedFactory) { return new SynchronizedKeyedPoolableObjectFactory(keyedFactory); | public static PoolableObjectFactory synchronizedPoolableFactory(final PoolableObjectFactory factory) { return new SynchronizedPoolableObjectFactory(factory); | public static KeyedPoolableObjectFactory synchronizedPoolableFactory(final KeyedPoolableObjectFactory keyedFactory) { return new SynchronizedKeyedPoolableObjectFactory(keyedFactory); } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/1313111fc820c43662b3b98672f70316d84ee80c/PoolUtils.java/buggy/src/java/org/apache/commons/pool/PoolUtils.java |
opLabel.setText(""); | opLabel.setText(" "); | public void stopUnpack() { parent.releaseGUI(); parent.lockPrevButton(); installButton.setIcon(parent.icons.getImageIcon("empty")); installButton.setEnabled(false); progressBar.setString(parent.langpack.getString("InstallPanel.finished")); progressBar.setEnabled(false); opLabel.setText(""); opLabel.setEnabled(false); idata.installSuccess = true; idata.canClose = true; validated = true; if (idata.panels.indexOf(this) != (idata.panels.size() - 1)) parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ae80d68d6ed7d1dfbfd2ae4ac3f7467e5fb5e2e0/InstallPanel.java/buggy/src/lib/com/izforge/izpack/panels/InstallPanel.java |
HighlightJButton(String text, Icon icon, Color color) | HighlightJButton(Icon icon, Color color) | HighlightJButton(String text, Icon icon, Color color) { super(text, icon); initButton(color); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/HighlightJButton.java/buggy/src/lib/com/izforge/izpack/gui/HighlightJButton.java |
super(text, icon); | super(icon); | HighlightJButton(String text, Icon icon, Color color) { super(text, icon); initButton(color); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/HighlightJButton.java/buggy/src/lib/com/izforge/izpack/gui/HighlightJButton.java |
public void panelActivate() { } | public void panelActivate() { } | public void panelActivate() { } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPanel.java/buggy/src/lib/com/izforge/izpack/installer/IzPanel.java |
{ color = new ColorUIResource(0, 0, 0); | { color = new ColorUIResource(0, 0, 0); | public IzPackMetalTheme() { color = new ColorUIResource(0, 0, 0); Font font1 = createFont("Tahoma", Font.PLAIN, 11); Font font2 = createFont("Tahoma", Font.BOLD, 11); menuFont = new FontUIResource(font1); controlFont = new FontUIResource(font1); windowTitleFont = new FontUIResource(font2); monospacedFont = new FontUIResource(font1); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
Font font1 = createFont("Tahoma", Font.PLAIN, 11); Font font2 = createFont("Tahoma", Font.BOLD, 11); | Font font1 = createFont("Tahoma", Font.PLAIN, 11); Font font2 = createFont("Tahoma", Font.BOLD, 11); | public IzPackMetalTheme() { color = new ColorUIResource(0, 0, 0); Font font1 = createFont("Tahoma", Font.PLAIN, 11); Font font2 = createFont("Tahoma", Font.BOLD, 11); menuFont = new FontUIResource(font1); controlFont = new FontUIResource(font1); windowTitleFont = new FontUIResource(font2); monospacedFont = new FontUIResource(font1); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
menuFont = new FontUIResource(font1); controlFont = new FontUIResource(font1); windowTitleFont = new FontUIResource(font2); monospacedFont = new FontUIResource(font1); } | menuFont = new FontUIResource(font1); controlFont = new FontUIResource(font1); windowTitleFont = new FontUIResource(font2); monospacedFont = new FontUIResource(font1); } | public IzPackMetalTheme() { color = new ColorUIResource(0, 0, 0); Font font1 = createFont("Tahoma", Font.PLAIN, 11); Font font2 = createFont("Tahoma", Font.BOLD, 11); menuFont = new FontUIResource(font1); controlFont = new FontUIResource(font1); windowTitleFont = new FontUIResource(font2); monospacedFont = new FontUIResource(font1); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
{ return color; } | { return color; } | public ColorUIResource getControlTextColor() { return color; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
{ return color; } | { return color; } | public ColorUIResource getMenuTextColor() { return color; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
{ return color; } | { return color; } | public ColorUIResource getSystemTextColor() { return color; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
{ return color; } | { return color; } | public ColorUIResource getUserTextColor() { return color; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
public MultiLineLabel (String label, int marginWidth, int marginHeight) | public MultiLineLabel (String text, int horMargin, int vertMargin, int maxWidth, int justify) | public MultiLineLabel (String label, int marginWidth, int marginHeight) { this.labelText = label; this.marginWidth = marginWidth; this.marginHeight = marginHeight; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/MultiLineLabel.java/buggy/src/lib/com/izforge/izpack/util/MultiLineLabel.java |
this.labelText = label; this.marginWidth = marginWidth; this.marginHeight = marginHeight; | this.labelText = text; this.marginWidth = horMargin; this.marginHeight = vertMargin; this.maxAllowed = maxWidth; this.maxAllowedSet = true; this.alignment = justify; | public MultiLineLabel (String label, int marginWidth, int marginHeight) { this.labelText = label; this.marginWidth = marginWidth; this.marginHeight = marginHeight; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/MultiLineLabel.java/buggy/src/lib/com/izforge/izpack/util/MultiLineLabel.java |
assertNotNull(pool); | public void testVariousConstructors() throws Exception { { StackKeyedObjectPool pool = new StackKeyedObjectPool(); } { StackKeyedObjectPool pool = new StackKeyedObjectPool(10); } { StackKeyedObjectPool pool = new StackKeyedObjectPool(10,5); } { StackKeyedObjectPool pool = new StackKeyedObjectPool(null); } { StackKeyedObjectPool pool = new StackKeyedObjectPool(null,10); } { StackKeyedObjectPool pool = new StackKeyedObjectPool(null,10,5); } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/3af8cd1f6c73a88cdbc7976a676b4169778823d9/TestStackKeyedObjectPool.java/clean/src/test/org/apache/commons/pool/impl/TestStackKeyedObjectPool.java |
|
public StackKeyedObjectPool(KeyedPoolableObjectFactory factory, int max) { this(factory,max,DEFAULT_INIT_SLEEPING_CAPACITY); | public StackKeyedObjectPool() { this((KeyedPoolableObjectFactory)null,DEFAULT_MAX_SLEEPING,DEFAULT_INIT_SLEEPING_CAPACITY); | public StackKeyedObjectPool(KeyedPoolableObjectFactory factory, int max) { this(factory,max,DEFAULT_INIT_SLEEPING_CAPACITY); } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/0cb929e62f4a0e70106497426bf6922eab710f51/StackKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java |
public int getNumActive(Object key) { try { return ((Integer)_activeCount.get(key)).intValue(); } catch(NoSuchElementException e) { return 0; } catch(NullPointerException e) { return 0; } | public int getNumActive() { return _totActive; | public int getNumActive(Object key) { try { return ((Integer)_activeCount.get(key)).intValue(); } catch(NoSuchElementException e) { return 0; } catch(NullPointerException e) { return 0; } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/0cb929e62f4a0e70106497426bf6922eab710f51/StackKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java |
public synchronized int getNumIdle(Object key) { try { return((Stack)(_pools.get(key))).size(); } catch(Exception e) { return 0; } | public int getNumIdle() { return _totIdle; | public synchronized int getNumIdle(Object key) { try { return((Stack)(_pools.get(key))).size(); } catch(Exception e) { return 0; } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/0cb929e62f4a0e70106497426bf6922eab710f51/StackKeyedObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java |
executablesList = new ArrayList(); | private UninstallData() { filesList = new ArrayList(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/UninstallData.java/buggy/src/lib/com/izforge/izpack/installer/UninstallData.java |
|
public void addExecutable(String path) | public void addExecutable(ExecutableFile file) | public void addExecutable(String path) { executablesList.add(path); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/UninstallData.java/buggy/src/lib/com/izforge/izpack/installer/UninstallData.java |
executablesList.add(path); | executablesList.add(file); | public void addExecutable(String path) { executablesList.add(path); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/UninstallData.java/buggy/src/lib/com/izforge/izpack/installer/UninstallData.java |
public ArrayList getExecutablesList() | public List getExecutablesList() | public ArrayList getExecutablesList() { return executablesList; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/UninstallData.java/buggy/src/lib/com/izforge/izpack/installer/UninstallData.java |
public ArrayList getFilesList() | public List getFilesList() | public ArrayList getFilesList() { return filesList; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/85d99afd9a4052ba0a6796445a7aa6be8c4054c9/UninstallData.java/buggy/src/lib/com/izforge/izpack/installer/UninstallData.java |
public synchronized Object borrowObject() throws Exception { | public Object borrowObject() throws Exception { | 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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
try { pair = (ObjectTimestampPair)(_pool.removeFirst()); } catch(NoSuchElementException e) { ; /* ignored */ | if (!_pool.isEmpty()) { synchronized(this) { try { _numActive++; pair = (ObjectTimestampPair)(_pool.removeFirst()); } catch(NoSuchElementException e) { ; /* ignored */ } if(null == pair) { _numActive--; notifyAll(); } } | 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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; | try { _numActive++; Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } finally { if(null == pair) { synchronized(this) { _numActive--; notifyAll(); } } } | 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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); | try { _numActive++; Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } finally { if(null == pair) { synchronized(this) { _numActive--; notifyAll(); } } } | 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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
try { if(_maxWait <= 0) { wait(); | synchronized(this) { if (_pool.isEmpty()) { try { if(_maxWait <= 0) { wait(); } else { wait(_maxWait); } } catch(InterruptedException e) { } } if(_maxWait > 0 && ((System.currentTimeMillis() - starttime) >= _maxWait)) { throw new NoSuchElementException("Timeout waiting for idle object"); | 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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
wait(_maxWait); | continue; | 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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
} catch(InterruptedException e) { } if(_maxWait > 0 && ((System.currentTimeMillis() - starttime) >= _maxWait)) { throw new NoSuchElementException("Timeout waiting for idle object"); } else { continue; | 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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
|
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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
||
_numActive++; | 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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
|
synchronized(this) { _numActive--; notifyAll(); } | 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) { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); 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 " + _whenExhaustedAction + " not recognized."); } } } try { _factory.activateObject(pair.value); if(_testOnBorrow && !_factory.validateObject(pair.value)) { throw new Exception("validateObject failed"); } _numActive++; return pair.value; } catch (Exception e) { try { _factory.destroyObject(pair.value); } catch (Exception e2) { // cannot destroy broken object } if(newlyCreated) { throw new NoSuchElementException("Could not create a validated object"); } else { continue; // keep looping } } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/161f3b9b1dce39597b8e5db56c57ef978aa4ed63/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
|
public StdXMLReader(InputStream stream) throws IOException | public StdXMLReader(String publicID, String systemID) throws MalformedURLException, FileNotFoundException, IOException | public StdXMLReader(InputStream stream) throws IOException { StringBuffer charsRead = new StringBuffer(); Reader reader = this.stream2reader(stream, charsRead); this.currentLineReader = new LineNumberReader(reader); this.currentPbReader = new PushbackReader(this.currentLineReader, 2); this.pbreaders = new Stack(); this.linereaders = new Stack(); this.publicIds = new Stack(); this.systemIds = new Stack(); this.currentPublicID = ""; try { this.currentSystemID = new URL("file:."); } catch (MalformedURLException e) { // never happens } this.startNewStream(new StringReader(charsRead.toString())); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/StdXMLReader.java/buggy/src/lib/net/n3/nanoxml/StdXMLReader.java |
StringBuffer charsRead = new StringBuffer(); Reader reader = this.stream2reader(stream, charsRead); | URL systemIDasURL = null; try { systemIDasURL = new URL(systemID); } catch (MalformedURLException e) { systemID = "file:" + systemID; try { systemIDasURL = new URL(systemID); } catch (MalformedURLException e2) { throw e; } } Reader reader = this.openStream(publicID, systemIDasURL.toString()); | public StdXMLReader(InputStream stream) throws IOException { StringBuffer charsRead = new StringBuffer(); Reader reader = this.stream2reader(stream, charsRead); this.currentLineReader = new LineNumberReader(reader); this.currentPbReader = new PushbackReader(this.currentLineReader, 2); this.pbreaders = new Stack(); this.linereaders = new Stack(); this.publicIds = new Stack(); this.systemIds = new Stack(); this.currentPublicID = ""; try { this.currentSystemID = new URL("file:."); } catch (MalformedURLException e) { // never happens } this.startNewStream(new StringReader(charsRead.toString())); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/StdXMLReader.java/buggy/src/lib/net/n3/nanoxml/StdXMLReader.java |
this.currentPublicID = ""; try { this.currentSystemID = new URL("file:."); } catch (MalformedURLException e) { } this.startNewStream(new StringReader(charsRead.toString())); | this.currentPublicID = publicID; this.currentSystemID = systemIDasURL; | public StdXMLReader(InputStream stream) throws IOException { StringBuffer charsRead = new StringBuffer(); Reader reader = this.stream2reader(stream, charsRead); this.currentLineReader = new LineNumberReader(reader); this.currentPbReader = new PushbackReader(this.currentLineReader, 2); this.pbreaders = new Stack(); this.linereaders = new Stack(); this.publicIds = new Stack(); this.systemIds = new Stack(); this.currentPublicID = ""; try { this.currentSystemID = new URL("file:."); } catch (MalformedURLException e) { // never happens } this.startNewStream(new StringReader(charsRead.toString())); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/StdXMLReader.java/buggy/src/lib/net/n3/nanoxml/StdXMLReader.java |
{ Font font = new Font(name, style, size); return ((font == null) ? new Font("Dialog", style, size) : font); } | { Font font = new Font(name, style, size); return ((font == null) ? new Font("Dialog", style, size) : font); } | private Font createFont(String name, int style, int size) { Font font = new Font(name, style, size); return ((font == null) ? new Font("Dialog", style, size) : font); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
{ return controlFont; } | { return controlFont; } | public FontUIResource getControlTextFont() { return controlFont; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
{ return menuFont; } | { return menuFont; } | public FontUIResource getMenuTextFont() { return menuFont; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
{ return controlFont; } | { return controlFont; } | public FontUIResource getSystemTextFont() { return controlFont; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
{ return controlFont; } | { return controlFont; } | public FontUIResource getUserTextFont() { return controlFont; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
{ return windowTitleFont; } | { return windowTitleFont; } | public FontUIResource getWindowTitleFont() { return windowTitleFont; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/IzPackMetalTheme.java/buggy/src/lib/com/izforge/izpack/gui/IzPackMetalTheme.java |
if(_maxActive <= 0 || _numActive < _maxActive) { | if(_maxActive < 0 || _numActive < _maxActive) { | public Object borrowObject() throws Exception { long starttime = System.currentTimeMillis(); boolean newlyCreated = false; for(;;) { ObjectTimestampPair pair = null; synchronized(this) { assertOpen(); // 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(); 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 " + _whenExhaustedAction + " not recognized."); } } } _numActive++; } // end synchronized // create new object when needed if(null == pair) { try { Object obj = _factory.makeObject(); pair = new ObjectTimestampPair(obj); newlyCreated = true; } catch (Exception e) { // object cannot be created synchronized(this) { _numActive--; notifyAll(); } throw 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 (Exception e) { // object cannot be activated or is invalid synchronized(this) { _numActive--; notifyAll(); } try { _factory.destroyObject(pair.value); } catch (Exception 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/61141d2f6a2a4013587053826e8caa92df7ff660/GenericObjectPool.java/buggy/src/java/org/apache/commons/pool/impl/GenericObjectPool.java |
ImageIcon icon = rm.getImageIconResource("Installer.image"); | ImageIcon icon; try { icon = rm.getImageIconResource("Installer.image"); } catch (Exception e) { icon = rm.getImageIconResource("Installer.image.0"); } | private void buildGUI() { // Sets the frame icon setIconImage(icons.getImageIcon("JFrameIcon").getImage()); // Prepares the glass pane to block the gui interaction when needed JPanel glassPane = (JPanel) getGlassPane(); glassPane.addMouseListener(new MouseAdapter() { }); glassPane.addMouseMotionListener(new MouseMotionAdapter() { }); glassPane.addKeyListener(new KeyAdapter() { }); // We set the layout & prepare the constraint object contentPane = (JPanel) getContentPane(); contentPane.setLayout(new BorderLayout()); //layout); // We add the panels container panelsContainer = new JPanel(); panelsContainer.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); panelsContainer.setLayout(new GridLayout(1, 1)); contentPane.add(panelsContainer, BorderLayout.CENTER); // We put the first panel installdata.curPanelNumber = 0; IzPanel panel_0 = (IzPanel) installdata.panels.get(0); panelsContainer.add(panel_0); // We add the navigation buttons & labels NavigationHandler navHandler = new NavigationHandler(); JPanel navPanel = new JPanel(); navPanel.setLayout(new BoxLayout(navPanel, BoxLayout.X_AXIS)); navPanel.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder(8, 8, 8, 8), BorderFactory.createTitledBorder( new EtchedLineBorder(), langpack.getString("installer.madewith") + " "))); navPanel.add(Box.createHorizontalGlue()); prevButton = ButtonFactory.createButton( langpack.getString("installer.prev"), icons.getImageIcon("stepback"), installdata.buttonsHColor); navPanel.add(prevButton); prevButton.addActionListener(navHandler); navPanel.add(Box.createRigidArea(new Dimension(5, 0))); nextButton = ButtonFactory.createButton( langpack.getString("installer.next"), icons.getImageIcon("stepforward"), installdata.buttonsHColor); navPanel.add(nextButton); nextButton.addActionListener(navHandler); navPanel.add(Box.createRigidArea(new Dimension(5, 0))); quitButton = ButtonFactory.createButton( langpack.getString("installer.quit"), icons.getImageIcon("stop"), installdata.buttonsHColor); navPanel.add(quitButton); quitButton.addActionListener(navHandler); contentPane.add(navPanel, BorderLayout.SOUTH); try { ResourceManager rm = ResourceManager.getInstance(); ImageIcon icon = rm.getImageIconResource("Installer.image"); if (icon != null) { JPanel imgPanel = new JPanel(); imgPanel.setLayout(new BorderLayout()); imgPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); iconLabel = new JLabel(icon); iconLabel.setBorder(BorderFactory.createLoweredBevelBorder()); imgPanel.add(iconLabel, BorderLayout.CENTER); contentPane.add(imgPanel, BorderLayout.WEST); } } catch (Exception e) { //ignore } loadImage(0); getRootPane().setDefaultButton(nextButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ff29e0472ba7710b2df9baf42b00a07903753692/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.