rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
{ zoomLevel = value; control.setZoomLevel(zoomLevel); } | { zoomLevel = value; control.setZoomLevel(zoomLevel); } | private void synchZoom(double value) { zoomLevel = value; control.setZoomLevel(zoomLevel); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
{ boolean valid = false; double val = 0; try { val = percentFormat.parse(zoomField.getText()).doubleValue(); if (ImageInspector.MIN_ZOOM_LEVEL <= val && val <= ImageInspector.MAX_ZOOM_LEVEL) { valid = true; } else if (val < ImageInspector.MIN_ZOOM_LEVEL) { val = ImageInspector.MIN_ZOOM_LEVEL; valid = true; } else if (val > ImageInspector.MAX_ZOOM_LEVEL) { val = ImageInspector.MAX_ZOOM_LEVEL; valid = true; } } catch(NumberFormatException nfe) {} catch(ParseException e) {} if (valid) synchZoom(val); else { zoomField.selectAll(); UserNotifier un = view.getRegistry().getUserNotifier(); un.notifyInfo("Invalid input value", "Please enter a value between 25% and 300%."); } } | { boolean valid = false; double val = 0; try { val = percentFormat.parse(zoomField.getText()).doubleValue(); if (ImageInspector.MIN_ZOOM_LEVEL <= val && val <= ImageInspector.MAX_ZOOM_LEVEL) { valid = true; } else if (val < ImageInspector.MIN_ZOOM_LEVEL) { val = ImageInspector.MIN_ZOOM_LEVEL; valid = true; } else if (val > ImageInspector.MAX_ZOOM_LEVEL) { val = ImageInspector.MAX_ZOOM_LEVEL; valid = true; } } catch(NumberFormatException nfe) {} catch(ParseException e) {} if (valid) synchZoom(val); else { zoomField.selectAll(); UserNotifier un = view.getRegistry().getUserNotifier(); un.notifyInfo("Invalid input value", "Please enter a value between 25% and 300%."); } } | private void zoomFieldActionHandler() { boolean valid = false; double val = 0; try { val = percentFormat.parse(zoomField.getText()).doubleValue(); if (ImageInspector.MIN_ZOOM_LEVEL <= val && val <= ImageInspector.MAX_ZOOM_LEVEL) { valid = true; } else if (val < ImageInspector.MIN_ZOOM_LEVEL) { val = ImageInspector.MIN_ZOOM_LEVEL; valid = true; } else if (val > ImageInspector.MAX_ZOOM_LEVEL) { val = ImageInspector.MAX_ZOOM_LEVEL; valid = true; } } catch(NumberFormatException nfe) {} catch(ParseException e) {} if (valid) synchZoom(val); else { zoomField.selectAll(); UserNotifier un = view.getRegistry().getUserNotifier(); un.notifyInfo("Invalid input value", "Please enter a value between 25% and 300%."); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
{ zoomLevel = ImageInspector.ZOOM_DEFAULT; control.setZoomLevel(zoomLevel); } | { zoomLevel = ImageInspector.ZOOM_DEFAULT; control.setZoomLevel(zoomLevel); } | private void zoomFit() { zoomLevel = ImageInspector.ZOOM_DEFAULT; control.setZoomLevel(zoomLevel); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
{ if (zoomLevel < ImageInspector.MAX_ZOOM_LEVEL) | { if (zoomLevel < ImageInspector.MAX_ZOOM_LEVEL) | private void zoomIn() { if (zoomLevel < ImageInspector.MAX_ZOOM_LEVEL) zoomLevel += ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
control.setZoomLevel(zoomLevel); } | control.setZoomLevel(zoomLevel); } | private void zoomIn() { if (zoomLevel < ImageInspector.MAX_ZOOM_LEVEL) zoomLevel += ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
{ if (zoomLevel > ImageInspector.MIN_ZOOM_LEVEL) zoomLevel -= ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); } | { if (zoomLevel > ImageInspector.MIN_ZOOM_LEVEL) zoomLevel -= ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); } | private void zoomOut() { if (zoomLevel > ImageInspector.MIN_ZOOM_LEVEL) zoomLevel -= ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
ImageDisplay newObject = (ImageDisplay) node.getUserObject(); | Object uo = node.getUserObject(); if (uo instanceof String) return; ImageDisplay newObject = (ImageDisplay) uo; | void setSelectedNode() { DefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent(); if (selectedNode == node) return; ImageDisplay newObject = (ImageDisplay) node.getUserObject(); ImageDisplay oldObject = null; if (selectedNode != null) oldObject = (ImageDisplay) selectedNode.getUserObject(); firePropertyChange(ClipBoard.LOCALIZE_IMAGE_DISPLAY, oldObject, newObject); selectedNode = node; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3feec30057da68977528d8509d07bff5c080fb40/SearchResultsPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/SearchResultsPane.java |
List list = CollectionSorter.sortImageDisplay(nodes); | ViewerSorter sorter = new ViewerSorter(nodes); List list = sorter.sort(); | void buildTree(Set nodes) { if (nodes.size() == 0) { getTreeModel(); DefaultMutableTreeNode childNode = new DefaultMutableTreeNode("Empty"); DefaultTreeModel tm= (DefaultTreeModel) view.getModel(); tm.insertNodeInto(childNode, root, root.getChildCount()); } else { List list = CollectionSorter.sortImageDisplay(nodes); Iterator i = list.iterator(); while (i.hasNext()) buildTreeNode((ImageDisplay) i.next()); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/SearchResultsPaneMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/SearchResultsPaneMng.java |
protected DataLoader createHierarchyLoader() | protected DataLoader createHierarchyLoader(boolean refresh) | protected DataLoader createHierarchyLoader() { return new ImagesLoader(component, imagesID); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fb3743d6f75abbf12f788b3b2925f4a6f4606dd6/ImagesModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/ImagesModel.java |
return new ImagesLoader(component, imagesID); | return new ImagesLoader(component, imagesID, refresh); | protected DataLoader createHierarchyLoader() { return new ImagesLoader(component, imagesID); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fb3743d6f75abbf12f788b3b2925f4a6f4606dd6/ImagesModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/ImagesModel.java |
super.paintComponent(g); | public void paintComponent(Graphics g) { Graphics2D g2D = (Graphics2D) g; g2D.setColor(bgColor); g2D.fillRect(0, 0, WIDTH, HEIGHT); Font font = g2D.getFont(); FontMetrics fontMetrics = g2D.getFontMetrics(); int hFont = fontMetrics.getHeight(); Rectangle2D rInput = font.getStringBounds("Input", g2D.getFontRenderContext()); int wInput = (int) rInput.getWidth(); // grid AffineTransform transform = new AffineTransform(); // 140/10 =14 then middle = 14/2 transform.translate(leftBorder+70, topBorder+70); transform.scale(1, -1); transform.scale(10, 10); g2D.setPaint(gridColor); GeneralPath path = new GeneralPath(); for (int i = -7; i <= 7; i++) { path.moveTo(i, -7); path.lineTo(i, 7); } for (int i = -7; i <= 7; i++) { path.moveTo(-7, i); path.lineTo(7, i); } g2D.draw(transform.createTransformedShape(path)); g2D.setColor(axisColor); //y-axis g2D.drawLine(leftBorder, topBorder-8, leftBorder, tS+5); g2D.drawLine(leftBorder, topBorder-8, leftBorder-3, topBorder-5); g2D.drawLine(leftBorder, topBorder-8, leftBorder+3, topBorder-5); g2D.drawLine(leftBorder-5, topBorder, leftBorder, topBorder); // x-axis g2D.drawLine(leftBorder-5, tS, lS+8, tS); g2D.drawLine(lS+5, tS-3, lS+8, tS); g2D.drawLine(lS+5, tS+3, lS+8, tS); g2D.drawLine(lS, tS, lS, tS+5); //input knob start int xStartPoints[] = {xStart1, xStart2, xStart3}; int yStartPoints[] = {yStart1, yStart2, yStart3}; GeneralPath filledPolygonStart = new GeneralPath(); filledPolygonStart.moveTo(xStartPoints[0], yStartPoints[0]); for (int index = 1; index < xStartPoints.length; index++) filledPolygonStart.lineTo(xStartPoints[index], yStartPoints[index]); filledPolygonStart.closePath(); g2D.setColor(startColor); g2D.fill(filledPolygonStart); //input knob end int xEndPoints[] = {xEnd1, xEnd2, xEnd3}; int yEndPoints[] = {yEnd1, yEnd2, yEnd3}; GeneralPath filledPolygonEnd = new GeneralPath(); filledPolygonEnd.moveTo(xEndPoints[0], yEndPoints[0]); for (int index = 1; index < xEndPoints.length; index++) filledPolygonEnd.lineTo(xEndPoints[index], yEndPoints[index]); filledPolygonEnd.closePath(); g2D.setColor(endColor); g2D.fill(filledPolygonEnd); // output knob start int xStartOutputPoints[] = {xStartOutput1, xStartOutput2, xStartOutput3}; int yStartOutputPoints[] = {yStartOutput1, yStartOutput2, yStartOutput3}; GeneralPath filledPolygonStartOutput = new GeneralPath(); filledPolygonStartOutput.moveTo(xStartOutputPoints[0], yStartOutputPoints[0]); for (int index = 1; index < xStartOutputPoints.length; index++) filledPolygonStartOutput.lineTo(xStartOutputPoints[index], yStartOutputPoints[index]); filledPolygonStartOutput.closePath(); g2D.setColor(startColor); g2D.fill(filledPolygonStartOutput); //output knob end int xEndOutputPoints[] = {xEndOutput1, xEndOutput2, xEndOutput3}; int yEndOutputPoints[] = {yEndOutput1, yEndOutput2, yEndOutput3}; GeneralPath filledPolygonEndOutput = new GeneralPath(); filledPolygonEndOutput.moveTo(xEndOutputPoints[0], yEndOutputPoints[0]); for (int index = 1; index < xEndOutputPoints.length; index++) filledPolygonEndOutput.lineTo(xEndOutputPoints[index], yEndOutputPoints[index]); filledPolygonEndOutput.closePath(); g2D.setColor(endColor); g2D.fill(filledPolygonEndOutput); g2D.drawString("Input", lS2-wInput/2, tS+bottomBorder/2+hFont); // set line color g2D.setColor(lineColor); g2D.setStroke(new BasicStroke(1.5f)); // draw line g2D.drawLine((int) staticStartPt.getX(), (int) staticStartPt.getY(), (int) startPt.getX(), (int) startPt.getY()); g2D.drawLine((int) endPt.getX(), (int) endPt.getY(), (int) staticEndPt.getX(), (int) staticEndPt.getY()); g2D.drawLine((int) startPt.getX(), (int) startPt.getY(), (int) endPt.getX(), (int) endPt.getY()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6a28b54c142c80cf786f76c45b6be256d92fd0bb/ContrastStretchingPanel.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/pane/ContrastStretchingPanel.java |
|
int i, n = Integer.parseInt(args[0]); | public static void main(String args[]) { //@START int i, n = Integer.parseInt(args[0]); int x[] = new int[n]; int y[] = new int[n]; for (i = 0; i < n;) { x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; } for (i = n-1; i >= 0;) { y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; } System.out.println(y[n-1]); //@END } | 53330 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53330/eb6c850277407b38bcaefb81155941da0f27b849/ary2.java/buggy/tests/shootout/java-start/ary2.java |
|
if (!cMacro && Expression.isTrue(c)) | if (!cMacro && Expression.isTrue(c)) { | public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/060af610f80a0ac517b7fa651e088807402a5dba/IfDirective.java/buggy/webmacro/src/org/webmacro/directive/IfDirective.java |
nConditions=elseifCount; if (cMacro) ++nConditions; | nConditions=elseifCount + (cMacro? 1 : 0); | public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/060af610f80a0ac517b7fa651e088807402a5dba/IfDirective.java/buggy/webmacro/src/org/webmacro/directive/IfDirective.java |
private IRubyObject substr(int beg, int len) { | public IRubyObject substr(int beg, int len) { | private IRubyObject substr(int beg, int len) { int length = getValue().length(); if (len < 0 || beg > length) { return getRuntime().getNil(); } if (beg < 0) { beg += length; if (beg < 0) { return getRuntime().getNil(); } } int end = Math.min(length, beg + len); return newString(getMutableValue().substring(beg, end)).infectBy(this); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/39c46ceddd2033806c64aede42f0f510136c9575/RubyString.java/clean/src/org/jruby/RubyString.java |
if (limit == 0) { | if (limit == 0 && result.size() > 0) { | private void process() { if (limit == 1) { result.add(splitee); return; } int pos = 0; int beg = 0; int hits = 0; int len = splitee.length(); RubyString rubySplitee = runtime.newString(splitee); while ((beg = pattern.search(rubySplitee, pos)) > -1) { hits++; RubyMatchData matchData = (RubyMatchData) runtime.getBackref(); int end = matchData.matchEndPosition(); // Whitespace splits are supposed to ignore leading whitespace if (beg != 0 || !isWhitespace) { addResult(substring(splitee, pos, (beg == pos && end == beg) ? 1 : beg - pos)); // Add to list any /(.)/ matched. long extraPatterns = matchData.getSize(); for (int i = 1; i < extraPatterns; i++) { addResult(((RubyString) matchData.group(i)).getValue()); } } pos = (end == beg) ? beg + 1 : end; if (hits + 1 == limit) { break; } } if (hits == 0) { addResult(splitee); } else if (pos <= len) { addResult(substring(splitee, pos, len - pos)); } if (limit == 0) { while (((String) result.get(result.size() - 1)).length() == 0) { result.remove(result.size() - 1); } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/09d8f30f6aebff1911b6b5fb96b24e45094f8cd7/Split.java/buggy/src/org/jruby/util/Split.java |
state = ServiceState.STARTING; serviceMonitor.serviceStopping(createServiceEvent()); | public void destroy(StopStrategy stopStrategy) throws IllegalServiceStateException, UnsatisfiedConditionsException { // if we are not restartable, we need to stop try { if (!stop(stopStrategy)) { throw new IllegalServiceStateException("Service did not stop", serviceName); } } catch (UnsatisfiedConditionsException e) { throw e; } if (!serviceFactory.isRestartable()) { lock("destroy"); try { if (state != ServiceState.STOPPED) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } finally { unlock(); } } // cool we can unregistered serviceMonitor.serviceUnregistered(createServiceEvent()); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
|
serviceMonitor.serviceRegistered(createServiceEvent()); if (!serviceFactory.isRestartable()) { serviceMonitor.serviceRunning(createServiceEvent()); } | public void initialize() throws IllegalServiceStateException, UnsatisfiedConditionsException, Exception { // if we are not restartable, we need to start immediately, otherwise we are not going to register this service if (!serviceFactory.isRestartable()) { try { start(false, StartStrategies.UNREGISTER); } catch (UnregisterServiceException e) { Throwable cause = e.getCause(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new AssertionError(cause); } } // a non restartable service uses a special stop conditions object that picks up stop conditions as they // are added. When the stop() method is called on a non-restartable service all of the stop conditions // registered with the service factory are initialized (if not already initialized), and the isSatisfied // method is called. This should cause the stop logic of a stop condition to fire. lock("initialize"); try { stopConditions = new NonRestartableStopConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock, serviceFactory); } finally { unlock(); } } // cool we are registered serviceMonitor.serviceRegistered(createServiceEvent()); // if we are not restartable, we need to notify everyone we just started if (!serviceFactory.isRestartable()) { serviceMonitor.serviceRunning(createServiceEvent()); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
|
public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
||
managerFutures = new ArrayList(); | managerFutures = new ArrayList(serviceManagers.values()); | public void destroy() throws KernelErrorsError { // we gather all errors that occur during shutdown and throw them as on huge exception List errors = new ArrayList(); List managerFutures; synchronized (serviceManagers) { managerFutures = new ArrayList(); serviceManagers.clear(); } List managers = new ArrayList(managerFutures.size()); for (Iterator iterator = managerFutures.iterator(); iterator.hasNext();) { Future future = (Future) iterator.next(); try { managers.add(future.get()); } catch (InterruptedException e) { // ignore -- this should not happen errors.add(new AssertionError(e)); } catch (ExecutionException e) { // good -- one less manager to deal with } } // Be nice and try to stop asynchronously errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // Be really nice and try to stop asynchronously again errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // We have been nice enough now nuke them errors.addAll(stopAll(managers, StopStrategies.FORCE)); // All managers are gaurenteed to be destroyed now for (Iterator iterator = managers.iterator(); iterator.hasNext();) { ServiceManager serviceManager = (ServiceManager) iterator.next(); try { serviceManager.destroy(StopStrategies.FORCE); } catch (UnsatisfiedConditionsException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (IllegalServiceStateException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (RuntimeException e) { errors.add(new AssertionError(e)); } catch (Error e) { errors.add(new AssertionError(e)); } } if (!errors.isEmpty()) { throw new KernelErrorsError(errors); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/8ffa6e70ecadf740148645cc7424763fd6c4c8e9/ServiceManagerRegistry.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManagerRegistry.java |
public void destroy() throws KernelErrorsError { // we gather all errors that occur during shutdown and throw them as on huge exception List errors = new ArrayList(); List managerFutures; synchronized (serviceManagers) { managerFutures = new ArrayList(); serviceManagers.clear(); } List managers = new ArrayList(managerFutures.size()); for (Iterator iterator = managerFutures.iterator(); iterator.hasNext();) { Future future = (Future) iterator.next(); try { managers.add(future.get()); } catch (InterruptedException e) { // ignore -- this should not happen errors.add(new AssertionError(e)); } catch (ExecutionException e) { // good -- one less manager to deal with } } // Be nice and try to stop asynchronously errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // Be really nice and try to stop asynchronously again errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // We have been nice enough now nuke them errors.addAll(stopAll(managers, StopStrategies.FORCE)); // All managers are gaurenteed to be destroyed now for (Iterator iterator = managers.iterator(); iterator.hasNext();) { ServiceManager serviceManager = (ServiceManager) iterator.next(); try { serviceManager.destroy(StopStrategies.FORCE); } catch (UnsatisfiedConditionsException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (IllegalServiceStateException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (RuntimeException e) { errors.add(new AssertionError(e)); } catch (Error e) { errors.add(new AssertionError(e)); } } if (!errors.isEmpty()) { throw new KernelErrorsError(errors); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/8ffa6e70ecadf740148645cc7424763fd6c4c8e9/ServiceManagerRegistry.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManagerRegistry.java |
||
ent.setMethod(fbody.getBodyNode()); | ent.setMethod(fbody.getHeadNode()); | public GetMethodBodyResult getMethodBody(RubyId id, int noex) { GetMethodBodyResult result = new GetMethodBodyResult(this, id, noex); MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { System.out.println( "Cant find method \"" + id.toName() + "\" in class " + toName()); RubyMethodCacheEntry.saveEmptyEntry(getRuby(), this, id); return result; } RubyMethodCacheEntry ent = new RubyMethodCacheEntry(this, methodNode.getNoex()); Node body = methodNode.getBodyNode(); if (body instanceof FBodyNode) { FBodyNode fbody = (FBodyNode) body; ent.setMid(id); ent.setOrigin((RubyModule) fbody.getOrigin()); ent.setMid0(fbody.getMId()); ent.setMethod(fbody.getBodyNode()); result.setRecvClass((RubyModule) fbody.getOrigin()); result.setId(fbody.getMId()); body = fbody.getBodyNode(); } else { ent.setMid(id); ent.setMid0(id); ent.setOrigin(methodNode.getMethodOrigin()); ent.setMethod(body); result.setRecvClass(methodNode.getMethodOrigin()); } RubyMethodCacheEntry.saveEntry(getRuby(), this, id, ent); result.setNoex(ent.getNoex()); result.setBody(body); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c7f13fd014f31b83985a27d44855459fd7abe0c5/RubyModule.java/buggy/org/jruby/RubyModule.java |
body = fbody.getBodyNode(); | body = fbody.getHeadNode(); | public GetMethodBodyResult getMethodBody(RubyId id, int noex) { GetMethodBodyResult result = new GetMethodBodyResult(this, id, noex); MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { System.out.println( "Cant find method \"" + id.toName() + "\" in class " + toName()); RubyMethodCacheEntry.saveEmptyEntry(getRuby(), this, id); return result; } RubyMethodCacheEntry ent = new RubyMethodCacheEntry(this, methodNode.getNoex()); Node body = methodNode.getBodyNode(); if (body instanceof FBodyNode) { FBodyNode fbody = (FBodyNode) body; ent.setMid(id); ent.setOrigin((RubyModule) fbody.getOrigin()); ent.setMid0(fbody.getMId()); ent.setMethod(fbody.getBodyNode()); result.setRecvClass((RubyModule) fbody.getOrigin()); result.setId(fbody.getMId()); body = fbody.getBodyNode(); } else { ent.setMid(id); ent.setMid0(id); ent.setOrigin(methodNode.getMethodOrigin()); ent.setMethod(body); result.setRecvClass(methodNode.getMethodOrigin()); } RubyMethodCacheEntry.saveEntry(getRuby(), this, id, ent); result.setNoex(ent.getNoex()); result.setBody(body); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c7f13fd014f31b83985a27d44855459fd7abe0c5/RubyModule.java/buggy/org/jruby/RubyModule.java |
this.ctx.applyBeanPropertyValues(this,getName()); | this.ctx.applyBeanPropertyValues(this,getServiceInterface()); | public void selfConfigure() { this.ctx = OmeroContext.getInternalServerContext(); this.ctx.applyBeanPropertyValues(this,getName()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/AbstractLevel2Service.java/clean/components/server/src/ome/logic/AbstractLevel2Service.java |
public void setQueryFactory(QueryFactory factory){ | public void setQueryFactory(QueryFactory factory) { | public void setQueryFactory(QueryFactory factory){ this.queryFactory = factory; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/AbstractLevel2Service.java/clean/components/server/src/ome/logic/AbstractLevel2Service.java |
InetAddress inetAddress = InetAddress.getByName(name.getValue()); | InetAddress inetAddress = InetAddress.getByName(name.toString()); | public RubyArray gethostbyname(IRubyObject hostname) { try { RubyString name = (RubyString) hostname; InetAddress inetAddress = InetAddress.getByName(name.getValue()); List parts = new ArrayList(); parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); parts.add(RubyArray.newArray(getRuntime())); parts.add(new RubyFixnum(getRuntime(),2)); parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); return RubyArray.newArray(getRuntime(), parts); } catch (UnknownHostException e) { // DSC throw SystemError("gethostbyname"); return RubyArray.newArray(getRuntime()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/SocketMetaClass.java/buggy/src/org/jruby/libraries/SocketMetaClass.java |
parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); | parts.add(getRuntime().newString(inetAddress.getCanonicalHostName())); | public RubyArray gethostbyname(IRubyObject hostname) { try { RubyString name = (RubyString) hostname; InetAddress inetAddress = InetAddress.getByName(name.getValue()); List parts = new ArrayList(); parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); parts.add(RubyArray.newArray(getRuntime())); parts.add(new RubyFixnum(getRuntime(),2)); parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); return RubyArray.newArray(getRuntime(), parts); } catch (UnknownHostException e) { // DSC throw SystemError("gethostbyname"); return RubyArray.newArray(getRuntime()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/SocketMetaClass.java/buggy/src/org/jruby/libraries/SocketMetaClass.java |
parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); | parts.add(getRuntime().newString(RubyString.bytesToString(inetAddress.getAddress()))); | public RubyArray gethostbyname(IRubyObject hostname) { try { RubyString name = (RubyString) hostname; InetAddress inetAddress = InetAddress.getByName(name.getValue()); List parts = new ArrayList(); parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); parts.add(RubyArray.newArray(getRuntime())); parts.add(new RubyFixnum(getRuntime(),2)); parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); return RubyArray.newArray(getRuntime(), parts); } catch (UnknownHostException e) { // DSC throw SystemError("gethostbyname"); return RubyArray.newArray(getRuntime()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/SocketMetaClass.java/buggy/src/org/jruby/libraries/SocketMetaClass.java |
return new RubyString(getRuntime(), hostName); | return getRuntime().newString(hostName); | public RubyString gethostname() { try { String hostName = InetAddress.getLocalHost().getHostName(); return new RubyString(getRuntime(), hostName); } catch (UnknownHostException e) { // DSC throw SystemError("gethostname"); return new RubyString(getRuntime(), ""); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/SocketMetaClass.java/buggy/src/org/jruby/libraries/SocketMetaClass.java |
return new RubyString(getRuntime(), ""); | return getRuntime().newString(""); | public RubyString gethostname() { try { String hostName = InetAddress.getLocalHost().getHostName(); return new RubyString(getRuntime(), hostName); } catch (UnknownHostException e) { // DSC throw SystemError("gethostname"); return new RubyString(getRuntime(), ""); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/SocketMetaClass.java/buggy/src/org/jruby/libraries/SocketMetaClass.java |
recursivelyCreateDirectory( new File(path).getParent()); | private void initPixelBuffer(PixelBuffer pixbuf) throws IOException { String path = getPixelsPath(pixbuf.getId()); byte[] padding = new byte[pixbuf.getPlaneSize() - NULL_PLANE_SIZE]; FileOutputStream stream = new FileOutputStream(path); for (int z = 0; z < pixbuf.getSizeZ(); z++) { for (int c = 0; c < pixbuf.getSizeC(); c++) { for (int t = 0; t < pixbuf.getSizeT(); t++) { stream.write(nullPlane); stream.write(padding); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9c735beaf7566accca575d2206f57f51b950ee15/PixelsService.java/buggy/components/romio/src/ome/io/nio/PixelsService.java |
|
lastModule = (ChainModuleData) node.getObject(); moduleCanvas.highlightModule(lastModule); | Object obj = node.getObject(); if (obj != null && obj instanceof ChainModuleData) { lastModule = (ChainModuleData) obj; moduleCanvas.highlightModule(lastModule); } | public void valueChanged(TreeSelectionEvent e) { // If this change is occurring because a if (lockTreeChange == true) return; ModuleTreeNode node = (ModuleTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; if (lastModule != null) { moduleCanvas.unhighlightModules(lastModule); } if (node.isLeaf()) { // it's a module lastModule = (ChainModuleData) node.getObject(); moduleCanvas.highlightModule(lastModule); } else if (node.getObject() instanceof ModuleCategoryData) { lastModule = null; ModuleCategoryData mc = (ModuleCategoryData) node.getObject(); moduleCanvas.highlightCategory(mc); } // clicked on uncategorized else if (node.getName() != null && node.getName().compareTo(ModuleTreeNode.UNCAT_NAME) ==0) moduleCanvas.highlightCategory(null); else moduleCanvas.unhighlightModules(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d73ba24badad0846f53ca0a25a67726733ab6854/ModulePaletteWindow.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ModulePaletteWindow.java |
return null; | return (RubyString)funcall(getRuby().intern("to_s")); | public RubyString m_inspect() { // if (TYPE(obj) == T_OBJECT // && ROBJECT(obj)->iv_tbl // && ROBJECT(obj)->iv_tbl->num_entries > 0) { // VALUE str; // char *c; // // c = rb_class2name(CLASS_OF(obj)); // if (rb_inspecting_p(obj)) { // str = rb_str_new(0, strlen(c)+10+16+1); /* 10:tags 16:addr 1:eos */ // sprintf(RSTRING(str)->ptr, "#<%s:0x%lx ...>", c, obj); // RSTRING(str)->len = strlen(RSTRING(str)->ptr); // return str; // } // str = rb_str_new(0, strlen(c)+6+16+1); /* 6:tags 16:addr 1:eos */ // sprintf(RSTRING(str)->ptr, "-<%s:0x%lx ", c, obj); // RSTRING(str)->len = strlen(RSTRING(str)->ptr); // return rb_protect_inspect(inspect_obj, obj, str); // } // return rb_funcall(obj, rb_intern("to_s"), 0, 0); // } //return (RubyString)invokeMethod(getRuby().intern("to_s"), null, null); return null; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/12847c6fd28fea4e223d132ced46eb1b4cb9de9a/RubyObject.java/buggy/org/jruby/RubyObject.java |
contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F6"), "viewNotes"); | contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control F6"), "viewNotes"); | public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/5e1d8400b514b5787162e272df97866d10408dc2/ScratchPadPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/scratchpad/ScratchPadPlugin.java |
contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F5"), "viewTasks"); | contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control F5"), "viewTasks"); | public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/5e1d8400b514b5787162e272df97866d10408dc2/ScratchPadPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/scratchpad/ScratchPadPlugin.java |
if(code == Code.NONE) { sb.append('n'); } else if(code == Code.UTF8) { sb.append('u'); } else if(code == Code.SJIS) { sb.append('s'); } | public IRubyObject inspect() { final String regex = pattern.pattern(); final int length = regex.length(); StringBuffer sb = new StringBuffer(length + 2); sb.append('/'); for (int i = 0; i < length; i++) { char c = regex.charAt(i); if (RubyString.isAlnum(c)) { sb.append(c); } else if (c == '/') { if (i == 0 || regex.charAt(i - 1) != '\\') { sb.append("\\"); } sb.append(c); } else if (RubyString.isPrint(c)) { sb.append(c); } else if (c == '\n') { sb.append('\\').append('n'); } else if (c == '\r') { sb.append('\\').append('r'); } else if (c == '\t') { sb.append('\\').append('t'); } else if (c == '\f') { sb.append('\\').append('f'); } else if (c == '\u000B') { sb.append('\\').append('v'); } else if (c == '\u0007') { sb.append('\\').append('a'); } else if (c == '\u001B') { sb.append('\\').append('e'); } else { sb.append(new PrintfFormat("\\%.3o").sprintf(c)); } } sb.append('/'); if ((pattern.flags() & Pattern.CASE_INSENSITIVE) > 0) { sb.append('i'); } if ((pattern.flags() & Pattern.DOTALL) > 0) { sb.append('m'); } if ((pattern.flags() & Pattern.COMMENTS) > 0) { sb.append('x'); } return getRuntime().newString(sb.toString()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a99c8643e2996a04338dcb2ea5ad169c29e5f798/RubyRegexp.java/clean/src/org/jruby/RubyRegexp.java |
|
} | } catch (RemoteServerErrorException iae) { connected = false; throw new DSOutOfServiceException("Failed to log in.", iae); } | void login(String userName, String password) throws DSOutOfServiceException { try { RemoteCaller proxy = proxiesFactory.getRemoteCaller(); proxy.login(userName, password); serverVersionCheck(); connected = true; } catch (RemoteConnectionException rce) { connected = false; throw new DSOutOfServiceException("Can't connect to OMEDS.", rce); } catch (RemoteAuthenticationException rae) { connected = false; throw new DSOutOfServiceException("Failed to log in.", rae); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/be05737de1d1d14e7b06c2042110ca9b6f994539/OMEDSGateway.java/clean/SRC/org/openmicroscopy/shoola/env/data/OMEDSGateway.java |
public static Object[] fillICGHierarchy(List classifications, Map mapIS, int userID) | public static Object[] fillICGHierarchy(List classifications, Map mapIS) | public static Object[] fillICGHierarchy(List classifications, Map mapIS, int userID) { Object[] results = new Object[2]; Iterator i = classifications.iterator(); //OME-JAVA object. Classification classification; Category category; CategoryGroup group; //Shoola object. ClassificationData cData; CategoryData cModel; CategoryGroupData gModel; ImageSummary is; Map categoryMap = new HashMap(), groupMap = new HashMap(), classificationsMap; float f; Integer categoryID, groupID; Collection unclassifiedImages = mapIS.values(); List classifiedImages = new ArrayList(); List categoriesList; while (i.hasNext()) { classification = (Classification) i.next(); if (userID != classification.getModuleExecution().getExperimenter().getID()) break; f = CategoryMapper.CONFIDENCE; if (classification.getConfidence() != null) f = classification.getConfidence().floatValue(); is = (ImageSummary) mapIS.get( new Integer(classification.getImage().getID())); if (!classifiedImages.contains(is)) classifiedImages.add(is); cData = new ClassificationData(classification.getID(), f); category = classification.getCategory(); group = category.getCategoryGroup(); groupID = new Integer(group.getID()); gModel = (CategoryGroupData) groupMap.get(groupID); //Create CategoryGroupData if (gModel == null) { gModel = CategoryMapper.buildCategoryGroup(group); gModel.setCategories(new ArrayList()); groupMap.put(groupID, gModel); } categoryID = new Integer(category.getID()); cModel = (CategoryData) categoryMap.get(categoryID); //Create CategoryData if (cModel == null) { cModel = CategoryMapper.buildCategoryData(category, gModel); cModel.setClassifications(new HashMap()); categoryMap.put(categoryID, cModel); gModel.getCategories(); } categoriesList = gModel.getCategories(); if (!categoriesList.contains(cModel)) categoriesList.add(cModel); classificationsMap = cModel.getClassifications(); classificationsMap.put(is.copyObject(), cData); } unclassifiedImages.removeAll(classifiedImages); results[0] = unclassifiedImages; results[1] = groupMap.values(); return results; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/HierarchyMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/HierarchyMapper.java |
if (userID != classification.getModuleExecution().getExperimenter().getID()) break; | public static Object[] fillICGHierarchy(List classifications, Map mapIS, int userID) { Object[] results = new Object[2]; Iterator i = classifications.iterator(); //OME-JAVA object. Classification classification; Category category; CategoryGroup group; //Shoola object. ClassificationData cData; CategoryData cModel; CategoryGroupData gModel; ImageSummary is; Map categoryMap = new HashMap(), groupMap = new HashMap(), classificationsMap; float f; Integer categoryID, groupID; Collection unclassifiedImages = mapIS.values(); List classifiedImages = new ArrayList(); List categoriesList; while (i.hasNext()) { classification = (Classification) i.next(); if (userID != classification.getModuleExecution().getExperimenter().getID()) break; f = CategoryMapper.CONFIDENCE; if (classification.getConfidence() != null) f = classification.getConfidence().floatValue(); is = (ImageSummary) mapIS.get( new Integer(classification.getImage().getID())); if (!classifiedImages.contains(is)) classifiedImages.add(is); cData = new ClassificationData(classification.getID(), f); category = classification.getCategory(); group = category.getCategoryGroup(); groupID = new Integer(group.getID()); gModel = (CategoryGroupData) groupMap.get(groupID); //Create CategoryGroupData if (gModel == null) { gModel = CategoryMapper.buildCategoryGroup(group); gModel.setCategories(new ArrayList()); groupMap.put(groupID, gModel); } categoryID = new Integer(category.getID()); cModel = (CategoryData) categoryMap.get(categoryID); //Create CategoryData if (cModel == null) { cModel = CategoryMapper.buildCategoryData(category, gModel); cModel.setClassifications(new HashMap()); categoryMap.put(categoryID, cModel); gModel.getCategories(); } categoriesList = gModel.getCategories(); if (!categoriesList.contains(cModel)) categoriesList.add(cModel); classificationsMap = cModel.getClassifications(); classificationsMap.put(is.copyObject(), cData); } unclassifiedImages.removeAll(classifiedImages); results[0] = unclassifiedImages; results[1] = groupMap.values(); return results; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/HierarchyMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/HierarchyMapper.java |
|
public static Object[] fillICGHierarchy(List classifications, Map mapIS, int userID) { Object[] results = new Object[2]; Iterator i = classifications.iterator(); //OME-JAVA object. Classification classification; Category category; CategoryGroup group; //Shoola object. ClassificationData cData; CategoryData cModel; CategoryGroupData gModel; ImageSummary is; Map categoryMap = new HashMap(), groupMap = new HashMap(), classificationsMap; float f; Integer categoryID, groupID; Collection unclassifiedImages = mapIS.values(); List classifiedImages = new ArrayList(); List categoriesList; while (i.hasNext()) { classification = (Classification) i.next(); if (userID != classification.getModuleExecution().getExperimenter().getID()) break; f = CategoryMapper.CONFIDENCE; if (classification.getConfidence() != null) f = classification.getConfidence().floatValue(); is = (ImageSummary) mapIS.get( new Integer(classification.getImage().getID())); if (!classifiedImages.contains(is)) classifiedImages.add(is); cData = new ClassificationData(classification.getID(), f); category = classification.getCategory(); group = category.getCategoryGroup(); groupID = new Integer(group.getID()); gModel = (CategoryGroupData) groupMap.get(groupID); //Create CategoryGroupData if (gModel == null) { gModel = CategoryMapper.buildCategoryGroup(group); gModel.setCategories(new ArrayList()); groupMap.put(groupID, gModel); } categoryID = new Integer(category.getID()); cModel = (CategoryData) categoryMap.get(categoryID); //Create CategoryData if (cModel == null) { cModel = CategoryMapper.buildCategoryData(category, gModel); cModel.setClassifications(new HashMap()); categoryMap.put(categoryID, cModel); gModel.getCategories(); } categoriesList = gModel.getCategories(); if (!categoriesList.contains(cModel)) categoriesList.add(cModel); classificationsMap = cModel.getClassifications(); classificationsMap.put(is.copyObject(), cData); } unclassifiedImages.removeAll(classifiedImages); results[0] = unclassifiedImages; results[1] = groupMap.values(); return results; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/HierarchyMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/HierarchyMapper.java |
||
this.script = new File(TEST_DIR + File.separator + filename); | public ScriptTest(Ruby ruby, String filename) { super(filename); this.ruby = ruby; this.filename = filename; this.script = new File(TEST_DIR + File.separator + filename); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/68ea79c613972391a1d5009c8c9590b9b87d509a/ScriptTestSuite.java/clean/org/jruby/test/ScriptTestSuite.java |
|
StringBuffer scriptString = new StringBuffer((int) script.length()); BufferedReader br = new BufferedReader(new FileReader(script)); String line; while ((line = br.readLine()) != null) { scriptString.append(line).append('\n'); } br.close(); | StringBuffer script = new StringBuffer(); script.append("require 'minirunit'").append('\n'); script.append("test_load('").append(scriptName()).append("')").append('\n'); script.append("test_get_last_failed()").append('\n'); | public void runTest() throws Throwable { StringBuffer scriptString = new StringBuffer((int) script.length()); BufferedReader br = new BufferedReader(new FileReader(script)); String line; while ((line = br.readLine()) != null) { scriptString.append(line).append('\n'); } br.close(); // At the end of the tests we need a value to tell us if they failed. scriptString.append("$curtestOK").append('\n'); RubyBoolean isOk = (RubyBoolean) ruby.evalScript(scriptString.toString()); if (isOk.isFalse()) { fail(filename + " failed"); } System.out.flush(); // Without a flush Ant will miss some of our output } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/68ea79c613972391a1d5009c8c9590b9b87d509a/ScriptTestSuite.java/clean/org/jruby/test/ScriptTestSuite.java |
scriptString.append("$curtestOK").append('\n'); RubyBoolean isOk = (RubyBoolean) ruby.evalScript(scriptString.toString()); if (isOk.isFalse()) { fail(filename + " failed"); | RubyObject lastFailed = ruby.evalScript(script.toString()); if (! lastFailed.isNil()) { RubyString message = (RubyString) lastFailed.funcall("to_s"); fail(message.getValue()); | public void runTest() throws Throwable { StringBuffer scriptString = new StringBuffer((int) script.length()); BufferedReader br = new BufferedReader(new FileReader(script)); String line; while ((line = br.readLine()) != null) { scriptString.append(line).append('\n'); } br.close(); // At the end of the tests we need a value to tell us if they failed. scriptString.append("$curtestOK").append('\n'); RubyBoolean isOk = (RubyBoolean) ruby.evalScript(scriptString.toString()); if (isOk.isFalse()) { fail(filename + " failed"); } System.out.flush(); // Without a flush Ant will miss some of our output } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/68ea79c613972391a1d5009c8c9590b9b87d509a/ScriptTestSuite.java/clean/org/jruby/test/ScriptTestSuite.java |
Collection contacts = contactList.getSelectedUsers(); | Collection contacts = contactList.getActiveGroup().getContactItems(); | public void actionPerformed(ActionEvent actionEvent) { Collection contacts = contactList.getSelectedUsers(); startConference(contacts); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/64167b93b841bd4a221dd80e076ac2fd148ee24f/Conferences.java/buggy/src/java/org/jivesoftware/spark/ui/conferences/Conferences.java |
public void actionPerformed(ActionEvent actionEvent) { Collection contacts = contactList.getSelectedUsers(); startConference(contacts); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/64167b93b841bd4a221dd80e076ac2fd148ee24f/Conferences.java/buggy/src/java/org/jivesoftware/spark/ui/conferences/Conferences.java |
||
PresenceListener presenceListener = new PresenceListener() { public void presenceChanged(Presence presence) { for(ChatRoom room : SparkManager.getChatManager().getChatContainer().getChatRooms()){ if(room instanceof GroupChatRoom){ GroupChatRoom groupChatRoom = (GroupChatRoom)room; String jid = groupChatRoom.getMultiUserChat().getRoom(); String to = presence.getTo(); presence.setTo(jid); SparkManager.getConnection().sendPacket(presence); presence.setTo(to); } } } }; SparkManager.getSessionManager().addPresenceListener(presenceListener); | public void initialize() { ServiceDiscoveryManager manager = ServiceDiscoveryManager.getInstanceFor(SparkManager.getConnection()); mucSupported = manager.includesFeature("http://jabber.org/protocol/muc"); if (mucSupported) { // Load the conference data from Private Data loadBookmarks(); // Add an invitation listener. addInvitationListener(); addChatRoomListener(); addPopupListeners(); // Add Join Conference Button to StatusBar // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); RolloverButton joinConference = new RolloverButton(SparkRes.getImageIcon(SparkRes.CONFERENCE_IMAGE_16x16)); joinConference.setToolTipText(Res.getString("message.join.conference.room")); commandPanel.add(joinConference); joinConference.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ConferenceRooms rooms = new ConferenceRooms(bookedMarkedConferences.getTree(), getDefaultServiceName()); rooms.invoke(); } }); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/64167b93b841bd4a221dd80e076ac2fd148ee24f/Conferences.java/buggy/src/java/org/jivesoftware/spark/ui/conferences/Conferences.java |
|
initComponents(sizeT, t); | initComponents(sizeT-1, t); | TNavigator(NavigationPaletteManager topManager, int sizeT, int t) { manager = new TNavigatorManager(this, topManager, sizeT, t); im = IconManager.getInstance(topManager.getRegistry()); initComponents(sizeT, t); manager.attachListeners(); buildGUI(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b52b1735c990029c4d2115a33258acf4d3c82ae5/TNavigator.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/TNavigator.java |
initSlider(sizeZ, z); initTextField(sizeZ, z); | initSlider(sizeZ-1, z); initTextField(sizeZ-1, z); | XYZNavigator(NavigationPaletteManager topManager, int sizeX, int sizeY, int sizeZ, int z) { manager = new XYZNavigatorManager(this, topManager, sizeZ, z); im = IconManager.getInstance(topManager.getRegistry()); initSlider(sizeZ, z); initTextField(sizeZ, z); manager.attachListeners(); buildGUI(sizeX, sizeY, sizeZ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b52b1735c990029c4d2115a33258acf4d3c82ae5/XYZNavigator.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/XYZNavigator.java |
return getRuntime().newFixnum(hashCode()); | long baseHash = (isExclusive ? 1 : 0); long beginHash = ((RubyFixnum) begin.callMethod("hash")).getLongValue(); long endHash = ((RubyFixnum) end.callMethod("hash")).getLongValue(); long hash = baseHash; hash = hash ^ (beginHash << 1); hash = hash ^ (endHash << 9); hash = hash ^ (baseHash << 24); return getRuntime().newFixnum(hash); | public RubyFixnum hash() { return getRuntime().newFixnum(hashCode()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4b12521bf34cff2c9841b1dacb1a929f6def5327/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill in the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill in the data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image img; while (i.hasNext()) { img = (Image) i.next(); images.add(new ImageSummary(img.getID(), img.getName(), fillListPixelsID(img), fillDefaultPixels(img.getDefaultPixels()))); } empty.setImages(images); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a43ad78503af4e7f39a04cb20cfba13e1c78b806/DatasetMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
||
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill in the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill in the data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image img; while (i.hasNext()) { img = (Image) i.next(); images.add(new ImageSummary(img.getID(), img.getName(), fillListPixelsID(img), fillDefaultPixels(img.getDefaultPixels()))); } empty.setImages(images); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a43ad78503af4e7f39a04cb20cfba13e1c78b806/DatasetMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
||
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill in the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill in the data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image img; while (i.hasNext()) { img = (Image) i.next(); images.add(new ImageSummary(img.getID(), img.getName(), fillListPixelsID(img), fillDefaultPixels(img.getDefaultPixels()))); } empty.setImages(images); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a43ad78503af4e7f39a04cb20cfba13e1c78b806/DatasetMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
||
public static List fillListImages(Dataset dataset) | public static List fillListImages(Dataset dataset, ImageSummary iProto) | public static List fillListImages(Dataset dataset) { List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image image; while (i.hasNext()) { image = (Image) i.next(); images.add(new ImageSummary(image.getID(), image.getName(), fillListPixelsID(image), fillDefaultPixels(image.getDefaultPixels()))); } return images; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a43ad78503af4e7f39a04cb20cfba13e1c78b806/DatasetMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
images.add(new ImageSummary(image.getID(), image.getName(), fillListPixelsID(image), fillDefaultPixels(image.getDefaultPixels()))); | is = (ImageSummary) iProto.makeNew(); is.setID(image.getID()); is.setName(image.getName()); is.setPixelsIDs(fillListPixelsID(image)); is.setDefaultPixels(fillDefaultPixels(image.getDefaultPixels())); images.add(is); | public static List fillListImages(Dataset dataset) { List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image image; while (i.hasNext()) { image = (Image) i.next(); images.add(new ImageSummary(image.getID(), image.getName(), fillListPixelsID(image), fillDefaultPixels(image.getDefaultPixels()))); } return images; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a43ad78503af4e7f39a04cb20cfba13e1c78b806/DatasetMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
public static List fillUserDatasets(List datasets, DatasetSummary dProto) { List datasetsList = new ArrayList(); //The returned summary list. Iterator i = datasets.iterator(); DatasetSummary ds; Dataset d; //For each d in datasets... while (i.hasNext()) { d = (Dataset) i.next(); //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(d.getID()); ds.setName(d.getName()); //Add the datasets to the list of returned datasets. datasetsList.add(ds); } return datasetsList; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a43ad78503af4e7f39a04cb20cfba13e1c78b806/DatasetMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
||
public static List fillUserDatasets(List datasets, DatasetSummary dProto) { List datasetsList = new ArrayList(); //The returned summary list. Iterator i = datasets.iterator(); DatasetSummary ds; Dataset d; //For each d in datasets... while (i.hasNext()) { d = (Dataset) i.next(); //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(d.getID()); ds.setName(d.getName()); //Add the datasets to the list of returned datasets. datasetsList.add(ds); } return datasetsList; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a43ad78503af4e7f39a04cb20cfba13e1c78b806/DatasetMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
||
context.getCurrentScope().setValue(argsNode.getBlockArgNode().getCount(), runtime.newProc(), 0); | blockArg = runtime.newProc(); blockArg.getBlock().isLambda = context.getCurrentBlock().isLambda; context.getCurrentScope().setValue(argsNode.getBlockArgNode().getCount(), blockArg, 0); | public IRubyObject internalCall(ThreadContext context, IRubyObject receiver, RubyModule lastClass, String name, IRubyObject[] args, boolean noSuper) { assert args != null; IRuby runtime = context.getRuntime(); if (argsNode.getBlockArgNode() != null && context.isBlockGiven()) { // We pass depth zero since we know this only applies to newly created local scope context.getCurrentScope().setValue(argsNode.getBlockArgNode().getCount(), runtime.newProc(), 0); } try { prepareArguments(context, runtime, receiver, args); getArity().checkArity(runtime, args); traceCall(context, runtime, receiver, name); return EvaluationState.eval(context, body, receiver); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { if (je.getPrimaryData() == this) { return (IRubyObject)je.getSecondaryData(); } } throw je; } finally { traceReturn(context, runtime, receiver, name); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/89deff9d4f0069e00009c8b39bbd472b68ef94d9/DefaultMethod.java/buggy/src/org/jruby/internal/runtime/methods/DefaultMethod.java |
gammaSlider.setEnabled((f.equals(RendererModel.POLYNOMIAL) || f.equals(RendererModel.EXPONENTIAL))); | gammaSlider.setEnabled(!(f.equals(RendererModel.LINEAR) || f.equals(RendererModel.LOGARITHMIC))); | void onCurveChange() { String f = model.getFamily(); gammaSlider.setEnabled((f.equals(RendererModel.POLYNOMIAL) || f.equals(RendererModel.EXPONENTIAL))); graphicsPane.onCurveChange(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5bd9f9c1b75e7f0835e1ddc6123c4d18df1f2ab9/DomainPane.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/rnd/DomainPane.java |
OrCondition(Condition l, Condition r) { _l = l; _r = r; System.out.println("Condition: " + l + " || + " + r); } | OrCondition(Condition l, Condition r) { _l = l; _r = r; } | OrCondition(Condition l, Condition r) { _l = l; _r = r; System.out.println("Condition: " + l + " || + " + r); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/fffcc026639af88787a0e227366da3bf91c7fa7a/OrConditionBuilder.java/buggy/webmacro/src/org/webmacro/engine/OrConditionBuilder.java |
args[0] = new RubyFixnum(ruby, new Date().getTime()); | args[0] = RubyFixnum.newFixnum(ruby, new Date().getTime()); | public static RubyTime s_new(Ruby ruby, RubyObject rubyClass) { RubyObject[] args = new RubyObject[1]; args[0] = new RubyFixnum(ruby, new Date().getTime()); return s_at(ruby, rubyClass, args); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/afb67c3765f6466c476317e6bb0c72f6593f05f3/RubyTime.java/buggy/org/jruby/RubyTime.java |
return match.isNil() ? getRuntime().getNil() : ((RubyMatchData) match).group(args[1].convertToInteger().getLongValue()); | long idx = args[1].convertToInteger().getLongValue(); return RubyRegexp.nth_match((int) idx, match); | public IRubyObject aref(IRubyObject[] args) { if (checkArgumentCount(args, 1, 2) == 2) { if (args[0] instanceof RubyRegexp) { IRubyObject match = RubyRegexp.regexpValue(args[0]).match(toString(), 0); return match.isNil() ? getRuntime().getNil() : ((RubyMatchData) match).group(args[1].convertToInteger().getLongValue()); } return substr(RubyNumeric.fix2int(args[0]), RubyNumeric.fix2int(args[1])); } if (args[0] instanceof RubyRegexp) { return RubyRegexp.regexpValue(args[0]).search(toString(), 0) >= 0 ? RubyRegexp.last_match(getRuntime().getCurrentContext().getBackref()) : getRuntime().getNil(); } else if (args[0] instanceof RubyString) { return toString().indexOf(stringValue(args[0]).toString()) != -1 ? args[0] : getRuntime().getNil(); } else if (args[0] instanceof RubyRange) { long[] begLen = ((RubyRange) args[0]).getBeginLength(getValue().length(), true, false); return begLen == null ? getRuntime().getNil() : substr((int) begLen[0], (int) begLen[1]); } int idx = (int) args[0].convertToInteger().getLongValue(); if (idx < 0) { idx += getValue().length(); } return idx < 0 || idx >= getValue().length() ? getRuntime().getNil() : getRuntime().newFixnum(getValue().charAt(idx)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ccaba8b36154afea86c2482886e84c7df5ddad99/RubyString.java/clean/src/org/jruby/RubyString.java |
Rectangle r = node.getBounds(); | public void visit(ImageNode node) { Rectangle r = node.getBounds(); Thumbnail th = node.getThumbnail(); double sf = th.getScalingFactor(); double factor = ZoomCmd.calculateFactor(sf); if (sf != factor) { th.scale(factor); double ratio = factor/sf; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2509d546984c0580d2b4a547fed842ec745b87b2/ZoomVisitor.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/ZoomVisitor.java |
|
if (sf != factor) { th.scale(factor); double ratio = factor/sf; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); } | if (sf != factor) th.scale(factor); | public void visit(ImageNode node) { Rectangle r = node.getBounds(); Thumbnail th = node.getThumbnail(); double sf = th.getScalingFactor(); double factor = ZoomCmd.calculateFactor(sf); if (sf != factor) { th.scale(factor); double ratio = factor/sf; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2509d546984c0580d2b4a547fed842ec745b87b2/ZoomVisitor.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/ZoomVisitor.java |
if (datasets == null ||projects.size() == 0) { | if (datasets == null ||datasets.size() == 0) { | public List getDatasets() { if (datasets == null ||projects.size() == 0) { try { DataManagementService dms = registry.getDataManagementService(); datasets = dms.retrieveUserDatasets(new BrowserDatasetSummary()); Collections.sort(datasets); registry.getLogger().info(this,"loaded datasets..."); } catch(DSAccessException dsae) { String s = "Can't retrieve user's datasets."; 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); } } return datasets; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e582f2c97fd5180ac03bea1d436b354862c22b28/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/zoombrowser/DataManager.java |
void collectUserCredentials(SplashScreenFuture future) | void collectUserCredentials(SplashScreenFuture future, boolean init) | void collectUserCredentials(SplashScreenFuture future) { userCredentials = future; view.user.setText(""); view.user.setEnabled(true); view.pass.setEnabled(true); view.pass.setText(""); view.login.setEnabled(true); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/84042cbca2e8aeaf65ca18c85ea2224ea4c04d55/SplashScreenManager.java/clean/SRC/org/openmicroscopy/shoola/env/ui/SplashScreenManager.java |
view.user.setText(""); | void collectUserCredentials(SplashScreenFuture future) { userCredentials = future; view.user.setText(""); view.user.setEnabled(true); view.pass.setEnabled(true); view.pass.setText(""); view.login.setEnabled(true); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/84042cbca2e8aeaf65ca18c85ea2224ea4c04d55/SplashScreenManager.java/clean/SRC/org/openmicroscopy/shoola/env/ui/SplashScreenManager.java |
|
view.pass.setText(""); | void collectUserCredentials(SplashScreenFuture future) { userCredentials = future; view.user.setText(""); view.user.setEnabled(true); view.pass.setEnabled(true); view.pass.setText(""); view.login.setEnabled(true); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/84042cbca2e8aeaf65ca18c85ea2224ea4c04d55/SplashScreenManager.java/clean/SRC/org/openmicroscopy/shoola/env/ui/SplashScreenManager.java |
|
if (!init) { view.user.setText(""); view.pass.setText(""); } | void collectUserCredentials(SplashScreenFuture future) { userCredentials = future; view.user.setText(""); view.user.setEnabled(true); view.pass.setEnabled(true); view.pass.setText(""); view.login.setEnabled(true); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/84042cbca2e8aeaf65ca18c85ea2224ea4c04d55/SplashScreenManager.java/clean/SRC/org/openmicroscopy/shoola/env/ui/SplashScreenManager.java |
|
result = (p.x2 == origin.x2); | else result = (p.x2 == origin.x2); | public boolean lies(PlanePoint p) { if (p == null) throw new NullPointerException("No point."); boolean result = false; double k1, k2; if (direction.x1 == 0 && direction.x2 !=0) { k2 = (p.x2-origin.x2)/direction.x2; if (k2 < 0 || k2 > 1) result = false; else result = (p.x1 == origin.x1); } else if (direction.x1 != 0 && direction.x2 ==0) { k1 = (p.x1-origin.x1)/direction.x1; if (k1 < 0 || k1 > 1) result = false; result = (p.x2 == origin.x2); } else if (direction.x1 != 0 && direction.x2 !=0) { k1 = (p.x1-origin.x1)/direction.x1; k2 = (p.x2-origin.x2)/direction.x2; if (k1 == k2) { if (k1 < 0 || k1 > 1) result = false; else result = true; } } return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae7f3de5c106a236bc540570a972b08a551522bb/Segment.java/buggy/SRC/org/openmicroscopy/shoola/util/math/geom2D/Segment.java |
RubyObject[] argsObj = ArgsUtil.setupArgs(ruby, self, getArgsNode()); | RubyPointer args = ArgsUtil.setupArgs(ruby, self, getArgsNode()); | public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyBlock tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject[] argsObj = ArgsUtil.setupArgs(ruby, self, getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); return self.getRubyClass().call(self, getMId(), argsObj, 1); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/FCallNode.java/clean/org/jruby/nodes/FCallNode.java |
return self.getRubyClass().call(self, getMId(), argsObj, 1); | return self.getRubyClass().call(self, getMId(), args, 1); | public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyBlock tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject[] argsObj = ArgsUtil.setupArgs(ruby, self, getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); return self.getRubyClass().call(self, getMId(), argsObj, 1); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/FCallNode.java/clean/org/jruby/nodes/FCallNode.java |
public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; | public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, ArrayNode node) { String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); | public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9a05f18f2b6207bf93455d756436fe8f0002b542/ArgsUtil.java/buggy/org/jruby/nodes/util/ArgsUtil.java |
if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } | RubyObject[] args = node.getArray(ruby, self); | public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9a05f18f2b6207bf93455d756436fe8f0002b542/ArgsUtil.java/buggy/org/jruby/nodes/util/ArgsUtil.java |
return result; | ruby.setSourceFile(file); ruby.setSourceLine(line); return args; | public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9a05f18f2b6207bf93455d756436fe8f0002b542/ArgsUtil.java/buggy/org/jruby/nodes/util/ArgsUtil.java |
switch (args.length) { case 0 : return this; case 1 : return (RubyException) m_new(getRuby(), this, args); default : throw new RubyArgumentException(getRuby(), "Wrong argument count"); } | switch (args.length) { case 0 : return this; case 1 : return (RubyException) m_new(getRuby(), this, args); default : throw new RubyArgumentException(getRuby(), "Wrong argument count"); } | public RubyException m_exception(RubyObject[] args) { switch (args.length) { case 0 : return this; case 1 : return (RubyException) m_new(getRuby(), this, args); default : throw new RubyArgumentException(getRuby(), "Wrong argument count"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
} | } | public RubyException m_exception(RubyObject[] args) { switch (args.length) { case 0 : return this; case 1 : return (RubyException) m_new(getRuby(), this, args); default : throw new RubyArgumentException(getRuby(), "Wrong argument count"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
RubyModule rubyClass = getRubyClass(); | RubyModule rubyClass = getRubyClass(); | public RubyString m_inspect() { RubyModule rubyClass = getRubyClass(); RubyString exception = RubyString.stringValue(this); if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
RubyString exception = RubyString.stringValue(this); | RubyString exception = RubyString.stringValue(this); | public RubyString m_inspect() { RubyModule rubyClass = getRubyClass(); RubyString exception = RubyString.stringValue(this); if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } } | if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } } | public RubyString m_inspect() { RubyModule rubyClass = getRubyClass(); RubyString exception = RubyString.stringValue(this); if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
return s_new(ruby, recv.getRubyClass(), args); } | return s_new(ruby, recv.getRubyClass(), args); } | public static RubyException m_new(Ruby ruby, RubyObject recv, RubyObject[] args) { return s_new(ruby, recv.getRubyClass(), args); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
RubyObject message = getInstanceVar("mesg"); | RubyObject message = getInstanceVar("mesg"); | public RubyString m_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/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
if (message.isNil()) { return getRubyClass().getClassPath(); } else { message.setTaint(isTaint()); | if (message.isNil()) { return getRubyClass().getClassPath(); } else { message.setTaint(isTaint()); | public RubyString m_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/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
return (RubyString) message; } } | return (RubyString) message; } } | public RubyString m_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/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
RubyException newException = new RubyException(ruby, (RubyClass)recv); if (args.length == 1) { newException.setInstanceVar("mesg", args[0]); } return newException; } | RubyException newException = new RubyException(ruby, (RubyClass)recv); if (args.length == 1) { newException.setInstanceVar("mesg", args[0]); } return newException; } | public static RubyException s_new(Ruby ruby, RubyObject recv, RubyObject[] args) { RubyException newException = new RubyException(ruby, (RubyClass)recv); if (args.length == 1) { newException.setInstanceVar("mesg", args[0]); } return newException; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyException.java/clean/org/jruby/RubyException.java |
controller.setSaved(true); | private void buildGUI() { setTitle("Edit Image Annotation"); Container container = getContentPane(); container.setLayout(new BorderLayout()); JPanel targetPanel = new JPanel(); targetPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); JLabel editingLabel = new JLabel("Editing: "); editingLabel.setFont(new Font(null,Font.BOLD,12)); JLabel targetLabel = new JLabel(controller.getTargetDescription()); targetPanel.add(editingLabel); targetPanel.add(targetLabel); container.add(targetPanel,BorderLayout.NORTH); annotationArea = new JTextArea(); annotationArea.setLineWrap(true); annotationArea.setWrapStyleWord(true); annotationArea.getDocument().addDocumentListener(this); JScrollPane scrollPane = new JScrollPane(annotationArea); scrollPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); scrollPane.setPreferredSize(new Dimension(300,150)); container.add(scrollPane,BorderLayout.CENTER); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); reloadButton = new JButton("Reload"); reloadButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { if(isNewAnnotation) { annotationArea.setText(""); } else { annotationArea.setText(controller.getAnnotation(annotationIndex)); } } }); saveButton = new JButton("Save"); saveButton.setEnabled(false); saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { if(isNewAnnotation) { controller.newAnnotation(annotationArea.getText()); isNewAnnotation = false; annotationIndex = 0; } else { controller.setAnnotation(annotationIndex, annotationArea.getText()); } controller.save(); dispose(); } }); buttonPanel.add(reloadButton); buttonPanel.add(saveButton); container.add(buttonPanel, BorderLayout.SOUTH); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); final Component refCopy = this; addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent arg0) { if(controller.isSaved()) { setVisible(false); dispose(); controller.close(); } else { Object[] options = {"Save","Don't Save","Cancel"}; int status = JOptionPane.showOptionDialog(refCopy, "Would you like to keep the changes?", "Save Annotation", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]); if(status == JOptionPane.YES_OPTION) { // TODO add extraction from text area -> controller controller.save(); setVisible(false); dispose(); controller.close(); } else if(status == JOptionPane.NO_OPTION) { setVisible(false); dispose(); controller.close(); } else if(status == JOptionPane.CANCEL_OPTION) { // do nothing } } } }); // ok, now check to see if there are any annotations (single-annotation // use case here) List annotations = controller.getTextAnnotations(); if(annotations.size() == 0) { isNewAnnotation = true; annotationArea.setText("(no annotation)"); } else { String annotation = controller.getAnnotation(0); annotationArea.setText(annotation); } pack(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/66741488882f7adf58b86911a2fcddeb7efa6448/TextAnnotationUIF.java/clean/SRC/org/openmicroscopy/shoola/agents/annotator/TextAnnotationUIF.java |
|
public static void flood(String directory, String fileName, String fileExt, int numOfFiles, int linesPerFile) { File dir = new File(directory); if (dir.exists() && dir.isDirectory()) { for (int i = 1; i <= numOfFiles; i++) { try { File file = new File(directory + "/" + fileName + i + "." + fileExt); LOGGER.info("Writing file: " + file.getAbsolutePath()); FileWriter writer = new FileWriter(file); for (int l = 1; l <= linesPerFile; l++) { writer.write("This is a test file. blah.... blah.... blah....\n"); } } catch(IOException ioe) { LOGGER.error("Error while writing file.", ioe); } } } } | public static void flood(String directory, String fileName, String fileExt, int numOfFiles, int linesPerFile) { File dir = new File(directory); if (dir.exists() && dir.isDirectory()) { for (int i = 1; i <= numOfFiles; i++) { FileWriter writer = null; try { File file = new File(directory + "/" + fileName + i + "." + fileExt); LOGGER.info("Writing file: " + file.getAbsolutePath()); writer = new FileWriter(file); for (int l = 1; l <= linesPerFile; l++) { writer.write("This is a test file. blah.... blah.... blah....\n"); } } catch (IOException ioe) { LOGGER.error("Error while writing file.", ioe); } finally { if (writer != null) try { writer.close(); } catch (IOException e) { } } } } } | public static void flood(String directory, String fileName, String fileExt, int numOfFiles, int linesPerFile) { File dir = new File(directory); if (dir.exists() && dir.isDirectory()) { for (int i = 1; i <= numOfFiles; i++) { try { File file = new File(directory + "/" + fileName + i + "." + fileExt); LOGGER.info("Writing file: " + file.getAbsolutePath()); FileWriter writer = new FileWriter(file); for (int l = 1; l <= linesPerFile; l++) { writer.write("This is a test file. blah.... blah.... blah....\n"); } } catch(IOException ioe) { LOGGER.error("Error while writing file.", ioe); } } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/FileFlooder.java/buggy/cobertura/test/net/sourceforge/cobertura/util/FileFlooder.java |
public static void main(String[] args) { FileFlooder.flood(".", "file", "txt", 100, 1000); System.out.println("done"); } | public static void main(String[] args) { FileFlooder.flood(".", "file", "txt", 100, 1000); System.out.println("done"); } | public static void main(String[] args) { FileFlooder.flood(".", "file", "txt", 100, 1000); System.out.println("done"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/FileFlooder.java/buggy/cobertura/test/net/sourceforge/cobertura/util/FileFlooder.java |
case RenderingDef.HSB: | static RenderingStrategy makeNew(int model) { RenderingStrategy strategy = null; switch(model) { case RenderingDef.GS: strategy = new GreyScaleStrategy(); break; case RenderingDef.RGB: strategy = new RGBStrategy(); break; default: throw new IllegalArgumentException( "Wrong Rendering model identifier"); } return strategy; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1af109c95da3a7c178aa582fbdc0a6c825b00e8c/RenderingStrategy.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/RenderingStrategy.java |
|
System.err.println ("pageName: " + pageName); | protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page System.err.println ("pageName: " + pageName); WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); System.err.println ("pageName: " + newPage.getTitle()); // make sure to save the page wiki.savePage (newPage); return newPage; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2e6a5e583cccdc19c543caf9a1fb259181c98cb6/SavePageAction.java/buggy/wiki/src/org/tcdi/opensource/wiki/servlet/SavePageAction.java |
|
System.err.println ("pageName: " + newPage.getTitle()); | protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page System.err.println ("pageName: " + pageName); WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); System.err.println ("pageName: " + newPage.getTitle()); // make sure to save the page wiki.savePage (newPage); return newPage; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2e6a5e583cccdc19c543caf9a1fb259181c98cb6/SavePageAction.java/buggy/wiki/src/org/tcdi/opensource/wiki/servlet/SavePageAction.java |
|
setOpaque(true); | setOpaque(false); | TreeCheckRenderer(boolean leafOnly) { this.leafOnly = leafOnly; restoredSize = null; setLayout(null); setOpaque(true); label = new TreeCheckLabel(); check = new JCheckBox(); check.setBackground(UIManager.getColor("Tree.textBackground")); setBackground(UIManager.getColor("Tree.textBackground")); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/TreeCheckRenderer.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/clsf/TreeCheckRenderer.java |
in = getClass().getClassLoader().getResourceAsStream(uri); | ClassLoader cl = parserContext.getReaderContext().getReader().getBeanClassLoader(); if (cl != null) { in = cl.getResourceAsStream(uri); } | protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } } return in; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c60ad9116626de2c6d3638075063ca9ed4876ccd/XBeanNamespaceHandler.java/buggy/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java |
log.debug("Could not find resource: " + uri); | in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } | protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } } return in; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c60ad9116626de2c6d3638075063ca9ed4876ccd/XBeanNamespaceHandler.java/buggy/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java |
return "* "; | return _number > 0 ? "" + (++_number) : "* "; | protected String renderListItem() { return "* "; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/63e182a593c47d9b882560d480b0bab109616dc8/TextPageRenderer.java/buggy/wiki/src/org/tcdi/opensource/wiki/renderer/TextPageRenderer.java |
IconManager icons = IconManager.getInstance(); putValue(Action.SMALL_ICON, icons.getIcon(IconManager.HIERARCHICAL_LAYOUT)); | public SquaryLayoutAction(HiViewer model) { super(model); setEnabled(true); putValue(Action.NAME, NAME); //String description = // LayoutFactory.getLayoutDescription(LayoutFactory.SQUARY_LAYOUT); putValue(Action.SHORT_DESCRIPTION, ""); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ea7509babe2344eb702969105eb77096cc5b6bcf/SquaryLayoutAction.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/actions/SquaryLayoutAction.java |
|
assertNull(c.scriptFileName); | assertNull(c.getScriptFileName()); | public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.scriptFileName); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }); assertTrue(c.showVersion); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }); assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0]); assertEquals("-", c.displayedFileName()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/TestCommandlineParser.java/clean/test/org/jruby/test/TestCommandlineParser.java |
assertTrue(c.showVersion); | assertTrue(c.isShowVersion()); | public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.scriptFileName); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }); assertTrue(c.showVersion); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }); assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0]); assertEquals("-", c.displayedFileName()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/TestCommandlineParser.java/clean/test/org/jruby/test/TestCommandlineParser.java |
assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); | assertTrue(c.isAssumeLoop()); assertEquals("myfile.rb", c.getScriptFileName()); | public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.scriptFileName); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }); assertTrue(c.showVersion); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }); assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0]); assertEquals("-", c.displayedFileName()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7fc9704f263fb0e26619a38cdcd58fae7692e4da/TestCommandlineParser.java/clean/test/org/jruby/test/TestCommandlineParser.java |
test.TPrx printer = test.TPrxHelper.checkedCast(base); | mono.TPrx printer = mono.TPrxHelper.checkedCast(base); | main(String[] args) { int status = 0; Ice.Communicator ic = null; try { ic = Ice.Util.initialize(args); Ice.ObjectPrx base = ic.stringToProxy( "T:default -p 10000"); test.TPrx printer = test.TPrxHelper.checkedCast(base); if (printer == null) throw new Error("Invalid proxy"); Roi5DRemote r5 = printer.getRoi5D(); Roi4DRemote r4 = (Roi4DRemote) r5.roi4ds.get(0); Roi4DRemote r4_ = (Roi4DRemote) r5.roi4ds.get(0); System.out.println(r4.roi3ds); System.out.println(r4_.roi3ds); } catch (Ice.LocalException e) { e.printStackTrace(); status = 1; } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } if (ic != null) { // Clean up // try { ic.destroy(); } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } } System.exit(status); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d075eea85d4fb93ed40f6b4f476d90a0bccaf12a/Client.java/clean/components/common/test/mono/Client.java |
+ new String(curBuf.buffer, 0, curBuf.curPos + 1); | + new String(curBuf.buffer, 0, curBuf.curPos); | public final String GetImage() { if (tokenBeginBuf == curBuf) return new String(curBuf.buffer, tokenBeginPos, curBuf.curPos - tokenBeginPos + 1); else return new String(otherBuf.buffer, tokenBeginPos, otherBuf.dataLen - tokenBeginPos) + new String(curBuf.buffer, 0, curBuf.curPos + 1); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/9dce0ae9f6a6e6eacbbac0735ab43aa8a7241478/BackupCharStream.java/buggy/webmacro/src/org/webmacro/parser/BackupCharStream.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.