rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
p.setStatus("Away due to idle."); | p.setStatus(Res.getString("message.away.idle")); | private void setIdleListener() throws Exception { final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } }, 1000, 1000); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/97917d876023996dcd3bd220e88b62b3f6dcb7fc/SessionManager.java/buggy/src/java/org/jivesoftware/spark/SessionManager.java |
p.setStatus("User has locked their workstation."); | p.setStatus(Res.getString("message.locked.workstation")); | public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/97917d876023996dcd3bd220e88b62b3f6dcb7fc/SessionManager.java/buggy/src/java/org/jivesoftware/spark/SessionManager.java |
p.setStatus("Away due to idle."); | p.setStatus(Res.getString("message.away.idle")); | public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/97917d876023996dcd3bd220e88b62b3f6dcb7fc/SessionManager.java/buggy/src/java/org/jivesoftware/spark/SessionManager.java |
Iterator iter = dndList.iterator(); | Iterator iter = statusList.iterator(); | public StatusItem getStatusItem(String label) { Iterator iter = dndList.iterator(); while (iter.hasNext()) { StatusItem item = (StatusItem)iter.next(); if (item.getText().equals(label)) { return item; } } return null; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/91bb3d356ac7e36b1815118359b4af3a4c14abed/StatusBar.java/buggy/src/java/org/jivesoftware/spark/ui/status/StatusBar.java |
void showClassifications() { getViewport().add(getClassificationComponent()); //add(getClassificationComponent(), BorderLayout.CENTER); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/ClassifierUI.java/clean/SRC/org/openmicroscopy/shoola/agents/util/classifier/view/ClassifierUI.java |
||
fireStateChange(); | public void setRenderingControl(RenderingControl result) { if (model.getState() != LOADING_RENDERING_CONTROL) throw new IllegalStateException( "This method can't be invoked in the LOADING_RENDERING_CONTROL."); model.setRenderingControl(result); //Register the renderer model.getRenderer().addPropertyChangeListener(controller); LoadingWindow window = view.getLoadingWindow(); window.setStatus("rendering settings. Loading: metadata"); window.setProgress(50); view.buildComponents(); view.setOnScreen(); view.setStatus(RENDERING_MSG, -1, false); renderXYPlane(); //model.fireChannelMetadataLoading(); //fireStateChange(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ImViewerComponent.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java |
|
String arg = args[0].convertToString().getValue(); | String arg = args[0].convertToString().toString(); | public static IRubyObject open(IRubyObject recv, IRubyObject[] args) { String arg = args[0].convertToString().getValue(); // Should this logic be pushed into RubyIO Somewhere? if (arg.startsWith("|")) { String command = arg.substring(1); // exec process, create IO with process try { // TODO: may need to part cli parms out ourself? Process p = Runtime.getRuntime().exec(command); RubyIO io = new RubyIO(recv.getRuntime(), p); if (recv.getRuntime().getCurrentContext().isBlockGiven()) { try { recv.getRuntime().getCurrentContext().yield(io); return recv.getRuntime().getNil(); } finally { io.close(); } } return io; } catch (IOException ioe) { throw recv.getRuntime().newIOErrorFromException(ioe); } } return ((FileMetaClass) recv.getRuntime().getClass("File")).open(args); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/RubyKernel.java/clean/src/org/jruby/RubyKernel.java |
if (args[i].isKindOf(ruby.getClasses().getModuleClass())) { | if (! args[i].isKindOf(ruby.getClasses().getModuleClass())) { | private boolean isRescueHandled(RubyException actExcptn, IListNode exceptionNodes) { // TMP_PROTECT; if (exceptionNodes == null) { return actExcptn.isKindOf(ruby.getExceptions().getStandardError()); } Block tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject[] args = ArgsUtil.setupArgs(ruby, this, exceptionNodes); ArgsUtil.endCallArgs(ruby, tmpBlock); for (int i = 0; i < args.length; i++) { if (args[i].isKindOf(ruby.getClasses().getModuleClass())) { throw new TypeError(ruby, "class or module required for rescue clause"); } if (actExcptn.isKindOf((RubyModule) args[i])) { return true; } } return false; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f0907240b4b4a4379424377e971ed0ca23f1dcb/EvaluateVisitor.java/buggy/org/jruby/evaluator/EvaluateVisitor.java |
final Block actBlock = ruby.getBlockStack().getCurrent(); | final Block currentBlock = ruby.getBlockStack().getCurrent(); | public final static Block beginCallArgs(final Ruby ruby) { final Block actBlock = ruby.getBlockStack().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlockStack().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return actBlock; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/385e3f4e7eba5184dfea0a1e9d23b8ab7d46b1a5/ArgsUtil.java/buggy/org/jruby/ast/util/ArgsUtil.java |
return actBlock; | return currentBlock; | public final static Block beginCallArgs(final Ruby ruby) { final Block actBlock = ruby.getBlockStack().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlockStack().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return actBlock; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/385e3f4e7eba5184dfea0a1e9d23b8ab7d46b1a5/ArgsUtil.java/buggy/org/jruby/ast/util/ArgsUtil.java |
public final static void endCallArgs( final Ruby ruby, final Block actBlock) { if (actBlock != null) { ruby.getBlockStack().push(actBlock); | public final static void endCallArgs(Ruby ruby, Block currentBlock) { if (currentBlock != null) { ruby.getBlockStack().push(currentBlock); | public final static void endCallArgs( final Ruby ruby, final Block actBlock) { if (actBlock != null) { // XXX ruby.getBlockStack().push(actBlock); // Refresh the next attribute. } ruby.getIterStack().pop(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/385e3f4e7eba5184dfea0a1e9d23b8ab7d46b1a5/ArgsUtil.java/buggy/org/jruby/ast/util/ArgsUtil.java |
public int getChannelFamily(int arg0) | public Family getChannelFamily(int arg0) | public int getChannelFamily(int arg0) { return delegate.getChannelFamily(arg0); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingBean.java/buggy/components/ejb/src/ome/ro/ejb/RenderingBean.java |
public int getModel() | public RenderingModel getModel() | public int getModel() { return delegate.getModel(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingBean.java/buggy/components/ejb/src/ome/ro/ejb/RenderingBean.java |
public void setModel(int arg0) | public void setModel(RenderingModel arg0) | public void setModel(int arg0) { delegate.setModel(arg0); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingBean.java/buggy/components/ejb/src/ome/ro/ejb/RenderingBean.java |
public void setQuantizationMap(int arg0, int arg1, double arg2, boolean arg3) | public void setQuantizationMap(int arg0, Family arg1, double arg2, boolean arg3) | public void setQuantizationMap(int arg0, int arg1, double arg2, boolean arg3) { delegate.setQuantizationMap(arg0, arg1, arg2, arg3); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingBean.java/buggy/components/ejb/src/ome/ro/ejb/RenderingBean.java |
dumpClasses((Clazz[])pack.getClasses().toArray( new Clazz[pack.getClasses().size()])); | dumpClasses((Clazz[])pack.getClasses().toArray(new Clazz[pack.getClasses().size()])); decreaseIndentation(); println("</package>"); | private void dumpPackage(Package pack) { println("<package name=\"" + pack.getName() + "\"" + " line-rate=\"" + pack.getLineCoverageRate() + "\"" + " branch-rate=\"" + pack.getBranchCoverageRate() + "\"" + ">"); increaseIndentation(); dumpClasses((Clazz[])pack.getClasses().toArray( new Clazz[pack.getClasses().size()])); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/XMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/xml/XMLReport.java |
private void dumpPackages(Coverage coverage) | private void dumpPackages(CoverageReport coverage) | private void dumpPackages(Coverage coverage) { Iterator it = coverage.getPackages().iterator(); while (it.hasNext()) { dumpPackage((Package)it.next()); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/XMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/xml/XMLReport.java |
if (numberOfLines == 0) | if (getNumberOfLines() == 0) | public double getLineCoverageRate() { if (numberOfLines == 0) { return 1; } return (double)numberOfCoveredLines / (double)numberOfLines; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/buggy/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
return (double)numberOfCoveredLines / (double)numberOfLines; | return (double)getNumberOfCoveredLines() / (double)getNumberOfLines(); | public double getLineCoverageRate() { if (numberOfLines == 0) { return 1; } return (double)numberOfCoveredLines / (double)numberOfLines; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/buggy/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
if (numberOfBranches == 0) | if (getNumberOfBranches() == 0) | public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/buggy/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
if (numberOfCoveredLines == 0) | if (getNumberOfCoveredLines() == 0) | public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/buggy/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
return (double)numberOfCoveredBranches / (double)numberOfBranches; | return (double)getNumberOfCoveredBranches() / (double)getNumberOfBranches(); | public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/buggy/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
return Collections.EMPTY_LIST; | return EMPTY_LIST; | public List childNodes() { return Collections.EMPTY_LIST; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/GlobalVarNode.java/clean/src/org/jruby/ast/GlobalVarNode.java |
menu.add(createClassifySubMenu()); | menu.add(new JMenuItem(controller.getAction(HiViewerControl.CLASSIFY))); menu.add(new JMenuItem(controller.getAction( HiViewerControl.DECLASSIFY))); | private JMenu createEditMenu() { JMenu menu = new JMenu("Edit"); menu.setMnemonic(KeyEvent.VK_E); menu.add(new JMenuItem(controller.getAction(HiViewerControl.FIND))); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(new JMenuItem(controller.getAction(HiViewerControl.VIEW))); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(createClassifySubMenu()); menu.add(new JMenuItem(controller.getAction(HiViewerControl.ANNOTATE))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.REMOVE))); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(HiViewerControl.PROPERTIES))); return menu; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java |
time.cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); | time.cal = Calendar.getInstance(TimeZone.getTimeZone(UTC)); | private static RubyTime createTime(IRubyObject type, IRubyObject[] args, boolean gmt) { int len = 6; if (args.length == 10) { args = new IRubyObject[] { args[5], args[4], args[3], args[2], args[1], args[0], }; } else { len = type.checkArgumentCount(args, 1, 7); } int year = RubyNumeric.fix2int(args[0]); int month = 0; if (len > 1) { if (!args[1].isNil()) { if (args[1] instanceof RubyString) { month = -1; for (int i = 0; i < 12; i++) { if (months[i].equalsIgnoreCase(args[1].toString())) { month = i; } } if (month == -1) { try { month = Integer.parseInt(args[1].toString()) - 1; } catch (NumberFormatException nfExcptn) { throw new ArgumentError(type.getRuntime(), "Argument out of range."); } } } else { month = RubyNumeric.fix2int(args[1]) - 1; } } if (0 > month || month > 11) { throw new ArgumentError(type.getRuntime(), "Argument out of range."); } } int[] int_args = { 1, 0, 0, 0, 0 }; for (int i = 0; len > i + 2; i++) { if (!args[i + 2].isNil()) { int_args[i] = RubyNumeric.fix2int(args[i + 2]); if (time_min[i] > int_args[i] || int_args[i] > time_max[i]) { throw new ArgumentError(type.getRuntime(), "Argument out of range."); } } } RubyTime time = new RubyTime(type.getRuntime(), (RubyClass) type); if (gmt) { time.cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); } else { time.cal = Calendar.getInstance(); } time.cal.set(year, month, int_args[0], int_args[1], int_args[2], int_args[3]); time.cal.set(Calendar.MILLISECOND, int_args[4] / 1000); time.usec = int_args[4] % 1000; time.callInit(args); return time; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ff2657d75cfcff1964e39f97c3ed3c1054b4baef/RubyTime.java/clean/src/org/jruby/RubyTime.java |
callbackFactory.getMethod(RubyTime.class, "hash")); | callbackFactory.getMethod(RubyTime.class, "hash")); | public static RubyClass createTimeClass(Ruby runtime) { RubyClass rubyTimeClass = runtime.defineClass("Time", runtime.getClasses().getObjectClass()); CallbackFactory callbackFactory = runtime.callbackFactory(); rubyTimeClass.defineSingletonMethod("new", callbackFactory.getSingletonMethod(RubyTime.class, "s_new")); rubyTimeClass.defineSingletonMethod("now", callbackFactory.getSingletonMethod(RubyTime.class, "s_new")); rubyTimeClass.defineSingletonMethod("at", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_at")); rubyTimeClass.defineSingletonMethod("local", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_local")); rubyTimeClass.defineSingletonMethod("mktime", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_local")); rubyTimeClass.defineSingletonMethod("utc", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_utc")); rubyTimeClass.defineSingletonMethod("gm", callbackFactory.getOptSingletonMethod(RubyTime.class, "new_utc")); rubyTimeClass.defineMethod("<=>", callbackFactory.getMethod(RubyTime.class, "op_cmp", IRubyObject.class)); rubyTimeClass.defineMethod("-", callbackFactory.getMethod(RubyTime.class, "op_minus", IRubyObject.class)); rubyTimeClass.defineMethod("+", callbackFactory.getMethod(RubyTime.class, "op_plus", IRubyObject.class)); rubyTimeClass.defineMethod("sec", callbackFactory.getMethod(RubyTime.class, "sec")); rubyTimeClass.defineMethod("min", callbackFactory.getMethod(RubyTime.class, "min")); rubyTimeClass.defineMethod("hour", callbackFactory.getMethod(RubyTime.class, "hour")); rubyTimeClass.defineMethod("mday", callbackFactory.getMethod(RubyTime.class, "mday")); rubyTimeClass.defineMethod("day", callbackFactory.getMethod(RubyTime.class, "mday")); rubyTimeClass.defineMethod("month", callbackFactory.getMethod(RubyTime.class, "month")); rubyTimeClass.defineMethod("mon", callbackFactory.getMethod(RubyTime.class, "month")); rubyTimeClass.defineMethod("year", callbackFactory.getMethod(RubyTime.class, "year")); rubyTimeClass.defineMethod("wday", callbackFactory.getMethod(RubyTime.class, "wday")); rubyTimeClass.defineMethod("yday", callbackFactory.getMethod(RubyTime.class, "yday")); rubyTimeClass.defineMethod("isdst", callbackFactory.getMethod(RubyTime.class, "isdst")); rubyTimeClass.defineMethod("zone", callbackFactory.getMethod(RubyTime.class, "zone")); rubyTimeClass.defineMethod("to_a", callbackFactory.getMethod(RubyTime.class, "to_a")); rubyTimeClass.defineMethod("to_f", callbackFactory.getMethod(RubyTime.class, "to_f")); rubyTimeClass.defineMethod("asctime", callbackFactory.getMethod(RubyTime.class, "asctime")); rubyTimeClass.defineMethod("ctime", callbackFactory.getMethod(RubyTime.class, "asctime")); rubyTimeClass.defineMethod("to_s", callbackFactory.getMethod(RubyTime.class, "to_s")); rubyTimeClass.defineMethod("inspect", callbackFactory.getMethod(RubyTime.class, "inspect")); rubyTimeClass.defineMethod("strftime", callbackFactory.getMethod(RubyTime.class, "strftime", IRubyObject.class)); rubyTimeClass.defineMethod("usec", callbackFactory.getMethod(RubyTime.class, "usec")); rubyTimeClass.defineMethod("tv_usec", callbackFactory.getMethod(RubyTime.class, "usec")); rubyTimeClass.defineMethod("to_i", callbackFactory.getMethod(RubyTime.class, "to_i")); rubyTimeClass.defineMethod("tv_sec", callbackFactory.getMethod(RubyTime.class, "to_i")); rubyTimeClass.defineMethod("gmtime", callbackFactory.getMethod(RubyTime.class, "gmtime")); rubyTimeClass.defineMethod("utc", callbackFactory.getMethod(RubyTime.class, "gmtime")); rubyTimeClass.defineMethod("gmt?", callbackFactory.getMethod(RubyTime.class, "gmt")); rubyTimeClass.defineMethod("gmtime?", callbackFactory.getMethod(RubyTime.class, "gmt")); rubyTimeClass.defineMethod("utc?", callbackFactory.getMethod(RubyTime.class, "gmt")); rubyTimeClass.defineMethod("localtime", callbackFactory.getMethod(RubyTime.class, "localtime")); rubyTimeClass.defineMethod("hash", callbackFactory.getMethod(RubyTime.class, "hash")); return rubyTimeClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ff2657d75cfcff1964e39f97c3ed3c1054b4baef/RubyTime.java/clean/src/org/jruby/RubyTime.java |
return RubyBoolean.newBoolean(runtime, cal.getTimeZone().getID().equals("GMT")); | return RubyBoolean.newBoolean(runtime, cal.getTimeZone().getID().equals(UTC)); | public RubyBoolean gmt() { return RubyBoolean.newBoolean(runtime, cal.getTimeZone().getID().equals("GMT")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ff2657d75cfcff1964e39f97c3ed3c1054b4baef/RubyTime.java/clean/src/org/jruby/RubyTime.java |
cal.setTimeZone(TimeZone.getTimeZone("GMT")); | cal.setTimeZone(TimeZone.getTimeZone(UTC)); | public RubyTime gmtime() { cal.setTimeZone(TimeZone.getTimeZone("GMT")); return this; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ff2657d75cfcff1964e39f97c3ed3c1054b4baef/RubyTime.java/clean/src/org/jruby/RubyTime.java |
return RubyFixnum.newFixnum(runtime, (int)(cal.get(Calendar.SECOND) ^ usec)); | return RubyFixnum.newFixnum(runtime, (int)(((cal.getTimeInMillis() / 1000) ^ microseconds()) << 1) >> 1); | public RubyFixnum hash() { return RubyFixnum.newFixnum(runtime, (int)(cal.get(Calendar.SECOND) ^ usec)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ff2657d75cfcff1964e39f97c3ed3c1054b4baef/RubyTime.java/clean/src/org/jruby/RubyTime.java |
return RubyFloat.newFloat(runtime, getTimeInMillis() / 1000.0); | return RubyFloat.newFloat(runtime, getTimeInMillis() / 1000 + microseconds() / 1000000.0); | public RubyFloat to_f() { return RubyFloat.newFloat(runtime, getTimeInMillis() / 1000.0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ff2657d75cfcff1964e39f97c3ed3c1054b4baef/RubyTime.java/clean/src/org/jruby/RubyTime.java |
return RubyFixnum.newFixnum(runtime, getTimeInMillis() % 1000 * 1000 + usec); | return RubyFixnum.newFixnum(runtime, microseconds()); | public RubyInteger usec() { return RubyFixnum.newFixnum(runtime, getTimeInMillis() % 1000 * 1000 + usec); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ff2657d75cfcff1964e39f97c3ed3c1054b4baef/RubyTime.java/clean/src/org/jruby/RubyTime.java |
TreePopupMenuMng(TreePopupMenu view, ClipBoardUI clipBoard) | TreePopupMenuMng(TreePopupMenu view, ClipBoardUI clipBoard, ClipBoardModel model) | TreePopupMenuMng(TreePopupMenu view, ClipBoardUI clipBoard) { if (view == null) throw new IllegalArgumentException("No view."); if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); this.clipBoard = clipBoard; attachItemListener(view.properties, PROPERTIES); attachItemListener(view.annotate, ANNOTATE); attachItemListener(view.classify, CLASSIFY); attachItemListener(view.declassify, DECLASSIFY); attachItemListener(view.view, VIEW); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/TreePopupMenuMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/TreePopupMenuMng.java |
attachItemListener(view.annotate, ANNOTATE); | TreePopupMenuMng(TreePopupMenu view, ClipBoardUI clipBoard) { if (view == null) throw new IllegalArgumentException("No view."); if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); this.clipBoard = clipBoard; attachItemListener(view.properties, PROPERTIES); attachItemListener(view.annotate, ANNOTATE); attachItemListener(view.classify, CLASSIFY); attachItemListener(view.declassify, DECLASSIFY); attachItemListener(view.view, VIEW); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/TreePopupMenuMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/TreePopupMenuMng.java |
|
attachItemListener(view.annotate, ANNOTATE); | TreePopupMenuMng(TreePopupMenu view, ClipBoardUI clipBoard) { if (view == null) throw new IllegalArgumentException("No view."); if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); this.clipBoard = clipBoard; attachItemListener(view.properties, PROPERTIES); attachItemListener(view.annotate, ANNOTATE); attachItemListener(view.classify, CLASSIFY); attachItemListener(view.declassify, DECLASSIFY); attachItemListener(view.view, VIEW); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/TreePopupMenuMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/TreePopupMenuMng.java |
|
if (object != null) new AnnotateCmd(object).execute(); | if (object != null) { AnnotateCmd cmd = new AnnotateCmd(model.getParentModel(), clipBoard.getSelectedNode()); cmd.execute(); } | public void actionPerformed(ActionEvent e) { int index = -1; DataObject object; try { index = Integer.parseInt(e.getActionCommand()); object = clipBoard.getDataObject(); switch (index) { case PROPERTIES: if (object != null) new PropertiesCmd(object).execute(); break; case ANNOTATE: if (object != null) new AnnotateCmd(object).execute(); break; case CLASSIFY: if (object instanceof ImageData) { ClassifyCmd cmd = new ClassifyCmd((ImageData) object, Classifier.CLASSIFICATION_MODE, null); cmd.execute(); } break; case DECLASSIFY: if (object instanceof ImageData) { ClassifyCmd cmd = new ClassifyCmd((ImageData) object, Classifier.DECLASSIFICATION_MODE, null); cmd.execute(); } break; case VIEW: if (object != null) new ViewCmd(object).execute(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/TreePopupMenuMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/TreePopupMenuMng.java |
if (model != null) { | if (model != null && hierarchyObject == null) { | public void execute() { if (model != null) { ImageDisplay selectedDisplay = model.getBrowser(). getSelectedDisplay(); hierarchyObject = (DataObject) selectedDisplay.getHierarchyObject(); } if (hierarchyObject == null) return; //post a show properties event. model.moveToBack(); //move the window to the back. EventBus eventBus = HiViewerAgent.getRegistry().getEventBus(); eventBus.post(new ShowProperties(hierarchyObject, ShowProperties.EDIT)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/03010c58165e57243d5a9590a791904493dfeec3/PropertiesCmd.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/PropertiesCmd.java |
model.moveToBack(); | if (model != null) model.moveToBack(); | public void execute() { if (model != null) { ImageDisplay selectedDisplay = model.getBrowser(). getSelectedDisplay(); hierarchyObject = (DataObject) selectedDisplay.getHierarchyObject(); } if (hierarchyObject == null) return; //post a show properties event. model.moveToBack(); //move the window to the back. EventBus eventBus = HiViewerAgent.getRegistry().getEventBus(); eventBus.post(new ShowProperties(hierarchyObject, ShowProperties.EDIT)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/03010c58165e57243d5a9590a791904493dfeec3/PropertiesCmd.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/PropertiesCmd.java |
Log.error("Unable to load plugin " + name + " due to min version incompatibility."); | public Collection getPluginList(InputStream response) { final List pluginList = new ArrayList(); SAXReader saxReader = new SAXReader(); Document pluginXML = null; try { pluginXML = saxReader.read(response); } catch (DocumentException e) { Log.error(e); } List plugins = pluginXML.selectNodes("/plugins/plugin"); Iterator iter = plugins.iterator(); while (iter.hasNext()) { PublicPlugin publicPlugin = new PublicPlugin(); String clazz = null; String name = null; try { Element plugin = (Element)iter.next(); try { String version = plugin.selectSingleNode("minSparkVersion").getText(); if (version.compareTo(JiveInfo.getVersion()) < 1) { continue; } } catch (Exception e) { Log.error("Unable to load plugin " + name + " due to no minSparkVersion."); continue; } name = plugin.selectSingleNode("name").getText(); clazz = plugin.selectSingleNode("class").getText(); publicPlugin.setPluginClass(clazz); publicPlugin.setName(name); try { String version = plugin.selectSingleNode("version").getText(); publicPlugin.setVersion(version); String author = plugin.selectSingleNode("author").getText(); publicPlugin.setAuthor(author); Node emailNode = plugin.selectSingleNode("email"); if (emailNode != null) { publicPlugin.setEmail(emailNode.getText()); } Node descriptionNode = plugin.selectSingleNode("description"); if (descriptionNode != null) { publicPlugin.setDescription(descriptionNode.getText()); } Node homePageNode = plugin.selectSingleNode("homePage"); if (homePageNode != null) { publicPlugin.setHomePage(homePageNode.getText()); } Node downloadNode = plugin.selectSingleNode("downloadURL"); if (downloadNode != null) { String downloadURL = downloadNode.getText(); publicPlugin.setDownloadURL(downloadURL); } Node changeLog = plugin.selectSingleNode("changeLog"); if (changeLog != null) { publicPlugin.setChangeLogAvailable(true); } Node readMe = plugin.selectSingleNode("readme"); if (readMe != null) { publicPlugin.setReadMeAvailable(true); } Node smallIcon = plugin.selectSingleNode("smallIcon"); if (smallIcon != null) { publicPlugin.setSmallIconAvailable(true); } Node largeIcon = plugin.selectSingleNode("largeIcon"); if (largeIcon != null) { publicPlugin.setLargeIconAvailable(true); } } catch (Exception e) { System.out.println("We can ignore these."); } pluginList.add(publicPlugin); } catch (Exception ex) { ex.printStackTrace(); } } return pluginList; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/16b62c86e7c19476e9f5094fb88d91bc3da3360a/PluginViewer.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/viewer/PluginViewer.java |
|
return "1.1.9.2"; | return "1.1.9.3"; | public static String getVersion() { return "1.1.9.2"; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/JiveInfo.java/buggy/src/java/org/jivesoftware/sparkimpl/settings/JiveInfo.java |
int[] rgba, int alpha, int index) | int[] rgba, int index) | ColorChooserManager(ColorChooser view, HSBPaneManager hsbManager, int[] rgba, int alpha, int index) { this.view = view; this.hsbManager = hsbManager; this.alpha = alpha; this.rgba = rgba; this.index = index; initColor(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5bb26faa9c073c259106cdbdd8e0f710624321f0/ColorChooserManager.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooserManager.java |
this.alpha = alpha; | this.alpha = rgba[ColorChooser.ALPHA]; | ColorChooserManager(ColorChooser view, HSBPaneManager hsbManager, int[] rgba, int alpha, int index) { this.view = view; this.hsbManager = hsbManager; this.alpha = alpha; this.rgba = rgba; this.index = index; initColor(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5bb26faa9c073c259106cdbdd8e0f710624321f0/ColorChooserManager.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooserManager.java |
setImages( new HashSet( d.eachLinkedImage( block ))); setProjects( new HashSet( d.eachLinkedProject( block ))); setAnnotations( new HashSet( d.collectAnnotations( block ))); | setImages( makeSet( d.sizeOfImageLinks(), d.eachLinkedImage( block ))); setProjects( makeSet( d.sizeOfProjectLinks(), d.eachLinkedProject( block ))); setAnnotations( makeSet( d.sizeOfAnnotations(), d.collectAnnotations( block ))); | public void copy(IObject model, ModelMapper mapper) { if (model instanceof Dataset) { Dataset d = (Dataset) model; super.copy(model,mapper); // Details if (d.getDetails() != null){ Details details = d.getDetails(); this.setOwner((ExperimenterData)mapper.findTarget( details.getOwner())); if ( details.getCounts() != null ) { Object annotationCount = details.getCounts().get( Dataset.ANNOTATIONS ); if ( annotationCount instanceof Integer ) this.setAnnotationCount( (Integer) annotationCount ); } } // Fields this.setName(d.getName()); this.setDescription(d.getDescription()); // Collections MapperBlock block = new MapperBlock( mapper ); setImages( new HashSet( d.eachLinkedImage( block ))); setProjects( new HashSet( d.eachLinkedProject( block ))); setAnnotations( new HashSet( d.collectAnnotations( block ))); } else { throw new IllegalArgumentException( "DatasetData can only copy from Dataset"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9638b50efec05ce0b3d19bbef1c149c757b964aa/DatasetData.java/clean/components/shoola-adapter/src/pojos/DatasetData.java |
case M_ID: return id(); | public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); } return super.callIndexed(index, args); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a33fc547e26999709256db0c7da831fd8ed14d1c/RubyFixnum.java/clean/org/jruby/RubyFixnum.java |
|
fixnumClass.defineMethod("id", IndexedCallback.create(M_ID, 0)); | public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.includeModule(ruby.getClasses().getPrecisionModule()); fixnumClass.defineSingletonMethod("induced_from", CallbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", IRubyObject.class)); fixnumClass.defineMethod("to_f", IndexedCallback.create(M_TO_F, 0)); fixnumClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("to_str", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("<<", IndexedCallback.create(M_OP_LSHIFT, 1)); fixnumClass.defineMethod(">>", IndexedCallback.create(M_OP_RSHIFT, 1)); fixnumClass.defineMethod("+", IndexedCallback.create(M_OP_PLUS, 1)); fixnumClass.defineMethod("-", IndexedCallback.create(M_OP_MINUS, 1)); fixnumClass.defineMethod("*", IndexedCallback.create(M_OP_MUL, 1)); fixnumClass.defineMethod("/", IndexedCallback.create(M_OP_DIV, 1)); fixnumClass.defineMethod("%", IndexedCallback.create(M_OP_MOD, 1)); fixnumClass.defineMethod("**", IndexedCallback.create(M_OP_POW, 1)); fixnumClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("eql?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("equal?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("<=>", IndexedCallback.create(M_OP_CMP, 1)); fixnumClass.defineMethod(">", IndexedCallback.create(M_OP_GT, 1)); fixnumClass.defineMethod(">=", IndexedCallback.create(M_OP_GE, 1)); fixnumClass.defineMethod("<", IndexedCallback.create(M_OP_LT, 1)); fixnumClass.defineMethod("<=", IndexedCallback.create(M_OP_LE, 1)); fixnumClass.defineMethod("&", IndexedCallback.create(M_OP_AND, 1)); fixnumClass.defineMethod("|", CallbackFactory.getMethod(RubyFixnum.class, "op_or", RubyInteger.class)); fixnumClass.defineMethod("^", CallbackFactory.getMethod(RubyFixnum.class, "op_xor", RubyInteger.class)); fixnumClass.defineMethod("size", IndexedCallback.create(M_SIZE, 0)); fixnumClass.defineMethod("[]", CallbackFactory.getMethod(RubyFixnum.class, "aref", RubyInteger.class)); fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); fixnumClass.defineMethod("id2name", IndexedCallback.create(M_ID2NAME, 0)); fixnumClass.defineMethod("~", IndexedCallback.create(M_INVERT, 0)); return fixnumClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a33fc547e26999709256db0c7da831fd8ed14d1c/RubyFixnum.java/clean/org/jruby/RubyFixnum.java |
|
public DatasetAnnotation(Integer attributeId, String content, Boolean valid, org.openmicroscopy.omero.model.Dataset dataset, org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.attributeId = attributeId; this.content = content; this.valid = valid; this.dataset = dataset; this.moduleExecution = moduleExecution; | public DatasetAnnotation() { | public DatasetAnnotation(Integer attributeId, String content, Boolean valid, org.openmicroscopy.omero.model.Dataset dataset, org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.attributeId = attributeId; this.content = content; this.valid = valid; this.dataset = dataset; this.moduleExecution = moduleExecution; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/DatasetAnnotation.java/buggy/components/common/src/org/openmicroscopy/omero/model/DatasetAnnotation.java |
public org.openmicroscopy.omero.model.Dataset getDataset() { | public Dataset getDataset() { | public org.openmicroscopy.omero.model.Dataset getDataset() { return this.dataset; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/DatasetAnnotation.java/buggy/components/common/src/org/openmicroscopy/omero/model/DatasetAnnotation.java |
public org.openmicroscopy.omero.model.ModuleExecution getModuleExecution() { | public ModuleExecution getModuleExecution() { | public org.openmicroscopy.omero.model.ModuleExecution getModuleExecution() { return this.moduleExecution; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/DatasetAnnotation.java/buggy/components/common/src/org/openmicroscopy/omero/model/DatasetAnnotation.java |
public void setDataset(org.openmicroscopy.omero.model.Dataset dataset) { | public void setDataset(Dataset dataset) { | public void setDataset(org.openmicroscopy.omero.model.Dataset dataset) { this.dataset = dataset; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/DatasetAnnotation.java/buggy/components/common/src/org/openmicroscopy/omero/model/DatasetAnnotation.java |
public void setModuleExecution(org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { | public void setModuleExecution(ModuleExecution moduleExecution) { | public void setModuleExecution(org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.moduleExecution = moduleExecution; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/DatasetAnnotation.java/buggy/components/common/src/org/openmicroscopy/omero/model/DatasetAnnotation.java |
return runtime.newFixnum(iVisited.getValue()); | return iVisited.getFixnum(runtime); | private static IRubyObject evalInternal(ThreadContext context, Node node, IRubyObject self) { IRuby runtime = context.getRuntime(); bigloop: do { if (node == null) return runtime.getNil(); switch (node.nodeId) { case NodeTypes.ALIASNODE: { AliasNode iVisited = (AliasNode) node; if (context.getRubyClass() == null) { throw runtime.newTypeError("no class to make alias"); } context.getRubyClass().defineAlias(iVisited.getNewName(), iVisited.getOldName()); context.getRubyClass().callMethod(context, "method_added", runtime.newSymbol(iVisited.getNewName())); return runtime.getNil(); } case NodeTypes.ANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.ARGSCATNODE: { ArgsCatNode iVisited = (ArgsCatNode) node; IRubyObject args = evalInternal(context, iVisited.getFirstNode(), self); IRubyObject secondArgs = splatValue(evalInternal(context, iVisited.getSecondNode(), self)); RubyArray list = args instanceof RubyArray ? (RubyArray) args : runtime.newArray(args); return list.concat(secondArgs); } // case NodeTypes.ARGSNODE: // EvaluateVisitor.argsNodeVisitor.execute(this, node); // break; // case NodeTypes.ARGUMENTNODE: // EvaluateVisitor.argumentNodeVisitor.execute(this, node); // break; case NodeTypes.ARRAYNODE: { ArrayNode iVisited = (ArrayNode) node; IRubyObject[] array = new IRubyObject[iVisited.size()]; int i = 0; for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node next = (Node) iterator.next(); array[i++] = evalInternal(context, next, self); } return runtime.newArray(array); } // case NodeTypes.ASSIGNABLENODE: // EvaluateVisitor.assignableNodeVisitor.execute(this, node); // break; case NodeTypes.BACKREFNODE: { BackRefNode iVisited = (BackRefNode) node; IRubyObject backref = context.getBackref(); switch (iVisited.getType()) { case '~': return backref; case '&': return RubyRegexp.last_match(backref); case '`': return RubyRegexp.match_pre(backref); case '\'': return RubyRegexp.match_post(backref); case '+': return RubyRegexp.match_last(backref); } break; } case NodeTypes.BEGINNODE: { BeginNode iVisited = (BeginNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.BIGNUMNODE: { BignumNode iVisited = (BignumNode) node; return RubyBignum.newBignum(runtime, iVisited.getValue()); } // case NodeTypes.BINARYOPERATORNODE: // EvaluateVisitor.binaryOperatorNodeVisitor.execute(this, node); // break; // case NodeTypes.BLOCKARGNODE: // EvaluateVisitor.blockArgNodeVisitor.execute(this, node); // break; case NodeTypes.BLOCKNODE: { BlockNode iVisited = (BlockNode) node; IRubyObject result = runtime.getNil(); for (Iterator iter = iVisited.iterator(); iter.hasNext();) { result = evalInternal(context, (Node) iter.next(), self); } return result; } case NodeTypes.BLOCKPASSNODE: { BlockPassNode iVisited = (BlockPassNode) node; IRubyObject proc = evalInternal(context, iVisited.getBodyNode(), self); if (proc.isNil()) { context.setNoBlock(); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearNoBlock(); } } // If not already a proc then we should try and make it one. if (!(proc instanceof RubyProc)) { proc = proc.convertToType("Proc", "to_proc", false); if (!(proc instanceof RubyProc)) { throw runtime.newTypeError("wrong argument type " + proc.getMetaClass().getName() + " (expected Proc)"); } } // TODO: Add safety check for taintedness Block block = (Block) context.getCurrentBlock(); if (block != null) { IRubyObject blockObject = block.getBlockObject(); // The current block is already associated with the proc. No need to create new // block for it. Just eval! if (blockObject != null && blockObject == proc) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearBlockAvailable(); } } } context.preBlockPassEval(((RubyProc) proc).getBlock()); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.postBlockPassEval(); } } case NodeTypes.BREAKNODE: { BreakNode iVisited = (BreakNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.BreakJump); je.setPrimaryData(result); je.setSecondaryData(node); throw je; } case NodeTypes.CALLNODE: { CallNode iVisited = (CallNode) node; context.beginCallArgs(); IRubyObject receiver = null; IRubyObject[] args = null; try { receiver = evalInternal(context, iVisited.getReceiverNode(), self); args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } assert receiver.getMetaClass() != null : receiver.getClass().getName(); // If reciever is self then we do the call the same way as vcall CallType callType = (receiver == self ? CallType.VARIABLE : CallType.NORMAL); return receiver.callMethod(context, iVisited.getName(), args, callType); } case NodeTypes.CASENODE: { CaseNode iVisited = (CaseNode) node; IRubyObject expression = null; if (iVisited.getCaseNode() != null) { expression = evalInternal(context, iVisited.getCaseNode(), self); } context.pollThreadEvents(); IRubyObject result = runtime.getNil(); Node firstWhenNode = iVisited.getFirstWhenNode(); while (firstWhenNode != null) { if (!(firstWhenNode instanceof WhenNode)) { node = firstWhenNode; continue bigloop; } WhenNode whenNode = (WhenNode) firstWhenNode; if (whenNode.getExpressionNodes() instanceof ArrayNode) { for (Iterator iter = ((ArrayNode) whenNode.getExpressionNodes()).iterator(); iter .hasNext();) { Node tag = (Node) iter.next(); context.setPosition(tag.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // Ruby grammar has nested whens in a case body because of // productions case_body and when_args. if (tag instanceof WhenNode) { RubyArray expressions = (RubyArray) evalInternal(context, ((WhenNode) tag) .getExpressionNodes(), self); for (int j = 0; j < expressions.getLength(); j++) { IRubyObject condition = expressions.entry(j); if ((expression != null && condition.callMethod(context, "===", expression) .isTrue()) || (expression == null && condition.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } continue; } result = evalInternal(context, tag, self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = whenNode.getBodyNode(); continue bigloop; } } } else { result = evalInternal(context, whenNode.getExpressionNodes(), self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } context.pollThreadEvents(); firstWhenNode = whenNode.getNextCase(); } return runtime.getNil(); } case NodeTypes.CLASSNODE: { ClassNode iVisited = (ClassNode) node; Node superNode = iVisited.getSuperNode(); RubyClass superClass = superNode == null ? null : (RubyClass) evalInternal(context, superNode, self); Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingClass = getEnclosingModule(context, classNameNode, self); RubyClass rubyClass = enclosingClass.defineOrGetClassUnder(name, superClass); if (context.getWrapper() != null) { rubyClass.extendObject(context.getWrapper()); rubyClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), rubyClass, self); } case NodeTypes.CLASSVARASGNNODE: { ClassVarAsgnNode iVisited = (ClassVarAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule) rubyClass.getInstanceVariable("__attached__"); } rubyClass.setClassVar(iVisited.getName(), result); return result; } case NodeTypes.CLASSVARDECLNODE: { ClassVarDeclNode iVisited = (ClassVarDeclNode) node; // FIXME: shouldn't we use cref here? if (context.getRubyClass() == null) { throw runtime.newTypeError("no class/module to define class variable"); } IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); ((RubyModule) context.peekCRef().getValue()).setClassVar(iVisited.getName(), result); return runtime.getNil(); } case NodeTypes.CLASSVARNODE: { ClassVarNode iVisited = (ClassVarNode) node; RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule)rubyClass.getInstanceVariable("__attached__"); } return rubyClass.getClassVar(iVisited.getName()); } case NodeTypes.COLON2NODE: { Colon2Node iVisited = (Colon2Node) node; Node leftNode = iVisited.getLeftNode(); // TODO: Made this more colon3 friendly because of cpath production // rule in grammar (it is convenient to think of them as the same thing // at a grammar level even though evaluation is). if (leftNode == null) { return runtime.getObject().getConstantFrom(iVisited.getName()); } else { IRubyObject result = evalInternal(context, iVisited.getLeftNode(), self); if (result instanceof RubyModule) { return ((RubyModule) result).getConstantFrom(iVisited.getName()); } else { return result.callMethod(context, iVisited.getName()); } } } case NodeTypes.COLON3NODE: { Colon3Node iVisited = (Colon3Node) node; return runtime.getObject().getConstantFrom(iVisited.getName()); } case NodeTypes.CONSTDECLNODE: { ConstDeclNode iVisited = (ConstDeclNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); IRubyObject module; if (iVisited.getPathNode() != null) { module = evalInternal(context, iVisited.getPathNode(), self); } else { // FIXME: why do we check RubyClass and then use CRef? if (context.getRubyClass() == null) { // TODO: wire into new exception handling mechanism throw runtime.newTypeError("no class/module to define constant"); } module = (RubyModule) context.peekCRef().getValue(); } // FIXME: shouldn't we use the result of this set in setResult? ((RubyModule) module).setConstant(iVisited.getName(), result); return result; } case NodeTypes.CONSTNODE: { ConstNode iVisited = (ConstNode) node; return context.getConstant(iVisited.getName()); } case NodeTypes.DASGNNODE: { DAsgnNode iVisited = (DAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("DSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.DEFINEDNODE: { DefinedNode iVisited = (DefinedNode) node; String definition = getDefinition(context, iVisited.getExpressionNode(), self); if (definition != null) { return runtime.newString(definition); } else { return runtime.getNil(); } } case NodeTypes.DEFNNODE: { DefnNode iVisited = (DefnNode) node; RubyModule containingClass = context.getRubyClass(); if (containingClass == null) { throw runtime.newTypeError("No class to add method."); } String name = iVisited.getName(); if (containingClass == runtime.getObject() && name.equals("initialize")) { runtime.getWarnings().warn("redefining Object#initialize may cause infinite loop"); } Visibility visibility = context.getCurrentVisibility(); if (name.equals("initialize") || visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } DefaultMethod newMethod = new DefaultMethod(containingClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, context.peekCRef()); if (iVisited.getBodyNode() != null) { iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); } containingClass.addMethod(name, newMethod); if (context.getCurrentVisibility().isModuleFunction()) { containingClass.getSingletonClass().addMethod( name, new WrapperCallable(containingClass.getSingletonClass(), newMethod, Visibility.PUBLIC)); containingClass.callMethod(context, "singleton_method_added", runtime.newSymbol(name)); } // 'class << state.self' and 'class << obj' uses defn as opposed to defs if (containingClass.isSingleton()) { ((MetaClass) containingClass).getAttachedObject().callMethod( context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); } else { containingClass.callMethod(context, "method_added", runtime.newSymbol(name)); } return runtime.getNil(); } case NodeTypes.DEFSNODE: { DefsNode iVisited = (DefsNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); RubyClass rubyClass; if (receiver.isNil()) { rubyClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { rubyClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { rubyClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure; can't define singleton method."); } if (receiver.isFrozen()) { throw runtime.newFrozenError("object"); } if (!receiver.singletonMethodsAllowed()) { throw runtime.newTypeError("can't define singleton method \"" + iVisited.getName() + "\" for " + receiver.getType()); } rubyClass = receiver.getSingletonClass(); } if (runtime.getSafeLevel() >= 4) { ICallable method = (ICallable) rubyClass.getMethods().get(iVisited.getName()); if (method != null) { throw runtime.newSecurityError("Redefining method prohibited."); } } DefaultMethod newMethod = new DefaultMethod(rubyClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), Visibility.PUBLIC, context.peekCRef()); if (iVisited.getBodyNode() != null) { iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); } rubyClass.addMethod(iVisited.getName(), newMethod); receiver.callMethod(context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); return runtime.getNil(); } case NodeTypes.DOTNODE: { DotNode iVisited = (DotNode) node; return RubyRange.newRange(runtime, evalInternal(context, iVisited.getBeginNode(), self), evalInternal(context, iVisited .getEndNode(), self), iVisited.isExclusive()); } case NodeTypes.DREGEXPNODE: { DRegexpNode iVisited = (DRegexpNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } return RubyRegexp.newRegexp(runtime, sb.toString(), iVisited.getOptions(), lang); } case NodeTypes.DSTRNODE: { DStrNode iVisited = (DStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newString(sb.toString()); } case NodeTypes.DSYMBOLNODE: { DSymbolNode iVisited = (DSymbolNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.getNode().iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newSymbol(sb.toString()); } case NodeTypes.DVARNODE: { DVarNode iVisited = (DVarNode) node; // System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject obj = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); // FIXME: null check is removable once we figure out how to assign to unset named block args return obj == null ? runtime.getNil() : obj; } case NodeTypes.DXSTRNODE: { DXStrNode iVisited = (DXStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return self.callMethod(context, "`", runtime.newString(sb.toString())); } case NodeTypes.ENSURENODE: { EnsureNode iVisited = (EnsureNode) node; // save entering the try if there's nothing to ensure if (iVisited.getEnsureNode() != null) { IRubyObject result = runtime.getNil(); try { result = evalInternal(context, iVisited.getBodyNode(), self); } finally { evalInternal(context, iVisited.getEnsureNode(), self); } return result; } node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.EVSTRNODE: { EvStrNode iVisited = (EvStrNode) node; node = iVisited.getBody(); continue bigloop; } case NodeTypes.FALSENODE: { context.pollThreadEvents(); return runtime.getFalse(); } case NodeTypes.FCALLNODE: { FCallNode iVisited = (FCallNode) node; context.beginCallArgs(); IRubyObject[] args; try { args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } return self.callMethod(context, iVisited.getName(), args, CallType.FUNCTIONAL); } case NodeTypes.FIXNUMNODE: { FixnumNode iVisited = (FixnumNode) node; return runtime.newFixnum(iVisited.getValue()); } case NodeTypes.FLIPNODE: { FlipNode iVisited = (FlipNode) node; IRubyObject result = runtime.getNil(); if (iVisited.isExclusive()) { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { result = evalInternal(context, iVisited.getBeginNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } else { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { if (evalInternal(context, iVisited.getBeginNode(), self).isTrue()) { context.getCurrentScope().setValue( iVisited.getIndex(), evalInternal(context, iVisited.getEndNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(), iVisited.getDepth()); return runtime.getTrue(); } else { return runtime.getFalse(); } } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } } case NodeTypes.FLOATNODE: { FloatNode iVisited = (FloatNode) node; return RubyFloat.newFloat(runtime, iVisited.getValue()); } case NodeTypes.FORNODE: { ForNode iVisited = (ForNode) node; // For nodes do not have to create an addition scope so we just pass null context.preForLoopEval(Block.createBlock(iVisited.getVarNode(), null, iVisited.getCallable(), self)); try { while (true) { try { ISourcePosition position = context.getPosition(); context.beginCallArgs(); IRubyObject recv = null; try { recv = evalInternal(context, iVisited.getIterNode(), self); } finally { context.setPosition(position); context.endCallArgs(); } return recv.callMethod(context, "each", IRubyObject.NULL_ARRAY, CallType.NORMAL); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // do nothing, allow loop to retry break; default: throw je; } } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postForLoopEval(); } } case NodeTypes.GLOBALASGNNODE: { GlobalAsgnNode iVisited = (GlobalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); runtime.getGlobalVariables().set(iVisited.getName(), result); return result; } case NodeTypes.GLOBALVARNODE: { GlobalVarNode iVisited = (GlobalVarNode) node; return runtime.getGlobalVariables().get(iVisited.getName()); } case NodeTypes.HASHNODE: { HashNode iVisited = (HashNode) node; Map hash = null; if (iVisited.getListNode() != null) { hash = new HashMap(iVisited.getListNode().size() / 2); for (Iterator iterator = iVisited.getListNode().iterator(); iterator.hasNext();) { // insert all nodes in sequence, hash them in the final instruction // KEY IRubyObject key = evalInternal(context, (Node) iterator.next(), self); IRubyObject value = evalInternal(context, (Node) iterator.next(), self); hash.put(key, value); } } if (hash == null) { return RubyHash.newHash(runtime); } return RubyHash.newHash(runtime, hash, runtime.getNil()); } case NodeTypes.IFNODE: { IfNode iVisited = (IfNode) node; IRubyObject result = evalInternal(context, iVisited.getCondition(), self); if (result.isTrue()) { node = iVisited.getThenBody(); continue bigloop; } else { node = iVisited.getElseBody(); continue bigloop; } } case NodeTypes.INSTASGNNODE: { InstAsgnNode iVisited = (InstAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); self.setInstanceVariable(iVisited.getName(), result); return result; } case NodeTypes.INSTVARNODE: { InstVarNode iVisited = (InstVarNode) node; IRubyObject variable = self.getInstanceVariable(iVisited.getName()); return variable == null ? runtime.getNil() : variable; } // case NodeTypes.ISCOPINGNODE: // EvaluateVisitor.iScopingNodeVisitor.execute(this, node); // break; case NodeTypes.ITERNODE: { IterNode iVisited = (IterNode) node; context.preIterEval(Block.createBlock(iVisited.getVarNode(), new DynamicScope(iVisited.getScope(), context.getCurrentScope()), iVisited.getCallable(), self)); try { while (true) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // allow loop to retry break; default: throw je; } } finally { context.clearBlockAvailable(); } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postIterEval(); } } case NodeTypes.LOCALASGNNODE: { LocalAsgnNode iVisited = (LocalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("LSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.LOCALVARNODE: { LocalVarNode iVisited = (LocalVarNode) node; //System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject result = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); return result == null ? runtime.getNil() : result; } case NodeTypes.MATCH2NODE: { Match2Node iVisited = (Match2Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); return ((RubyRegexp) recv).match(value); } case NodeTypes.MATCH3NODE: { Match3Node iVisited = (Match3Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); if (value instanceof RubyString) { return ((RubyRegexp) recv).match(value); } else { return value.callMethod(context, "=~", recv); } } case NodeTypes.MATCHNODE: { MatchNode iVisited = (MatchNode) node; return ((RubyRegexp) evalInternal(context, iVisited.getRegexpNode(), self)).match2(); } case NodeTypes.MODULENODE: { ModuleNode iVisited = (ModuleNode) node; Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingModule = getEnclosingModule(context, classNameNode, self); if (enclosingModule == null) { throw runtime.newTypeError("no outer class/module"); } RubyModule module; if (enclosingModule == runtime.getObject()) { module = runtime.getOrCreateModule(name); } else { module = enclosingModule.defineModuleUnder(name); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), module, self); } case NodeTypes.MULTIPLEASGNNODE: { MultipleAsgnNode iVisited = (MultipleAsgnNode) node; return AssignmentVisitor.assign(context, self, iVisited, evalInternal(context, iVisited.getValueNode(), self), false); } case NodeTypes.NEWLINENODE: { NewlineNode iVisited = (NewlineNode) node; // something in here is used to build up ruby stack trace... context.setPosition(iVisited.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // TODO: do above but not below for additional newline nodes node = iVisited.getNextNode(); continue bigloop; } case NodeTypes.NEXTNODE: { NextNode iVisited = (NextNode) node; context.pollThreadEvents(); IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.NextJump); je.setPrimaryData(result); je.setSecondaryData(iVisited); //state.setCurrentException(je); throw je; } case NodeTypes.NILNODE: return runtime.getNil(); case NodeTypes.NOTNODE: { NotNode iVisited = (NotNode) node; IRubyObject result = evalInternal(context, iVisited.getConditionNode(), self); return result.isTrue() ? runtime.getFalse() : runtime.getTrue(); } case NodeTypes.NTHREFNODE: { NthRefNode iVisited = (NthRefNode) node; return RubyRegexp.nth_match(iVisited.getMatchNumber(), context.getBackref()); } case NodeTypes.OPASGNANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; // add in reverse order IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.OPASGNNODE: { OpAsgnNode iVisited = (OpAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = receiver.callMethod(context, iVisited.getVariableName()); if (iVisited.getOperatorName().equals("||")) { if (value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else { value = value.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited.getValueNode(), self)); } receiver.callMethod(context, iVisited.getVariableName() + "=", value); context.pollThreadEvents(); return value; } case NodeTypes.OPASGNORNODE: { OpAsgnOrNode iVisited = (OpAsgnOrNode) node; String def = getDefinition(context, iVisited.getFirstNode(), self); IRubyObject result = runtime.getNil(); if (def != null) { result = evalInternal(context, iVisited.getFirstNode(), self); } if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } case NodeTypes.OPELEMENTASGNNODE: { OpElementAsgnNode iVisited = (OpElementAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject[] args = setupArgs(context, iVisited.getArgsNode(), self); IRubyObject firstValue = receiver.callMethod(context, "[]", args); if (iVisited.getOperatorName().equals("||")) { if (firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else { firstValue = firstValue.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited .getValueNode(), self)); } IRubyObject[] expandedArgs = new IRubyObject[args.length + 1]; System.arraycopy(args, 0, expandedArgs, 0, args.length); expandedArgs[expandedArgs.length - 1] = firstValue; return receiver.callMethod(context, "[]=", expandedArgs); } case NodeTypes.OPTNNODE: { OptNNode iVisited = (OptNNode) node; IRubyObject result = runtime.getNil(); while (RubyKernel.gets(runtime.getTopSelf(), IRubyObject.NULL_ARRAY).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: // do nothing, this iteration restarts break; case JumpType.NEXT: // recheck condition break loop; case JumpType.BREAK: // end loop return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.ORNODE: { OrNode iVisited = (OrNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } // case NodeTypes.POSTEXENODE: // EvaluateVisitor.postExeNodeVisitor.execute(this, node); // break; case NodeTypes.REDONODE: { context.pollThreadEvents(); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.RedoJump); je.setSecondaryData(node); throw je; } case NodeTypes.REGEXPNODE: { RegexpNode iVisited = (RegexpNode) node; String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } try { return RubyRegexp.newRegexp(runtime, iVisited.getPattern(), lang); } catch(java.util.regex.PatternSyntaxException e) { throw runtime.newSyntaxError(e.getMessage()); } } case NodeTypes.RESCUEBODYNODE: { RescueBodyNode iVisited = (RescueBodyNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.RESCUENODE: { RescueNode iVisited = (RescueNode)node; RescuedBlock : while (true) { try { // Execute rescue block IRubyObject result = evalInternal(context, iVisited.getBodyNode(), self); // If no exception is thrown execute else block if (iVisited.getElseNode() != null) { if (iVisited.getRescueNode() == null) { runtime.getWarnings().warn(iVisited.getElseNode().getPosition(), "else without rescue is useless"); } result = evalInternal(context, iVisited.getElseNode(), self); } return result; } catch (RaiseException raiseJump) { RubyException raisedException = raiseJump.getException(); // TODO: Rubicon TestKernel dies without this line. A cursory glance implies we // falsely set $! to nil and this sets it back to something valid. This should // get fixed at the same time we address bug #1296484. runtime.getGlobalVariables().set("$!", raisedException); RescueBodyNode rescueNode = iVisited.getRescueNode(); while (rescueNode != null) { Node exceptionNodes = rescueNode.getExceptionNodes(); ListNode exceptionNodesList; if (exceptionNodes instanceof SplatNode) { exceptionNodesList = (ListNode) evalInternal(context, exceptionNodes, self); } else { exceptionNodesList = (ListNode) exceptionNodes; } if (isRescueHandled(context, raisedException, exceptionNodesList, self)) { try { return evalInternal(context, rescueNode, self); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.RetryJump) { // should be handled in the finally block below //state.runtime.getGlobalVariables().set("$!", state.runtime.getNil()); //state.threadContext.setRaisedException(null); continue RescuedBlock; } else { throw je; } } } rescueNode = rescueNode.getOptRescueNode(); } // no takers; bubble up throw raiseJump; } finally { // clear exception when handled or retried runtime.getGlobalVariables().set("$!", runtime.getNil()); } } } case NodeTypes.RETRYNODE: { context.pollThreadEvents(); JumpException je = new JumpException(JumpException.JumpType.RetryJump); throw je; } case NodeTypes.RETURNNODE: { ReturnNode iVisited = (ReturnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.ReturnJump); je.setPrimaryData(iVisited.getTarget()); je.setSecondaryData(result); je.setTertiaryData(iVisited); throw je; } case NodeTypes.ROOTNODE: { RootNode iVisited = (RootNode) node; DynamicScope scope = iVisited.getScope(); // Serialization killed our dynamic scope. We can just create an empty one // since serialization cannot serialize an eval (which is the only thing // which is capable of having a non-empty dynamic scope). if (scope == null) { scope = new DynamicScope(iVisited.getStaticScope(), null); } // Each root node has a top-level scope that we need to push context.preRootNode(scope); // FIXME: Wire up BEGIN and END nodes try { return eval(context, iVisited.getBodyNode(), self); } finally { context.postRootNode(); } } case NodeTypes.SCLASSNODE: { SClassNode iVisited = (SClassNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); RubyClass singletonClass; if (receiver.isNil()) { singletonClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { singletonClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { singletonClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure: can't extend object."); } singletonClass = receiver.getSingletonClass(); } if (context.getWrapper() != null) { singletonClass.extendObject(context.getWrapper()); singletonClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), singletonClass, self); } case NodeTypes.SELFNODE: return self; case NodeTypes.SPLATNODE: { SplatNode iVisited = (SplatNode) node; return splatValue(evalInternal(context, iVisited.getValue(), self)); } //// case NodeTypes.STARNODE: //// EvaluateVisitor.starNodeVisitor.execute(this, node); //// break; case NodeTypes.STRNODE: { StrNode iVisited = (StrNode) node; return runtime.newString(iVisited.getValue()); } case NodeTypes.SUPERNODE: { SuperNode iVisited = (SuperNode) node; if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("Superclass method '" + name + "' disabled.", name); } context.beginCallArgs(); IRubyObject[] args = null; try { args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } return context.callSuper(args); } case NodeTypes.SVALUENODE: { SValueNode iVisited = (SValueNode) node; return aValueSplat(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.SYMBOLNODE: { SymbolNode iVisited = (SymbolNode) node; return runtime.newSymbol(iVisited.getName()); } case NodeTypes.TOARYNODE: { ToAryNode iVisited = (ToAryNode) node; return aryToAry(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.TRUENODE: { context.pollThreadEvents(); return runtime.getTrue(); } case NodeTypes.UNDEFNODE: { UndefNode iVisited = (UndefNode) node; if (context.getRubyClass() == null) { throw runtime .newTypeError("No class to undef method '" + iVisited.getName() + "'."); } context.getRubyClass().undef(iVisited.getName()); return runtime.getNil(); } case NodeTypes.UNTILNODE: { UntilNode iVisited = (UntilNode) node; IRubyObject result = runtime.getNil(); while (!(result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.VALIASNODE: { VAliasNode iVisited = (VAliasNode) node; runtime.getGlobalVariables().alias(iVisited.getNewName(), iVisited.getOldName()); return runtime.getNil(); } case NodeTypes.VCALLNODE: { VCallNode iVisited = (VCallNode) node; return self.callMethod(context, iVisited.getName(), IRubyObject.NULL_ARRAY, CallType.VARIABLE); } case NodeTypes.WHENNODE: assert false; return null; case NodeTypes.WHILENODE: { WhileNode iVisited = (WhileNode) node; IRubyObject result = runtime.getNil(); boolean firstTest = iVisited.evaluateAtStart(); while (!firstTest || (result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { firstTest = true; loop: while (true) { // Used for the 'redo' command try { evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return result; default: throw je; } } } } return result; } case NodeTypes.XSTRNODE: { XStrNode iVisited = (XStrNode) node; return self.callMethod(context, "`", runtime.newString(iVisited.getValue())); } case NodeTypes.YIELDNODE: { YieldNode iVisited = (YieldNode) node; IRubyObject result = evalInternal(context, iVisited.getArgsNode(), self); if (iVisited.getArgsNode() == null) { result = null; } return context.yieldCurrentBlock(result, null, null, iVisited.getCheckState()); } case NodeTypes.ZARRAYNODE: { return runtime.newArray(); } case NodeTypes.ZSUPERNODE: { if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("superclass method '" + name + "' disabled", name); } return context.callSuper(context.getFrameArgs(), true); } } } while (true); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6b4693d0592a3a856c70b2a8ea7ffb3ceb398f5c/EvaluationState.java/buggy/src/org/jruby/evaluator/EvaluationState.java |
return variable == null || variable.getAccessor() instanceof UndefinedAccessor; | return variable != null && variable.getAccessor() instanceof UndefinedAccessor; | public boolean isDefined(String name) { Asserts.notNull(name); Asserts.isTrue(name.startsWith("$")); GlobalVariable variable = (GlobalVariable)globalVariables.get(name); return variable == null || variable.getAccessor() instanceof UndefinedAccessor; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/44202c7c4496a9d93a130961952235c60934e5ee/GlobalVariables.java/buggy/src/org/jruby/internal/runtime/GlobalVariables.java |
String scope = ArticleUtil.getArticleRootPath(); | String scope = ArticleUtil.getArticleBaseFolderPath(); | public List listArticles() throws XmlException, IOException{ List list = new ArrayList(); IWContext iwc = IWContext.getInstance(); try { String scope = ArticleUtil.getArticleRootPath(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwc,IWSlideSession.class); if(scope != null){ if(scope.startsWith(session.getWebdavServerURI())){ scope = scope.substring(session.getWebdavServerURI().length()); } if(scope.startsWith("/")){ scope = scope.substring(1); } } ContentSearch searchBusiness = new ContentSearch(iwc.getIWMainApplication()); Search search = searchBusiness.createSearch(getSearchRequest(scope, iwc.getCurrentLocale())); Collection results = search.getSearchResults(); if(results!=null){ for (Iterator iter = results.iterator(); iter.hasNext();) { SearchResult result = (SearchResult) iter.next(); try { System.out.println("Attempting to load "+result.getSearchResultURI()); ArticleItemBean article = new ArticleSearchResultBean(); article.load(result.getSearchResultURI()); list.add(article); }catch(Exception e) { e.printStackTrace(); } } } } catch (SearchException e1) { e1.printStackTrace(); } return list; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/9dd8a7f9883fa3785baebfbed97ebf38eba1add9/SearchArticleBean.java/clean/src/java/com/idega/block/article/bean/SearchArticleBean.java |
setBounds(X_LOCATION, Y_LOCATION, WIN_WIDTH, WIN_HEIGHT); | ViewerUIF(ViewerCtrl control, Registry registry) { //name, resizable, closable, maximizable, iconifiable. super("Viewer", true, true, true, true); this.control = control; this.registry = registry; setJMenuBar(createMenuBar()); buildGUI(); //set the size and position the window. setBounds(X_LOCATION, Y_LOCATION, WIN_WIDTH, WIN_HEIGHT); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e717f628b707987e5b693ea9d57b6ef34b300679/ViewerUIF.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerUIF.java |
|
int w = canvas.getIconWidth()+EXTRA; int h = canvas.getIconHeight()+EXTRA; if (w > WIN_WIDTH) w = WIN_WIDTH; if (h > WIN_HEIGHT) h = WIN_HEIGHT; setSize(w, h); | void setImage(BufferedImage img) { canvas.display(img); revalidate(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e717f628b707987e5b693ea9d57b6ef34b300679/ViewerUIF.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerUIF.java |
|
manager = new ImageCanvasMng(this); | manager = new ImageCanvasMng(this, control); | public ImageCanvas(ViewerUIF view, ViewerCtrl control) { this.view = view; this.control = control; filters = new ArrayList(); manager = new ImageCanvasMng(this); magFactor = 1.0; setBackground(Viewer.BACKGROUND_COLOR); setDoubleBuffered(true); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/637cfc480ca0f34d360e30b6cf903cef502fa8dc/ImageCanvas.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvas.java |
setBorder(BorderFactory.createEtchedBorder()); JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(statusButton); p.add(status); add(UIUtilities.buildComponentPanel(p)); JPanel progress = new JPanel(); progress.setLayout(new BoxLayout(progress, BoxLayout.X_AXIS)); progress.add(progressBar); IconManager icons = IconManager.getInstance(); progressLabel = new JLabel(icons.getIcon(IconManager.PROGRESS)); progress.add(progressLabel); add(UIUtilities.buildComponentPanelRight(progress)); | setBorder(BorderFactory.createEtchedBorder()); add(status); JPanel progress = new JPanel(); progress.setLayout(new BoxLayout(progress, BoxLayout.X_AXIS)); progress.add(progressBar); IconManager icons = IconManager.getInstance(); progress.add(new JLabel(icons.getIcon(IconManager.PROGRESS))); add(UIUtilities.buildComponentPanelRight(progress)); | private void buildUI() { setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setBorder(BorderFactory.createEtchedBorder()); JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(statusButton); p.add(status); add(UIUtilities.buildComponentPanel(p)); JPanel progress = new JPanel(); progress.setLayout(new BoxLayout(progress, BoxLayout.X_AXIS)); progress.add(progressBar); IconManager icons = IconManager.getInstance(); progressLabel = new JLabel(icons.getIcon(IconManager.PROGRESS)); progress.add(progressLabel); add(UIUtilities.buildComponentPanelRight(progress)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d165d84615e7f90ee0847be9809fedfd2c53fadc/StatusBar.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/StatusBar.java |
status = new JLabel(); statusButton = new JButton(icons.getIcon(IconManager.INFO)); statusButton.setBorder(null); statusButton.setBorderPainted(false); statusButton.setFocusPainted(false); statusButton.setOpaque(false); | status = new JLabel(icons.getIcon(IconManager.INFO)); | private void initComponents() { IconManager icons = IconManager.getInstance(); progressBar = new JProgressBar(); progressBar.setIndeterminate(true); progressBar.setVisible(false); status = new JLabel(); statusButton = new JButton(icons.getIcon(IconManager.INFO)); statusButton.setBorder(null); statusButton.setBorderPainted(false); statusButton.setFocusPainted(false); statusButton.setOpaque(false); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d165d84615e7f90ee0847be9809fedfd2c53fadc/StatusBar.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/StatusBar.java |
void writeEntry(int tag, int fieldType, int count, int value) | private void writeEntry(int tag, int fieldType, int count, int value) | void writeEntry(int tag, int fieldType, int count, int value) throws IOException { output.writeShort(tag); output.writeShort(fieldType); output.writeInt(count); if (count == 1 && fieldType == TIFFEncoderCst.SHORT) value <<= 16; //left justify 16-bit values output.writeInt(value); // may be an offset } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c6482863aab2726a4e7e2791983dabc68962687a/TIFFEncoder.java/buggy/SRC/org/openmicroscopy/shoola/util/image/io/TIFFEncoder.java |
int bytesWritten = 0; int size = imageWidth*imageHeight*3; int count = imageWidth*24; byte[] buffer = new byte[count]; int i, j; DataBufferByte bufferByte = (DataBufferByte) image.getRaster().getDataBuffer(); byte[] red = bufferByte.getData(Encoder.RED_BAND); byte[] green = bufferByte.getData(Encoder.GREEN_BAND); byte[] blue = bufferByte.getData(Encoder.BLUE_BAND); while (bytesWritten < size) { if ((bytesWritten+count) > size) count = size - bytesWritten; j = bytesWritten/3; for (i = 0; i < count; i += 3) { buffer[i] = red[j]; buffer[i+1] = green[j]; buffer[i+2] = blue[j]; j++; } output.write(buffer, 0, count); bytesWritten += count; } writeColorMap(red, green, blue); | DataBuffer db = image.getRaster().getDataBuffer(); if (db instanceof DataBufferByte) writeRGBDataBufferByte((DataBufferByte) db); else if (db instanceof DataBufferInt) writeRGBDataBufferInt((DataBufferInt) db); | private void writeRGBPixels() throws IOException { int bytesWritten = 0; int size = imageWidth*imageHeight*3; int count = imageWidth*24; //3*8 byte[] buffer = new byte[count]; int i, j; DataBufferByte bufferByte = (DataBufferByte) image.getRaster().getDataBuffer(); //model chosen byte[] red = bufferByte.getData(Encoder.RED_BAND); byte[] green = bufferByte.getData(Encoder.GREEN_BAND); byte[] blue = bufferByte.getData(Encoder.BLUE_BAND); while (bytesWritten < size) { if ((bytesWritten+count) > size) count = size - bytesWritten; j = bytesWritten/3; //TIFF save as BRG and not RGB. for (i = 0; i < count; i += 3) { buffer[i] = red[j]; buffer[i+1] = green[j]; buffer[i+2] = blue[j]; j++; } output.write(buffer, 0, count); bytesWritten += count; } writeColorMap(red, green, blue); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c6482863aab2726a4e7e2791983dabc68962687a/TIFFEncoder.java/buggy/SRC/org/openmicroscopy/shoola/util/image/io/TIFFEncoder.java |
output.writeInt((int)(xscale*scale)); output.writeInt((int)scale); output.writeInt((int)(yscale*scale)); output.writeInt((int)scale); | output.writeInt((int) (xscale*scale)); output.writeInt((int) scale); output.writeInt((int) (yscale*scale)); output.writeInt((int) scale); | private void writeScale() throws IOException { double xscale = 1.0/imageWidth; double yscale = 1.0/imageHeight; double scale = 1000000.0; if (xscale > 1000.0) scale = 1000.0; output.writeInt((int)(xscale*scale)); output.writeInt((int)scale); output.writeInt((int)(yscale*scale)); output.writeInt((int)scale); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c6482863aab2726a4e7e2791983dabc68962687a/TIFFEncoder.java/buggy/SRC/org/openmicroscopy/shoola/util/image/io/TIFFEncoder.java |
{ int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case SAVE: saveDisplayOptions(); break; case RESET_DEFAULTS: resetDefaults(); break; case GREY: case RGB: case HSB: activateRenderingModel(index); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case SAVE: saveDisplayOptions(); break; case RESET_DEFAULTS: resetDefaults(); break; case GREY: case RGB: case HSB: activateRenderingModel(index); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case SAVE: saveDisplayOptions(); break; case RESET_DEFAULTS: resetDefaults(); break; case GREY: case RGB: case HSB: activateRenderingModel(index); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ ModelPane rnd = (ModelPane) renderersPool.get(c); if (rnd == null) { rnd = createRenderer(c); rnd.setEventManager(this); renderersPool.put(c, rnd); } return rnd; } | { ModelPane rnd = (ModelPane) renderersPool.get(c); if (rnd == null) { rnd = createRenderer(c); rnd.setEventManager(this); renderersPool.put(c, rnd); } return rnd; } | private ModelPane activate(Class c) { ModelPane rnd = (ModelPane) renderersPool.get(c); if (rnd == null) { rnd = createRenderer(c); rnd.setEventManager(this); renderersPool.put(c, rnd); } return rnd; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ Class c = getRendererClass(i); presentation.setModelPane(activate(c), true); QuantumPane qp = presentation.getQuantumPane(); if (i == GREY) { qp.setSelectionWavelengthsEnable(false); ChannelData[] channelData = getChannelData(); for (int j = 0; j < channelData.length; j++) { if (isActive(j)) { qp.setSelectedWavelength(j); presentation.getTabs().setSelectedIndex( RenderingAgtUIF.POS_MODEL); break; } } } else qp.setSelectionWavelengthsEnable(true); abstraction.setModel(i); } | { Class c = getRendererClass(i); presentation.setModelPane(activate(c), true); QuantumPane qp = presentation.getQuantumPane(); if (i == GREY) { qp.setSelectionWavelengthsEnable(false); ChannelData[] channelData = getChannelData(); for (int j = 0; j < channelData.length; j++) { if (isActive(j)) { qp.setSelectedWavelength(j); presentation.getTabs().setSelectedIndex( RenderingAgtUIF.POS_MODEL); break; } } } else qp.setSelectionWavelengthsEnable(true); abstraction.setModel(i); } | public void activateRenderingModel(int i) { Class c = getRendererClass(i); presentation.setModelPane(activate(c), true); QuantumPane qp = presentation.getQuantumPane(); if (i == GREY) { qp.setSelectionWavelengthsEnable(false); ChannelData[] channelData = getChannelData(); for (int j = 0; j < channelData.length; j++) { if (isActive(j)) { qp.setSelectedWavelength(j); presentation.getTabs().setSelectedIndex( RenderingAgtUIF.POS_MODEL); break; } } } else qp.setSelectionWavelengthsEnable(true); abstraction.setModel(i); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.addCodomainMap(ctx); } | { abstraction.addCodomainMap(ctx); } | public void addCodomainMap(CodomainMapContext ctx) { abstraction.addCodomainMap(ctx); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ ModelPane model = null; try { model = (ModelPane) c.newInstance(); } catch(Exception e) { String msg = "Can't create an instance of "+c.getName(); throw new InternalError(msg, e); } return model; } | { ModelPane model = null; try { model = (ModelPane) c.newInstance(); } catch(Exception e) { String msg = "Can't create an instance of "+c.getName(); throw new InternalError(msg, e); } return model; } | private ModelPane createRenderer(Class c) { ModelPane model = null; try { model = (ModelPane) c.newInstance(); } catch(Exception e) { String msg = "Can't create an instance of "+c.getName(); throw new InternalError(msg, e); } return model; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ if (qpManager != null) qpManager.disposeDialogs(); } | { if (qpManager != null) qpManager.disposeDialogs(); } | void disposeDialogs() { // forward event to the quantumManager. if (qpManager != null) qpManager.disposeDialogs(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ return abstraction.getChannelStats(w); } | { return abstraction.getChannelStats(w); } | public PixelsStatsEntry[] getChannelStats(int w) { return abstraction.getChannelStats(w); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ return activate(getRendererClass(abstraction.getModel())); } | { return activate(getRendererClass(abstraction.getModel())); } | ModelPane getModelPane() { return activate(getRendererClass(abstraction.getModel())); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ return presentation; } | { return presentation; } | public RenderingAgtUIF getReferenceFrame() { return presentation; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ Class result = null; try { switch (index) { case GREY: result = GreyScalePane.class; modelType = "Grey"; modelIcon = im.getIcon(IconManager.GREYSCALE); break; case HSB: result = HSBPane.class; modelType = "HSB"; modelIcon = im.getIcon(IconManager.HSB); break; case RGB: result = RGBPane.class; modelType = "RGB"; modelIcon = im.getIcon(IconManager.RGB); } }catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } return result; } | { Class result = null; try { switch (index) { case GREY: result = GreyScalePane.class; modelType = "Grey"; modelIcon = im.getIcon(IconManager.GREYSCALE); break; case HSB: result = HSBPane.class; modelType = "HSB"; modelIcon = im.getIcon(IconManager.HSB); break; case RGB: result = RGBPane.class; modelType = "RGB"; modelIcon = im.getIcon(IconManager.RGB); } }catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } return result; } | private Class getRendererClass(int index) { Class result = null; try { switch (index) { case GREY: result = GreyScalePane.class; modelType = "Grey"; modelIcon = im.getIcon(IconManager.GREYSCALE); break; case HSB: result = HSBPane.class; modelType = "HSB"; modelIcon = im.getIcon(IconManager.HSB); break; case RGB: result = RGBPane.class; modelType = "RGB"; modelIcon = im.getIcon(IconManager.RGB); } }catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.removeCodomainMap(ctx); } | { abstraction.removeCodomainMap(ctx); } | public void removeCodomainMap(CodomainMapContext ctx) { abstraction.removeCodomainMap(ctx); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.resetDefaults(); qpManager.resetDefaults(); QuantumPane qp = presentation.getQuantumPane(); qp.setSelectionWavelengthsEnable(false); presentation.resetGUI(activate(getRendererClass(GREY))); } | { abstraction.resetDefaults(); qpManager.resetDefaults(); QuantumPane qp = presentation.getQuantumPane(); qp.setSelectionWavelengthsEnable(false); presentation.resetGUI(activate(getRendererClass(GREY))); } | public void resetDefaults() { //update the rendering control. abstraction.resetDefaults(); //update the view. qpManager.resetDefaults(); //reset the model pane QuantumPane qp = presentation.getQuantumPane(); qp.setSelectionWavelengthsEnable(false); presentation.resetGUI(activate(getRendererClass(GREY))); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.saveDisplayOptions(); } | { abstraction.saveDisplayOptions(); } | public void saveDisplayOptions() { abstraction.saveDisplayOptions(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ if (active) { presentation.getQuantumPane().setSelectedWavelength(w); presentation.getTabs().setSelectedIndex(RenderingAgtUIF.POS_MODEL); } abstraction.setActive(w, active); } | { if (active) { presentation.getQuantumPane().setSelectedWavelength(w); presentation.getTabs().setSelectedIndex(RenderingAgtUIF.POS_MODEL); } abstraction.setActive(w, active); } | public void setActive(int w, boolean active) { if (active) { presentation.getQuantumPane().setSelectedWavelength(w); presentation.getTabs().setSelectedIndex(RenderingAgtUIF.POS_MODEL); } abstraction.setActive(w, active); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.setChannelWindowEnd(w, x); } | { abstraction.setChannelWindowEnd(w, x); } | public void setChannelWindowEnd(int w, int x) { abstraction.setChannelWindowEnd(w, x); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.setChannelWindowStart(w, x); } | { abstraction.setChannelWindowStart(w, x); } | public void setChannelWindowStart(int w, int x) { abstraction.setChannelWindowStart(w, x); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.setCodomainLowerBound(x); } | { abstraction.setCodomainLowerBound(x); } | public void setCodomainLowerBound(int x) { abstraction.setCodomainLowerBound(x); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.setCodomainUpperBound(x); } | { abstraction.setCodomainUpperBound(x); } | public void setCodomainUpperBound(int x) { abstraction.setCodomainUpperBound(x); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ presentation.setMappingPane(); } | { presentation.setMappingPane(); } | public void setMappingPane() { presentation.setMappingPane(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ this.presentation = presentation; } | { this.presentation = presentation; } | void setPresentation(RenderingAgtUIF presentation) { this.presentation = presentation; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
public void setQuantumStrategy(double k, int family, int resolution) { abstraction.setQuantumStrategy(k, family, resolution); } | public void setQuantumStrategy(int resolution, boolean b) { abstraction.setQuantumStrategy(resolution, b); } | public void setQuantumStrategy(double k, int family, int resolution) { abstraction.setQuantumStrategy(k, family, resolution); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.setRGBA(w, red, green, blue, alpha); } | { abstraction.setRGBA(w, red, green, blue, alpha); } | public void setRGBA(int w, int red, int green, int blue, int alpha) { abstraction.setRGBA(w, red, green, blue, alpha); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.updateChannelData(cd); } | { abstraction.updateChannelData(cd); } | public void updateChannelData(ChannelData cd) { abstraction.updateChannelData(cd); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ abstraction.updateCodomainMap(ctx); } | { abstraction.updateCodomainMap(ctx); } | public void updateCodomainMap(CodomainMapContext ctx) { abstraction.updateCodomainMap(ctx); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtCtrl.java |
{ tabs.remove(POS_MODEL); modelPane.removeAll(); modelPane = pane; modelPane.buildComponent(); tabs.insertTab(control.getModelType()+" Model", control.getModelIcon(), modelPane, null, POS_MODEL); if (b) tabs.setSelectedIndex(POS_MODEL); } | { tabs.remove(POS_MODEL); modelPane.removeAll(); modelPane = pane; modelPane.buildComponent(); tabs.insertTab(control.getModelType()+" Model", control.getModelIcon(), modelPane, null, POS_MODEL); if (b) tabs.setSelectedIndex(POS_MODEL); } | void setModelPane(ModelPane pane, boolean b) { tabs.remove(POS_MODEL); modelPane.removeAll(); modelPane = pane; modelPane.buildComponent(); tabs.insertTab(control.getModelType()+" Model", control.getModelIcon(), modelPane, null, POS_MODEL); if (b) tabs.setSelectedIndex(POS_MODEL); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtUIF.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtUIF.java |
{ renderingControl.setModel(model); refreshImage(); } | { renderingControl.setModel(model); refreshImage(); } | void setModel(int model) { renderingControl.setModel(model); refreshImage(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ renderingControl.addCodomainMap(ctx); refreshImage(); } | { renderingControl.addCodomainMap(ctx); refreshImage(); } | void addCodomainMap(CodomainMapContext ctx) { renderingControl.addCodomainMap(ctx); refreshImage(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ DomainPaneManager dpm = view.getDomainPane().getManager(); dpm.disposeDialogs(); } | { DomainPaneManager dpm = view.getDomainPane().getManager(); dpm.disposeDialogs(); } | public void disposeDialogs() { DomainPaneManager dpm = view.getDomainPane().getManager(); dpm.disposeDialogs(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/QuantumPaneManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/QuantumPaneManager.java |
{ PixelsStatsEntry[] channelStats = new PixelsStatsEntry[pxsDims.sizeT]; for (int t = 0; t < pxsDims.sizeT; t++) channelStats[t] = pxsStats.getEntry(w, t); return channelStats; } | { PixelsStatsEntry[] channelStats = new PixelsStatsEntry[pxsDims.sizeT]; for (int t = 0; t < pxsDims.sizeT; t++) channelStats[t] = pxsStats.getEntry(w, t); return channelStats; } | PixelsStatsEntry[] getChannelStats(int w) { PixelsStatsEntry[] channelStats = new PixelsStatsEntry[pxsDims.sizeT]; for (int t = 0; t < pxsDims.sizeT; t++) channelStats[t] = pxsStats.getEntry(w, t); return channelStats; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ return renderingControl.getChannelWindowEnd(w); } | { return renderingControl.getChannelWindowEnd(w); } | double getChannelWindowEnd(int w) { return renderingControl.getChannelWindowEnd(w); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ return renderingControl.getChannelWindowStart(w); } | { return renderingControl.getChannelWindowStart(w); } | double getChannelWindowStart(int w) { return renderingControl.getChannelWindowStart(w); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ return pxsStats.getGlobalEntry(w).globalMax; } | { return pxsStats.getGlobalEntry(w).globalMax; } | double getGlobalChannelWindowEnd(int w) { return pxsStats.getGlobalEntry(w).globalMax; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ return pxsStats.getGlobalEntry(w).globalMin; } | { return pxsStats.getGlobalEntry(w).globalMin; } | double getGlobalChannelWindowStart(int w) { return pxsStats.getGlobalEntry(w).globalMin; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ renderingControl.removeCodomainMap(ctx); refreshImage(); } | { renderingControl.removeCodomainMap(ctx); refreshImage(); } | void removeCodomainMap(CodomainMapContext ctx) { renderingControl.removeCodomainMap(ctx); refreshImage(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ renderingControl.resetDefaults(); refreshImage(); } | { renderingControl.resetDefaults(); refreshImage(); } | void resetDefaults() { renderingControl.resetDefaults(); refreshImage(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ DomainPaneManager dpm = view.getDomainPane().getManager(); dpm.resetDefaults(); CodomainPaneManager cpm = view.getCodomainPane().getManager(); cpm.resetDefaults(); view.getGRPane().removeAll(); GraphicsRepresentation gr = view.getGRepresentation(); gr = null; int mini = (int) eventManager.getGlobalChannelWindowStart(0); int maxi = (int) eventManager.getGlobalChannelWindowEnd(0); gr = new GraphicsRepresentation(this, QuantumFactory.LINEAR, 1.0, 0, 255, mini, maxi); gr.setReverseIntensity(false); gr.setDefaultLinear(mini, maxi); view.setGRepresentation(gr); view.buildGRPane(); } | { DomainPaneManager dpm = view.getDomainPane().getManager(); dpm.resetDefaults(); CodomainPaneManager cpm = view.getCodomainPane().getManager(); cpm.resetDefaults(); view.getGRPane().removeAll(); GraphicsRepresentation gr = view.getGRepresentation(); gr = null; int mini = (int) eventManager.getGlobalChannelWindowStart( QuantumPane.INDEX); int maxi = (int) eventManager.getGlobalChannelWindowEnd( QuantumPane.INDEX); double[] cbStats = eventManager.getChannelBindingStats( QuantumPane.INDEX); gr = new GraphicsRepresentation(this, QuantumFactory.LINEAR, 1.0, 0, 255, mini, maxi, cbStats); gr.setReverseIntensity(false); gr.setDefaultLinear(mini, maxi); view.setGRepresentation(gr); view.buildGRPane(); } | public void resetDefaults() { //DomainPane+Histogram DomainPaneManager dpm = view.getDomainPane().getManager(); dpm.resetDefaults(); //Codomain CodomainPaneManager cpm = view.getCodomainPane().getManager(); cpm.resetDefaults(); //Graphics representation view.getGRPane().removeAll(); GraphicsRepresentation gr = view.getGRepresentation(); gr = null; int mini = (int) eventManager.getGlobalChannelWindowStart(0); int maxi = (int) eventManager.getGlobalChannelWindowEnd(0); gr = new GraphicsRepresentation(this, QuantumFactory.LINEAR, 1.0, 0, 255, mini, maxi); gr.setReverseIntensity(false); gr.setDefaultLinear(mini, maxi); view.setGRepresentation(gr); view.buildGRPane(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/QuantumPaneManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/QuantumPaneManager.java |
{ setModelPane(pane, false); setMappingPane(); } | { setModelPane(pane, false); setMappingPane(); } | void resetGUI(ModelPane pane) { setModelPane(pane, false); setMappingPane(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgtUIF.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgtUIF.java |
{ renderingControl.saveCurrentSettings(); String msg = "The settings have now been saved, Note that the " + "parameters set in \"options\" haven't been saved."; registry.getUserNotifier().notifyInfo("Rendering", msg); } | { renderingControl.saveCurrentSettings(); } | void saveDisplayOptions() { renderingControl.saveCurrentSettings(); String msg = "The settings have now been saved, Note that the " + "parameters set in \"options\" haven't been saved."; registry.getUserNotifier().notifyInfo("Rendering", msg); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ renderingControl.setActive(w, active); refreshImage(); } | { renderingControl.setActive(w, active); refreshImage(); } | void setActive(int w, boolean active) { renderingControl.setActive(w, active); refreshImage(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
{ double start = renderingControl.getChannelWindowStart(w); renderingControl.setChannelWindow(w, start, x); refreshImage(); } | { double start = renderingControl.getChannelWindowStart(w); renderingControl.setChannelWindow(w, start, x); refreshImage(); } | void setChannelWindowEnd(int w, double x) { double start = renderingControl.getChannelWindowStart(w); renderingControl.setChannelWindow(w, start, x); refreshImage(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/RenderingAgt.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/RenderingAgt.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.