rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
return delegate.getPixels();
Pixels pix = delegate.getPixels(); return (Pixels) new ShallowCopy().copy(pix);
public Pixels getPixels() { return delegate.getPixels(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d5f70f979d40e800343124ec8c28a1f184e2acc8/RenderingBean.java/clean/components/ejb/src/ome/ro/ejb/RenderingBean.java
return delegate.getQuantumDef();
QuantumDef def = delegate.getQuantumDef(); return (QuantumDef) new ShallowCopy().copy(def);
public QuantumDef getQuantumDef() { return delegate.getQuantumDef(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d5f70f979d40e800343124ec8c28a1f184e2acc8/RenderingBean.java/clean/components/ejb/src/ome/ro/ejb/RenderingBean.java
messagePanel.add(iconLabel);
JPanel p = UIUtilities.buildComponentPanel(iconLabel); p.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(p);
private void buildMessagePanel(String msg, Icon msgIcon) { messagePanel.setLayout(new BoxLayout(messagePanel, BoxLayout.X_AXIS)); if (msgIcon != null) { JLabel iconLabel = new JLabel(msgIcon); iconLabel.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(iconLabel); messagePanel.add(Box.createRigidArea(H_SPACER_SIZE)); } MultilineLabel message = new MultilineLabel(msg); message.setPreferredSize(MSG_AREA_SIZE); message.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(message); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/OptionsDialog.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/OptionsDialog.java
messagePanel.add(message);
messagePanel.add(UIUtilities.buildComponentPanelRight(message));
private void buildMessagePanel(String msg, Icon msgIcon) { messagePanel.setLayout(new BoxLayout(messagePanel, BoxLayout.X_AXIS)); if (msgIcon != null) { JLabel iconLabel = new JLabel(msgIcon); iconLabel.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(iconLabel); messagePanel.add(Box.createRigidArea(H_SPACER_SIZE)); } MultilineLabel message = new MultilineLabel(msg); message.setPreferredSize(MSG_AREA_SIZE); message.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(message); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/OptionsDialog.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/OptionsDialog.java
runtime.getLoadService().init(runtime, new ArrayList());
runtime.getLoadService().init(new ArrayList());
public void setUp() { runtime = Ruby.getDefaultInstance(); runtime.getLoadService().init(runtime, new ArrayList()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/61503e7396c70acb6ed9f50922ff044d1fcc4bcc/TestKernel.java/clean/test/org/jruby/test/TestKernel.java
public NODE newCall(Object r, Object m, Object a) { return newDefaultNode(NODE.NODE_CALL, r, m, a);
public NODE newCall(NODE recv, Object m, Object a) { return newDefaultNode(NODE.NODE_CALL, recv, m, a);
public NODE newCall(Object r, Object m, Object a) { return newDefaultNode(NODE.NODE_CALL, r, m, a); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a6fb3288b71aaedfe3a7b5e8d1e561e0bc249dc6/NodeFactory.java/clean/org/jruby/interpreter/nodes/NodeFactory.java
public NODE newVCall(Object m) { return newDefaultNode(NODE.NODE_VCALL, null, m, null);
public NODE newVCall(RubyId mid) { return newDefaultNode(NODE.NODE_VCALL, null, mid, null);
public NODE newVCall(Object m) { return newDefaultNode(NODE.NODE_VCALL, null, m, null); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a6fb3288b71aaedfe3a7b5e8d1e561e0bc249dc6/NodeFactory.java/clean/org/jruby/interpreter/nodes/NodeFactory.java
public IRubyObject callSuper(IRubyObject[] args) { Frame frame = getCurrentFrame();
public IRubyObject callSuper(IRubyObject[] args, boolean zSuper) { Frame frame = getCurrentFrame(); frame.setCallingZSuper(zSuper);
public IRubyObject callSuper(IRubyObject[] args) { Frame frame = getCurrentFrame(); if (frame.getLastClass() == null) { String name = frame.getLastFunc(); throw runtime.newNameError("superclass method '" + name + "' must be enabled by enableSuper().", name); } setNoBlockIfNoBlock(); try { RubyClass superClass = frame.getLastClass().getSuperClass(); // Modules do not directly inherit Object so we have hacks like this if (superClass == null) { // TODO cnutter: I believe modules, the only ones here to have no superclasses, should have Module as their superclass superClass = runtime.getClass("Module"); } return frame.getSelf().callMethod(this, superClass, frame.getLastFunc(), args, CallType.SUPER); } finally { clearNoBlock(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/62645b2160c482d6d16d79513df80eac48c28894/ThreadContext.java/buggy/src/org/jruby/runtime/ThreadContext.java
frame.setCallingZSuper(false);
public IRubyObject callSuper(IRubyObject[] args) { Frame frame = getCurrentFrame(); if (frame.getLastClass() == null) { String name = frame.getLastFunc(); throw runtime.newNameError("superclass method '" + name + "' must be enabled by enableSuper().", name); } setNoBlockIfNoBlock(); try { RubyClass superClass = frame.getLastClass().getSuperClass(); // Modules do not directly inherit Object so we have hacks like this if (superClass == null) { // TODO cnutter: I believe modules, the only ones here to have no superclasses, should have Module as their superclass superClass = runtime.getClass("Module"); } return frame.getSelf().callMethod(this, superClass, frame.getLastFunc(), args, CallType.SUPER); } finally { clearNoBlock(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/62645b2160c482d6d16d79513df80eac48c28894/ThreadContext.java/buggy/src/org/jruby/runtime/ThreadContext.java
pushFrame(new Frame(this, self, args, lastFunc, lastClass, getPosition(), getCurrentIter(), getCurrentBlock()));
Iter iter = getCurrentFrame().getCallingZSuper() ? getCurrentFrame().getIter() : getCurrentIter(); pushFrame(new Frame(this, self, args, lastFunc, lastClass, getPosition(), iter, getCurrentBlock()));
private void pushCallFrame(IRubyObject self, IRubyObject[] args, String lastFunc, RubyModule lastClass) { pushFrame(new Frame(this, self, args, lastFunc, lastClass, getPosition(), getCurrentIter(), getCurrentBlock())); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/62645b2160c482d6d16d79513df80eac48c28894/ThreadContext.java/buggy/src/org/jruby/runtime/ThreadContext.java
add(mainPanel, BorderLayout.CENTER);
add(treeScroller, BorderLayout.CENTER);
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem("Add Contact", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem("Add Contact Group", SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem("Remove from Group", SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem("Start a Chat", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem("Rename", SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new BorderLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(mainPanel, BorderLayout.CENTER); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); viewOnline = new RolloverButton(SparkRes.getImageIcon(SparkRes.VIEW_IMAGE)); commandPanel.add(viewOnline); viewOnline.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); } }); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); commandPanel.add(addContactButton); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
viewOnline = new RolloverButton(SparkRes.getImageIcon(SparkRes.VIEW_IMAGE)); commandPanel.add(viewOnline); viewOnline.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); } });
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem("Add Contact", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem("Add Contact Group", SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem("Remove from Group", SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem("Start a Chat", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem("Rename", SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new BorderLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(mainPanel, BorderLayout.CENTER); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); viewOnline = new RolloverButton(SparkRes.getImageIcon(SparkRes.VIEW_IMAGE)); commandPanel.add(viewOnline); viewOnline.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); } }); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); commandPanel.add(addContactButton); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
showEmptyGroups(!showHideMenu.isSelected());
new RosterDialog().showRosterDialog();
public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
new RosterDialog().showRosterDialog();
String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = new ContactGroup(groupName); addContactGroup(contactGroup); } }
public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = new ContactGroup(groupName); addContactGroup(contactGroup); } }
showEmptyGroups(showHideMenu.isSelected());
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = new ContactGroup(groupName); addContactGroup(contactGroup); } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
subscriptionRequest(presence.getFrom());
Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.UNSUBSCRIBED); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } }
public void run() { subscriptionRequest(presence.getFrom()); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
Presence unsub = new Presence(Presence.Type.UNSUBSCRIBED); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub);
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.UNSUBSCRIBED); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid);
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.UNSUBSCRIBED); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry);
SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid);
});
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
SwingUtilities.invokeLater(new Runnable() { public void run() {
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
}); }
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
public void actionPerformed(ActionEvent e) { String newName = JOptionPane.showInputDialog(group, "Rename Roster Group", "Rename to:", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { removeContactGroup(group); rosterGroup.setName(newName); }
public void actionPerformed(ActionEvent actionEvent) { SparkManager.getTransferManager().sendFileTo(item);
public void actionPerformed(ActionEvent e) { String newName = JOptionPane.showInputDialog(group, "Rename Roster Group", "Rename to:", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { removeContactGroup(group); rosterGroup.setName(newName); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster();
String newName = JOptionPane.showInputDialog(group, "Rename Roster Group", "Rename to:", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster();
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } }
RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) {
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
invalidate(); repaint();
rosterGroup.setName(newName);
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
RosterEntry entry = roster.getEntry(jid); addUser(entry);
RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { Iterator rosterGroups = rosterEntry.getGroups(); boolean isUnfiled = true; while (rosterGroups.hasNext()) { isUnfiled = false; RosterGroup group = (RosterGroup)rosterGroups.next(); if (getContactGroup(group.getName()) == null) { ContactGroup contactGroup = new ContactGroup(group.getName()); contactGroup.setVisible(false); addContactGroup(contactGroup); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); Iterator groups = rosterEntry.getGroups(); while (groups.hasNext()) { RosterGroup g = (RosterGroup)groups.next(); groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry entry = roster.getEntry(jid); addUser(entry); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
Roster roster = SparkManager.getConnection().getRoster();
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. Iterator rosterGroups = rosterEntry.getGroups(); boolean isUnfiled = true; while (rosterGroups.hasNext()) { isUnfiled = false; RosterGroup group = (RosterGroup)rosterGroups.next(); // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = new ContactGroup(group.getName()); contactGroup.setVisible(false); addContactGroup(contactGroup); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); Iterator groups = rosterEntry.getGroups(); while (groups.hasNext()) { RosterGroup g = (RosterGroup)groups.next(); groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { Iterator rosterGroups = rosterEntry.getGroups(); boolean isUnfiled = true; while (rosterGroups.hasNext()) { isUnfiled = false; RosterGroup group = (RosterGroup)rosterGroups.next(); if (getContactGroup(group.getName()) == null) { ContactGroup contactGroup = new ContactGroup(group.getName()); contactGroup.setVisible(false); addContactGroup(contactGroup); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); Iterator groups = rosterEntry.getGroups(); while (groups.hasNext()) { RosterGroup g = (RosterGroup)groups.next(); groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } }
removeContactItem(jid);
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. Iterator rosterGroups = rosterEntry.getGroups(); boolean isUnfiled = true; while (rosterGroups.hasNext()) { isUnfiled = false; RosterGroup group = (RosterGroup)rosterGroups.next(); // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = new ContactGroup(group.getName()); contactGroup.setVisible(false); addContactGroup(contactGroup); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); Iterator groups = rosterEntry.getGroups(); while (groups.hasNext()) { RosterGroup g = (RosterGroup)groups.next(); groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
viewOnline.setSelected(show); if (showHideMenu.isSelected()) { viewOnline.setToolTipText("Hide Empty Groups"); } else { viewOnline.setToolTipText("Show Empty Groups"); }
private void showEmptyGroups(boolean show) { Iterator contactGroups = getContactGroups().iterator(); while (contactGroups.hasNext()) { ContactGroup group = (ContactGroup)contactGroups.next(); if (show) { group.setVisible(true); } else { // Never hide offline group. if (group != offlineGroup) { group.setVisible(group.hasAvailableContacts()); } } } localPreferences.setEmptyGroupsShown(show); showHideMenu.setSelected(show); viewOnline.setSelected(show); if (showHideMenu.isSelected()) { viewOnline.setToolTipText("Hide Empty Groups"); } else { viewOnline.setToolTipText("Show Empty Groups"); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
public void actionPerformed(ActionEvent actionEvent) { SparkManager.getTransferManager().sendFileTo(item);
public void actionPerformed(ActionEvent e) { removeContactFromRoster(item);
public void actionPerformed(ActionEvent actionEvent) { SparkManager.getTransferManager().sendFileTo(item); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
removeContactFromRoster(item);
VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace());
public void actionPerformed(ActionEvent e) { removeContactFromRoster(item); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace());
JEditorPane pane = new JEditorPane(); StringBuffer buf = new StringBuffer(); Collection col = item.getPresenceHistory(); Iterator iter = col.iterator(); while (iter.hasNext()) { String history = (String)iter.next(); buf.append(history + "\n"); } pane.setText(buf.toString()); MessageDialog.showComponent("Presence History", "History of user activity while online.", SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE), new JScrollPane(pane), getGUI(), 400, 400, false);
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
public void actionPerformed(ActionEvent e) { JEditorPane pane = new JEditorPane(); StringBuffer buf = new StringBuffer(); Collection col = item.getPresenceHistory(); Iterator iter = col.iterator(); while (iter.hasNext()) { String history = (String)iter.next(); buf.append(history + "\n");
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), "Idle for " + time, "Last Activity", JOptionPane.INFORMATION_MESSAGE);
public void actionPerformed(ActionEvent e) { JEditorPane pane = new JEditorPane(); StringBuffer buf = new StringBuffer(); Collection col = item.getPresenceHistory(); Iterator iter = col.iterator(); while (iter.hasNext()) { String history = (String)iter.next(); buf.append(history + "\n"); } pane.setText(buf.toString()); MessageDialog.showComponent("Presence History", "History of user activity while online.", SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE), new JScrollPane(pane), getGUI(), 400, 400, false); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
pane.setText(buf.toString()); MessageDialog.showComponent("Presence History", "History of user activity while online.", SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE), new JScrollPane(pane), getGUI(), 400, 400, false);
catch (XMPPException e1) { }
public void actionPerformed(ActionEvent e) { JEditorPane pane = new JEditorPane(); StringBuffer buf = new StringBuffer(); Collection col = item.getPresenceHistory(); Iterator iter = col.iterator(); while (iter.hasNext()) { String history = (String)iter.next(); buf.append(history + "\n"); } pane.setText(buf.toString()); MessageDialog.showComponent("Presence History", "History of user activity while online.", SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE), new JScrollPane(pane), getGUI(), 400, 400, false); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), "Idle for " + time, "Last Activity", JOptionPane.INFORMATION_MESSAGE); } catch (XMPPException e1) { }
public void actionPerformed(ActionEvent e) { String jid = item.getFullJID(); Presence response = new Presence(Presence.Type.SUBSCRIBE); response.setTo(jid);
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), "Idle for " + time, "Last Activity", JOptionPane.INFORMATION_MESSAGE); } catch (XMPPException e1) { } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
SparkManager.getConnection().sendPacket(response);
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), "Idle for " + time, "Last Activity", JOptionPane.INFORMATION_MESSAGE); } catch (XMPPException e1) { } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
String jid = item.getFullJID(); Presence response = new Presence(Presence.Type.SUBSCRIBE); response.setTo(jid); SparkManager.getConnection().sendPacket(response);
sendMessages(items);
public void actionPerformed(ActionEvent e) { String jid = item.getFullJID(); Presence response = new Presence(Presence.Type.SUBSCRIBE); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
Presence response = new Presence(Presence.Type.SUBSCRIBED); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); }
public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.SUBSCRIBED); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
Presence response = new Presence(Presence.Type.UNSUBSCRIBE); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose();
SparkManager.getVCardManager().viewProfile(jid, getGUI());
public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.UNSUBSCRIBE); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
static RenderingStrategy makeNew(int model)
static RenderingStrategy makeNew(RenderingModel model)
static RenderingStrategy makeNew(int model) { RenderingStrategy strategy = null; try { switch (model) { case RenderingDefConstants.GS: strategy = new GreyScaleStrategy(); break; case RenderingDefConstants.HSB: strategy = new HSBStrategy(); break; case RenderingDefConstants.RGB: strategy = new RGBStrategy(); break; default: //Set the GreyScaleStrategy as the default one. strategy = new GreyScaleStrategy(); //TODO: log debug? } } catch(NumberFormatException nfe) { throw new RuntimeException("Invalid model ID "+model+".", nfe); } return strategy; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingStrategy.java/clean/components/rendering/src/omeis/providers/re/RenderingStrategy.java
RenderingStrategy strategy = null; try { switch (model) { case RenderingDefConstants.GS: strategy = new GreyScaleStrategy(); break; case RenderingDefConstants.HSB: strategy = new HSBStrategy(); break; case RenderingDefConstants.RGB: strategy = new RGBStrategy(); break; default: strategy = new GreyScaleStrategy(); } } catch(NumberFormatException nfe) { throw new RuntimeException("Invalid model ID "+model+".", nfe); } return strategy;
String value = model.getValue(); if (value == Renderer.MODEL_GREYSCALE) return new GreyScaleStrategy(); else if (value == Renderer.MODEL_HSB) return new HSBStrategy(); else if (value == Renderer.MODEL_RGB) return new RGBStrategy(); log.warn("WARNING: Unknown model '" + value + "' using greyscale."); return new GreyScaleStrategy();
static RenderingStrategy makeNew(int model) { RenderingStrategy strategy = null; try { switch (model) { case RenderingDefConstants.GS: strategy = new GreyScaleStrategy(); break; case RenderingDefConstants.HSB: strategy = new HSBStrategy(); break; case RenderingDefConstants.RGB: strategy = new RGBStrategy(); break; default: //Set the GreyScaleStrategy as the default one. strategy = new GreyScaleStrategy(); //TODO: log debug? } } catch(NumberFormatException nfe) { throw new RuntimeException("Invalid model ID "+model+".", nfe); } return strategy; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingStrategy.java/clean/components/rendering/src/omeis/providers/re/RenderingStrategy.java
public Object yyparse (RubyYaccLexer yyLex, Object yydebug)
public Object yyparse (RubyYaccLexer yyLex, Object ayydebug)
public Object yyparse (RubyYaccLexer yyLex, Object yydebug) throws java.io.IOException, yyException { return yyparse(yyLex); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1d8ec540dc793b2d5ad5084d2cb6b204087302b7/DefaultRubyParser.java/buggy/src/org/jruby/parser/DefaultRubyParser.java
Map newMap = new HashMap(emotionMap);
Map<String,String> newMap = new HashMap<String,String>(emotionMap);
public static Map getEmoticonMap() { Map newMap = new HashMap(emotionMap); newMap.remove("8-)"); newMap.remove("|-)"); newMap.remove("<:o)"); newMap.remove(":-)"); return newMap; }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/6e12dffdf7547958af6c57a401e514cd0de09117/EmotionRes.java/clean/src/java/org/jivesoftware/resource/EmotionRes.java
public static final ImageIcon getImageIcon(String face) { final String value = (String)emotionMap.get(face);
public static ImageIcon getImageIcon(String face) { final String value = emotionMap.get(face);
public static final ImageIcon getImageIcon(String face) { final String value = (String)emotionMap.get(face); if (value != null) { final URL url = cl.getResource(value); if (url != null) { return new ImageIcon(url); } } return null; }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/6e12dffdf7547958af6c57a401e514cd0de09117/EmotionRes.java/clean/src/java/org/jivesoftware/resource/EmotionRes.java
public static final URL getURL(String face) { final String value = (String)emotionMap.get(face);
public static URL getURL(String face) { final String value = emotionMap.get(face);
public static final URL getURL(String face) { final String value = (String)emotionMap.get(face); if (value != null) { final URL url = cl.getResource(value); if (url != null) { return url; } } return null; }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/6e12dffdf7547958af6c57a401e514cd0de09117/EmotionRes.java/clean/src/java/org/jivesoftware/resource/EmotionRes.java
tree.addPropertyChangeListener(TreeCheck.NODE_SELECTED_PROPERTY, this);
public FilterWindow(Object parent, JFrame owner, int containerType, Set nodes) { super(owner, "Filter Images Retrieval", true); if (nodes == null) throw new IllegalArgumentException("No nodes."); if (parent == null) throw new IllegalArgumentException("Parent cannot be null."); checkType(containerType); this.parent = parent; this.containerType = containerType; initComponents(); buildGUI(getFilterComponent(nodes)); attachListeners(); setSize(WINDOW_SIZE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/43f8c678f03aa7cac6a19865461c28a00cf7eb2b/FilterWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/util/FilterWindow.java
setButton.setEnabled(false);
private void initComponents() { IconManager im = IconManager.getInstance(); tree = new TreeCheck("", im.getIcon(IconManager.ROOT)); tree.setRootVisible(false); selectAll = new JButton("Select All"); selectAll.setToolTipText( UIUtilities.formatToolTipText("Select all items.")); selectAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { tree.selectAllNodes(); } }); clearAll = new JButton("Deselect All"); clearAll.setToolTipText( UIUtilities.formatToolTipText("Clear selection.")); clearAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { tree.deselectAllNodes(); } }); cancelButton = new JButton("Cancel"); cancelButton.setToolTipText( UIUtilities.formatToolTipText("Close the window.")); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { close(); } }); setButton = new JButton("Apply"); setButton.setToolTipText( UIUtilities.formatToolTipText("Apply the selection.")); setButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setValues(); } }); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/43f8c678f03aa7cac6a19865461c28a00cf7eb2b/FilterWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/util/FilterWindow.java
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/319a529cc1666e267b662b895d6c0d0409a6a838/RubyModule.java/buggy/src/org/jruby/RubyModule.java
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/319a529cc1666e267b662b895d6c0d0409a6a838/RubyModule.java/buggy/src/org/jruby/RubyModule.java
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/319a529cc1666e267b662b895d6c0d0409a6a838/RubyModule.java/buggy/src/org/jruby/RubyModule.java
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/319a529cc1666e267b662b895d6c0d0409a6a838/RubyModule.java/buggy/src/org/jruby/RubyModule.java
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/319a529cc1666e267b662b895d6c0d0409a6a838/RubyModule.java/buggy/src/org/jruby/RubyModule.java
return new ConversionSet(valueMap.entrySet());
return new ConversionMapEntrySet(getRuntime(), valueMap.entrySet());
public Set entrySet() { // TODO: Set.Entry must be wrapped appropriately...? return new ConversionSet(valueMap.entrySet()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b46a9962586a768eaf50113d17bdb4aef7e22000/RubyHash.java/clean/src/org/jruby/RubyHash.java
return new ConversionSet(valueMap.keySet());
return new AbstractSet() { public Iterator iterator() { return new IteratorAdapter(entrySet().iterator()) { public Object next() { return ((Map.Entry) super.next()).getKey(); } }; } public int size() { return RubyHash.this.size(); } };
public Set keySet() { return new ConversionSet(valueMap.keySet()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b46a9962586a768eaf50113d17bdb4aef7e22000/RubyHash.java/clean/src/org/jruby/RubyHash.java
return null;
return new AbstractCollection() { public Iterator iterator() { return new IteratorAdapter(entrySet().iterator()) { public Object next() { return ((Map.Entry) super.next()).getValue(); } }; } public int size() { return RubyHash.this.size(); } public boolean contains(Object v) { return RubyHash.this.containsValue(v); } };
public Collection values() { // TODO Auto-generated method stub return null; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b46a9962586a768eaf50113d17bdb4aef7e22000/RubyHash.java/clean/src/org/jruby/RubyHash.java
private static void computeLocationStats(Pixels pixels, List<ChannelBinding> cbs, PlaneDef planeDef, PixelBuffer buf) { if (planeDef == null) throw new NullPointerException("No plane definition."); StatsFactory sf = new StatsFactory(); int w = 0; List<Channel> channels = pixels.getChannels(); for (Channel channel : channels) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. ChannelBinding cb = cbs.get(w); //Test sf.computeLocationStats(pixels, buf, planeDef, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb.setNoiseReduction(Boolean.TRUE); cb.setInputStart(new Float(sf.getInputStart())); cb.setInputEnd(new Float(sf.getInputEnd())); w++; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/96e921a430a0d0cc0ba3a6f2cdc25e82227755d5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
cb.setNoiseReduction(Boolean.TRUE);
cb.setNoiseReduction(sf.isNoiseReduction());
private static void computeLocationStats(Pixels pixels, List<ChannelBinding> cbs, PlaneDef planeDef, PixelBuffer buf) { if (planeDef == null) throw new NullPointerException("No plane definition."); StatsFactory sf = new StatsFactory(); int w = 0; List<Channel> channels = pixels.getChannels(); for (Channel channel : channels) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. ChannelBinding cb = cbs.get(w); //Test sf.computeLocationStats(pixels, buf, planeDef, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb.setNoiseReduction(Boolean.TRUE); cb.setInputStart(new Float(sf.getInputStart())); cb.setInputEnd(new Float(sf.getInputEnd())); w++; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/96e921a430a0d0cc0ba3a6f2cdc25e82227755d5/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java
System.out.println("Closing down the spring context");
log.info("Closing down the spring context");
protected void tearDown() throws Exception { if (context != null) { System.out.println("Closing down the spring context"); context.destroy(); } }
52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/732c0ef7c045830951a19004a71a949d91016155/SpringTestSupport.java/clean/spring/src/test/org/xbean/spring/context/SpringTestSupport.java
colorModelButton.setToolTipText(getColorModelDescription(model.getColorModel()));
private void initializeValues() { zoomingBox.addActionListener(this); zoomingBox.setSelectedItem( controller.getAction(ImViewerControl.ZOOM_100)); switch (model.getRatingLevel()) { case ImViewerModel.RATING_ONE: ratingBox.setSelectedIndex(0); break; case ImViewerModel.RATING_TWO: ratingBox.setSelectedIndex(1); break; case ImViewerModel.RATING_THREE: ratingBox.setSelectedIndex(2); break; case ImViewerModel.RATING_FOUR: ratingBox.setSelectedIndex(3); break; case ImViewerModel.RATING_FIVE: ratingBox.setSelectedIndex(4); } ratingBox.addActionListener(this); zSlider.setMaximum(model.getMaxZ()); zSlider.setValue(model.getDefaultZ()); tSlider.setMaximum(model.getMaxT()); tSlider.setValue(model.getDefaultT()); zSlider.addChangeListener(this); tSlider.addChangeListener(this); zSlider.addMouseWheelListener(this); tSlider.addMouseWheelListener(this); zSlider.setToolTipText(Z_SLIDER_DESCRIPTION); zSlider.setEndLabel(Z_SLIDER_TIPSTRING); zSlider.setShowEndLabel(true); zSlider.setShowTipLabel(true); tSlider.setToolTipText(T_SLIDER_DESCRIPTION); tSlider.setEndLabel(T_SLIDER_TIPSTRING); tSlider.setShowEndLabel(true); tSlider.setShowTipLabel(true); colorModelButton.setIcon(getColorModelIcon(model.getColorModel())); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ControlPane.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ControlPane.java
state = ImViewer.READY;
void setImage(BufferedImage image) { browser.setRenderedImage(image); //update image icon computeSizes(); imageIcon = magnifyImage(factor, image); state = ImViewer.READY; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java
public void callInit(IRubyObject[] args) { ThreadContext tc = getRuntime().getCurrentContext(); tc.setIfBlockAvailable(); try { callMethod(getRuntime().getCurrentContext(), "initialize", args); } finally { tc.clearIfBlockAvailable(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject convertToTypeWithCheck(String targetType, String convertMethod) { if (targetType.equals(getMetaClass().getName())) { return this; } IRubyObject value = convertToType(targetType, convertMethod, false); if (value.isNil()) { return value; } if (!targetType.equals(value.getMetaClass().getName())) { throw getRuntime().newTypeError(value.getMetaClass().getName() + "#" + convertMethod + "should return " + targetType); } return value; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject convertToTypeWithCheck(String targetType, String convertMethod) { if (targetType.equals(getMetaClass().getName())) { return this; } IRubyObject value = convertToType(targetType, convertMethod, false); if (value.isNil()) { return value; } if (!targetType.equals(value.getMetaClass().getName())) { throw getRuntime().newTypeError(value.getMetaClass().getName() + "#" + convertMethod + "should return " + targetType); } return value; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject convertToTypeWithCheck(String targetType, String convertMethod) { if (targetType.equals(getMetaClass().getName())) { return this; } IRubyObject value = convertToType(targetType, convertMethod, false); if (value.isNil()) { return value; } if (!targetType.equals(value.getMetaClass().getName())) { throw getRuntime().newTypeError(value.getMetaClass().getName() + "#" + convertMethod + "should return " + targetType); } return value; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject display(IRubyObject[] args) { IRubyObject port = args.length == 0 ? getRuntime().getGlobalVariables().get("$>") : args[0]; port.callMethod(getRuntime().getCurrentContext(), "write", this); return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalUnder(RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line) { /* if (ruby_safe_level >= 4) { Check_Type(src, T_STRING); } else { Check_SafeStr(src); } */ return under.executeUnder(new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject source = args[1]; IRubyObject filename = args[2]; // FIXME: lineNumber is not supported //IRubyObject lineNumber = args[3]; return args[0].evalSimple(source.getRuntime().getCurrentContext(), source, ((RubyString) filename).toString()); } public Arity getArity() { return Arity.optional(); } }, new IRubyObject[] { this, src, file, line }); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject source = args[1]; IRubyObject filename = args[2]; // FIXME: lineNumber is not supported //IRubyObject lineNumber = args[3]; return args[0].evalSimple(source.getRuntime().getCurrentContext(), source, ((RubyString) filename).toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
threadContext.preEvalWithBinding(blockOfBinding);
threadContext.preEvalWithBinding(blockOfBinding);
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject extend(IRubyObject[] args) { checkArgumentCount(args, 1, -1); // Make sure all arguments are modules before calling the callbacks RubyClass module = getRuntime().getClass("Module"); for (int i = 0; i < args.length; i++) { if (!args[i].isKindOf(module)) { throw getRuntime().newTypeError(args[i], module); } } for (int i = 0; i < args.length; i++) { args[i].callMethod(getRuntime().getCurrentContext(), "extend_object", this); args[i].callMethod(getRuntime().getCurrentContext(), "extended", this); } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject extend(IRubyObject[] args) { checkArgumentCount(args, 1, -1); // Make sure all arguments are modules before calling the callbacks RubyClass module = getRuntime().getClass("Module"); for (int i = 0; i < args.length; i++) { if (!args[i].isKindOf(module)) { throw getRuntime().newTypeError(args[i], module); } } for (int i = 0; i < args.length; i++) { args[i].callMethod(getRuntime().getCurrentContext(), "extend_object", this); args[i].callMethod(getRuntime().getCurrentContext(), "extended", this); } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
if (!type.isSingleton()) {
if (!type.isSingleton()) {
public MetaClass getSingletonClass() { RubyClass type = getMetaClass(); if (!type.isSingleton()) { type = makeMetaClass(type, type.getCRef()); } assert type instanceof MetaClass; if (!isNil()) { type.setTaint(isTaint()); type.setFrozen(isFrozen()); } return (MetaClass)type; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
assert type instanceof MetaClass;
assert type instanceof MetaClass;
public MetaClass getSingletonClass() { RubyClass type = getMetaClass(); if (!type.isSingleton()) { type = makeMetaClass(type, type.getCRef()); } assert type instanceof MetaClass; if (!isNil()) { type.setTaint(isTaint()); type.setFrozen(isFrozen()); } return (MetaClass)type; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public RubyFixnum id() { return getRuntime().newFixnum(System.identityHashCode(this));
public synchronized RubyFixnum id() { if (id == 0) { id = getRuntime().getObjectSpace().createId(this); } return getRuntime().newFixnum(id);
public RubyFixnum id() { return getRuntime().newFixnum(System.identityHashCode(this)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject infectBy(IRubyObject obj) { setTaint(isTaint() || obj.isTaint()); return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
callMethod(getRuntime().getCurrentContext(), "initialize_copy", original);
callMethod(getRuntime().getCurrentContext(), "initialize_copy", original);
public void initCopy(IRubyObject original) { assert original != null; assert !isFrozen() : "frozen object (" + getMetaClass().getName() + ") allocated"; setInstanceVariables(new HashMap(original.getInstanceVariables())); callMethod(getRuntime().getCurrentContext(), "initialize_copy", original); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject instance_variable_get(IRubyObject var) { String varName = var.asSymbol(); if (!varName.startsWith("@")) { throw getRuntime().newNameError("`" + varName + "' is not allowable as an instance variable name"); } IRubyObject variable = getInstanceVariable(varName); // Pickaxe v2 says no var should show NameError, but ruby only sends back nil.. return variable == null ? getRuntime().getNil() : variable; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
IRubyObject variable = getInstanceVariable(varName);
IRubyObject variable = getInstanceVariable(varName);
public IRubyObject instance_variable_get(IRubyObject var) { String varName = var.asSymbol(); if (!varName.startsWith("@")) { throw getRuntime().newNameError("`" + varName + "' is not allowable as an instance variable name"); } IRubyObject variable = getInstanceVariable(varName); // Pickaxe v2 says no var should show NameError, but ruby only sends back nil.. return variable == null ? getRuntime().getNil() : variable; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
return variable == null ? getRuntime().getNil() : variable;
return variable == null ? getRuntime().getNil() : variable;
public IRubyObject instance_variable_get(IRubyObject var) { String varName = var.asSymbol(); if (!varName.startsWith("@")) { throw getRuntime().newNameError("`" + varName + "' is not allowable as an instance variable name"); } IRubyObject variable = getInstanceVariable(varName); // Pickaxe v2 says no var should show NameError, but ruby only sends back nil.. return variable == null ? getRuntime().getNil() : variable; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject instance_variable_set(IRubyObject var, IRubyObject value) { String varName = var.asSymbol(); if (!varName.startsWith("@")) { throw getRuntime().newNameError("`" + varName + "' is not allowable as an instance variable name"); } return setInstanceVariable(var.asSymbol(), value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject instance_variable_set(IRubyObject var, IRubyObject value) { String varName = var.asSymbol(); if (!varName.startsWith("@")) { throw getRuntime().newNameError("`" + varName + "' is not allowable as an instance variable name"); } return setInstanceVariable(var.asSymbol(), value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public RubyArray instance_variables() { ArrayList names = new ArrayList(); for(Iterator iter = getInstanceVariablesSnapshot().keySet().iterator();iter.hasNext();) { String name = (String) iter.next(); // Do not include constants which also get stored in instance var list in classes. if (!Character.isUpperCase(name.charAt(0))) { names.add(getRuntime().newString(name)); } } return getRuntime().newArray(names); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
String msg = new PrintfFormat(format).sprintf(new Object[] { name, description,
String msg = new PrintfFormat(format).sprintf(new Object[] { name, description,
public IRubyObject method_missing(IRubyObject[] args) { if (args.length == 0) { throw getRuntime().newArgumentError("no id given"); } String name = args[0].asSymbol(); String description = callMethod(getRuntime().getCurrentContext(), "inspect").toString(); boolean noClass = description.length() > 0 && description.charAt(0) == '#'; ThreadContext tc = getRuntime().getCurrentContext(); Visibility lastVis = tc.getLastVisibility(); CallType lastCallType = tc.getLastCallType(); String format = lastVis.errorMessageFormat(lastCallType, name); String msg = new PrintfFormat(format).sprintf(new Object[] { name, description, noClass ? "" : ":", noClass ? "" : getType().getName()}); if (lastCallType == CallType.VARIABLE) { throw getRuntime().newNameError(msg); } throw getRuntime().newNoMethodError(msg); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject methods(IRubyObject[] args) { checkArgumentCount(args, 0, 1); if (args.length == 0) { args = new IRubyObject[] { getRuntime().getTrue() }; } return getMetaClass().instance_methods(args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject send(IRubyObject[] args) { if (args.length < 1) { throw getRuntime().newArgumentError("no method name given"); } String name = args[0].asSymbol(); IRubyObject[] newArgs = new IRubyObject[args.length - 1]; System.arraycopy(args, 1, newArgs, 0, newArgs.length); ThreadContext tc = getRuntime().getCurrentContext(); tc.setIfBlockAvailable(); try { return callMethod(getRuntime().getCurrentContext(), name, newArgs, CallType.FUNCTIONAL); } finally { tc.clearIfBlockAvailable(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject send(IRubyObject[] args) { if (args.length < 1) { throw getRuntime().newArgumentError("no method name given"); } String name = args[0].asSymbol(); IRubyObject[] newArgs = new IRubyObject[args.length - 1]; System.arraycopy(args, 1, newArgs, 0, newArgs.length); ThreadContext tc = getRuntime().getCurrentContext(); tc.setIfBlockAvailable(); try { return callMethod(getRuntime().getCurrentContext(), name, newArgs, CallType.FUNCTIONAL); } finally { tc.clearIfBlockAvailable(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
for (RubyClass type = getMetaClass(); type != null && type instanceof MetaClass; type = type.getSuperClass()) {
for (RubyClass type = getMetaClass(); type != null && type instanceof MetaClass; type = type.getSuperClass()) {
public RubyArray singleton_methods() { RubyArray result = getRuntime().newArray(); for (RubyClass type = getMetaClass(); type != null && type instanceof MetaClass; type = type.getSuperClass()) { for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); // We do not want to capture cached methods if (method.getImplementationClass() != type) { continue; } RubyString methodName = getRuntime().newString((String) entry.getKey()); if (method.getVisibility().isPublic() && ! result.includes(methodName)) { result.append(methodName); } } } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public RubyArray singleton_methods() { RubyArray result = getRuntime().newArray(); for (RubyClass type = getMetaClass(); type != null && type instanceof MetaClass; type = type.getSuperClass()) { for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); // We do not want to capture cached methods if (method.getImplementationClass() != type) { continue; } RubyString methodName = getRuntime().newString((String) entry.getKey()); if (method.getVisibility().isPublic() && ! result.includes(methodName)) { result.append(methodName); } } } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public IRubyObject specificEval(RubyModule mod, IRubyObject[] args) { ThreadContext tc = getRuntime().getCurrentContext(); if (tc.isBlockGiven()) { if (args.length > 0) { throw getRuntime().newArgumentError(args.length, 0); } return yieldUnder(mod); } if (args.length == 0) { throw getRuntime().newArgumentError("block not supplied"); } else if (args.length > 3) { String lastFuncName = tc.getFrameLastFunc(); throw getRuntime().newArgumentError( "wrong # of arguments: " + lastFuncName + "(src) or " + lastFuncName + "{..}"); } /* if (ruby.getSecurityLevel() >= 4) { Check_Type(argv[0], T_STRING); } else { Check_SafeStr(argv[0]); } */ IRubyObject file = args.length > 1 ? args[1] : getRuntime().newString("(eval)"); IRubyObject line = args.length > 2 ? args[2] : RubyFixnum.one(getRuntime()); Visibility savedVisibility = tc.getCurrentVisibility(); tc.setCurrentVisibility(Visibility.PUBLIC); try { return evalUnder(mod, args[0], file, line); } finally { tc.setCurrentVisibility(savedVisibility); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java
private IRubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { ThreadContext context = getRuntime().getCurrentContext(); Block block = (Block) context.getCurrentBlock(); Visibility savedVisibility = block.getVisibility(); block.setVisibility(Visibility.PUBLIC); try { IRubyObject valueInYield = args[0]; IRubyObject selfInYield = args[0]; return context.yieldCurrentBlock(valueInYield, selfInYield, context.getRubyClass(), false); //TODO: Should next and return also catch here? } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.BreakJump) { IRubyObject breakValue = (IRubyObject)je.getPrimaryData(); return breakValue == null ? getRuntime().getNil() : breakValue; } else { throw je; } } finally { block.setVisibility(savedVisibility); } } public Arity getArity() { return Arity.optional(); } }, new IRubyObject[] { this }); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/RubyObject.java/buggy/src/org/jruby/RubyObject.java