rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
{ double end = renderingControl.getChannelWindowEnd(w); renderingControl.setChannelWindow(w, x, end); refreshImage(); }
{ double end = renderingControl.getChannelWindowEnd(w); renderingControl.setChannelWindow(w, x, end); refreshImage(); }
void setChannelWindowStart(int w, double x) { double end = renderingControl.getChannelWindowEnd(w); renderingControl.setChannelWindow(w, x, end); refreshImage(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java
{ QuantumDef qDef = renderingControl.getQuantumDef(); renderingControl.setCodomainInterval(x, qDef.cdEnd); refreshImage(); }
{ QuantumDef qDef = renderingControl.getQuantumDef(); renderingControl.setCodomainInterval(x, qDef.cdEnd); refreshImage(); }
void setCodomainLowerBound(int x) { QuantumDef qDef = renderingControl.getQuantumDef(); renderingControl.setCodomainInterval(x, qDef.cdEnd); refreshImage(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java
{ QuantumDef qDef = renderingControl.getQuantumDef(); renderingControl.setCodomainInterval(qDef.cdStart, x); refreshImage(); }
{ QuantumDef qDef = renderingControl.getQuantumDef(); renderingControl.setCodomainInterval(qDef.cdStart, x); refreshImage(); }
void setCodomainUpperBound(int x) { QuantumDef qDef = renderingControl.getQuantumDef(); renderingControl.setCodomainInterval(qDef.cdStart, x); refreshImage(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java
{ tabs.remove(POS_MAPPING); mappingPanel.removeAll(); buildMappingPanel(); tabs.insertTab("Mapping", im.getIcon(IconManager.MAPPING), mappingPanel, null, POS_MAPPING); tabs.setSelectedIndex(POS_MAPPING); }
{ tabs.remove(POS_MAPPING); mappingPanel.removeAll(); buildMappingPanel(); tabs.insertTab("Mapping", im.getIcon(IconManager.MAPPING), mappingPanel, null, POS_MAPPING); tabs.setSelectedIndex(POS_MAPPING); }
void setMappingPane() { tabs.remove(POS_MAPPING); mappingPanel.removeAll(); buildMappingPanel(); tabs.insertTab("Mapping", im.getIcon(IconManager.MAPPING), mappingPanel, null, POS_MAPPING); tabs.setSelectedIndex(POS_MAPPING); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtUIF.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtUIF.java
void setQuantumStrategy(double k, int family, int resolution) { renderingControl.setQuantumStrategy(family, k, resolution); refreshImage(); }
void setQuantumStrategy(int resolution, boolean b) { renderingControl.setQuantumStrategy(resolution, b); refreshImage(); }
void setQuantumStrategy(double k, int family, int resolution) { renderingControl.setQuantumStrategy(family, k, resolution); refreshImage(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java
{ renderingControl.setRGBA(w, red, green, blue, alpha); refreshImage(); }
{ renderingControl.setRGBA(w, red, green, blue, alpha); refreshImage(); }
void setRGBA(int w, int red, int green, int blue, int alpha) { renderingControl.setRGBA(w, red, green, blue, alpha); refreshImage(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java
{ try { if (canUpdate) { DataManagementService ds = registry.getDataManagementService(); ds.updateChannelData(cd); channelData[cd.getIndex()] = cd; } else { String msg = "The channel data can't be updated b/c of a data" + " retrieval failure at initialization time."; registry.getUserNotifier().notifyInfo("Update channel", msg); } } catch(DSAccessException dsae) { String s = "Can't update the channel data."; registry.getLogger().error(this, s+" Error: "+dsae); registry.getUserNotifier().notifyError("Data Retrieval Failure", s, dsae); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } }
{ try { if (canUpdate) { DataManagementService ds = registry.getDataManagementService(); ds.updateChannelData(cd); channelData[cd.getIndex()] = cd; } else { String msg = "The channel data can't be updated b/c of a data" + " retrieval failure at initialization time."; registry.getUserNotifier().notifyInfo("Update channel", msg); } } catch(DSAccessException dsae) { String s = "Can't update the channel data."; registry.getLogger().error(this, s+" Error: "+dsae); registry.getUserNotifier().notifyError("Data Retrieval Failure", s, dsae); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } }
void updateChannelData(ChannelData cd) { try { if (canUpdate) { DataManagementService ds = registry.getDataManagementService(); ds.updateChannelData(cd); channelData[cd.getIndex()] = cd; } else { String msg = "The channel data can't be updated b/c of a data" + " retrieval failure at initialization time."; registry.getUserNotifier().notifyInfo("Update channel", msg); } } catch(DSAccessException dsae) { String s = "Can't update the channel data."; registry.getLogger().error(this, s+" Error: "+dsae); registry.getUserNotifier().notifyError("Data Retrieval Failure", s, dsae); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java
{ renderingControl.updateCodomainMap(ctx); refreshImage(); }
{ renderingControl.updateCodomainMap(ctx); refreshImage(); }
void updateCodomainMap(CodomainMapContext ctx) { renderingControl.updateCodomainMap(ctx); refreshImage(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java
public NODE getMethodBody(RubyId id, int scope) { NODE body = searchMethod(id);
public GetMethodBodyResult getMethodBody(RubyId id, int noex) { GetMethodBodyResult result = new GetMethodBodyResult(this, id, noex);
public NODE getMethodBody(RubyId id, int scope) { NODE body = searchMethod(id); // ?? if (body == null) { System.out.println("Cant find method \"" + id.toName() + "\" in class " + toName()); return null; } // ?? // ... cache body = body.nd_body(); if (body.nd_type() == NODE_FBODY) { body = body.nd_head(); } return body; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/03950522a75c28f406bd4cb011cb1916a662366d/RubyModule.java/buggy/org/jruby/RubyModule.java
if (body == null) {
SearchMethodResult smr = searchMethod(id); NODE body = smr.getBody(); RubyModule origin = smr.getOrigin(); if (body == null || body.nd_body() == null) {
public NODE getMethodBody(RubyId id, int scope) { NODE body = searchMethod(id); // ?? if (body == null) { System.out.println("Cant find method \"" + id.toName() + "\" in class " + toName()); return null; } // ?? // ... cache body = body.nd_body(); if (body.nd_type() == NODE_FBODY) { body = body.nd_head(); } return body; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/03950522a75c28f406bd4cb011cb1916a662366d/RubyModule.java/buggy/org/jruby/RubyModule.java
return null;
MethodCacheEntry.saveEmptyEntry(getRuby(), this, id); return result;
public NODE getMethodBody(RubyId id, int scope) { NODE body = searchMethod(id); // ?? if (body == null) { System.out.println("Cant find method \"" + id.toName() + "\" in class " + toName()); return null; } // ?? // ... cache body = body.nd_body(); if (body.nd_type() == NODE_FBODY) { body = body.nd_head(); } return body; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/03950522a75c28f406bd4cb011cb1916a662366d/RubyModule.java/buggy/org/jruby/RubyModule.java
MethodCacheEntry ent = new MethodCacheEntry(this, body.nd_noex());
public NODE getMethodBody(RubyId id, int scope) { NODE body = searchMethod(id); // ?? if (body == null) { System.out.println("Cant find method \"" + id.toName() + "\" in class " + toName()); return null; } // ?? // ... cache body = body.nd_body(); if (body.nd_type() == NODE_FBODY) { body = body.nd_head(); } return body; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/03950522a75c28f406bd4cb011cb1916a662366d/RubyModule.java/buggy/org/jruby/RubyModule.java
return body;
result.setNoex(ent.getNoex()); result.setBody(body); return result;
public NODE getMethodBody(RubyId id, int scope) { NODE body = searchMethod(id); // ?? if (body == null) { System.out.println("Cant find method \"" + id.toName() + "\" in class " + toName()); return null; } // ?? // ... cache body = body.nd_body(); if (body.nd_type() == NODE_FBODY) { body = body.nd_head(); } return body; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/03950522a75c28f406bd4cb011cb1916a662366d/RubyModule.java/buggy/org/jruby/RubyModule.java
super(ruby, rubyClass); }
super(ruby, rubyClass); }
public RubyMethod(Ruby ruby, RubyClass rubyClass) { super(ruby, rubyClass); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java
this.receiverClass = receiverClass; }
this.receiverClass = receiverClass; }
public void setReceiverClass(RubyClass receiverClass) { this.receiverClass = receiverClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java
this.receiver = receiver; }
this.receiver = receiver; }
public void setReceiver(RubyObject receiver) { this.receiver = receiver; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java
this.methodId = methodId; }
this.methodId = methodId; }
public void setMethodId(RubyId methodId) { this.methodId = methodId; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java
this.originalClass = originalClass; }
this.originalClass = originalClass; }
public void setOriginalClass(RubyClass originalClass) { this.originalClass = originalClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java
this.originalId = originalId; }
this.originalId = originalId; }
public void setOriginalId(RubyId originalId) { this.originalId = originalId; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java
RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), getDoubleValue() * other.getDoubleValue());
return multiplyWith(numericValue(num));
public RubyNumeric op_mul(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), getDoubleValue() * other.getDoubleValue()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a25fc494ea7daeb4b5b479e0173372332cf7d4ac/RubyFloat.java/buggy/src/org/jruby/RubyFloat.java
assertStringTemplateEquals ("#if(true){ pass }", " pass ");
public void testAfterBegin () throws Exception { assertStringTemplateEquals ("#if(true)#begin \npass#end", "pass"); assertStringTemplateEquals ("#if(true)#begin \n pass#end", " pass"); assertStringTemplateEquals ("#if(true)#begin pass#end", " pass"); assertStringTemplateEquals ("#if(true)#begin pass#end", "pass"); assertStringTemplateEquals ("#if(true) {pass}", "pass"); assertStringTemplateEquals ("#if(true){ pass}", " pass"); assertStringTemplateEquals ("#if(true){\n pass}", " pass"); assertStringTemplateEquals ("#if(true){ \n pass}", " pass"); assertStringTemplateEquals ("#if(true){ \npass}", "pass"); assertStringTemplateEquals ("#if(true) \npass #end", "pass"); assertStringTemplateEquals ("#if(true) pass #end", "pass"); assertStringTemplateEquals ("#if(true) \n pass #end", " pass"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/380cf71624b51f570339abaad8b44c15f6b31844/TestWhitespace.java/clean/webmacro/test/unit/org/webmacro/template/TestWhitespace.java
statusButton = new JButton(icons.getIcon(IconManager.CANCEL)); statusButton.setVisible(false);
statusButton = new JButton(icons.getIcon(IconManager.TRANSPARENT)); statusButton.setContentAreaFilled(false);
private void initComponents() { IconManager icons = IconManager.getInstance(); progressBar = new JProgressBar(); progressBar.setIndeterminate(true); status = new JLabel(); statusButton = new JButton(icons.getIcon(IconManager.CANCEL)); statusButton.setVisible(false); statusButton.setBorder(null); UIUtilities.unifiedButtonLookAndFeel(statusButton); //statusButton.setOpaque(false); statusButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (buttonEnabled) controller.cancel(); } }); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/StatusBar.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/StatusBar.java
Pixels p = new Pixels(pixelsId);
Pixels p = new Pixels(); p.setId(pixelsId);
protected Pixels createPixelGraph(Long pixelsId) { // TODO put this into ome.testing.ObjectFactory PIType pi = new PIType(); pi.setValue("test"); AcquisitionContext ac = new AcquisitionContext(); ac.setPhotometricInterpretation(pi); Channel c = new Channel(); c.setIndex(1); Pixels p = new Pixels(pixelsId); p.setSizeX(new Integer(1)); p.setSizeY(new Integer(1)); p.setSizeZ(new Integer(1)); p.setSizeC(new Integer(1)); p.setSizeT(new Integer(1)); p.setSha1("09bc7b2dcc9a510f4ab3a40c47f7a4cb77954356"); // "pixels" p.setAcquisitionContext(ac); p.setChannels(new HashSet()); p.getChannels().add(c); c.setPixels(p); p.setDetails(new Details()); return p; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/50ff3a771581d9f58121b05f50819d8474d33b6c/AbstractUpdateTest.java/clean/components/server/test/ome/server/itests/update/AbstractUpdateTest.java
File[] files = finder.findDirectory(packageData.getSourceFileName()); if (files.length == 0) { LOGGER.warn("No directories found for package: " + packageData.getSourceFileName()); } double ccnSum = 0; for (int i = 0; i < files.length; i++) { ccnSum += Util.getCCN(files[i], false); } double ccn = ccnSum / (double) files.length;
double ccn = packageData.getCCN(finder);
private String generateTableRowForPackage(PackageData packageData) { StringBuffer ret = new StringBuffer(); String url1 = "frame-summary-" + packageData.getName() + ".html"; String url2 = "frame-sourcefiles-" + packageData.getName() + ".html"; double lineCoverage = -1; double branchCoverage = -1; File[] files = finder.findDirectory(packageData.getSourceFileName()); if (files.length == 0) { LOGGER.warn("No directories found for package: " + packageData.getSourceFileName()); } double ccnSum = 0; for (int i = 0; i < files.length; i++) { ccnSum += Util.getCCN(files[i], false); } double ccn = ccnSum / (double) files.length; if (packageData.getNumberOfValidLines() > 0) lineCoverage = packageData.getLineCoverageRate(); if (packageData.getNumberOfValidBranches() > 0) branchCoverage = packageData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + url1 + "\" onClick='parent.sourceFileList.location.href=\"" + url2 + "\"'>" + generatePackageName(packageData) + "</a></td>"); ret.append("<td class=\"value\">" + packageData.getNumberOfChildren() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/3e8a06cb6e7e9c5e2474adf5e83e4b6ddcc7a464/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java
setBorder(BorderFactory.createLineBorder(Color.GRAY, 2));
BrowserCanvas(BrowserModel model, BrowserUI view) { if (model == null) throw new NullPointerException("No model."); if (view == null) throw new NullPointerException("No view."); this.model = model; this.view = view; charWidth = getFontMetrics(getFont()).charWidth('m'); setDoubleBuffered(true); setBorder(BorderFactory.createLineBorder(Color.GRAY, 2)); dragging = false; addMouseListener(this); addMouseMotionListener(this); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/4077a713b0e44eebe43adbb3a899add85b8ca9c2/BrowserCanvas.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserCanvas.java
setCanvasLocation(image.getWidth()+2*BrowserUI.TOP_LEFT_IMAGE, image.getHeight()+2*BrowserUI.TOP_LEFT_IMAGE);
System.out.println(model.getPixelsSizeX());
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); BufferedImage image = model.getDisplayedImage(); if (image == null) return; paintXYFrame(g2D); setCanvasLocation(image.getWidth()+2*BrowserUI.TOP_LEFT_IMAGE, image.getHeight()+2*BrowserUI.TOP_LEFT_IMAGE); double v = 1;//model.getPixelsSizeX()/model.getZoomFactor(); if (v > 0) { int h = image.getHeight()+3*BrowserUI.TOP_LEFT_IMAGE/2; paintScaleBar(g2D, BrowserUI.TOP_LEFT_IMAGE, h, 2*LENGTH, ""+(int) v+NANOMETER); } g2D.drawImage(image, null, BrowserUI.TOP_LEFT_IMAGE, BrowserUI.TOP_LEFT_IMAGE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/4077a713b0e44eebe43adbb3a899add85b8ca9c2/BrowserCanvas.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserCanvas.java
void setComponentsSize(int w, int h)
private void setComponentsSize(int w, int h)
void setComponentsSize(int w, int h) { Dimension d = new Dimension(w, h); layeredPane.setPreferredSize(d); layeredPane.setSize(d); browserCanvas.setPreferredSize(d); browserCanvas.setSize(d); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/4077a713b0e44eebe43adbb3a899add85b8ca9c2/BrowserUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserUI.java
"WEB-INF/security.xml",
protected String[] getConfigLocations() { return new String[] { "WEB-INF/services.xml", "WEB-INF/dao.xml", "WEB-INF/data.xml", "WEB-INF/test/config-test.xml" }; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/00ef5f18481d04aa649d8ea20819b4b7bb9c2f28/WriteTest.java/buggy/components/server/test/org/openmicroscopy/omero/server/itests/WriteTest.java
sb.append(obj.toString());
sb.append( obj==null?"null":obj.toString());
private void log(Object...objects) { if ( log.isDebugEnabled() && objects != null && objects.length > 0) { StringBuilder sb = new StringBuilder(objects.length*16); for (Object obj : objects) { sb.append(obj.toString()); } log.debug(sb.toString()); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/708b83b406aaf9ac834e50df2d7ce7380a971242/MergeEventListener.java/buggy/components/server/src/ome/security/basic/MergeEventListener.java
g2.setPaint(oldPaint);
g2.setPaint(new Color(153,153,153,128));
public void paint(PPaintContext context) { Graphics2D g2 = context.getGraphics(); Paint oldPaint = g2.getPaint(); Font oldFont = g2.getFont(); Color oldColor = g2.getColor(); g2.setPaint(Color.yellow); g2.fill(border); g2.setPaint(oldPaint); g2.drawImage(getImage(),0,0,null); g2.drawImage(openIconImage, (int)Math.round(openIconShape.getX()), (int)Math.round(openIconShape.getY()),null); g2.drawImage(closeIconImage, (int)Math.round(closeIconShape.getX()), (int)Math.round(closeIconShape.getY()),null); g2.setFont(nameFont); g2.setColor(Color.yellow); String wellName = (String)parentThumbnail.getModel().getValue(UIConstants.WELL_KEY_STRING); if(wellName != null) { g2.drawString(wellName,4,26); } g2.setFont(oldFont); g2.setColor(oldColor); if(multipleModeOn) { g2.setPaint(Color.yellow); g2.setColor(Color.yellow); String whichSelected = (parentThumbnail.getMultipleImageIndex()+1) + "/" + (String.valueOf(parentThumbnail.getMultipleImageSize())); Rectangle2D selectedBounds = g2.getFontMetrics(multiFont).getStringBounds(whichSelected,g2); Rectangle2D totalBounds = getBounds().getBounds2D(); g2.setFont(multiFont); g2.drawString(whichSelected, (float)((totalBounds.getWidth()-selectedBounds.getWidth())/2), (float)(totalBounds.getHeight()-selectedBounds.getHeight()-5)); g2.fill(prevImageShape); g2.fill(nextImageShape); g2.setFont(oldFont); g2.setPaint(oldPaint); g2.setColor(oldColor); } Rectangle2D bounds = getBounds().getBounds2D(); /* double width = bounds.getWidth(); double height = bounds.getHeight(); DrawStyle noteStyle = DrawStyles.ANNOTATION_NODE_STYLE; DrawStyle oldStyle = noteStyle.applyStyle(g2); PaintShapeGenerator generator = PaintShapeGenerator.getInstance(); Shape note = generator.getAnnotationNoteShape(width-32,height-38); Shape glass = generator.getOuterMagnifierShape(width-32,height-68); g2.fill(note); g2.draw(note); g2.fill(glass); g2.draw(glass); oldStyle.applyStyle(g2); */ }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/SemanticZoomNode.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/SemanticZoomNode.java
g2.fill(closeIconShape);
public void paint(PPaintContext context) { Graphics2D g2 = context.getGraphics(); Paint oldPaint = g2.getPaint(); Font oldFont = g2.getFont(); Color oldColor = g2.getColor(); g2.setPaint(Color.yellow); g2.fill(border); g2.setPaint(oldPaint); g2.drawImage(getImage(),0,0,null); g2.drawImage(openIconImage, (int)Math.round(openIconShape.getX()), (int)Math.round(openIconShape.getY()),null); g2.drawImage(closeIconImage, (int)Math.round(closeIconShape.getX()), (int)Math.round(closeIconShape.getY()),null); g2.setFont(nameFont); g2.setColor(Color.yellow); String wellName = (String)parentThumbnail.getModel().getValue(UIConstants.WELL_KEY_STRING); if(wellName != null) { g2.drawString(wellName,4,26); } g2.setFont(oldFont); g2.setColor(oldColor); if(multipleModeOn) { g2.setPaint(Color.yellow); g2.setColor(Color.yellow); String whichSelected = (parentThumbnail.getMultipleImageIndex()+1) + "/" + (String.valueOf(parentThumbnail.getMultipleImageSize())); Rectangle2D selectedBounds = g2.getFontMetrics(multiFont).getStringBounds(whichSelected,g2); Rectangle2D totalBounds = getBounds().getBounds2D(); g2.setFont(multiFont); g2.drawString(whichSelected, (float)((totalBounds.getWidth()-selectedBounds.getWidth())/2), (float)(totalBounds.getHeight()-selectedBounds.getHeight()-5)); g2.fill(prevImageShape); g2.fill(nextImageShape); g2.setFont(oldFont); g2.setPaint(oldPaint); g2.setColor(oldColor); } Rectangle2D bounds = getBounds().getBounds2D(); /* double width = bounds.getWidth(); double height = bounds.getHeight(); DrawStyle noteStyle = DrawStyles.ANNOTATION_NODE_STYLE; DrawStyle oldStyle = noteStyle.applyStyle(g2); PaintShapeGenerator generator = PaintShapeGenerator.getInstance(); Shape note = generator.getAnnotationNoteShape(width-32,height-38); Shape glass = generator.getOuterMagnifierShape(width-32,height-68); g2.fill(note); g2.draw(note); g2.fill(glass); g2.draw(glass); oldStyle.applyStyle(g2); */ }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/SemanticZoomNode.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/SemanticZoomNode.java
setGroups( new HashSet( exp.eachLinkedExperimenterGroup( block )));
setGroups( makeSet( exp.sizeOfGroupExperimenterMap(), exp.eachLinkedExperimenterGroup( block )));
public void copy(IObject model, ModelMapper mapper) { if (model instanceof Experimenter) { Experimenter exp = (Experimenter) model; super.copy(model,mapper); // Fields this.setFirstName(exp.getFirstName()); this.setLastName(exp.getLastName()); this.setEmail(exp.getEmail()); this.setInstitution(exp.getInstitution()); // Collections MapperBlock block = new MapperBlock( mapper ); setGroups( new HashSet( exp.eachLinkedExperimenterGroup( block ))); } else { throw new IllegalArgumentException( "ExperimenterData can only copy from Experimenter"); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9638b50efec05ce0b3d19bbef1c149c757b964aa/ExperimenterData.java/buggy/components/shoola-adapter/src/pojos/ExperimenterData.java
RubyClass metaClass = objectClass.makeMetaClass(classClass); metaClass = moduleClass.makeMetaClass(metaClass); metaClass = classClass.makeMetaClass(metaClass);
RubyClass metaClass = objectClass.makeMetaClass(classClass, runtime.getCurrentContext().getRubyClass()); metaClass = moduleClass.makeMetaClass(metaClass, runtime.getCurrentContext().getRubyClass()); metaClass = classClass.makeMetaClass(metaClass, runtime.getCurrentContext().getRubyClass());
public void initCoreClasses() { objectClass = defineBootClass("Object", null); moduleClass = defineBootClass("Module", objectClass); classClass = defineBootClass("Class", moduleClass); RubyClass metaClass = objectClass.makeMetaClass(classClass); metaClass = moduleClass.makeMetaClass(metaClass); metaClass = classClass.makeMetaClass(metaClass); kernelModule = RubyKernel.createKernelModule(runtime); objectClass.includeModule(kernelModule); CallbackFactory callbackFactory = runtime.callbackFactory(RubyClasses.class); objectClass.definePrivateMethod("initialize", callbackFactory.getNilMethod(-1)); classClass.definePrivateMethod("inherited", callbackFactory.getNilMethod(1)); RubyObject.createObjectClass(objectClass); RubyClass.createClassClass(classClass); RubyModule.createModuleClass(moduleClass); nilClass = RubyNil.createNilClass(runtime); falseClass = RubyBoolean.createFalseClass(runtime); trueClass = RubyBoolean.createTrueClass(runtime); threadGroupClass = RubyThreadGroup.createThreadGroupClass(runtime); threadClass = RubyThread.createThreadClass(runtime); runtime.getLoadService().addAutoload("UnboundMethod", new IAutoloadMethod() { public IRubyObject load(Ruby runtime, String name) { return RubyUnboundMethod.defineUnboundMethodClass(runtime); } }); runtime.getClasses().getFileTestModule(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/32d84ae899fd3c367ef3800d0984b69f53209031/RubyClasses.java/buggy/src/org/jruby/RubyClasses.java
fileStatClass.defineMethod("ino", callbackFactory.getMethod("ino"));
public static RubyClass createFileStatClass(IRuby runtime) { final RubyClass fileStatClass = runtime.getClass("File").defineClassUnder("Stat",runtime.getObject()); final CallbackFactory callbackFactory = runtime.callbackFactory(RubyFileStat.class); // fileStatClass.defineMethod("<=>", callbackFactory.getMethod("")); // fileStateClass.includeModule(runtime.getModule("Comparable")); // fileStatClass.defineMethod("atime", callbackFactory.getMethod("")); fileStatClass.defineMethod("blksize", callbackFactory.getMethod("blksize")); // fileStatClass.defineMethod("blockdev?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("blocks", callbackFactory.getMethod("")); // fileStatClass.defineMethod("chardev?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("ctime", callbackFactory.getMethod("")); // fileStatClass.defineMethod("dev", callbackFactory.getMethod("")); // fileStatClass.defineMethod("dev_major", callbackFactory.getMethod("")); // fileStatClass.defineMethod("dev_minor", callbackFactory.getMethod("")); fileStatClass.defineMethod("directory?", callbackFactory.getMethod("directory_p")); // fileStatClass.defineMethod("executable?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("executable_real?", callbackFactory.getMethod("")); fileStatClass.defineMethod("file?", callbackFactory.getMethod("file_p")); fileStatClass.defineMethod("ftype", callbackFactory.getMethod("ftype")); // fileStatClass.defineMethod("gid", callbackFactory.getMethod("")); // fileStatClass.defineMethod("grpowned?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("ino", callbackFactory.getMethod("")); fileStatClass.defineMethod("mode", callbackFactory.getMethod("mode")); fileStatClass.defineMethod("mtime", callbackFactory.getMethod("mtime")); // fileStatClass.defineMethod("nlink", callbackFactory.getMethod("")); // fileStatClass.defineMethod("owned?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("pipe?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("rdev", callbackFactory.getMethod("")); // fileStatClass.defineMethod("rdev_major", callbackFactory.getMethod("")); // fileStatClass.defineMethod("rdev_minor", callbackFactory.getMethod("")); fileStatClass.defineMethod("readable?", callbackFactory.getMethod("readable_p")); // fileStatClass.defineMethod("readable_real?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("setgid?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("setuid?", callbackFactory.getMethod("")); fileStatClass.defineMethod("size", callbackFactory.getMethod("size")); // fileStatClass.defineMethod("size?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("socket?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("sticky?", callbackFactory.getMethod("")); fileStatClass.defineMethod("symlink?", callbackFactory.getMethod("symlink_p")); // fileStatClass.defineMethod("uid", callbackFactory.getMethod("")); fileStatClass.defineMethod("writable?", callbackFactory.getMethod("writable")); // fileStatClass.defineMethod("writable_real?", callbackFactory.getMethod("")); // fileStatClass.defineMethod("zero?", callbackFactory.getMethod("")); return fileStatClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7c9ec57d0ce44adc41c27cdfce89439cec7da0ed/RubyFileStat.java/buggy/src/org/jruby/RubyFileStat.java
return (RubyString) message;
return (RubyString)message.funcall("to_s");
public RubyString to_s() { RubyObject message = getInstanceVar("mesg"); if (message.isNil()) { return getRubyClass().getClassPath(); } else { message.setTaint(isTaint()); return (RubyString) message; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyException.java/clean/org/jruby/RubyException.java
uninstallListeners(b);
ColouredButtonUI(JButton b, Color c) { if (b == null) throw new IllegalArgumentException("No button."); if (c == null) throw new IllegalArgumentException("No color."); colour = c; button = b; greyedOut = false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/406af898c8201f57e22420d70ddf032867b5cecd/ColouredButtonUI.java/clean/SRC/org/openmicroscopy/shoola/util/ui/ColouredButtonUI.java
public HSV(float hs, float ss, float vs, float as)
public HSV()
public HSV(float hs, float ss, float vs, float as) { h = hs; s = ss; v = vs; a = as; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5f705d8033fda105f3e041fa00c4b22556e3a94d/HSV.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/colour/HSV.java
h = hs; s = ss; v = vs; a = as;
h = 0; s = 0; v = 0; a = 0;
public HSV(float hs, float ss, float vs, float as) { h = hs; s = ss; v = vs; a = as; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5f705d8033fda105f3e041fa00c4b22556e3a94d/HSV.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/colour/HSV.java
String cname = getMetaClass().getName();
String cname = getMetaClass().getRealClass().getName();
public RubyString to_s() { String cname = getMetaClass().getName(); RubyString str = getRuntime().newString(""); /* 6:tags 16:addr 1:eos */ str.setValue("#<" + cname + ":0x" + Integer.toHexString(System.identityHashCode(this)) + ">"); str.setTaint(isTaint()); return str; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/3ede202d0612738913c251608fd955d6b23c9527/RubyObject.java/buggy/src/org/jruby/RubyObject.java
statusButton.setBorderPainted(false); statusButton.setFocusPainted(false); statusButton.setOpaque(false);
UIUtilities.unifiedButtonLookAndFeel(statusButton);
private void initComponents() { IconManager icons = IconManager.getInstance(); progressBar = new JProgressBar(); progressBar.setIndeterminate(true); status = new JLabel(); statusButton = new JButton(icons.getIcon(IconManager.STATUS_INFO)); statusButton.setBorder(null); statusButton.setBorderPainted(false); statusButton.setFocusPainted(false); statusButton.setOpaque(false); statusButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (buttonEnabled) controller.cancel(); } }); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d165d84615e7f90ee0847be9809fedfd2c53fadc/StatusBar.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/StatusBar.java
public RubyException(String message) { super(message);
public RubyException() { super();
public RubyException(String message) { super(message); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9a05f18f2b6207bf93455d756436fe8f0002b542/RubyException.java/buggy/org/jruby/exceptions/RubyException.java
new RuntimeException("[BUG] Want to convert" + yyVal.getClass().getName() + " to StrNode").printStackTrace();
((StrNodeConvertable)yyVal).convertToStrNode();
private int here_document(int term, int indent) { int c; Node list = null; int linesave = ruby.getSourceLine(); newtok(); switch (term) { case '\'' : case '"' : case '`' : while ((c = nextc()) != term) { tokadd(c); } if (term == '\'') { term = 0; } break; default : c = term; term = '"'; if (!is_identchar(c)) { ph.rb_warn("use of bare << to mean <<\"\" is deprecated"); break; } while (is_identchar(c)) { tokadd(c); c = nextc(); } pushback(c); break; } tokfix(); RubyObject lastline_save = lex_lastline; int offset_save = lex_p - lex_pbeg; String eos = tok(); int len = eos.length(); RubyString str = RubyString.newString(ruby, ""); RubyObject line; while (true) { lex_lastline = line = lex_getline(); if (line.isNil()) { // error: ruby.setSourceLine(linesave); ph.rb_compile_error("can't find string \"" + eos + "\" anywhere before EOF"); return 0; } ruby.setSourceLine(ruby.getSourceLine()); String p = ((RubyString) line).getValue(); if (indent != 0) { while (Character.isWhitespace(p.charAt(0))) { p = p.substring(1); } // while (*p && (*p == ' ' || *p == '\t')) { // p++; // } } if (p /*.trim()*/ .startsWith(eos)) { if (p.charAt(len) == '\n' || p.charAt(len) == '\r') { break; } if (len == ((RubyString) line).getValue().length()) { break; } } lex_curline = ((RubyString) line).getValue(); lex_pbeg = lex_p = 0; lex_pend = lex_curline.length(); while (true) { switch (parse_string(term, '\n', '\n')) { case Token.tSTRING : case Token.tXSTRING : ((RubyString) yyVal).cat("\n"); if (list == null) { str.concat((RubyString) yyVal); } else { ph.list_append(list, nf.newStr((RubyObject) yyVal)); } break; case Token.tDSTRING : if (list == null) { list = nf.newDStr(str); } /* fall through */ case Token.tDXSTRING : if (list == null) { list = nf.newDXStr(str); } ph.list_append((Node) yyVal, nf.newStr(RubyString.newString(ruby, "\n"))); new RuntimeException("[BUG] Want to convert" + yyVal.getClass().getName() + " to StrNode").printStackTrace(); // ((NODE)yyVal).nd_set_type(NODE.NODE_STR); yyVal = nf.newList((Node) yyVal); ((Node) yyVal).setNextNode(((Node) yyVal).getHeadNode().getNextNode()); ph.list_concat(list, (Node) yyVal); break; case 0 : // goto error; ruby.setSourceLine(linesave); ph.rb_compile_error("can't find string \"" + eos + "\" anywhere before EOF"); return 0; } if (lex_p == lex_pend) { break; } } } lex_lastline = lastline_save; lex_curline = ((RubyString) lex_lastline).getValue(); lex_pbeg = 0; lex_pend = lex_pbeg + lex_curline.length(); lex_p = lex_pbeg + offset_save; ph.setLexState(LexState.EXPR_END); ph.setHeredocEnd(ruby.getSourceLine()); ruby.setSourceLine(linesave); if (list != null) { list.setLine(linesave + 1); yyVal = list; } switch (term) { case '\0' : case '\'' : case '"' : if (list != null) { return Token.tDSTRING; } yyVal = str; return Token.tSTRING; case '`' : if (list != null) { return Token.tDXSTRING; } yyVal = str; return Token.tXSTRING; } return 0; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/58f05ce53c167c336c9619e751471924f79325f3/DefaultRubyScanner.java/buggy/org/jruby/parser/DefaultRubyScanner.java
if (!event.isLoaded()) return null;
public Timestamp event2timestamp(Event event){ if (event==null) return null; if (event.getTime()==null) return null; return event.getTime(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/06ca33745babfe964f26f7a1d5d5d371ecc63a1b/ModelMapper.java/buggy/components/common/src/ome/util/ModelMapper.java
regex = OCTAL_SINGLE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"0$1");
String translatePattern(String regex, boolean commentsAllowed) { regex = COMMENT_PATTERN.matcher(regex).replaceAll(""); regex = HEX_SINGLE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"x0$1"); regex = OCTAL_SINGLE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"0$1"); regex = OCTAL_THREE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"0$1"); if (commentsAllowed) { regex = SPACE_IN_CHARACTER_CLASS_PATTERN.matcher(regex).replaceAll("$1\\\\x20$2"); regex = SHARP_IN_CHARACTER_CLASS_PATTERN.matcher(regex).replaceAll("$1\\\\x23$2"); } return regex; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4d62d6f77d06ba34dda2ae56b8598e93f8ae39ad/RegexpTranslator.java/clean/src/org/jruby/RegexpTranslator.java
String translatePattern(String regex, boolean commentsAllowed) { regex = COMMENT_PATTERN.matcher(regex).replaceAll(""); regex = HEX_SINGLE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"x0$1"); regex = OCTAL_SINGLE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"0$1"); regex = OCTAL_THREE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"0$1"); if (commentsAllowed) { regex = SPACE_IN_CHARACTER_CLASS_PATTERN.matcher(regex).replaceAll("$1\\\\x20$2"); regex = SHARP_IN_CHARACTER_CLASS_PATTERN.matcher(regex).replaceAll("$1\\\\x23$2"); } return regex; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4d62d6f77d06ba34dda2ae56b8598e93f8ae39ad/RegexpTranslator.java/clean/src/org/jruby/RegexpTranslator.java
public void compile(Ruby ruby, String pattern) throws RegexpError {
public void compile(Ruby runtime, String pattern) throws RegexpError {
public void compile(Ruby ruby, String pattern) throws RegexpError { if (extended) { pattern = unextend(pattern); } try { this.re = new RE(pattern, cflags); } catch (REException e) { throw new RegexpError(ruby, e.getMessage()); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5da2c6076b449b5de3adb26549527bf497ec10c/GNURegexpAdapter.java/buggy/src/org/jruby/runtime/regexp/GNURegexpAdapter.java
throw new RegexpError(ruby, e.getMessage());
throw new RegexpError(runtime, e.getMessage());
public void compile(Ruby ruby, String pattern) throws RegexpError { if (extended) { pattern = unextend(pattern); } try { this.re = new RE(pattern, cflags); } catch (REException e) { throw new RegexpError(ruby, e.getMessage()); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5da2c6076b449b5de3adb26549527bf497ec10c/GNURegexpAdapter.java/buggy/src/org/jruby/runtime/regexp/GNURegexpAdapter.java
public IRubyObject search(Ruby ruby, String target, int startPos) {
public IRubyObject search(Ruby runtime, String target, int startPos) {
public IRubyObject search(Ruby ruby, String target, int startPos) { REMatch match = re.getMatch(target, startPos, eflags); if (match != null) { int count = re.getNumSubs() + 1; int[] begin = new int[count]; int[] end = new int[count]; for (int i = 0; i < count; i++) { begin[i] = match.getStartIndex(i); end[i] = match.getEndIndex(i); } return new RubyMatchData(ruby, target, begin, end); } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5da2c6076b449b5de3adb26549527bf497ec10c/GNURegexpAdapter.java/buggy/src/org/jruby/runtime/regexp/GNURegexpAdapter.java
return new RubyMatchData(ruby, target, begin, end);
return new RubyMatchData(runtime, target, begin, end);
public IRubyObject search(Ruby ruby, String target, int startPos) { REMatch match = re.getMatch(target, startPos, eflags); if (match != null) { int count = re.getNumSubs() + 1; int[] begin = new int[count]; int[] end = new int[count]; for (int i = 0; i < count; i++) { begin[i] = match.getStartIndex(i); end[i] = match.getEndIndex(i); } return new RubyMatchData(ruby, target, begin, end); } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5da2c6076b449b5de3adb26549527bf497ec10c/GNURegexpAdapter.java/buggy/src/org/jruby/runtime/regexp/GNURegexpAdapter.java
return ruby.getNil();
return runtime.getNil();
public IRubyObject search(Ruby ruby, String target, int startPos) { REMatch match = re.getMatch(target, startPos, eflags); if (match != null) { int count = re.getNumSubs() + 1; int[] begin = new int[count]; int[] end = new int[count]; for (int i = 0; i < count; i++) { begin[i] = match.getStartIndex(i); end[i] = match.getEndIndex(i); } return new RubyMatchData(ruby, target, begin, end); } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5da2c6076b449b5de3adb26549527bf497ec10c/GNURegexpAdapter.java/buggy/src/org/jruby/runtime/regexp/GNURegexpAdapter.java
public abstract void compile(Ruby ruby, String pattern) throws RegexpError;
public abstract void compile(Ruby ruby, String pattern) throws RegexpError;
public abstract void compile(Ruby ruby, String pattern) throws RegexpError;
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5da2c6076b449b5de3adb26549527bf497ec10c/IRegexpAdapter.java/buggy/src/org/jruby/runtime/regexp/IRegexpAdapter.java
if (pos > 2 && re.charAt(pos - 2) == '(' && re.charAt(pos - 1) == '?') {
if (pos > 2 && re.charAt(pos - 2) == '(' && re.charAt(pos - 1) == '?') {
public String unextend(String re) { boolean inClass = false; int len = re.length(); StringBuffer sbuf = new StringBuffer(len); int pos = 0; char c; while (pos < len) { c = re.charAt(pos); if (c == '\\' && ++pos < len) { sbuf.append('\\').append(re.charAt(pos)); } else if (c == '[' && ++pos < len) { sbuf.append(c); inClass = true; if ((c = re.charAt(pos)) == ']') { sbuf.append(c); } } else if (c == ']') { sbuf.append(c); inClass = false; } else if (c == '#') { if (pos > 2 && re.charAt(pos - 2) == '(' && re.charAt(pos - 1) == '?') { sbuf.append(c); } else { pos++; for (; pos < len && re.charAt(pos) != '\n' && re.charAt(pos) != '\r'; pos++); } } else if (inClass || !Character.isWhitespace(c)) { sbuf.append(c); } pos++; } return sbuf.toString(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5da2c6076b449b5de3adb26549527bf497ec10c/IRegexpAdapter.java/buggy/src/org/jruby/runtime/regexp/IRegexpAdapter.java
for (; pos < len && re.charAt(pos) != '\n' && re.charAt(pos) != '\r'; pos++);
for (; pos < len && re.charAt(pos) != '\n' && re.charAt(pos) != '\r'; pos++);
public String unextend(String re) { boolean inClass = false; int len = re.length(); StringBuffer sbuf = new StringBuffer(len); int pos = 0; char c; while (pos < len) { c = re.charAt(pos); if (c == '\\' && ++pos < len) { sbuf.append('\\').append(re.charAt(pos)); } else if (c == '[' && ++pos < len) { sbuf.append(c); inClass = true; if ((c = re.charAt(pos)) == ']') { sbuf.append(c); } } else if (c == ']') { sbuf.append(c); inClass = false; } else if (c == '#') { if (pos > 2 && re.charAt(pos - 2) == '(' && re.charAt(pos - 1) == '?') { sbuf.append(c); } else { pos++; for (; pos < len && re.charAt(pos) != '\n' && re.charAt(pos) != '\r'; pos++); } } else if (inClass || !Character.isWhitespace(c)) { sbuf.append(c); } pos++; } return sbuf.toString(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5da2c6076b449b5de3adb26549527bf497ec10c/IRegexpAdapter.java/buggy/src/org/jruby/runtime/regexp/IRegexpAdapter.java
public abstract IRubyObject search(Ruby ruby, String target, int startPos);
public abstract IRubyObject search(Ruby runtime, String target, int startPos);
public abstract IRubyObject search(Ruby ruby, String target, int startPos);
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5da2c6076b449b5de3adb26549527bf497ec10c/IRegexpAdapter.java/buggy/src/org/jruby/runtime/regexp/IRegexpAdapter.java
if ( RootException.class.isAssignableFrom( t.getClass() ) )
if ( RootException.class .isAssignableFrom( t.getClass() ) )
protected Throwable getAndLogException(Throwable t){ if (null == t) { log.error("Exception thrown. (null)"); return new InternalException("Exception thrown with null message"); } else { String msg = " Wrapped Exception: (" + t.getClass().getName()+"):\n" + t.getMessage(); log.error("Exception thrown: "+msg); if ( RootException.class.isAssignableFrom( t.getClass() ) ) return t; else if ( OptimisticLockingFailureException.class.isAssignableFrom( t.getClass() )) { OptimisticLockException ole = new OptimisticLockException( t.getMessage() ); ole.setStackTrace( t.getStackTrace() ); return ole; } else if ( IllegalArgumentException.class.isAssignableFrom( t.getClass() )) { ApiUsageException aue = new ApiUsageException( t.getMessage() ); aue.setStackTrace( t.getStackTrace() ); log.warn("IllegalArgumentException thrown:\n"+aue.getStackTrace()); return aue; } else { // Wrap all other exceptions in InternalException InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re; } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/ServiceHandler.java/buggy/components/server/src/ome/services/util/ServiceHandler.java
else if ( OptimisticLockingFailureException.class.isAssignableFrom( t.getClass() ))
else if ( OptimisticLockingFailureException.class .isAssignableFrom( t.getClass() ))
protected Throwable getAndLogException(Throwable t){ if (null == t) { log.error("Exception thrown. (null)"); return new InternalException("Exception thrown with null message"); } else { String msg = " Wrapped Exception: (" + t.getClass().getName()+"):\n" + t.getMessage(); log.error("Exception thrown: "+msg); if ( RootException.class.isAssignableFrom( t.getClass() ) ) return t; else if ( OptimisticLockingFailureException.class.isAssignableFrom( t.getClass() )) { OptimisticLockException ole = new OptimisticLockException( t.getMessage() ); ole.setStackTrace( t.getStackTrace() ); return ole; } else if ( IllegalArgumentException.class.isAssignableFrom( t.getClass() )) { ApiUsageException aue = new ApiUsageException( t.getMessage() ); aue.setStackTrace( t.getStackTrace() ); log.warn("IllegalArgumentException thrown:\n"+aue.getStackTrace()); return aue; } else { // Wrap all other exceptions in InternalException InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re; } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/ServiceHandler.java/buggy/components/server/src/ome/services/util/ServiceHandler.java
else if ( IllegalArgumentException.class.isAssignableFrom( t.getClass() ))
else if ( IllegalArgumentException.class .isAssignableFrom( t.getClass() ))
protected Throwable getAndLogException(Throwable t){ if (null == t) { log.error("Exception thrown. (null)"); return new InternalException("Exception thrown with null message"); } else { String msg = " Wrapped Exception: (" + t.getClass().getName()+"):\n" + t.getMessage(); log.error("Exception thrown: "+msg); if ( RootException.class.isAssignableFrom( t.getClass() ) ) return t; else if ( OptimisticLockingFailureException.class.isAssignableFrom( t.getClass() )) { OptimisticLockException ole = new OptimisticLockException( t.getMessage() ); ole.setStackTrace( t.getStackTrace() ); return ole; } else if ( IllegalArgumentException.class.isAssignableFrom( t.getClass() )) { ApiUsageException aue = new ApiUsageException( t.getMessage() ); aue.setStackTrace( t.getStackTrace() ); log.warn("IllegalArgumentException thrown:\n"+aue.getStackTrace()); return aue; } else { // Wrap all other exceptions in InternalException InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re; } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/ServiceHandler.java/buggy/components/server/src/ome/services/util/ServiceHandler.java
return aue; } else if ( InvalidDataAccessResourceUsageException.class .isAssignableFrom( t.getClass() ) ) { ApiUsageException aue = new ApiUsageException( t.getMessage() ); aue.setStackTrace( t.getStackTrace() ); log.warn("InvalidDataAccessResourceUsageException thrown:\n"+aue.getStackTrace());
protected Throwable getAndLogException(Throwable t){ if (null == t) { log.error("Exception thrown. (null)"); return new InternalException("Exception thrown with null message"); } else { String msg = " Wrapped Exception: (" + t.getClass().getName()+"):\n" + t.getMessage(); log.error("Exception thrown: "+msg); if ( RootException.class.isAssignableFrom( t.getClass() ) ) return t; else if ( OptimisticLockingFailureException.class.isAssignableFrom( t.getClass() )) { OptimisticLockException ole = new OptimisticLockException( t.getMessage() ); ole.setStackTrace( t.getStackTrace() ); return ole; } else if ( IllegalArgumentException.class.isAssignableFrom( t.getClass() )) { ApiUsageException aue = new ApiUsageException( t.getMessage() ); aue.setStackTrace( t.getStackTrace() ); log.warn("IllegalArgumentException thrown:\n"+aue.getStackTrace()); return aue; } else { // Wrap all other exceptions in InternalException InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re; } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/ServiceHandler.java/buggy/components/server/src/ome/services/util/ServiceHandler.java
if (anns == null) continue;
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { if ( implClass == null || mthd == null ) { throw new ApiUsageException( "ApiConstraintChecker expects non null class and method " + "arguments."); } log.info("Checking: " + mthd); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Object[] allAnnotations = findAnnotations(implClass, mthd); for (int j = 0; j < allAnnotations.length; j++) { Annotation[][] anns = (Annotation[][]) allAnnotations[j]; for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + mthd + " may not be null."; log.warn(msg); throw new ApiUsageException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new ApiUsageException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new ApiUsageException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(mthd + " is missing a required @" + Validate.class.getName() + " annotation. This should be added to one of the " + " implemented interfaces. Refusing to proceed..."); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a667964171a938ef9610f116ff3e28028965ec5a/ApiConstraintChecker.java/buggy/components/common/src/ome/annotations/ApiConstraintChecker.java
newProc.block = ((Block) runtime.getBlockStack().peek()).cloneBlock();
newProc.block = block.cloneBlock();
public static RubyProc newProc(Ruby runtime, boolean isLambda) { if (!runtime.isBlockGiven() && !runtime.isFBlockGiven()) { throw runtime.newArgumentError("tried to create Proc object without a block"); } RubyProc newProc = new RubyProc(runtime, runtime.getClasses().getProcClass()); newProc.block = ((Block) runtime.getBlockStack().peek()).cloneBlock(); newProc.wrapper = runtime.getWrapper(); newProc.block.setIter(newProc.block.getNext() != null ? Iter.ITER_PRE : Iter.ITER_NOT); newProc.block.isLambda = isLambda; return newProc; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/50d6342dd5da06c42d25bc955addce6aaa0e6b97/RubyProc.java/buggy/src/org/jruby/RubyProc.java
block.setBlockObject(newProc);
public static RubyProc newProc(Ruby runtime, boolean isLambda) { if (!runtime.isBlockGiven() && !runtime.isFBlockGiven()) { throw runtime.newArgumentError("tried to create Proc object without a block"); } RubyProc newProc = new RubyProc(runtime, runtime.getClasses().getProcClass()); newProc.block = ((Block) runtime.getBlockStack().peek()).cloneBlock(); newProc.wrapper = runtime.getWrapper(); newProc.block.setIter(newProc.block.getNext() != null ? Iter.ITER_PRE : Iter.ITER_NOT); newProc.block.isLambda = isLambda; return newProc; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/50d6342dd5da06c42d25bc955addce6aaa0e6b97/RubyProc.java/buggy/src/org/jruby/RubyProc.java
List getLocalValues() {
public List getLocalValues() {
List getLocalValues() { return localValues; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6e143e1ded2275ed4da3449d4a13446b099f800d/Scope.java/buggy/src/org/jruby/runtime/Scope.java
identities.remove(long Long(ref.id()));
identities.remove(new Long(ref.id()));
private void cleanIdentities() { IdReference ref; while ((ref = (IdReference) deadIdentityReferences.poll()) != null) identities.remove(long Long(ref.id())); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/39287875330d64df4598a499096484bb5f65fdc3/ObjectSpace.java/buggy/src/org/jruby/runtime/ObjectSpace.java
Block oldBlock = ruby.getBlock().getCurrent(); ruby.getBlock().push(((RubyProc) block).getBlock());
Block oldBlock = ruby.getBlockStack().getCurrent(); ruby.getBlockStack().push(((RubyProc) block).getBlock());
public void visitBlockPassNode(BlockPassNode iVisited) { IRubyObject block = eval(iVisited.getBodyNode()); if (block.isNil()) { eval(iVisited.getIterNode()); return; } else if (block instanceof RubyMethod) { block = ((RubyMethod)block).to_proc(); } else if (!(block instanceof RubyProc)) { throw new TypeError(ruby, "wrong argument type " + block.getInternalClass().toName() + " (expected Proc)"); } Block oldBlock = ruby.getBlock().getCurrent(); ruby.getBlock().push(((RubyProc) block).getBlock()); ruby.getIterStack().push(Iter.ITER_PRE); ruby.getCurrentFrame().setIter(Iter.ITER_PRE); try { eval(iVisited.getIterNode()); } finally { ruby.getIterStack().pop(); ruby.getBlock().setCurrent(oldBlock); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java
ruby.getBlock().setCurrent(oldBlock);
ruby.getBlockStack().setCurrent(oldBlock);
public void visitBlockPassNode(BlockPassNode iVisited) { IRubyObject block = eval(iVisited.getBodyNode()); if (block.isNil()) { eval(iVisited.getIterNode()); return; } else if (block instanceof RubyMethod) { block = ((RubyMethod)block).to_proc(); } else if (!(block instanceof RubyProc)) { throw new TypeError(ruby, "wrong argument type " + block.getInternalClass().toName() + " (expected Proc)"); } Block oldBlock = ruby.getBlock().getCurrent(); ruby.getBlock().push(((RubyProc) block).getBlock()); ruby.getIterStack().push(Iter.ITER_PRE); ruby.getCurrentFrame().setIter(Iter.ITER_PRE); try { eval(iVisited.getIterNode()); } finally { ruby.getIterStack().pop(); ruby.getBlock().setCurrent(oldBlock); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java
ruby.getBlock().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject());
ruby.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject());
public void visitForNode(ForNode iVisited) { ruby.getBlock().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject()); ruby.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); // XXX ruby.getBlock().flags &= ~RubyBlock.BLOCK_D_SCOPE; Block tmpBlock = ArgsUtil.beginCallArgs(ruby); IRubyObject recv = eval(iVisited.getIterNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); ruby.setSourceFile(file); ruby.setSourceLine(line); result = recv.getInternalClass().call(recv.toRubyObject(), "each", null, 0); return; } catch (RetryException rExcptn) { } } } catch (ReturnException rExcptn) { result = rExcptn.getReturnValue(); } catch (BreakJump bExcptn) { result = ruby.getNil(); } finally { ruby.getIterStack().pop(); ruby.getBlock().pop(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java
ruby.getBlock().pop();
ruby.getBlockStack().pop();
public void visitForNode(ForNode iVisited) { ruby.getBlock().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject()); ruby.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); // XXX ruby.getBlock().flags &= ~RubyBlock.BLOCK_D_SCOPE; Block tmpBlock = ArgsUtil.beginCallArgs(ruby); IRubyObject recv = eval(iVisited.getIterNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); ruby.setSourceFile(file); ruby.setSourceLine(line); result = recv.getInternalClass().call(recv.toRubyObject(), "each", null, 0); return; } catch (RetryException rExcptn) { } } } catch (ReturnException rExcptn) { result = rExcptn.getReturnValue(); } catch (BreakJump bExcptn) { result = ruby.getNil(); } finally { ruby.getIterStack().pop(); ruby.getBlock().pop(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java
ruby.getBlock().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject());
ruby.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject());
public void visitIterNode(IterNode iVisited) { ruby.getBlock().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject()); ruby.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { result = eval(iVisited.getIterNode()); return; } catch (RetryException rExcptn) { } } } catch (ReturnException rExcptn) { result = rExcptn.getReturnValue(); } catch (BreakJump bExcptn) { result = ruby.getNil(); } finally { ruby.getIterStack().pop(); ruby.getBlock().pop(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java
ruby.getBlock().pop();
ruby.getBlockStack().pop();
public void visitIterNode(IterNode iVisited) { ruby.getBlock().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject()); ruby.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { result = eval(iVisited.getIterNode()); return; } catch (RetryException rExcptn) { } } } catch (ReturnException rExcptn) { result = rExcptn.getReturnValue(); } catch (BreakJump bExcptn) { result = ruby.getNil(); } finally { ruby.getIterStack().pop(); ruby.getBlock().pop(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java
public NoteTreeNode(Tree parent, Note data) { treeItem = new TreeItem(parent, SWT.NONE);
public NoteTreeNode(NoteTreeNode parent, DisplayedNote data) { treeItem = new TreeItem(parent.treeItem, SWT.NONE);
public NoteTreeNode(Tree parent, Note data) { treeItem = new TreeItem(parent, SWT.NONE); init(data); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/a21e67d29e81a4038ecb2d55530f57396df4085c/NoteTreeNode.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTreeNode.java
if (displayedNote.getTab() != null) displayedNote.getTab().dispose();
for (TreeItem childTi : treeItem.getItems()) { ((NoteTreeNode) childTi.getData()).dispose(); }
public void dispose() { if (displayedNote.getTab() != null) displayedNote.getTab().dispose(); treeItem.dispose(); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/a21e67d29e81a4038ecb2d55530f57396df4085c/NoteTreeNode.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTreeNode.java
private void init(Note data) { this.displayedNote = new DisplayedNote(this, data);
private void init(DisplayedNote data) { displayedNote = data;
private void init(Note data) { this.displayedNote = new DisplayedNote(this, data); treeItem.setText(data.getName()); treeItem.setData(this); for (Note n : data.getChildren()) { new NoteTreeNode(treeItem, n); } }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/a21e67d29e81a4038ecb2d55530f57396df4085c/NoteTreeNode.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTreeNode.java
for (Note n : data.getChildren()) { new NoteTreeNode(treeItem, n); }
private void init(Note data) { this.displayedNote = new DisplayedNote(this, data); treeItem.setText(data.getName()); treeItem.setData(this); for (Note n : data.getChildren()) { new NoteTreeNode(treeItem, n); } }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/a21e67d29e81a4038ecb2d55530f57396df4085c/NoteTreeNode.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTreeNode.java
public MetaClass(Ruby runtime, RubyClass type, RubyClass superClass) { super(runtime, type, superClass);
public MetaClass(Ruby runtime, RubyClass superClass, RubyModule parentModule) { super(runtime, runtime.getClasses().getClassClass(), superClass, parentModule, null);
public MetaClass(Ruby runtime, RubyClass type, RubyClass superClass) { super(runtime, type, superClass); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/32d84ae899fd3c367ef3800d0984b69f53209031/MetaClass.java/buggy/src/org/jruby/MetaClass.java
System.out.println("command: " + lShellProp + " " + lSwitch + " " + lCommand);
public static RubyObject backquote(Ruby ruby, RubyObject recv, RubyString aString) { // XXX use other methods try { String lShellProp = System.getProperty("jruby.shell"); Process aProcess; String lCommand = aString.toString(); String lSwitch = "-c"; if (lShellProp != null) { if (!lShellProp.endsWith("sh")) //case windowslike lSwitch = "/c"; System.out.println("command: " + lShellProp + " " + lSwitch + " " + lCommand); aProcess = Runtime.getRuntime().exec(new String[] { lShellProp, lSwitch, lCommand}); } else { System.out.println("command: " + lCommand); aProcess = Runtime.getRuntime().exec(lCommand); } final StringBuffer sb = new StringBuffer(); final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); String line; while ((line = reader.readLine()) != null) { sb.append(line).append('\n'); } aProcess.waitFor(); return RubyString.newString(ruby, sb.toString()); } catch (Exception excptn) { excptn.printStackTrace(); return RubyString.newString(ruby, ""); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/64e7f5fdb16cb9a9a712da37e02ccfe842e598f3/RubyGlobal.java/buggy/org/jruby/RubyGlobal.java
System.out.println("command: " + lCommand);
public static RubyObject backquote(Ruby ruby, RubyObject recv, RubyString aString) { // XXX use other methods try { String lShellProp = System.getProperty("jruby.shell"); Process aProcess; String lCommand = aString.toString(); String lSwitch = "-c"; if (lShellProp != null) { if (!lShellProp.endsWith("sh")) //case windowslike lSwitch = "/c"; System.out.println("command: " + lShellProp + " " + lSwitch + " " + lCommand); aProcess = Runtime.getRuntime().exec(new String[] { lShellProp, lSwitch, lCommand}); } else { System.out.println("command: " + lCommand); aProcess = Runtime.getRuntime().exec(lCommand); } final StringBuffer sb = new StringBuffer(); final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); String line; while ((line = reader.readLine()) != null) { sb.append(line).append('\n'); } aProcess.waitFor(); return RubyString.newString(ruby, sb.toString()); } catch (Exception excptn) { excptn.printStackTrace(); return RubyString.newString(ruby, ""); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/64e7f5fdb16cb9a9a712da37e02ccfe842e598f3/RubyGlobal.java/buggy/org/jruby/RubyGlobal.java
if (level < 0) { StringBuffer sb = new StringBuffer(100); if (frame.getLastFunc() != null) { sb.append(ruby.getSourceFile()).append(':').append(ruby.getSourceLine()); sb.append(":in '").append(frame.getLastFunc()).append('\''); } else if (ruby.getSourceLine() == 0) { sb.append(ruby.getSourceFile()); } else { sb.append(ruby.getSourceFile()).append(':').append(ruby.getSourceLine()); } backtrace.push(RubyString.newString(ruby, sb.toString())); } else {
public static RubyArray createBacktrace(Ruby ruby, int level) { RubyFrame frame = ruby.getRubyFrame(); RubyArray backtrace = RubyArray.newArray(ruby); if (level < 0) { StringBuffer sb = new StringBuffer(100); if (frame.getLastFunc() != null) { sb.append(ruby.getSourceFile()).append(':').append(ruby.getSourceLine()); sb.append(":in '").append(frame.getLastFunc()).append('\''); } else if (ruby.getSourceLine() == 0) { sb.append(ruby.getSourceFile()); } else { sb.append(ruby.getSourceFile()).append(':').append(ruby.getSourceLine()); } backtrace.push(RubyString.newString(ruby, sb.toString())); } else { while (level-- > 0) { frame = frame.getPrev(); if (frame == null) { return RubyArray.nilArray(ruby); } } } while (frame != null && frame.getFile() != null) { StringBuffer sb = new StringBuffer(100); if (frame.getPrev() != null && frame.getPrev().getLastFunc() != null) { sb.append(frame.getFile()).append(':').append(frame.getLine()); sb.append(":in '").append(frame.getPrev().getLastFunc()).append('\''); } else { sb.append(frame.getFile()).append(':').append(frame.getLine()); } backtrace.push(RubyString.newString(ruby, sb.toString())); frame = frame.getPrev(); } return backtrace; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/RaiseException.java/buggy/org/jruby/exceptions/RaiseException.java
}
public static RubyArray createBacktrace(Ruby ruby, int level) { RubyFrame frame = ruby.getRubyFrame(); RubyArray backtrace = RubyArray.newArray(ruby); if (level < 0) { StringBuffer sb = new StringBuffer(100); if (frame.getLastFunc() != null) { sb.append(ruby.getSourceFile()).append(':').append(ruby.getSourceLine()); sb.append(":in '").append(frame.getLastFunc()).append('\''); } else if (ruby.getSourceLine() == 0) { sb.append(ruby.getSourceFile()); } else { sb.append(ruby.getSourceFile()).append(':').append(ruby.getSourceLine()); } backtrace.push(RubyString.newString(ruby, sb.toString())); } else { while (level-- > 0) { frame = frame.getPrev(); if (frame == null) { return RubyArray.nilArray(ruby); } } } while (frame != null && frame.getFile() != null) { StringBuffer sb = new StringBuffer(100); if (frame.getPrev() != null && frame.getPrev().getLastFunc() != null) { sb.append(frame.getFile()).append(':').append(frame.getLine()); sb.append(":in '").append(frame.getPrev().getLastFunc()).append('\''); } else { sb.append(frame.getFile()).append(':').append(frame.getLine()); } backtrace.push(RubyString.newString(ruby, sb.toString())); frame = frame.getPrev(); } return backtrace; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/RaiseException.java/buggy/org/jruby/exceptions/RaiseException.java
public void push(StackElement newElement) { if (top != null) { ((Scope) top).setMethodScope(ruby.getActMethodScope());
public void push(List localNames) { push(); setLocalNames(localNames); if (localNames != null) { setLocalValues(new ArrayList(Collections.nCopies(localNames.size(), ruby.getNil())));
public void push(StackElement newElement) { if (top != null) { ((Scope) top).setMethodScope(ruby.getActMethodScope()); } super.push(newElement); ruby.setActMethodScope(Constants.NOEX_PUBLIC); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e92b4e4534b91ba3b317a0b178054259c061476a/ScopeStack.java/clean/org/jruby/runtime/ScopeStack.java
super.push(newElement); ruby.setActMethodScope(Constants.NOEX_PUBLIC);
public void push(StackElement newElement) { if (top != null) { ((Scope) top).setMethodScope(ruby.getActMethodScope()); } super.push(newElement); ruby.setActMethodScope(Constants.NOEX_PUBLIC); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e92b4e4534b91ba3b317a0b178054259c061476a/ScopeStack.java/clean/org/jruby/runtime/ScopeStack.java
setRolloverEnabled(true);
PinButton(ImageNode node) { if (node == null) throw new IllegalArgumentException("No node"); parentNode = node; setBorder(BorderFactory.createEmptyBorder()); //No border around icon. setMargin(new Insets(0, 0, 0, 0));//Just to make sure button sz=icon sz. setOpaque(false); //B/c button=icon. setFocusPainted(false); //Don't paint focus box on top of icon. setRolloverEnabled(true); IconManager im = IconManager.getInstance(); setIcon(im.getIcon(IconManager.PIN_SMALL)); setRolloverIcon(im.getIcon(IconManager.PIN_SMALL_OVER)); setToolTipText(DESCRIPTION); addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { parentNode.pinThumbnail(); } }); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/58be91fb535c971d0bef1fde12344382b140273b/PinButton.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/browser/PinButton.java
setRolloverIcon(im.getIcon(IconManager.PIN_SMALL_OVER));
PinButton(ImageNode node) { if (node == null) throw new IllegalArgumentException("No node"); parentNode = node; setBorder(BorderFactory.createEmptyBorder()); //No border around icon. setMargin(new Insets(0, 0, 0, 0));//Just to make sure button sz=icon sz. setOpaque(false); //B/c button=icon. setFocusPainted(false); //Don't paint focus box on top of icon. setRolloverEnabled(true); IconManager im = IconManager.getInstance(); setIcon(im.getIcon(IconManager.PIN_SMALL)); setRolloverIcon(im.getIcon(IconManager.PIN_SMALL_OVER)); setToolTipText(DESCRIPTION); addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { parentNode.pinThumbnail(); } }); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/58be91fb535c971d0bef1fde12344382b140273b/PinButton.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/browser/PinButton.java
private void addContactListToWorkspace() { Workspace workspace = SparkManager.getWorkspace(); workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); //NOTRANS // Add To Contacts Menu final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); JMenuItem addContactsMenu = new JMenuItem("", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); contactsMenu.add(addContactsMenu); contactsMenu.add(addContactGroupMenu); addContactsMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); addContactGroupMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); } } } }); // Add Toggle Contacts Menu ResourceUtils.resButton(showHideMenu, "&Show Empty Groups"); contactsMenu.add(showHideMenu); showHideMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(showHideMenu.isSelected()); } }); // Initialize vcard support SparkManager.getVCardManager(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
contactGroup.setVisible(true); validateTree(); repaint();
private void addContactListToWorkspace() { Workspace workspace = SparkManager.getWorkspace(); workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); //NOTRANS // Add To Contacts Menu final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); JMenuItem addContactsMenu = new JMenuItem("", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); contactsMenu.add(addContactsMenu); contactsMenu.add(addContactGroupMenu); addContactsMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); addContactGroupMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); } } } }); // Add Toggle Contacts Menu ResourceUtils.resButton(showHideMenu, "&Show Empty Groups"); contactsMenu.add(showHideMenu); showHideMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(showHideMenu.isSelected()); } }); // Initialize vcard support SparkManager.getVCardManager(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
contactGroup.setVisible(true); validateTree(); repaint();
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterGroup group : entry.getGroups()){
for (RosterGroup group : entry.getGroups()) {
private void addUser(RosterEntry entry) { String name = entry.getName(); if (!ModelUtil.hasLength(name)) { name = entry.getUser(); } String nickname = entry.getName(); if (!ModelUtil.hasLength(nickname)) { nickname = entry.getUser(); } ContactItem newContactItem = new ContactItem(nickname, entry.getUser()); // Update users icon Presence presence = SparkManager.getConnection().getRoster().getPresence(entry.getUser()); newContactItem.setPresence(presence); if (entry != null && (entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM)) { // Ignore, since the new user is pending to be added. for(RosterGroup group : entry.getGroups()){ ContactGroup contactGroup = getContactGroup(group.getName()); if (contactGroup == null) { contactGroup = addContactGroup(group.getName()); } contactGroup.addContactItem(newContactItem); } return; } else { offlineGroup.addContactItem(newContactItem); } if (presence != null) { updateUserPresence(presence); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterGroup group : roster.getGroups()){
for (RosterGroup group : roster.getGroups()) {
private void buildContactList() { XMPPConnection con = SparkManager.getConnection(); final Roster roster = con.getRoster(); roster.addRosterListener(this); for(RosterGroup group : roster.getGroups()){ ContactGroup contactGroup = addContactGroup(group.getName()); for(RosterEntry entry : group.getEntries()){ String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); contactItem.setPresence(null); if ((entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { // Add to contact group. contactGroup.addContactItem(contactItem); contactGroup.setVisible(true); } else { if (offlineGroup.getContactItemByJID(entry.getUser()) == null) { offlineGroup.addContactItem(contactItem); } } } } // Add Unfiled Group // addContactGroup(unfiledGroup); for(RosterEntry entry : roster.getUnfiledEntries()){ String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); offlineGroup.addContactItem(contactItem); } unfiledGroup.setVisible(false); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterEntry entry : group.getEntries()){
for (RosterEntry entry : group.getEntries()) {
private void buildContactList() { XMPPConnection con = SparkManager.getConnection(); final Roster roster = con.getRoster(); roster.addRosterListener(this); for(RosterGroup group : roster.getGroups()){ ContactGroup contactGroup = addContactGroup(group.getName()); for(RosterEntry entry : group.getEntries()){ String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); contactItem.setPresence(null); if ((entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { // Add to contact group. contactGroup.addContactItem(contactItem); contactGroup.setVisible(true); } else { if (offlineGroup.getContactItemByJID(entry.getUser()) == null) { offlineGroup.addContactItem(contactItem); } } } } // Add Unfiled Group // addContactGroup(unfiledGroup); for(RosterEntry entry : roster.getUnfiledEntries()){ String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); offlineGroup.addContactItem(contactItem); } unfiledGroup.setVisible(false); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterEntry entry : roster.getUnfiledEntries()){
for (RosterEntry entry : roster.getUnfiledEntries()) {
private void buildContactList() { XMPPConnection con = SparkManager.getConnection(); final Roster roster = con.getRoster(); roster.addRosterListener(this); for(RosterGroup group : roster.getGroups()){ ContactGroup contactGroup = addContactGroup(group.getName()); for(RosterEntry entry : group.getEntries()){ String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); contactItem.setPresence(null); if ((entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { // Add to contact group. contactGroup.addContactItem(contactItem); contactGroup.setVisible(true); } else { if (offlineGroup.getContactItemByJID(entry.getUser()) == null) { offlineGroup.addContactItem(contactItem); } } } } // Add Unfiled Group // addContactGroup(unfiledGroup); for(RosterEntry entry : roster.getUnfiledEntries()){ String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); offlineGroup.addContactItem(contactItem); } unfiledGroup.setVisible(false); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterGroup rosterGroup : entry.getGroups()){
for (RosterGroup rosterGroup : entry.getGroups()) {
private void changeOfflineToOnline(String bareJID, final RosterEntry entry, Presence presence) { // Move out of offline group. Add to all groups. ContactItem offlineItem = offlineGroup.getContactItemByJID(bareJID); if (offlineItem == null) { return; } offlineGroup.removeContactItem(offlineItem); // Add To all groups it belongs to. boolean isFiled = false; for(RosterGroup rosterGroup : entry.getGroups()){ isFiled = true; ContactGroup contactGroup = getContactGroup(rosterGroup.getName()); if (contactGroup != null) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = null; if (contactGroup.getContactItemByJID(entry.getUser()) == null) { contactItem = new ContactItem(name, entry.getUser()); contactGroup.addContactItem(contactItem); } else if (contactGroup.getContactItemByJID(entry.getUser()) != null) { // If the user is in their, but without a nice presence. contactItem = contactGroup.getContactItemByJID(entry.getUser()); } contactItem.setPresence(presence); contactItem.setAvailable(true); toggleGroupVisibility(contactGroup.getGroupName(), true); contactItem.showUserComingOnline(); contactGroup.fireContactGroupUpdated(); int numberOfMillisecondsInTheFuture = 5000; Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture); Timer timer = new Timer(); final ContactItem staticItem = contactItem; final ContactGroup staticGroup = contactGroup; timer.schedule(new TimerTask() { public void run() { staticItem.updatePresenceIcon(staticItem.getPresence()); staticGroup.fireContactGroupUpdated(); } }, timeToRun); } } if (!isFiled) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); unfiledGroup.addContactItem(contactItem); contactItem.setPresence(presence); contactItem.setAvailable(true); unfiledGroup.setVisible(true); unfiledGroup.fireContactGroupUpdated(); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterEntry entry : roster.getEntries()){
for (RosterEntry entry : roster.getEntries()) {
public void clientReconnected() { XMPPConnection con = SparkManager.getConnection(); if (con.isConnected()) { // Send Available status final Presence presence = SparkManager.getWorkspace().getStatusBar().getPresence(); SparkManager.getSessionManager().changePresence(presence); final Roster roster = con.getRoster(); for(RosterEntry entry : roster.getEntries()){ updateUserPresence(roster.getPresence(entry.getUser())); } } workspace.changeCardLayout(Workspace.WORKSPACE_PANE); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterEntry entry : rosterGroup.getEntries()){
for (RosterEntry entry : rosterGroup.getEntries()) {
public void contactGroupPopup(MouseEvent e, final ContactGroup group) { // Do nothing with offline group if (group == offlineGroup || group == unfiledGroup) { return; } final JPopupMenu popup = new JPopupMenu(); popup.add(addContactMenu); popup.add(addContactGroupMenu); popup.addSeparator(); fireContextMenuListenerPopup(popup, group); JMenuItem delete = new JMenuItem("Delete"); JMenuItem rename = new JMenuItem("Rename"); if (!group.isSharedGroup()) { popup.addSeparator(); popup.add(delete); popup.add(rename); } delete.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for(RosterEntry entry : rosterGroup.getEntries()){ try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } } }); rename.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String newName = JOptionPane.showInputDialog(group, "Rename Roster Group", "Rename to:", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { removeContactGroup(group); rosterGroup.setName(newName); } } }); // popup.add(inviteFirstAcceptor); popup.show(group, e.getX(), e.getY()); activeGroup = group; }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterEntry entry : rosterGroup.getEntries()){
for (RosterEntry entry : rosterGroup.getEntries()) {
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for(RosterEntry entry : rosterGroup.getEntries()){ try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
boolean isUnfiled = true; for(RosterGroup group : rosterEntry.getGroups()){
boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) {
public void entriesUpdated(final Collection addresses) { SwingUtilities.invokeLater(new Runnable() { public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for(RosterGroup group : rosterEntry.getGroups()){ isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for(RosterGroup g : rosterEntry.getGroups()){ groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterGroup g : rosterEntry.getGroups()){
for (RosterGroup g : rosterEntry.getGroups()) {
public void entriesUpdated(final Collection addresses) { SwingUtilities.invokeLater(new Runnable() { public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for(RosterGroup group : rosterEntry.getGroups()){ isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for(RosterGroup g : rosterEntry.getGroups()){ groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
boolean isUnfiled = true; for(RosterGroup group : rosterEntry.getGroups()){
boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) {
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for(RosterGroup group : rosterEntry.getGroups()){ isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for(RosterGroup g : rosterEntry.getGroups()){ groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
for(RosterGroup g : rosterEntry.getGroups()){
for (RosterGroup g : rosterEntry.getGroups()) {
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for(RosterGroup group : rosterEntry.getGroups()){ isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for(RosterGroup g : rosterEntry.getGroups()){ groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java
, BorderFactory.createEtchedBorder());
, BorderFactory.createEtchedBorder());
public RosterDialog() { contactList = SparkManager.getWorkspace().getContactList(); panel = new JPanel(); JLabel contactIDLabel = new JLabel(); jidField = new JTextField(); JLabel nicknameLabel = new JLabel(); nicknameField = new JTextField(); JLabel groupLabel = new JLabel(); groupBox = new JComboBox(groupModel); JButton newGroupButton = new JButton(); JLabel accountsLabel = new JLabel(); accounts = new JComboBox(); publicBox = new JCheckBox(Res.getString("label.user.on.public.network")); ResourceUtils.resLabel(accountsLabel, publicBox, Res.getString("label.network")); pane = null; dialog = null; panel.setLayout(new GridBagLayout()); panel.add(contactIDLabel, new GridBagConstraints(0, 0, 1, 1, 0.0D, 0.0D, 17, 2, new Insets(5, 5, 5, 5), 0, 0)); panel.add(jidField, new GridBagConstraints(1, 0, 1, 1, 1.0D, 0.0D, 17, 2, new Insets(5, 5, 5, 5), 0, 0)); panel.add(nicknameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0D, 0.0D, 17, 2, new Insets(5, 5, 5, 5), 0, 0)); panel.add(nicknameField, new GridBagConstraints(1, 1, 1, 1, 1.0D, 0.0D, 17, 2, new Insets(5, 5, 5, 5), 0, 0)); ComponentTitledBorder componentBorder = new ComponentTitledBorder(publicBox, networkPanel , BorderFactory.createEtchedBorder()); networkPanel.add(accountsLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 17, 2, new Insets(5, 5, 5, 5), 0, 0)); networkPanel.add(accounts, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, 17, 2, new Insets(5, 5, 5, 5), 0, 0)); networkPanel.setBorder(componentBorder); networkPanel.setVisible(false); accounts.setEnabled(false); panel.add(groupLabel, new GridBagConstraints(0, 4, 1, 1, 0.0D, 0.0D, 17, 2, new Insets(5, 5, 5, 5), 0, 0)); panel.add(groupBox, new GridBagConstraints(1, 4, 1, 1, 1.0D, 0.0D, 17, 2, new Insets(5, 5, 5, 5), 0, 0)); panel.add(newGroupButton, new GridBagConstraints(2, 4, 1, 1, 0.0D, 0.0D, 17, 2, new Insets(5, 5, 5, 5), 0, 0)); newGroupButton.addActionListener(this); panel.add(networkPanel, new GridBagConstraints(0, 5, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); ResourceUtils.resLabel(contactIDLabel, jidField, Res.getString("label.username") + ":"); ResourceUtils.resLabel(nicknameLabel, nicknameField, Res.getString("label.nickname") + ":"); ResourceUtils.resLabel(groupLabel, groupBox, Res.getString("label.group") + ":"); ResourceUtils.resButton(newGroupButton, Res.getString("button.new")); accounts.setRenderer(new JPanelRenderer()); for (ContactGroup group : contactList.getContactGroups()) { if (!group.isOfflineGroup() && !"Unfiled".equalsIgnoreCase(group.getGroupName()) && !group.isSharedGroup()) { groupModel.add(group.getGroupName()); } } groupBox.setEditable(true); if (groupModel.size() == 0) { groupBox.addItem("Friends"); } if (groupModel.size() > 0) { groupBox.setSelectedIndex(0); } jidField.addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { } public void focusLost(FocusEvent e) { String jid = jidField.getText(); String nickname = nicknameField.getText(); if (!ModelUtil.hasLength(nickname) && ModelUtil.hasLength(jid)) { nickname = StringUtils.parseName(jid); if (!ModelUtil.hasLength(nickname)) { nickname = jid; } nicknameField.setText(nickname); } } }); final List<AccountItem> accountCol = getAccounts(); for (AccountItem item : accountCol) { accounts.addItem(item); } if (accountCol.size() > 0) { accountsLabel.setVisible(true); accounts.setVisible(true); publicBox.setVisible(true); networkPanel.setVisible(true); } publicBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { accounts.setEnabled(publicBox.isSelected()); } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/6c0051f92a99737d42226d1e696824d21ec0dcd2/RosterDialog.java/buggy/src/java/org/jivesoftware/spark/ui/RosterDialog.java
public void showRosterDialog() { showRosterDialog(SparkManager.getMainWindow());
public void showRosterDialog(JFrame parent) { TitlePanel titlePanel = new TitlePanel(Res.getString("title.add.contact"), Res.getString("message.add.contact.to.list"), null, true); JPanel mainPanel = new JPanel() { public Dimension getPreferredSize() { final Dimension size = super.getPreferredSize(); size.width = 350; return size; } }; mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); Object[] options = { Res.getString("add"), Res.getString("cancel") }; pane = new JOptionPane(panel, -1, 2, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); dialog = new JDialog(parent, Res.getString("title.add.contact"), false); dialog.setContentPane(mainPanel); dialog.pack(); dialog.setLocationRelativeTo(parent); pane.addPropertyChangeListener(this); dialog.setVisible(true); dialog.toFront(); dialog.requestFocus(); jidField.requestFocus();
public void showRosterDialog() { showRosterDialog(SparkManager.getMainWindow()); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/6c0051f92a99737d42226d1e696824d21ec0dcd2/RosterDialog.java/buggy/src/java/org/jivesoftware/spark/ui/RosterDialog.java