rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
else if (status == FileTransfer.Status.IN_PROGRESS) { titleLabel.setText("You are receiving a file from " + contactItem.getNickname()); | else if (status == FileTransfer.Status.in_progress) { titleLabel.setText(Res.getString("message.receiving.file", contactItem.getNickname())); | public Object construct() { try { transfer.recieveFile(downloadedFile); } catch (XMPPException e) { Log.error(e); } while (true) { try { Thread.sleep(10); } catch (InterruptedException e) { Log.error(e); } long bytesRead = transfer.getAmountWritten(); if (bytesRead == -1) { bytesRead = 0; } ByteFormat format = new ByteFormat(); String text = format.format(bytesRead); progressBar.setString(text + " received"); progressBar.setValue((int)bytesRead); FileTransfer.Status status = transfer.getStatus(); if (status == FileTransfer.Status.ERROR || status == FileTransfer.Status.COMPLETE || status == FileTransfer.Status.CANCLED || status == FileTransfer.Status.REFUSED) { break; } else if (status == FileTransfer.Status.NEGOTIATING_STREAM) { titleLabel.setText("Negotiating connection stream. Please wait..."); } else if (status == FileTransfer.Status.IN_PROGRESS) { titleLabel.setText("You are receiving a file from " + contactItem.getNickname()); } } return "ok"; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
imageLabel.setToolTipText("Click to open"); titleLabel.setToolTipText("Click to open"); | imageLabel.setToolTipText(Res.getString("message.click.to.open")); titleLabel.setToolTipText(Res.getString("message.click.to.open")); | public void finished() { if (transfer.getAmountWritten() >= request.getFileSize()) { transferDone(request, transfer); imageLabel.setToolTipText("Click to open"); titleLabel.setToolTipText("Click to open"); imageLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); imageLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); invalidate(); validate(); repaint(); return; } String transferMessage = ""; if (transfer.getStatus() == FileTransfer.Status.ERROR) { if (transfer.getException() != null) { Log.error("There was an error during file transfer.", transfer.getException()); } transferMessage = "There was an error during file transfer."; } else if (transfer.getStatus() == FileTransfer.Status.REFUSED) { transferMessage = "The file transfer was refused."; } else if (transfer.getStatus() == FileTransfer.Status.CANCLED || transfer.getAmountWritten() < request.getFileSize()) { transferMessage = "The file transfer was cancelled."; } setFinishedText(transferMessage); showAlert(true); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
if (transfer.getStatus() == FileTransfer.Status.ERROR) { | if (transfer.getStatus() == FileTransfer.Status.error) { | public void finished() { if (transfer.getAmountWritten() >= request.getFileSize()) { transferDone(request, transfer); imageLabel.setToolTipText("Click to open"); titleLabel.setToolTipText("Click to open"); imageLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); imageLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); invalidate(); validate(); repaint(); return; } String transferMessage = ""; if (transfer.getStatus() == FileTransfer.Status.ERROR) { if (transfer.getException() != null) { Log.error("There was an error during file transfer.", transfer.getException()); } transferMessage = "There was an error during file transfer."; } else if (transfer.getStatus() == FileTransfer.Status.REFUSED) { transferMessage = "The file transfer was refused."; } else if (transfer.getStatus() == FileTransfer.Status.CANCLED || transfer.getAmountWritten() < request.getFileSize()) { transferMessage = "The file transfer was cancelled."; } setFinishedText(transferMessage); showAlert(true); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
transferMessage = "There was an error during file transfer."; | transferMessage = Res.getString("message.error.during.file.transfer"); | public void finished() { if (transfer.getAmountWritten() >= request.getFileSize()) { transferDone(request, transfer); imageLabel.setToolTipText("Click to open"); titleLabel.setToolTipText("Click to open"); imageLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); imageLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); invalidate(); validate(); repaint(); return; } String transferMessage = ""; if (transfer.getStatus() == FileTransfer.Status.ERROR) { if (transfer.getException() != null) { Log.error("There was an error during file transfer.", transfer.getException()); } transferMessage = "There was an error during file transfer."; } else if (transfer.getStatus() == FileTransfer.Status.REFUSED) { transferMessage = "The file transfer was refused."; } else if (transfer.getStatus() == FileTransfer.Status.CANCLED || transfer.getAmountWritten() < request.getFileSize()) { transferMessage = "The file transfer was cancelled."; } setFinishedText(transferMessage); showAlert(true); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
else if (transfer.getStatus() == FileTransfer.Status.REFUSED) { transferMessage = "The file transfer was refused."; | else if (transfer.getStatus() == FileTransfer.Status.refused) { transferMessage = Res.getString("message.transfer.refused"); | public void finished() { if (transfer.getAmountWritten() >= request.getFileSize()) { transferDone(request, transfer); imageLabel.setToolTipText("Click to open"); titleLabel.setToolTipText("Click to open"); imageLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); imageLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); invalidate(); validate(); repaint(); return; } String transferMessage = ""; if (transfer.getStatus() == FileTransfer.Status.ERROR) { if (transfer.getException() != null) { Log.error("There was an error during file transfer.", transfer.getException()); } transferMessage = "There was an error during file transfer."; } else if (transfer.getStatus() == FileTransfer.Status.REFUSED) { transferMessage = "The file transfer was refused."; } else if (transfer.getStatus() == FileTransfer.Status.CANCLED || transfer.getAmountWritten() < request.getFileSize()) { transferMessage = "The file transfer was cancelled."; } setFinishedText(transferMessage); showAlert(true); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
else if (transfer.getStatus() == FileTransfer.Status.CANCLED || | else if (transfer.getStatus() == FileTransfer.Status.cancelled || | public void finished() { if (transfer.getAmountWritten() >= request.getFileSize()) { transferDone(request, transfer); imageLabel.setToolTipText("Click to open"); titleLabel.setToolTipText("Click to open"); imageLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); imageLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); invalidate(); validate(); repaint(); return; } String transferMessage = ""; if (transfer.getStatus() == FileTransfer.Status.ERROR) { if (transfer.getException() != null) { Log.error("There was an error during file transfer.", transfer.getException()); } transferMessage = "There was an error during file transfer."; } else if (transfer.getStatus() == FileTransfer.Status.REFUSED) { transferMessage = "The file transfer was refused."; } else if (transfer.getStatus() == FileTransfer.Status.CANCLED || transfer.getAmountWritten() < request.getFileSize()) { transferMessage = "The file transfer was cancelled."; } setFinishedText(transferMessage); showAlert(true); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
transferMessage = "The file transfer was cancelled."; | transferMessage = Res.getString("message.transfer.cancelled"); | public void finished() { if (transfer.getAmountWritten() >= request.getFileSize()) { transferDone(request, transfer); imageLabel.setToolTipText("Click to open"); titleLabel.setToolTipText("Click to open"); imageLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); imageLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { imageLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openFile(downloadedFile); } } }); titleLabel.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { titleLabel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); invalidate(); validate(); repaint(); return; } String transferMessage = ""; if (transfer.getStatus() == FileTransfer.Status.ERROR) { if (transfer.getException() != null) { Log.error("There was an error during file transfer.", transfer.getException()); } transferMessage = "There was an error during file transfer."; } else if (transfer.getStatus() == FileTransfer.Status.REFUSED) { transferMessage = "The file transfer was refused."; } else if (transfer.getStatus() == FileTransfer.Status.CANCLED || transfer.getAmountWritten() < request.getFileSize()) { transferMessage = "The file transfer was cancelled."; } setFinishedText(transferMessage); showAlert(true); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
ResourceUtils.resButton(cancelButton, "Cancel"); | ResourceUtils.resButton(cancelButton, Res.getString("cancel")); | private void decorateCancelButton() { cancelButton.setVisible(false); ResourceUtils.resButton(cancelButton, "Cancel"); cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); cancelButton.setForeground(new Color(73, 113, 196)); cancelButton.setFont(new Font("Verdana", Font.BOLD, 10)); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelTransfer(); } }); cancelButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
cancelButton.setFont(new Font("Verdana", Font.BOLD, 10)); | cancelButton.setFont(new Font("Dialog", Font.BOLD, 10)); | private void decorateCancelButton() { cancelButton.setVisible(false); ResourceUtils.resButton(cancelButton, "Cancel"); cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); cancelButton.setForeground(new Color(73, 113, 196)); cancelButton.setFont(new Font("Verdana", Font.BOLD, 10)); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelTransfer(); } }); cancelButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
titleLabel.setText("You have cancelled the file transfer."); | titleLabel.setText(Res.getString("message.file.transfer.canceled")); | private void rejectRequest(FileTransferRequest request) { request.reject(); setBackground(new Color(239, 245, 250)); acceptLabel.setText(""); declineLabel.setText(""); fileLabel.setText(""); titleLabel.setText("You have cancelled the file transfer."); titleLabel.setForeground(new Color(65, 139, 179)); invalidate(); validate(); repaint(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
int confirm = JOptionPane.showConfirmDialog(ui, "The file already exists. Overwrite?", "File Exists", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); | int confirm = JOptionPane.showConfirmDialog(ui, Res.getString("message.file.exists.question"), Res.getString("title.file.exists"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); | private void showPopup(MouseEvent e, final File downloadedFile) { if (e.isPopupTrigger()) { final JPopupMenu popup = new JPopupMenu(); final ReceiveMessage ui = this; Action saveAsAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { final JFileChooser chooser = Downloads.getInstance().getFileChooser(); File selectedFile = chooser.getSelectedFile(); if (selectedFile != null) { selectedFile = new File(selectedFile.getParent(), downloadedFile.getName()); } else { selectedFile = downloadedFile; } chooser.setSelectedFile(selectedFile); int ok = chooser.showSaveDialog(ui); if (ok == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); try { if (file.exists()) { int confirm = JOptionPane.showConfirmDialog(ui, "The file already exists. Overwrite?", "File Exists", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (confirm == JOptionPane.NO_OPTION) { return; } } URLFileSystem.copy(downloadedFile.toURL(), file); } catch (IOException e1) { Log.error(e1); } } } }; saveAsAction.putValue(Action.NAME, "Save As..."); popup.add(saveAsAction); popup.show(this, e.getX(), e.getY()); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
saveAsAction.putValue(Action.NAME, "Save As..."); | saveAsAction.putValue(Action.NAME, Res.getString("menuitem.save.as")); | private void showPopup(MouseEvent e, final File downloadedFile) { if (e.isPopupTrigger()) { final JPopupMenu popup = new JPopupMenu(); final ReceiveMessage ui = this; Action saveAsAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { final JFileChooser chooser = Downloads.getInstance().getFileChooser(); File selectedFile = chooser.getSelectedFile(); if (selectedFile != null) { selectedFile = new File(selectedFile.getParent(), downloadedFile.getName()); } else { selectedFile = downloadedFile; } chooser.setSelectedFile(selectedFile); int ok = chooser.showSaveDialog(ui); if (ok == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); try { if (file.exists()) { int confirm = JOptionPane.showConfirmDialog(ui, "The file already exists. Overwrite?", "File Exists", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (confirm == JOptionPane.NO_OPTION) { return; } } URLFileSystem.copy(downloadedFile.toURL(), file); } catch (IOException e1) { Log.error(e1); } } } }; saveAsAction.putValue(Action.NAME, "Save As..."); popup.add(saveAsAction); popup.show(this, e.getX(), e.getY()); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
int confirm = JOptionPane.showConfirmDialog(ui, "The file already exists. Overwrite?", "File Exists", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); | int confirm = JOptionPane.showConfirmDialog(ui, Res.getString("message.file.exists.question"), Res.getString("title.file.exists"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); | public void actionPerformed(ActionEvent e) { final JFileChooser chooser = Downloads.getInstance().getFileChooser(); File selectedFile = chooser.getSelectedFile(); if (selectedFile != null) { selectedFile = new File(selectedFile.getParent(), downloadedFile.getName()); } else { selectedFile = downloadedFile; } chooser.setSelectedFile(selectedFile); int ok = chooser.showSaveDialog(ui); if (ok == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); try { if (file.exists()) { int confirm = JOptionPane.showConfirmDialog(ui, "The file already exists. Overwrite?", "File Exists", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (confirm == JOptionPane.NO_OPTION) { return; } } URLFileSystem.copy(downloadedFile.toURL(), file); } catch (IOException e1) { Log.error(e1); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
titleLabel.setText("You have received a file from " + contactItem.getNickname() + "."); | titleLabel.setText(Res.getString("message.received.file", contactItem.getNickname())); | private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText("You have received a file from " + contactItem.getNickname() + "."); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, "Open"); ResourceUtils.resButton(openFolderButton, "Open Folder"); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Verdana", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Verdana", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
ResourceUtils.resButton(openFileButton, "Open"); ResourceUtils.resButton(openFolderButton, "Open Folder"); | ResourceUtils.resButton(openFileButton, Res.getString("open")); ResourceUtils.resButton(openFolderButton, Res.getString("open.folder")); | private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText("You have received a file from " + contactItem.getNickname() + "."); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, "Open"); ResourceUtils.resButton(openFolderButton, "Open Folder"); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Verdana", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Verdana", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
openFileButton.setFont(new Font("Verdana", Font.BOLD, 10)); | openFileButton.setFont(new Font("Dialog", Font.BOLD, 10)); | private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText("You have received a file from " + contactItem.getNickname() + "."); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, "Open"); ResourceUtils.resButton(openFolderButton, "Open Folder"); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Verdana", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Verdana", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
openFolderButton.setFont(new Font("Verdana", Font.BOLD, 10)); | openFolderButton.setFont(new Font("Dialog", Font.BOLD, 10)); | private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText("You have received a file from " + contactItem.getNickname() + "."); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, "Open"); ResourceUtils.resButton(openFolderButton, "Open Folder"); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Verdana", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Verdana", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/ReceiveMessage.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/filetransfer/transfer/ui/ReceiveMessage.java |
suite.addTest(new ScriptTest(ruby, "testFile")); | suite.addTest(new ScriptTest(ruby, "testFile")); | public static Test suite() { TestSuite suite = new TestSuite(); Ruby ruby = Ruby.getDefaultInstance(null); ruby.initLoad(new ArrayList()); suite.addTest(new ScriptTest(ruby, "testRegexp")); suite.addTest(new ScriptTest(ruby, "testStringEval")); suite.addTest(new ScriptTest(ruby, "testHereDocument")); suite.addTest(new ScriptTest(ruby, "testClass"));// suite.addTest(new ScriptTest(ruby, "testArray")); suite.addTest(new ScriptTest(ruby, "testVariableAndMethod")); suite.addTest(new ScriptTest(ruby, "testIf")); suite.addTest(new ScriptTest(ruby, "testLoops")); suite.addTest(new ScriptTest(ruby, "testMethods")); suite.addTest(new ScriptTest(ruby, "testGlobalVars")); suite.addTest(new ScriptTest(ruby, "testClasses")); suite.addTest(new ScriptTest(ruby, "testNumber")); suite.addTest(new ScriptTest(ruby, "testFloat")); suite.addTest(new ScriptTest(ruby, "testBlock")); suite.addTest(new ScriptTest(ruby, "testRange")); suite.addTest(new ScriptTest(ruby, "testString"));// suite.addTest(new ScriptTest(ruby, "testException"));// suite.addTest(new ScriptTest(ruby, "testSpecialVar")); suite.addTest(new ScriptTest(ruby, "testFile")); suite.addTest(new ScriptTest(ruby, "testMarshal")); suite.addTest(new ScriptTest(ruby, "testHash")); suite.addTest(new ScriptTest(ruby, "testSymbol")); suite.addTest(new ScriptTest(ruby, "testRandom")); return suite; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a3a14c0a68f0036a9a25b161b3023eb829eeac7b/ScriptTestSuite.java/clean/org/jruby/test/ScriptTestSuite.java |
suite.addTest(new ScriptTest(ruby, "testStruct")); | public static Test suite() { TestSuite suite = new TestSuite(); Ruby ruby = Ruby.getDefaultInstance(null); ruby.initLoad(new ArrayList()); suite.addTest(new ScriptTest(ruby, "testRegexp")); suite.addTest(new ScriptTest(ruby, "testStringEval")); suite.addTest(new ScriptTest(ruby, "testHereDocument")); suite.addTest(new ScriptTest(ruby, "testClass"));// suite.addTest(new ScriptTest(ruby, "testArray")); suite.addTest(new ScriptTest(ruby, "testVariableAndMethod")); suite.addTest(new ScriptTest(ruby, "testIf")); suite.addTest(new ScriptTest(ruby, "testLoops")); suite.addTest(new ScriptTest(ruby, "testMethods")); suite.addTest(new ScriptTest(ruby, "testGlobalVars")); suite.addTest(new ScriptTest(ruby, "testClasses")); suite.addTest(new ScriptTest(ruby, "testNumber")); suite.addTest(new ScriptTest(ruby, "testFloat")); suite.addTest(new ScriptTest(ruby, "testBlock")); suite.addTest(new ScriptTest(ruby, "testRange")); suite.addTest(new ScriptTest(ruby, "testString"));// suite.addTest(new ScriptTest(ruby, "testException"));// suite.addTest(new ScriptTest(ruby, "testSpecialVar")); suite.addTest(new ScriptTest(ruby, "testFile")); suite.addTest(new ScriptTest(ruby, "testMarshal")); suite.addTest(new ScriptTest(ruby, "testHash")); suite.addTest(new ScriptTest(ruby, "testSymbol")); suite.addTest(new ScriptTest(ruby, "testRandom")); return suite; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a3a14c0a68f0036a9a25b161b3023eb829eeac7b/ScriptTestSuite.java/clean/org/jruby/test/ScriptTestSuite.java |
|
String list = null; | String list = ""; | private boolean attempt() { UserCredentials uc = config.getCredentials(); try { if (uc == null) throw new DSOutOfServiceException( "No user's credentials have been entered yet."); //NOTE: This will never happen if the Splash Screen always blocks //waiting for the user's credentials and the login dialog never //passes null credentials along. DataServicesFactory factory = DataServicesFactory.getInstance( container); if (factory.isConnected()) return true; factory.connect(uc); //Log success. LogMessage msg = new LogMessage(); msg.println("Logged onto OMERO at: "+uc.getHostName()); msg.println(uc); Logger logger = container.getRegistry().getLogger(); logger.info(this, msg); Preferences userPrefs = Preferences.userNodeForPackage(LoginConfig.class); String servers = null; servers = userPrefs.get(LoginConfig.OMERO_SERVER, servers); String listOfServers = null; if (servers == null) { listOfServers = uc.getHostName(); } else { String[] l = servers.split(LoginConfig.SERVER_NAME_SEPARATOR, 0); if (l == null || l.length == 0) { listOfServers = uc.getHostName(); } else { int n = l.length-1; String name = uc.getHostName(); String host; String list = null; for (int index = 0; index < l.length; index++) { host = l[index].trim(); if (!name.equals(host)) { if (index == 0) list = host; else list += host; if (index != n) list += ","; } } listOfServers = uc.getHostName()+","+list; } } if (listOfServers != null) { userPrefs.put(LoginConfig.OMERO_SERVER, listOfServers); } return true; } catch (DSOutOfServiceException dsose) { //Log failure. LogMessage msg = new LogMessage(); msg.println("Failed to log onto OMERO."); msg.println("Reason: "+dsose); msg.println("OMERO Address: "+uc.getHostName()); if (uc != null) msg.println(uc); Logger logger = container.getRegistry().getLogger(); logger.error(this, msg); } return false; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c41eaa212f1aa7884be174de7ed21c2dfeceed96/LoginServiceImpl.java/clean/SRC/org/openmicroscopy/shoola/env/data/login/LoginServiceImpl.java |
if (index == 0) list = host; else list += host; if (index != n) list += ","; | list += host; if (index != n) list += LoginConfig.SERVER_NAME_SEPARATOR; | private boolean attempt() { UserCredentials uc = config.getCredentials(); try { if (uc == null) throw new DSOutOfServiceException( "No user's credentials have been entered yet."); //NOTE: This will never happen if the Splash Screen always blocks //waiting for the user's credentials and the login dialog never //passes null credentials along. DataServicesFactory factory = DataServicesFactory.getInstance( container); if (factory.isConnected()) return true; factory.connect(uc); //Log success. LogMessage msg = new LogMessage(); msg.println("Logged onto OMERO at: "+uc.getHostName()); msg.println(uc); Logger logger = container.getRegistry().getLogger(); logger.info(this, msg); Preferences userPrefs = Preferences.userNodeForPackage(LoginConfig.class); String servers = null; servers = userPrefs.get(LoginConfig.OMERO_SERVER, servers); String listOfServers = null; if (servers == null) { listOfServers = uc.getHostName(); } else { String[] l = servers.split(LoginConfig.SERVER_NAME_SEPARATOR, 0); if (l == null || l.length == 0) { listOfServers = uc.getHostName(); } else { int n = l.length-1; String name = uc.getHostName(); String host; String list = null; for (int index = 0; index < l.length; index++) { host = l[index].trim(); if (!name.equals(host)) { if (index == 0) list = host; else list += host; if (index != n) list += ","; } } listOfServers = uc.getHostName()+","+list; } } if (listOfServers != null) { userPrefs.put(LoginConfig.OMERO_SERVER, listOfServers); } return true; } catch (DSOutOfServiceException dsose) { //Log failure. LogMessage msg = new LogMessage(); msg.println("Failed to log onto OMERO."); msg.println("Reason: "+dsose); msg.println("OMERO Address: "+uc.getHostName()); if (uc != null) msg.println(uc); Logger logger = container.getRegistry().getLogger(); logger.error(this, msg); } return false; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c41eaa212f1aa7884be174de7ed21c2dfeceed96/LoginServiceImpl.java/clean/SRC/org/openmicroscopy/shoola/env/data/login/LoginServiceImpl.java |
listOfServers = uc.getHostName()+","+list; | listOfServers = uc.getHostName()+ LoginConfig.SERVER_NAME_SEPARATOR+list; | private boolean attempt() { UserCredentials uc = config.getCredentials(); try { if (uc == null) throw new DSOutOfServiceException( "No user's credentials have been entered yet."); //NOTE: This will never happen if the Splash Screen always blocks //waiting for the user's credentials and the login dialog never //passes null credentials along. DataServicesFactory factory = DataServicesFactory.getInstance( container); if (factory.isConnected()) return true; factory.connect(uc); //Log success. LogMessage msg = new LogMessage(); msg.println("Logged onto OMERO at: "+uc.getHostName()); msg.println(uc); Logger logger = container.getRegistry().getLogger(); logger.info(this, msg); Preferences userPrefs = Preferences.userNodeForPackage(LoginConfig.class); String servers = null; servers = userPrefs.get(LoginConfig.OMERO_SERVER, servers); String listOfServers = null; if (servers == null) { listOfServers = uc.getHostName(); } else { String[] l = servers.split(LoginConfig.SERVER_NAME_SEPARATOR, 0); if (l == null || l.length == 0) { listOfServers = uc.getHostName(); } else { int n = l.length-1; String name = uc.getHostName(); String host; String list = null; for (int index = 0; index < l.length; index++) { host = l[index].trim(); if (!name.equals(host)) { if (index == 0) list = host; else list += host; if (index != n) list += ","; } } listOfServers = uc.getHostName()+","+list; } } if (listOfServers != null) { userPrefs.put(LoginConfig.OMERO_SERVER, listOfServers); } return true; } catch (DSOutOfServiceException dsose) { //Log failure. LogMessage msg = new LogMessage(); msg.println("Failed to log onto OMERO."); msg.println("Reason: "+dsose); msg.println("OMERO Address: "+uc.getHostName()); if (uc != null) msg.println(uc); Logger logger = container.getRegistry().getLogger(); logger.error(this, msg); } return false; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c41eaa212f1aa7884be174de7ed21c2dfeceed96/LoginServiceImpl.java/clean/SRC/org/openmicroscopy/shoola/env/data/login/LoginServiceImpl.java |
if (nonHTMLsrc == null) return null; | public static final String escape (String nonHTMLsrc) { StringBuffer res = new StringBuffer(); int l = nonHTMLsrc.length(); int idx; char c; for (int i = 0; i < l; i++) { c = nonHTMLsrc.charAt(i); idx = entityMap.indexOf(c); if (idx == -1) { res.append(c); } else { res.append(quickEntities[idx]); } } return res.toString(); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/48800e75790b125baa3467012ddae0ffedaffadb/HTMLEscaper.java/clean/webmacro/src/org/webmacro/util/HTMLEscaper.java |
|
model.getTreeView().sortNodes(index, (ImageDisplay) model.getBrowser().getUI()); | TreeView tv = model.getTreeView(); if (tv != null) tv.sortNodes(index, (ImageDisplay) model.getBrowser().getUI()); | public void sortBy(int index) { model.getSorter().setByDate(SortByAction.BY_DATE == index); view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); Browser browser = getBrowser(); switch (browser.getSelectedLayout()) { case LayoutFactory.SQUARY_LAYOUT: browser.accept(LayoutFactory.createLayout( LayoutFactory.SQUARY_LAYOUT, model.getSorter()), ImageDisplayVisitor.IMAGE_SET_ONLY); break; case LayoutFactory.FLAT_LAYOUT: browser.resetChildDisplay(); Layout l = LayoutFactory.createLayout(LayoutFactory.FLAT_LAYOUT, model.getSorter()); browser.accept(l); l.doLayout(); } model.getTreeView().sortNodes(index, (ImageDisplay) model.getBrowser().getUI()); view.setCursor( Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1811507ad4983eef432b6c41a94f9b778b5701cd/HiViewerComponent.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerComponent.java |
ChannelToggleButton channelButton; | ChannelToggleButton item; | private JPanel createChannelButtons() { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); ChannelMetadata[] data = model.getChannelData(); boolean gs = model.getColorModel().equals(ImViewer.GREY_SCALE_MODEL); ChannelMetadata d; ChannelToggleButton channelButton; p.add(Box.createRigidArea(VBOX)); for (int j = 0; j < data.length; j++) { d = data[j]; channelButton = new ChannelToggleButton(""+d.getEmissionWavelength() , model.getChannelColor(j), j); channelList.add(channelButton); if (model.getSelectedChannel() == j) channelButton.setSelected(true); channelButton.setGrayedOut(gs); channelButton.addPropertyChangeListener(controller); channelButton.setPreferredSize(new Dimension(30, 30)); channelButton.setMinimumSize(new Dimension(30, 30)); p.add(channelButton); p.add(Box.createRigidArea(VBOX)); } return UIUtilities.buildComponentPanel(p); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/DomainPane.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/rnd/DomainPane.java |
channelButton = new ChannelToggleButton(""+d.getEmissionWavelength() , model.getChannelColor(j), j); channelList.add(channelButton); if (model.getSelectedChannel() == j) channelButton.setSelected(true); | item = new ChannelToggleButton(""+d.getEmissionWavelength(), model.getChannelColor(j), j); channelList.add(item); item.setSelected(model.getSelectedChannel() == j); | private JPanel createChannelButtons() { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); ChannelMetadata[] data = model.getChannelData(); boolean gs = model.getColorModel().equals(ImViewer.GREY_SCALE_MODEL); ChannelMetadata d; ChannelToggleButton channelButton; p.add(Box.createRigidArea(VBOX)); for (int j = 0; j < data.length; j++) { d = data[j]; channelButton = new ChannelToggleButton(""+d.getEmissionWavelength() , model.getChannelColor(j), j); channelList.add(channelButton); if (model.getSelectedChannel() == j) channelButton.setSelected(true); channelButton.setGrayedOut(gs); channelButton.addPropertyChangeListener(controller); channelButton.setPreferredSize(new Dimension(30, 30)); channelButton.setMinimumSize(new Dimension(30, 30)); p.add(channelButton); p.add(Box.createRigidArea(VBOX)); } return UIUtilities.buildComponentPanel(p); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/DomainPane.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/rnd/DomainPane.java |
channelButton.setGrayedOut(gs); channelButton.addPropertyChangeListener(controller); channelButton.setPreferredSize(new Dimension(30, 30)); channelButton.setMinimumSize(new Dimension(30, 30)); p.add(channelButton); | item.setGrayedOut(gs); item.addPropertyChangeListener(controller); item.setPreferredSize(ChannelButton.DEFAULT_MIN_SIZE); item.setMinimumSize(ChannelButton.DEFAULT_MIN_SIZE); p.add(item); | private JPanel createChannelButtons() { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); ChannelMetadata[] data = model.getChannelData(); boolean gs = model.getColorModel().equals(ImViewer.GREY_SCALE_MODEL); ChannelMetadata d; ChannelToggleButton channelButton; p.add(Box.createRigidArea(VBOX)); for (int j = 0; j < data.length; j++) { d = data[j]; channelButton = new ChannelToggleButton(""+d.getEmissionWavelength() , model.getChannelColor(j), j); channelList.add(channelButton); if (model.getSelectedChannel() == j) channelButton.setSelected(true); channelButton.setGrayedOut(gs); channelButton.addPropertyChangeListener(controller); channelButton.setPreferredSize(new Dimension(30, 30)); channelButton.setMinimumSize(new Dimension(30, 30)); p.add(channelButton); p.add(Box.createRigidArea(VBOX)); } return UIUtilities.buildComponentPanel(p); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/DomainPane.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/rnd/DomainPane.java |
public void activate() { } | public void activate() {} | public void activate() { } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e717f628b707987e5b693ea9d57b6ef34b300679/Viewer.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
if (presentation != null) { topFrame.addToDesktop(presentation, TopFrame.PALETTE_LAYER); presentation.setVisible(true); } | topFrame.addToDesktop(presentation, TopFrame.PALETTE_LAYER); presentation.setVisible(true); | void showPresentation() { if (presentation != null) { topFrame.addToDesktop(presentation, TopFrame.PALETTE_LAYER); presentation.setVisible(true); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e717f628b707987e5b693ea9d57b6ef34b300679/Viewer.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
if (root.equals(display)) loadData(); else model.refreshSelectedDisplay(); | if (root.equals(display)) { if (model.getBrowserType() == IMAGES_EXPLORER) loadFilteredImagesForHierarchy(); else loadData(); } else model.refreshSelectedDisplay(); | public void refresh() { switch (model.getState()) { case LOADING_DATA: case LOADING_LEAVES: case DISCARDED: throw new IllegalStateException( "This method cannot be invoked in the LOADING_DATA, "+ " LOADING_LEAVES or DISCARDED state."); } TreeImageDisplay display = model.getSelectedDisplay(); if (display == null) return; if (!display.hasChildrenDisplay()) return; TreeImageDisplay root = view.getTreeRoot(); display.removeAllChildrenDisplay(); if (root.equals(display)) loadData(); else model.refreshSelectedDisplay(); fireStateChange(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/79512e4e932534e29dad48577ab56b1f09f02fc7/BrowserComponent.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java |
acrossT.setSelected(true); acrossZ.setSelected(true); | acrossZT.setSelected(true); | void setDefaults() { int maxZ = model.getMaxZ(); int maxT = model.getMaxT(); zSlider.setEnabled(maxZ != 0); startZ.setEnabled(maxZ != 0); endZ.setEnabled(maxZ != 0); tSlider.setEnabled(maxT != 0); startT.setEnabled(maxT != 0); endT.setEnabled(maxT != 0); acrossZ.setEnabled(maxZ != 0); acrossT.setEnabled(maxT != 0); int index = model.getMovieIndex(); if (index == MoviePlayer.ACROSS_Z) { acrossZ.setSelected(true); } else if (index == MoviePlayer.ACROSS_T) { acrossT.setSelected(true); } else if (index == MoviePlayer.ACROSS_ZT) { acrossT.setSelected(true); acrossZ.setSelected(true); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/10741ce22be9051166109de0c40e67fef675822e/MoviePlayerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/util/MoviePlayerUI.java |
if ( ! Hibernate.isInitialized( o )) return true; | protected boolean alreadySeen( Object o ) { if ( o == null ) return false; return hasReplacement( o ) ? true : _cache.containsKey( o ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5455b73a435a252c2c058cc4c625f039b667cd2f/UpdateFilter.java/clean/components/server/src/ome/tools/hibernate/UpdateFilter.java |
|
if ( ! Hibernate.isInitialized( o )) return o; | protected Object returnSeen( Object o ) { if ( o == null) return null; if ( hasReplacement( o )) { IObject obj = (IObject) o; IObject replacement = obj.getDetails().getReplacement(); obj.unload(); return replacement; } return o; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5455b73a435a252c2c058cc4c625f039b667cd2f/UpdateFilter.java/clean/components/server/src/ome/tools/hibernate/UpdateFilter.java |
|
final DelayInformation offlineInformation = (DelayInformation)message.getExtension("x", "jabber:x:delay"); if (offlineInformation != null || message.getError() != null) { return; } | public void processPacket(final Packet packet) { SwingUtilities.invokeLater(new Runnable() { public void run() { final Message message = (Message)packet; boolean broadcast = message.getProperty("broadcast") != null; if ((broadcast || (message.getType() == Message.Type.NORMAL) || message.getType() == Message.Type.HEADLINE) && message.getBody() != null) { showAlert((Message)packet); } else { String host = SparkManager.getSessionManager().getServerAddress(); String from = packet.getFrom() != null ? packet.getFrom() : ""; if (host.equalsIgnoreCase(from) || !ModelUtil.hasLength(from)) { showAlert((Message)packet); } } } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/e51fe7fc839fd9898d56e3951ad79de91d48b592/BroadcastPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/alerts/BroadcastPlugin.java |
|
final DelayInformation offlineInformation = (DelayInformation)message.getExtension("x", "jabber:x:delay"); if (offlineInformation != null || message.getError() != null) { return; } | public void run() { final Message message = (Message)packet; boolean broadcast = message.getProperty("broadcast") != null; if ((broadcast || (message.getType() == Message.Type.NORMAL) || message.getType() == Message.Type.HEADLINE) && message.getBody() != null) { showAlert((Message)packet); } else { String host = SparkManager.getSessionManager().getServerAddress(); String from = packet.getFrom() != null ? packet.getFrom() : ""; if (host.equalsIgnoreCase(from) || !ModelUtil.hasLength(from)) { showAlert((Message)packet); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/e51fe7fc839fd9898d56e3951ad79de91d48b592/BroadcastPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/alerts/BroadcastPlugin.java |
|
long s = System.currentTimeMillis(); | RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); | public BufferedImage render(PlaneDef pDef) { if (pDef == null) throw new IllegalArgumentException("Plane def cannot be null."); //See if the requested image is in cache. //BufferedImage img = null;//getFromCache(pDef); //if (img == null) { //If not, ask the server to render the plane. RGBBuffer buf = servant.render(pDef); //TO BE modified. if (xyImage == null) { xyImage = new BufferedImage(buf.getSizeX1(), buf.getSizeX2(), BufferedImage.TYPE_INT_RGB); } //See if we can/need work out the XY image size. if (xyImgSize == 0 && pDef.getSlice() == PlaneDef.XY) xyImgSize = buf.getRedBand().length+buf.getGreenBand().length+ buf.getBlueBand().length; //RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); long s = System.currentTimeMillis(); int sizeX1 = buf.getSizeX1(); int sizeX2 = buf.getSizeX2(); int pos = 0; for (int y = sizeX2-1; y >= 0; y--) { for (int x = sizeX1-1; x >= 0; x--) { pos = sizeX1*y+x; xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); } } System.out.println("creation: "+(System.currentTimeMillis()-s)); //Then create a Java2D buffer for buf. /* RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); //Now we only need to tell Java2D how to handle the RGB buffer. BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, buf.getSizeX1(), buf.getSizeX2(), 3); ColorModel cm = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB), null, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); img = new BufferedImage(cm, Raster.createWritableRaster(csm, j2DBuf, null), false, null); */ //Finally add to cache. // cache(pDef, img); //} //return img; return xyImage; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bd1ad73aba0e6043358bdc7f229b530947958a1/RenderingControlProxy.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/RenderingControlProxy.java |
xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); | xyImage.setRGB(x, y, makeRGB( j2DBuf.getElem(0,pos), j2DBuf.getElem(1,pos), j2DBuf.getElem(2,pos))); | public BufferedImage render(PlaneDef pDef) { if (pDef == null) throw new IllegalArgumentException("Plane def cannot be null."); //See if the requested image is in cache. //BufferedImage img = null;//getFromCache(pDef); //if (img == null) { //If not, ask the server to render the plane. RGBBuffer buf = servant.render(pDef); //TO BE modified. if (xyImage == null) { xyImage = new BufferedImage(buf.getSizeX1(), buf.getSizeX2(), BufferedImage.TYPE_INT_RGB); } //See if we can/need work out the XY image size. if (xyImgSize == 0 && pDef.getSlice() == PlaneDef.XY) xyImgSize = buf.getRedBand().length+buf.getGreenBand().length+ buf.getBlueBand().length; //RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); long s = System.currentTimeMillis(); int sizeX1 = buf.getSizeX1(); int sizeX2 = buf.getSizeX2(); int pos = 0; for (int y = sizeX2-1; y >= 0; y--) { for (int x = sizeX1-1; x >= 0; x--) { pos = sizeX1*y+x; xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); } } System.out.println("creation: "+(System.currentTimeMillis()-s)); //Then create a Java2D buffer for buf. /* RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); //Now we only need to tell Java2D how to handle the RGB buffer. BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, buf.getSizeX1(), buf.getSizeX2(), 3); ColorModel cm = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB), null, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); img = new BufferedImage(cm, Raster.createWritableRaster(csm, j2DBuf, null), false, null); */ //Finally add to cache. // cache(pDef, img); //} //return img; return xyImage; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bd1ad73aba0e6043358bdc7f229b530947958a1/RenderingControlProxy.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/RenderingControlProxy.java |
System.out.println("creation: "+(System.currentTimeMillis()-s)); | public BufferedImage render(PlaneDef pDef) { if (pDef == null) throw new IllegalArgumentException("Plane def cannot be null."); //See if the requested image is in cache. //BufferedImage img = null;//getFromCache(pDef); //if (img == null) { //If not, ask the server to render the plane. RGBBuffer buf = servant.render(pDef); //TO BE modified. if (xyImage == null) { xyImage = new BufferedImage(buf.getSizeX1(), buf.getSizeX2(), BufferedImage.TYPE_INT_RGB); } //See if we can/need work out the XY image size. if (xyImgSize == 0 && pDef.getSlice() == PlaneDef.XY) xyImgSize = buf.getRedBand().length+buf.getGreenBand().length+ buf.getBlueBand().length; //RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); long s = System.currentTimeMillis(); int sizeX1 = buf.getSizeX1(); int sizeX2 = buf.getSizeX2(); int pos = 0; for (int y = sizeX2-1; y >= 0; y--) { for (int x = sizeX1-1; x >= 0; x--) { pos = sizeX1*y+x; xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); } } System.out.println("creation: "+(System.currentTimeMillis()-s)); //Then create a Java2D buffer for buf. /* RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); //Now we only need to tell Java2D how to handle the RGB buffer. BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, buf.getSizeX1(), buf.getSizeX2(), 3); ColorModel cm = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB), null, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); img = new BufferedImage(cm, Raster.createWritableRaster(csm, j2DBuf, null), false, null); */ //Finally add to cache. // cache(pDef, img); //} //return img; return xyImage; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bd1ad73aba0e6043358bdc7f229b530947958a1/RenderingControlProxy.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/RenderingControlProxy.java |
|
if (!view.isPartialName()) { PartialNameVisitor v = new PartialNameVisitor(view.isPartialName()); accept(v, TreeImageDisplayVisitor.TREEIMAGE_NODE_ONLY); } | public void setLeaves(Set leaves, TreeImageSet parent) { if (model.getState() != LOADING_LEAVES) throw new IllegalStateException( "This method can only be invoked in the LOADING_LEAVES "+ "state."); if (leaves == null) throw new NullPointerException("No leaves."); long userID = model.getUserID(); long groupID = model.getRootGroupID(); Set visLeaves = TreeViewerTranslator.transformHierarchy(leaves, userID, groupID); view.setLeavesViews(visLeaves, parent); model.setState(READY); model.getParentModel().setStatus(false, "", true); fireStateChange(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/BrowserComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java |
|
if (!view.isPartialName()) { PartialNameVisitor v = new PartialNameVisitor(view.isPartialName()); accept(v, TreeImageDisplayVisitor.TREEIMAGE_NODE_ONLY); } | public void setNodes(Set nodes) { if (model.getState() != LOADING_DATA) throw new IllegalStateException( "This method can only be invoked in the LOADING_DATA "+ "state."); if (nodes == null) throw new NullPointerException("No nodes."); long userID = model.getUserID(); long groupID = model.getRootGroupID(); Set visNodes = TreeViewerTranslator.transformHierarchy(nodes, userID, groupID); view.setViews(visNodes); model.setState(READY); model.getParentModel().setStatus(false, "", true); fireStateChange(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/BrowserComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java |
|
setCurrentException(je); | private void handleReturn(JumpException je) { // make sure ensures fire while (!getCurrentInstructionStack().isEmpty()) { InstructionBundle ib = peekCurrentInstructionBundle(); if (ib.ensured) { // exec ensured node, return to "breaking" afterwards popCurrentInstruction(); setResult((IRubyObject)je.getSecondaryData()); addInstruction(ib.instructionContext, exceptionRethrower); addInstructionBundle(ib); return; } popCurrentInstruction(); } throw je; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ad0296bc87cc61adf9b46eadf0ad38b553e7da8c/EvaluationState.java/buggy/src/org/jruby/evaluator/EvaluationState.java |
|
if (listDatasets == null) listDatasets = new ArrayList(); | private void buildGUI() { listDatasets = manager.getProjectData().getDatasets(); buildTablePanel(); buildButtonsPanel(); buildButtonsToAddPanel(); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(tablePanel); add(Box.createRigidArea(DataManagerUIF.VBOX)); add(buttonsPanel); add(Box.createRigidArea(DataManagerUIF.VBOX)); Border b = BorderFactory.createEmptyBorder(0, 0, 10, 10); setBorder(b); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/983b9ea2ea56f723b31a22821e03a449360b8a2b/ProjectDatasetsPane.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/editors/project/ProjectDatasetsPane.java |
|
setConfig(configHash, "arch", "java"); | public void load(IRuby runtime) { RubyModule configModule = runtime.defineModule("Config"); RubyHash configHash = RubyHash.newHash(runtime); configModule.defineConstant("CONFIG", configHash); String[] versionParts = Constants.RUBY_VERSION.split("\\."); setConfig(configHash, "MAJOR", versionParts[0]); setConfig(configHash, "MINOR", versionParts[1]); setConfig(configHash, "TEENY", versionParts[2]); setConfig(configHash, "ruby_version", versionParts[0] + '.' + versionParts[1]); setConfig(configHash, "bindir", new NormalizedFile(System.getProperty("jruby.home"), "bin").getAbsolutePath()); setConfig(configHash, "RUBY_INSTALL_NAME", System.getProperty("jruby.script").replace('\\', '/')); setConfig(configHash, "ruby_install_name", System.getProperty("jruby.script").replace('\\', '/')); setConfig(configHash, "SHELL", System.getProperty("jruby.shell").replace('\\', '/')); setConfig(configHash, "prefix", new NormalizedFile(System.getProperty("jruby.home")).getAbsolutePath()); String libdir = System.getProperty("jruby.lib"); if (libdir == null) { libdir = new NormalizedFile(System.getProperty("jruby.home"), "lib").getAbsolutePath(); } else { libdir = new NormalizedFile(libdir).getAbsolutePath(); } setConfig(configHash, "libdir", libdir); setConfig(configHash, "rubylibdir", new NormalizedFile(libdir, "ruby/1.8").getAbsolutePath()); setConfig(configHash, "sitedir", new NormalizedFile(libdir, "ruby/site_ruby").getAbsolutePath()); setConfig(configHash, "sitelibdir", new NormalizedFile(libdir, "ruby/site_ruby/1.8").getAbsolutePath()); setConfig(configHash, "sitearchdir", new NormalizedFile(libdir, "ruby/site_ruby/1.8/java").getAbsolutePath()); setConfig(configHash, "configure_args", ""); setConfig(configHash, "datadir", new NormalizedFile(System.getProperty("jruby.home"), "share").getAbsolutePath()); setConfig(configHash, "mandir", new NormalizedFile(System.getProperty("jruby.home"), "man").getAbsolutePath()); setConfig(configHash, "sysconfdir", new NormalizedFile(System.getProperty("jruby.home"), "etc").getAbsolutePath()); if (isWindows()) { setConfig(configHash, "EXEEXT", ".exe"); } else { setConfig(configHash, "EXEEXT", ""); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ecaa1075877123d6bc029331082a3fbb34a47c21/RbConfigLibrary.java/buggy/src/org/jruby/libraries/RbConfigLibrary.java |
|
return "ImageInfo"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); | return "ImageInfo"+(attributeId==null ? ":Hash_"+this.hashCode() : ":Id_"+attributeId); | public String toString(){ return "ImageInfo"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/ImageInfo.java/clean/components/common/src/ome/model/ImageInfo.java |
module.definePublicModuleFunction("singleton_methods", objectCallbackFactory.getMethod("singleton_methods")); | module.definePublicModuleFunction("singleton_methods", objectCallbackFactory.getOptMethod("singleton_methods")); | public static RubyModule createKernelModule(IRuby runtime) { RubyModule module = runtime.defineModule("Kernel"); CallbackFactory callbackFactory = runtime.callbackFactory(RubyKernel.class); CallbackFactory objectCallbackFactory = runtime.callbackFactory(RubyObject.class); module.defineModuleFunction("Array", callbackFactory.getSingletonMethod("new_array", IRubyObject.class)); module.defineModuleFunction("Float", callbackFactory.getSingletonMethod("new_float", IRubyObject.class)); module.defineModuleFunction("Integer", callbackFactory.getSingletonMethod("new_integer", IRubyObject.class)); module.defineModuleFunction("String", callbackFactory.getSingletonMethod("new_string", IRubyObject.class)); module.defineModuleFunction("`", callbackFactory.getSingletonMethod("backquote", IRubyObject.class)); module.defineModuleFunction("abort", callbackFactory.getOptSingletonMethod("abort")); module.defineModuleFunction("at_exit", callbackFactory.getSingletonMethod("at_exit")); module.defineModuleFunction("autoload", callbackFactory.getSingletonMethod("autoload", IRubyObject.class, IRubyObject.class)); module.definePublicModuleFunction("autoload?", callbackFactory.getSingletonMethod("autoload_p", IRubyObject.class)); module.defineModuleFunction("binding", callbackFactory.getSingletonMethod("binding")); module.defineModuleFunction("block_given?", callbackFactory.getSingletonMethod("block_given")); // TODO: Implement Kernel#callcc module.defineModuleFunction("caller", callbackFactory.getOptSingletonMethod("caller")); module.defineModuleFunction("catch", callbackFactory.getSingletonMethod("rbCatch", IRubyObject.class)); module.defineModuleFunction("chomp", callbackFactory.getOptSingletonMethod("chomp")); module.defineModuleFunction("chomp!", callbackFactory.getOptSingletonMethod("chomp_bang")); module.defineModuleFunction("chop", callbackFactory.getSingletonMethod("chop")); module.defineModuleFunction("chop!", callbackFactory.getSingletonMethod("chop_bang")); module.defineModuleFunction("eval", callbackFactory.getOptSingletonMethod("eval")); module.defineModuleFunction("exit", callbackFactory.getOptSingletonMethod("exit")); module.defineModuleFunction("exit!", callbackFactory.getOptSingletonMethod("exit_bang")); module.defineModuleFunction("fail", callbackFactory.getOptSingletonMethod("raise")); // TODO: Implement Kernel#fork module.defineModuleFunction("format", callbackFactory.getOptSingletonMethod("sprintf")); module.defineModuleFunction("gets", callbackFactory.getOptSingletonMethod("gets")); module.defineModuleFunction("global_variables", callbackFactory.getSingletonMethod("global_variables")); module.defineModuleFunction("gsub", callbackFactory.getOptSingletonMethod("gsub")); module.defineModuleFunction("gsub!", callbackFactory.getOptSingletonMethod("gsub_bang")); // TODO: Add deprecation to Kernel#iterator? (maybe formal deprecation mech.) module.defineModuleFunction("iterator?", callbackFactory.getSingletonMethod("block_given")); module.defineModuleFunction("lambda", callbackFactory.getSingletonMethod("proc")); module.defineModuleFunction("load", callbackFactory.getOptSingletonMethod("load")); module.defineModuleFunction("local_variables", callbackFactory.getSingletonMethod("local_variables")); module.defineModuleFunction("loop", callbackFactory.getSingletonMethod("loop")); // Note: method_missing is documented as being in Object, but ruby appears to stick it in Kernel. module.defineModuleFunction("method_missing", callbackFactory.getOptSingletonMethod("method_missing")); module.defineModuleFunction("open", callbackFactory.getOptSingletonMethod("open")); module.defineModuleFunction("p", callbackFactory.getOptSingletonMethod("p")); module.defineModuleFunction("print", callbackFactory.getOptSingletonMethod("print")); module.defineModuleFunction("printf", callbackFactory.getOptSingletonMethod("printf")); module.defineModuleFunction("proc", callbackFactory.getSingletonMethod("proc")); // TODO: implement Kernel#putc module.defineModuleFunction("puts", callbackFactory.getOptSingletonMethod("puts")); module.defineModuleFunction("raise", callbackFactory.getOptSingletonMethod("raise")); module.defineModuleFunction("rand", callbackFactory.getOptSingletonMethod("rand")); module.defineModuleFunction("readline", callbackFactory.getOptSingletonMethod("readline")); module.defineModuleFunction("readlines", callbackFactory.getOptSingletonMethod("readlines")); module.defineModuleFunction("require", callbackFactory.getSingletonMethod("require", IRubyObject.class)); module.defineModuleFunction("scan", callbackFactory.getSingletonMethod("scan", IRubyObject.class)); module.defineModuleFunction("select", callbackFactory.getOptSingletonMethod("select")); module.defineModuleFunction("set_trace_func", callbackFactory.getSingletonMethod("set_trace_func", IRubyObject.class)); module.defineModuleFunction("sleep", callbackFactory.getSingletonMethod("sleep", IRubyObject.class)); module.defineModuleFunction("split", callbackFactory.getOptSingletonMethod("split")); module.defineModuleFunction("sprintf", callbackFactory.getOptSingletonMethod("sprintf")); module.defineModuleFunction("srand", callbackFactory.getOptSingletonMethod("srand")); module.defineModuleFunction("sub", callbackFactory.getOptSingletonMethod("sub")); module.defineModuleFunction("sub!", callbackFactory.getOptSingletonMethod("sub_bang")); // Skipping: Kernel#syscall (too system dependent) module.defineModuleFunction("system", callbackFactory.getOptSingletonMethod("system")); // TODO: Implement Kernel#exec differently? module.defineModuleFunction("exec", callbackFactory.getOptSingletonMethod("system")); // TODO: Implement Kernel#test (partial impl) module.defineModuleFunction("throw", callbackFactory.getOptSingletonMethod("rbThrow")); // TODO: Implement Kernel#trace_var module.defineModuleFunction("trap", callbackFactory.getOptSingletonMethod("trap")); // TODO: Implement Kernel#untrace_var module.defineModuleFunction("warn", callbackFactory.getSingletonMethod("warn", IRubyObject.class)); // Defined p411 Pickaxe 2nd ed. module.defineModuleFunction("singleton_method_added", callbackFactory.getSingletonMethod("singleton_method_added", IRubyObject.class)); // Object methods module.definePublicModuleFunction("==", objectCallbackFactory.getMethod("equal", IRubyObject.class)); module.defineAlias("===", "=="); module.defineAlias("eql?", "=="); module.definePublicModuleFunction("to_s", objectCallbackFactory.getMethod("to_s")); module.definePublicModuleFunction("nil?", objectCallbackFactory.getMethod("nil_p")); module.definePublicModuleFunction("to_a", callbackFactory.getSingletonMethod("to_a")); module.definePublicModuleFunction("hash", objectCallbackFactory.getMethod("hash")); module.definePublicModuleFunction("id", objectCallbackFactory.getMethod("id")); module.defineAlias("__id__", "id"); module.defineAlias("object_id", "id"); module.definePublicModuleFunction("is_a?", objectCallbackFactory.getMethod("kind_of", IRubyObject.class)); module.defineAlias("kind_of?", "is_a?"); module.definePublicModuleFunction("dup", objectCallbackFactory.getMethod("dup")); module.definePublicModuleFunction("equal?", objectCallbackFactory.getMethod("same", IRubyObject.class)); module.definePublicModuleFunction("type", objectCallbackFactory.getMethod("type_deprecated")); module.definePublicModuleFunction("class", objectCallbackFactory.getMethod("type")); module.definePublicModuleFunction("inspect", objectCallbackFactory.getMethod("inspect")); module.definePublicModuleFunction("=~", objectCallbackFactory.getMethod("match", IRubyObject.class)); module.definePublicModuleFunction("clone", objectCallbackFactory.getMethod("rbClone")); module.definePublicModuleFunction("display", objectCallbackFactory.getOptMethod("display")); module.definePublicModuleFunction("extend", objectCallbackFactory.getOptMethod("extend")); module.definePublicModuleFunction("freeze", objectCallbackFactory.getMethod("freeze")); module.definePublicModuleFunction("frozen?", objectCallbackFactory.getMethod("frozen")); module.defineModuleFunction("initialize_copy", objectCallbackFactory.getMethod("initialize_copy", IRubyObject.class)); module.definePublicModuleFunction("instance_eval", objectCallbackFactory.getOptMethod("instance_eval")); module.definePublicModuleFunction("instance_of?", objectCallbackFactory.getMethod("instance_of", IRubyObject.class)); module.definePublicModuleFunction("instance_variables", objectCallbackFactory.getMethod("instance_variables")); module.definePublicModuleFunction("instance_variable_get", objectCallbackFactory.getMethod("instance_variable_get", IRubyObject.class)); module.definePublicModuleFunction("instance_variable_set", objectCallbackFactory.getMethod("instance_variable_set", IRubyObject.class, IRubyObject.class)); module.definePublicModuleFunction("method", objectCallbackFactory.getMethod("method", IRubyObject.class)); module.definePublicModuleFunction("methods", objectCallbackFactory.getOptMethod("methods")); module.definePublicModuleFunction("private_methods", objectCallbackFactory.getMethod("private_methods")); module.definePublicModuleFunction("protected_methods", objectCallbackFactory.getMethod("protected_methods")); module.definePublicModuleFunction("public_methods", objectCallbackFactory.getOptMethod("public_methods")); module.defineModuleFunction("remove_instance_variable", objectCallbackFactory.getMethod("remove_instance_variable", IRubyObject.class)); module.definePublicModuleFunction("respond_to?", objectCallbackFactory.getOptMethod("respond_to")); module.definePublicModuleFunction("send", objectCallbackFactory.getOptMethod("send")); module.defineAlias("__send__", "send"); module.definePublicModuleFunction("singleton_methods", objectCallbackFactory.getMethod("singleton_methods")); module.definePublicModuleFunction("taint", objectCallbackFactory.getMethod("taint")); module.definePublicModuleFunction("tainted?", objectCallbackFactory.getMethod("tainted")); module.definePublicModuleFunction("untaint", objectCallbackFactory.getMethod("untaint")); return module; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7a32a4636ecb1df6caaf05de241ff89fc6fd721a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
show(currentWin, p.x, p.y); | Point pNew = SwingUtilities.convertPoint(currentWin, p.x, p.y, null); show(currentWin.getParent(), pNew.x, pNew.y); | private void showMenu() { Point p = currentWin.getPopupPoint(); show(currentWin, p.x, p.y); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/11fc11c4e769e382f5279d4e21088d468940d1b6/ThumbWinPopupMenu.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/ThumbWinPopupMenu.java |
public Object get(int i){ if ((i<1) || (i>fields.size())){ return _tbl.formatError("Invalid index: " + i + ". The column index must be between 1 and " + fields.size()); | public Object get(Object key){ Object o = super.get((_tbl.isCaseSensitive()) ? key : key.toString().toUpperCase()); if ((o == null) && (!fields.contains(key))){ return _tbl.formatError( key + " is not a column of this table!"); | public Object get(int i){ if ((i<1) || (i>fields.size())){ return _tbl.formatError("Invalid index: " + i + ". The column index must be between 1 and " + fields.size()); } return fields.getEntry(i-1); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/5729b41ccfce450fabc642c0d322460672dd0ddb/SimpleTableRow.java/buggy/contrib/DataTable/org/webmacro/datatable/SimpleTableRow.java |
return fields.getEntry(i-1); | return o; | public Object get(int i){ if ((i<1) || (i>fields.size())){ return _tbl.formatError("Invalid index: " + i + ". The column index must be between 1 and " + fields.size()); } return fields.getEntry(i-1); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/5729b41ccfce450fabc642c0d322460672dd0ddb/SimpleTableRow.java/buggy/contrib/DataTable/org/webmacro/datatable/SimpleTableRow.java |
if (argsNode.getBlockArgNode() != null) { | if (argsNode.getBlockArgNode() != null && ruby.isBlockGiven()) { | public RubyObject execute(Ruby ruby, RubyObject receiver, String name, RubyObject[] args, boolean noSuper) { if (args == null) { args = new RubyObject[0]; } RubyProc optionalBlockArg = null; if (argsNode.getBlockArgNode() != null) { optionalBlockArg = RubyProc.newProc(ruby, ruby.getClasses().getProcClass()); } ruby.getScope().push(); Namespace savedNamespace = null; if (namespace != null) { savedNamespace = ruby.getNamespace(); ruby.setNamespace(namespace); ruby.getActFrame().setNamespace(namespace); } if (body.getLocalNames() != null) { ruby.getScope().setLocalValues(new ArrayList(Collections.nCopies(body.getLocalNames().size(), ruby.getNil()))); ruby.getScope().setLocalNames(body.getLocalNames()); } RubyVarmap.push(ruby); try { if (argsNode != null) { int i = argsNode.getArgsCount(); if (i > args.length) { throw new ArgumentError(ruby, "Wrong # of arguments(" + args.length + " for " + i + ")"); } if (argsNode.getRestArg() == -1 && argsNode.getOptArgs() != null) { int opt = i; IListNode optNode = argsNode.getOptArgs(); Iterator iter = optNode.iterator(); while (iter.hasNext()) { iter.next(); opt++; } if (opt < args.length) { throw new ArgumentError(ruby, "wrong # of arguments(" + args.length + " for " + opt + ")"); } // XXX ruby.getActFrame().setArgs(Arrays.asList(args)); } if (ruby.getScope().getLocalValues() != null) { if (i > 0) { for (int j = 0; j < i; j++) { ruby.getScope().setValue(j + 2, args[j]); } } if (argsNode.getOptArgs() != null) { IListNode optArgs = argsNode.getOptArgs(); Iterator iter = optArgs.iterator(); for (int j = i; j < args.length && iter.hasNext(); j++) { new AssignmentVisitor(ruby, receiver).assign((INode)iter.next(), args[j], true); i++; } // assign the default values. while (iter.hasNext()) { new EvaluateVisitor(ruby, receiver).eval((INode)iter.next()); } } if (argsNode.getRestArg() >= 0) { RubyArray array = null; if (args.length > i) { array = RubyArray.newArray(ruby, Arrays.asList(args).subList(i, args.length)); } else { array = RubyArray.newArray(ruby, 0); } ruby.getScope().setValue(argsNode.getRestArg(), array); } } } if (optionalBlockArg != null) { ruby.getScope().setValue(argsNode.getBlockArgNode().getCount(), optionalBlockArg); } if (ruby.getRuntime().getTraceFunction() != null) { //a lot of complication to try to get a line number and a file name //without a NullPointerException ISourcePosition lPos = null; if (body != null) if (body.getBodyNode() != null) if(body.getBodyNode().getPosition() != null) lPos = body.getBodyNode().getPosition(); else ; else if (body.getPosition() != null) lPos = body.getPosition(); else ; else if (argsNode != null) lPos = argsNode.getPosition(); String lFile = ruby.getSourceFile(); int lLine = ruby.getSourceLine(); if (lPos != null) { lFile = lPos.getFile(); lLine = lPos.getLine(); } ruby.getRuntime().callTraceFunction("call", lFile, lLine, receiver, name, getImplementationClass()); // XXX } return receiver.eval(body.getBodyNode()); // skip scope assignment } catch (ReturnException rExcptn) { return rExcptn.getReturnValue(); } finally { RubyVarmap.pop(ruby); ruby.getScope().pop(); if (savedNamespace != null) { ruby.setNamespace(savedNamespace); } if (ruby.getRuntime().getTraceFunction() != null) { String file = ruby.getFrameStack().getPrevious().getFile(); int line = ruby.getFrameStack().getPrevious().getLine(); if (file == null) { file = ruby.getSourceFile(); line = ruby.getSourceLine(); } ruby.getRuntime().callTraceFunction("return", file, line, receiver, name, getImplementationClass()); // XXX } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/af3b33b4255b64ca8a03cfabfd2435bc65c83091/DefaultMethod.java/buggy/org/jruby/internal/runtime/methods/DefaultMethod.java |
runtime.getBlockStack().getCurrent().getScope().setVisibility(Visibility.PUBLIC); | private IRubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { Block savedBlock = runtime.getBlockStack().getCurrent().cloneBlock(); Namespace ns = runtime.getCurrentFrame().getNamespace(); runtime.getBlockStack().getCurrent().getFrame().setNamespace(ns); try { return runtime.yield(args[0], args[0], runtime.getRubyClass(), false); } finally { runtime.getBlockStack().setCurrent(savedBlock); } } public Arity getArity() { return Arity.optional(); } }, new IRubyObject[] { this }); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f848ba29fc8a834cb1adbc99411904d4a2393723/RubyObject.java/buggy/src/org/jruby/RubyObject.java |
|
runtime.getBlockStack().getCurrent().getScope().setVisibility(Visibility.PUBLIC); | public IRubyObject execute(IRubyObject self, IRubyObject[] args) { Block savedBlock = runtime.getBlockStack().getCurrent().cloneBlock(); Namespace ns = runtime.getCurrentFrame().getNamespace(); runtime.getBlockStack().getCurrent().getFrame().setNamespace(ns); try { return runtime.yield(args[0], args[0], runtime.getRubyClass(), false); } finally { runtime.getBlockStack().setCurrent(savedBlock); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f848ba29fc8a834cb1adbc99411904d4a2393723/RubyObject.java/buggy/src/org/jruby/RubyObject.java |
|
log.info("loadCGCI-C:"+data.cId); | public Object testLoadCGCIHierarchyCategory(){ setUp(); log.info("loadCGCI-C:"+data.cId); hbw.loadHierarchy(CategoryData.class, data.cId, observer); return observer.result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/ShoolaGrinderTest.java/clean/components/test/src/org/openmicroscopy/shoola/env/data/t/ShoolaGrinderTest.java |
|
log.info("loadCGCI-CG:"+data.cgId); | public Object testLoadCGCIHierarchyCategoryGroup(){ setUp(); log.info("loadCGCI-CG:"+data.cgId); hbw.loadHierarchy(CategoryGroupData.class, data.cgId, observer); return observer.result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/ShoolaGrinderTest.java/clean/components/test/src/org/openmicroscopy/shoola/env/data/t/ShoolaGrinderTest.java |
|
System.out.println(doc); | public void testSearch() throws IOException, ParseException{ IndexSearcher is = new IndexSearcher("/tmp/j"); Analyzer analyzer = new StandardAnalyzer(); QueryParser parser = new QueryParser("class", analyzer); Query query = parser.parse("Roi"); Hits hits = is.search(query); for (int i=0; i<hits.length(); i++) { Document doc = hits.doc(i); // display the articles that were found to the user } is.close(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1713e2c03207b5a19e514c71f0f3e4c76ef3e020/ModelTest.java/buggy/components/server/meta/ome/ModelTest.java |
|
setCategories (new HashSet( | setCategories (makeSet( cg.sizeOfCategoryLinks(), | public void copy(IObject model, ModelMapper mapper) { if (model instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) model; super.copy(model,mapper); // Details if (cg.getDetails()!=null){ this.setOwner((ExperimenterData) mapper.findTarget( cg.getDetails().getOwner())); } // Fields this.setName(cg.getName()); this.setDescription(cg.getDescription()); // Collections setCategories (new HashSet( cg.eachLinkedCategory( new MapperBlock( mapper ) ))); // FIXME this won't work. Needs CGCL as pointer to original // otherwise you get non-referential integrity } else { throw new IllegalArgumentException( "CategoryGroupData can only copy from CategoryGroup types"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9638b50efec05ce0b3d19bbef1c149c757b964aa/CategoryGroupData.java/clean/components/shoola-adapter/src/pojos/CategoryGroupData.java |
public void copy(IObject model, ModelMapper mapper) { if (model instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) model; super.copy(model,mapper); // Details if (cg.getDetails()!=null){ this.setOwner((ExperimenterData) mapper.findTarget( cg.getDetails().getOwner())); } // Fields this.setName(cg.getName()); this.setDescription(cg.getDescription()); // Collections setCategories (new HashSet( cg.eachLinkedCategory( new MapperBlock( mapper ) ))); // FIXME this won't work. Needs CGCL as pointer to original // otherwise you get non-referential integrity } else { throw new IllegalArgumentException( "CategoryGroupData can only copy from CategoryGroup types"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9638b50efec05ce0b3d19bbef1c149c757b964aa/CategoryGroupData.java/clean/components/shoola-adapter/src/pojos/CategoryGroupData.java |
||
setToolTipText(((SemanticTypeTree.TreeNode)value).getFQName()); | setToolTipText(getToolTip(value)); | public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree,value,sel,expanded, leaf,row,hasFocus); int nodeType = getNodeType(value); if(nodeType == STRING_NODE) { setIcon(stringIcon); } else if(nodeType == NUMERIC_NODE) { setIcon(numericIcon); } else if(nodeType == ATTRIBUTE_NODE) { setIcon(typeIcon); } else if(nodeType == BOOLEAN_NODE) { setIcon(booleanIcon); } setToolTipText(((SemanticTypeTree.TreeNode)value).getFQName()); return this; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/4cf433422d8c15e5f7030e055c5c942d76836275/HeatMapTreeRenderer.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapTreeRenderer.java |
Enumeration enum = elements(); | Enumeration enumeration = elements(); | final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enum = elements(); while (enum.hasMoreElements()) { Object txt = enum.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/66b6fa23bd4cbc41e75a36f1705ebb0db3d2f013/QuotedStringBuilder.java/clean/webmacro/src/org/webmacro/engine/QuotedStringBuilder.java |
while (enum.hasMoreElements()) | while (enumeration.hasMoreElements()) | final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enum = elements(); while (enum.hasMoreElements()) { Object txt = enum.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/66b6fa23bd4cbc41e75a36f1705ebb0db3d2f013/QuotedStringBuilder.java/clean/webmacro/src/org/webmacro/engine/QuotedStringBuilder.java |
Object txt = enum.nextElement(); | Object txt = enumeration.nextElement(); | final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enum = elements(); while (enum.hasMoreElements()) { Object txt = enum.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/66b6fa23bd4cbc41e75a36f1705ebb0db3d2f013/QuotedStringBuilder.java/clean/webmacro/src/org/webmacro/engine/QuotedStringBuilder.java |
if (str.length() > 0) { qs.addElement(str.toString()); } if (qs.size() == 1) { return qs.elementAt(0); } else { return qs; } } | final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enum = elements(); while (enum.hasMoreElements()) { Object txt = enum.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/66b6fa23bd4cbc41e75a36f1705ebb0db3d2f013/QuotedStringBuilder.java/clean/webmacro/src/org/webmacro/engine/QuotedStringBuilder.java |
|
c = AnnotationMapper.buildImageAnnotationCriteria(ids); | c = AnnotationMapper.buildImageAnnotationCriteria(ids, uc.getUserID()); | private CategoryData getCategory(int id, boolean withAnnotation) throws DSOutOfServiceException, DSAccessException { //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); //Retrieve the specified category. Criteria c = CategoryMapper.buildClassificationCriteria(id); Category category = (Category) gateway.retrieveSTSData("Category", c); CategoryData model = new CategoryData(); if (category != null) CategoryMapper.fillCategory(category, model, uc.getUserID()); if (withAnnotation) { List imgs = model.getImages(); if (imgs.size() != 0) { //i.e. some classifications List ids = new ArrayList(); Iterator i = imgs.iterator(); while (i.hasNext()) ids.add(new Integer(((ImageSummary) i.next()).getID())); c = AnnotationMapper.buildImageAnnotationCriteria(ids); List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); CategoryMapper.fillImageAnnotationInCategory( model.getClassifications(), l, uc.getUserID()); } } return model; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
private CategoryData getCategory(int id, boolean withAnnotation) throws DSOutOfServiceException, DSAccessException { //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); //Retrieve the specified category. Criteria c = CategoryMapper.buildClassificationCriteria(id); Category category = (Category) gateway.retrieveSTSData("Category", c); CategoryData model = new CategoryData(); if (category != null) CategoryMapper.fillCategory(category, model, uc.getUserID()); if (withAnnotation) { List imgs = model.getImages(); if (imgs.size() != 0) { //i.e. some classifications List ids = new ArrayList(); Iterator i = imgs.iterator(); while (i.hasNext()) ids.add(new Integer(((ImageSummary) i.next()).getID())); c = AnnotationMapper.buildImageAnnotationCriteria(ids); List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); CategoryMapper.fillImageAnnotationInCategory( model.getClassifications(), l, uc.getUserID()); } } return model; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
||
model.getClassifications(), l, uc.getUserID()); | model.getClassifications(), l); | private CategoryData getCategory(int id, boolean withAnnotation) throws DSOutOfServiceException, DSAccessException { //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); //Retrieve the specified category. Criteria c = CategoryMapper.buildClassificationCriteria(id); Category category = (Category) gateway.retrieveSTSData("Category", c); CategoryData model = new CategoryData(); if (category != null) CategoryMapper.fillCategory(category, model, uc.getUserID()); if (withAnnotation) { List imgs = model.getImages(); if (imgs.size() != 0) { //i.e. some classifications List ids = new ArrayList(); Iterator i = imgs.iterator(); while (i.hasNext()) ids.add(new Integer(((ImageSummary) i.next()).getID())); c = AnnotationMapper.buildImageAnnotationCriteria(ids); List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); CategoryMapper.fillImageAnnotationInCategory( model.getClassifications(), l, uc.getUserID()); } } return model; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
group.getID()); | group.getID(), uc.getUserID()); | public List retrieveCategoriesNotInGroup(CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { //List of categorySummary objects List result = new ArrayList(); Criteria c = CategoryMapper.buildCategoryWithClassificationsCriteria( group.getID()); List l = (List) gateway.retrieveListSTSData("Category", c); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); | public List retrieveCategoriesNotInGroup(CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { //List of categorySummary objects List result = new ArrayList(); Criteria c = CategoryMapper.buildCategoryWithClassificationsCriteria( group.getID()); List l = (List) gateway.retrieveListSTSData("Category", c); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
|
CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); | CategoryMapper.fillCategoryWithClassifications(l, result, group); | public List retrieveCategoriesNotInGroup(CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { //List of categorySummary objects List result = new ArrayList(); Criteria c = CategoryMapper.buildCategoryWithClassificationsCriteria( group.getID()); List l = (List) gateway.retrieveListSTSData("Category", c); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
Criteria c = CategoryMapper.buildCategoryGroupCriteria(-1); List l = (List) gateway.retrieveListSTSData("CategoryGroup", c); | UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); Criteria c = CategoryMapper.buildCategoryGroupCriteria(-1, uc.getUserID()); List l = (List) gateway.retrieveListSTSData("CategoryGroup", c); | public List retrieveCategoryGroups() throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildCategoryGroupCriteria(-1); List l = (List) gateway.retrieveListSTSData("CategoryGroup", c); List result = new ArrayList(); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryGroup(l, result, uc.getUserID()); return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); | public List retrieveCategoryGroups() throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildCategoryGroupCriteria(-1); List l = (List) gateway.retrieveListSTSData("CategoryGroup", c); List result = new ArrayList(); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryGroup(l, result, uc.getUserID()); return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
|
Criteria c = HierarchyMapper.buildICGHierarchyCriteria(ids); | UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); Criteria c = HierarchyMapper.buildICGHierarchyCriteria(ids, uc.getUserID()); | public Object[] retrieveICGHierarchy(List imageSummaries) throws DSOutOfServiceException, DSAccessException { if (imageSummaries == null) throw new NullPointerException("List of imageSummaries " + "cannot be null"); if (imageSummaries.size() == 0) throw new IllegalArgumentException("List of imageSummaries " + "cannot be of length 0"); Iterator i = imageSummaries.iterator(); ImageSummary is; Map map = new HashMap(); List ids = new ArrayList(); Integer id; while (i.hasNext()) { is = (ImageSummary) i.next(); id = new Integer(is.getID()); map.put(id, is); ids.add(id); } Criteria c = HierarchyMapper.buildICGHierarchyCriteria(ids); List classifications = (List) gateway.retrieveListSTSData("Classification", c); if (classifications == null) return null; UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); return HierarchyMapper.fillICGHierarchy(classifications, map, uc.getUserID()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); return HierarchyMapper.fillICGHierarchy(classifications, map, uc.getUserID()); | return HierarchyMapper.fillICGHierarchy(classifications, map); | public Object[] retrieveICGHierarchy(List imageSummaries) throws DSOutOfServiceException, DSAccessException { if (imageSummaries == null) throw new NullPointerException("List of imageSummaries " + "cannot be null"); if (imageSummaries.size() == 0) throw new IllegalArgumentException("List of imageSummaries " + "cannot be of length 0"); Iterator i = imageSummaries.iterator(); ImageSummary is; Map map = new HashMap(); List ids = new ArrayList(); Integer id; while (i.hasNext()) { is = (ImageSummary) i.next(); id = new Integer(is.getID()); map.put(id, is); ids.add(id); } Criteria c = HierarchyMapper.buildICGHierarchyCriteria(ids); List classifications = (List) gateway.retrieveListSTSData("Classification", c); if (classifications == null) return null; UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); return HierarchyMapper.fillICGHierarchy(classifications, map, uc.getUserID()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
Criteria c = CategoryMapper.buildBasicCriteria(data.getID()); | UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); Criteria c = CategoryMapper.buildBasicCriteria(data.getID(), uc.getUserID()); | public void updateCategory(CategoryData data, List imgsToRemove, List imgsToAdd) throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildBasicCriteria(data.getID()); Category category = (Category) gateway.retrieveSTSData("Category", c); category.setName(data.getName()); category.setDescription(data.getDescription()); List toUpdate = new ArrayList(), newAttributes = new ArrayList(); toUpdate.add(category); //Map classifications = data.getClassifications(); Map classifications = data.getImageClassifications(); ClassificationData cData; Classification classification; //Images to declassify if (imgsToRemove != null) { Iterator i = imgsToRemove.iterator(); List l; Iterator k; ImageSummary is; while (i.hasNext()) { is = (ImageSummary) i.next(); l = (List) classifications.get(new Integer(is.getID())); if (l != null) { k = l.iterator(); while(k.hasNext()) { cData = (ClassificationData) k.next(); c = CategoryMapper.buildBasicClassificationCriteria( cData.getID()); classification = (Classification) gateway.retrieveSTSData("Classification", c); classification.setValid(Boolean.FALSE); toUpdate.add(classification); } } } } //Images to classify if (imgsToAdd != null) { Iterator j = imgsToAdd.iterator(); Object[] results; while (j.hasNext()) { results = buildClassification(category, ((ImageSummary) j.next()).getID()); classification = (Classification) results[1]; if (((Boolean) results[0]).booleanValue()) { newAttributes.add(classification); gateway.annotateAttributesData(newAttributes); newAttributes.removeAll(newAttributes); } else toUpdate.add(classification); } } if (newAttributes.size() != 0) //to have a mex gateway.annotateAttributesData(newAttributes); gateway.updateAttributes(toUpdate); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
Criteria c = CategoryMapper.buildBasicCriteria(data.getID()); | UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); Criteria c = CategoryMapper.buildBasicCriteria(data.getID(), uc.getUserID()); | public void updateCategoryGroup(CategoryGroupData data, List toAdd) throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildBasicCriteria(data.getID()); CategoryGroup cg = (CategoryGroup) gateway.retrieveSTSData("CategoryGroup", c); cg.setName(data.getName()); cg.setDescription(data.getDescription()); List l = new ArrayList(); l.add(cg); gateway.updateAttributes(l); /* Need to discuss the semantic of the operation //Prepare the categories to add or remove. List categories = data.getCategories(); CategorySummary cs; if (toAdd != null) { Iterator j = toAdd.iterator(); while (j.hasNext()) { cs = (CategorySummary) j.next(); if (!categories.contains(cs)) categories.add(cs); } } Iterator k = categories.iterator(); List newSelection = new ArrayList(); while (k.hasNext()) { cs = (CategorySummary) k.next(); c = CategoryMapper.buildBasicCriteria(cs.getID()); newSelection.add(gateway.retrieveSTSData("Category", c)); } */ } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/STSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/STSAdapter.java |
public static void fillImageAnnotationInCategory(Map map, List annotations, int userID) | public static void fillImageAnnotationInCategory(Map map, List annotations) | public static void fillImageAnnotationInCategory(Map map, List annotations, int userID) { Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); Iterator i = map.keySet().iterator(); ImageSummary is; while (i.hasNext()) { is = (ImageSummary) i.next(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(is.getID())))); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); | Map ids = AnnotationMapper.reverseListImageAnnotations(annotations); | public static void fillImageAnnotationInCategory(Map map, List annotations, int userID) { Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); Iterator i = map.keySet().iterator(); ImageSummary is; while (i.hasNext()) { is = (ImageSummary) i.next(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(is.getID())))); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
public static Criteria buildCategoryWithClassificationsCriteria(int groupID) | public static Criteria buildCategoryWithClassificationsCriteria(int groupID, int userID) | public static Criteria buildCategoryWithClassificationsCriteria(int groupID) { Criteria c = new Criteria(); c.addWantedField("Name"); c.addWantedField("CategoryGroup"); c.addWantedField("ClassificationList"); c.addWantedField("ClassificationList", "Valid"); c.addWantedField("ClassificationList", "image"); //Fields we want for the images c.addWantedField("ClassificationList", "module_execution"); c.addWantedField("ClassificationList.module_execution", "experimenter"); //Specify which fields we want for the owner. c.addWantedField("module_execution"); c.addWantedField("module_execution", "experimenter"); //Specify which fields we want for the owner. if (groupID != -1) c.addFilter("CategoryGroup", "!=", new Integer(groupID)); return c; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
c.addWantedField("module_execution"); c.addWantedField("module_execution", "experimenter"); | public static Criteria buildCategoryWithClassificationsCriteria(int groupID) { Criteria c = new Criteria(); c.addWantedField("Name"); c.addWantedField("CategoryGroup"); c.addWantedField("ClassificationList"); c.addWantedField("ClassificationList", "Valid"); c.addWantedField("ClassificationList", "image"); //Fields we want for the images c.addWantedField("ClassificationList", "module_execution"); c.addWantedField("ClassificationList.module_execution", "experimenter"); //Specify which fields we want for the owner. c.addWantedField("module_execution"); c.addWantedField("module_execution", "experimenter"); //Specify which fields we want for the owner. if (groupID != -1) c.addFilter("CategoryGroup", "!=", new Integer(groupID)); return c; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
|
if (userID != -1) c.addFilter("module_execution.experimenter_id", new Integer(userID)); | public static Criteria buildCategoryWithClassificationsCriteria(int groupID) { Criteria c = new Criteria(); c.addWantedField("Name"); c.addWantedField("CategoryGroup"); c.addWantedField("ClassificationList"); c.addWantedField("ClassificationList", "Valid"); c.addWantedField("ClassificationList", "image"); //Fields we want for the images c.addWantedField("ClassificationList", "module_execution"); c.addWantedField("ClassificationList.module_execution", "experimenter"); //Specify which fields we want for the owner. c.addWantedField("module_execution"); c.addWantedField("module_execution", "experimenter"); //Specify which fields we want for the owner. if (groupID != -1) c.addFilter("CategoryGroup", "!=", new Integer(groupID)); return c; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
|
CategoryGroupData group, int userID) | CategoryGroupData group) | public static void fillCategoryWithClassifications(List l, List result, CategoryGroupData group, int userID) { //Map of ID of the images contained in the group. Map ids = new HashMap(); CategorySummary cs; Iterator i = group.getCategories().iterator(); Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } i = l.iterator(); Category c; Map categoryMap = new HashMap(); Integer id; while (i.hasNext()) { c = (Category) i.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) categoryMap.get(id); if (cs == null) { cs = createCategorySummary(c, ids); if (cs != null) { categoryMap.put(id, cs); result.add(cs); } } else result.add(cs); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) categoryMap.get(id); if (cs == null) { cs = createCategorySummary(c, ids); if (cs != null) { categoryMap.put(id, cs); result.add(cs); } } else result.add(cs); } | id = new Integer(c.getID()); cs = (CategorySummary) categoryMap.get(id); if (cs == null) { cs = createCategorySummary(c, ids); if (cs != null) { categoryMap.put(id, cs); result.add(cs); } } else result.add(cs); | public static void fillCategoryWithClassifications(List l, List result, CategoryGroupData group, int userID) { //Map of ID of the images contained in the group. Map ids = new HashMap(); CategorySummary cs; Iterator i = group.getCategories().iterator(); Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } i = l.iterator(); Category c; Map categoryMap = new HashMap(); Integer id; while (i.hasNext()) { c = (Category) i.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) categoryMap.get(id); if (cs == null) { cs = createCategorySummary(c, ids); if (cs != null) { categoryMap.put(id, cs); result.add(cs); } } else result.add(cs); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
if (cg.getModuleExecution().getExperimenter().getID() == userID) { cgd = buildCategoryGroup(cg); categories = new ArrayList(); if (cg.getCategoryList() != null) { j = cg.getCategoryList().iterator(); while (j.hasNext()) { c = (Category) j.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) cMap.get(id); if (cs == null) { cs = createCategorySummary(c, userID); cMap.put(id, cs); } categories.add(cs); | cgd = buildCategoryGroup(cg); categories = new ArrayList(); if (cg.getCategoryList() != null) { j = cg.getCategoryList().iterator(); while (j.hasNext()) { c = (Category) j.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) cMap.get(id); if (cs == null) { cs = createCategorySummary(c, userID); cMap.put(id, cs); | public static void fillCategoryGroup(List l, List result, int userID) { Map cMap = new HashMap(); Iterator i = l.iterator(); CategoryGroup cg; CategoryGroupData cgd; CategorySummary cs; Category c; Iterator j; List categories; Integer id; while (i.hasNext()) { cg = (CategoryGroup) i.next(); if (cg.getModuleExecution().getExperimenter().getID() == userID) { cgd = buildCategoryGroup(cg); categories = new ArrayList(); if (cg.getCategoryList() != null) { j = cg.getCategoryList().iterator(); while (j.hasNext()) { c = (Category) j.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) cMap.get(id); if (cs == null) { cs = createCategorySummary(c, userID); cMap.put(id, cs); } //Add the categories categories.add(cs); } } } cgd.setCategories(categories); result.add(cgd); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
cgd.setCategories(categories); result.add(cgd); | public static void fillCategoryGroup(List l, List result, int userID) { Map cMap = new HashMap(); Iterator i = l.iterator(); CategoryGroup cg; CategoryGroupData cgd; CategorySummary cs; Category c; Iterator j; List categories; Integer id; while (i.hasNext()) { cg = (CategoryGroup) i.next(); if (cg.getModuleExecution().getExperimenter().getID() == userID) { cgd = buildCategoryGroup(cg); categories = new ArrayList(); if (cg.getCategoryList() != null) { j = cg.getCategoryList().iterator(); while (j.hasNext()) { c = (Category) j.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) cMap.get(id); if (cs == null) { cs = createCategorySummary(c, userID); cMap.put(id, cs); } //Add the categories categories.add(cs); } } } cgd.setCategories(categories); result.add(cgd); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
|
cgd.setCategories(categories); result.add(cgd); | public static void fillCategoryGroup(List l, List result, int userID) { Map cMap = new HashMap(); Iterator i = l.iterator(); CategoryGroup cg; CategoryGroupData cgd; CategorySummary cs; Category c; Iterator j; List categories; Integer id; while (i.hasNext()) { cg = (CategoryGroup) i.next(); if (cg.getModuleExecution().getExperimenter().getID() == userID) { cgd = buildCategoryGroup(cg); categories = new ArrayList(); if (cg.getCategoryList() != null) { j = cg.getCategoryList().iterator(); while (j.hasNext()) { c = (Category) j.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) cMap.get(id); if (cs == null) { cs = createCategorySummary(c, userID); cMap.put(id, cs); } //Add the categories categories.add(cs); } } } cgd.setCategories(categories); result.add(cgd); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/CategoryMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
|
throw new RubyArgumentException(getRuby(), "wrong number of arguments"); | String msg = "Wrong number of arguments for method '" + ruby.getRubyFrame().getLastFunc() + "' in class " + getRubyClass().toName() + ". " + args.length + " is not in Range " + min + ".." + max; throw new RubyArgumentException(getRuby(), msg); | protected int argCount(RubyObject[] args, int min, int max) { int len = args.length; if (len < min || (max > -1 && len > max)) { throw new RubyArgumentException(getRuby(), "wrong number of arguments"); } return len; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f0711e7cbb2b441d095c8d8c0838be2b630638c/RubyObject.java/clean/org/jruby/RubyObject.java |
uiDelegate.setComponentsEnabled(false); | void save() { //TODO Add controls if annotated AnnotationData data = model.getUserAnnotationData(); String text = uiDelegate.getAnnotationText().trim(); if (data == null) { //creation Object ho = model.getHierarchyObject(); if (ho instanceof ImageData) data = new AnnotationData(AnnotationData.IMAGE_ANNOTATION); else if (ho instanceof DatasetData) data = new AnnotationData(AnnotationData.DATASET_ANNOTATION); data.setText(text); model.editAnnotation(data, ClipBoard.CREATE_ANNOTATION); } else { //update or delete if (uiDelegate.isAnnotationDeleted()) { model.editAnnotation(data, ClipBoard.DELETE_ANNOTATION); } else { data.setText(text); model.editAnnotation(data, ClipBoard.UPDATE_ANNOTATION); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fa3d7c2352dfbc9f73f26510e5aed556f4c86872/AnnotationPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/annotator/AnnotationPane.java |
|
return str.getValue().length() == 0 ? str.getRuntime().getNil() : str; | return (str.getValue().length() == 0 && ((org.jvyaml.nodes.ScalarNode)node).getStyle() == 0) ? str.getRuntime().getNil() : str; | public static Object constructYamlStr(final Constructor ctor, final Node node) { final org.jruby.RubyString str = (org.jruby.RubyString)((JRubyConstructor)ctor).constructRubyScalar(node); return str.getValue().length() == 0 ? str.getRuntime().getNil() : str; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6cb3a81e54d5a1bc0b4bbfbada7e947760f668f1/JRubyConstructor.java/clean/src/org/jruby/yaml/JRubyConstructor.java |
true); | false); | public void invoke(JFrame parentFrame, PreferencesPanel contentPane) { this.prefPanel = contentPane; // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); // Construct Dialog preferenceDialog = new JDialog(parentFrame, "Preferences", true); Object[] options = {"Close"}; pane = new JOptionPane(contentPane, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); preferenceDialog.pack(); preferenceDialog.setSize(600, 500); preferenceDialog.setContentPane(mainPanel); preferenceDialog.setLocationRelativeTo(SparkManager.getMainWindow()); pane.addPropertyChangeListener(this); preferenceDialog.setVisible(true); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/7645851bdaa2a933966642360f8bb4b56e708043/PreferenceDialog.java/clean/src/java/org/jivesoftware/sparkimpl/preference/PreferenceDialog.java |
throw new IllegalArgumentException("Could not load property editor: "+propertyEditor, e); | throw (IllegalArgumentException)new IllegalArgumentException("Could not load property editor: "+propertyEditor).initCause(e); | protected PropertyEditor createPropertyEditor(String propertyEditor) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if( cl==null ) { cl = XBeanNamespaceHandler.class.getClassLoader(); } try { return (PropertyEditor)cl.loadClass(propertyEditor).newInstance(); } catch (Throwable e){ throw new IllegalArgumentException("Could not load property editor: "+propertyEditor, e); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/354c41d6c2c4265c5e2ce703503def790f084e2e/XBeanNamespaceHandler.java/clean/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanNamespaceHandler.java |
if (ChainBuilderAgent.DEBUG) | if (ChainBuilderAgent.DEBUG_TIMING) | public Object getContents() { long start; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ChainDataManager chainDataManager = (ChainDataManager) dataManager; if (chains == null) { chains = chainDataManager.getChains(); } Iterator iter = chains.iterator(); while (iter.hasNext()) { LayoutChainData chain = (LayoutChainData) iter.next(); reconcileChain(chain); chain.layout(); } if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("total time in chain loader"+end); } return chains; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/630a53d68f5d29c53d2485557b18599785befb83/ChainLoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/data/ChainLoader.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public Object getContents() { long start; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ChainDataManager chainDataManager = (ChainDataManager) dataManager; if (chains == null) { chains = chainDataManager.getChains(); } Iterator iter = chains.iterator(); while (iter.hasNext()) { LayoutChainData chain = (LayoutChainData) iter.next(); reconcileChain(chain); chain.layout(); } if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("total time in chain loader"+end); } return chains; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/630a53d68f5d29c53d2485557b18599785befb83/ChainLoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/data/ChainLoader.java |
traceLines.add(new RubyString(interpreter, testLine(i))); | traceLines.add(RubyString.newString(interpreter, testLine(i))); | private void setBackTrace(int lineCount) { List traceLines = new ArrayList(); for (int i=0; i<lineCount; i++) traceLines.add(new RubyString(interpreter, testLine(i))); exception.set_backtrace(RubyArray.newArray(interpreter, traceLines)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/TestRubyException.java/clean/test/org/jruby/test/TestRubyException.java |
public void testPrintBacktraceWithHiddenLevels() throws Exception { setBackTrace(19); String[] lines = printError(); assertEquals(expectedTraceLine(1), lines[0]); assertEquals("\t ... 7 levels...", lines[RubyException.TRACE_HEAD]); assertEquals(expectedTraceLine(16), lines[RubyException.TRACE_HEAD + 1]); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/TestRubyException.java/clean/test/org/jruby/test/TestRubyException.java |
||
klass.equals(CategoryGroup.class)) | klass.equals(CategoryGroupData.class)) | private void checkClass(Class klass) { if (klass.equals(ProjectData.class) || klass.equals(CategoryGroup.class)) return; throw new IllegalArgumentException("Root node not supported."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/53473ec69ff72f3c6a693dea151fde37deb95ff1/RefreshDataLoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/RefreshDataLoader.java |
new BuiltinScript("zlib").load(runtime); | public void load(final IRuby runtime) throws IOException { RubyZlib.createZlibModule(runtime); new BuiltinScript("zlib").load(runtime); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/510a41b06f3103200e881725915b7cc1a5a10b39/ZlibLibrary.java/buggy/src/org/jruby/libraries/ZlibLibrary.java |
|
result.defineConstant("ZLIB_VERSION",runtime.newString("1.2.1")); result.defineConstant("VERSION",runtime.newString("0.6.0")); result.defineConstant("BINARY",runtime.newFixnum(0)); result.defineConstant("ASCII",runtime.newFixnum(1)); result.defineConstant("UNKNOWN",runtime.newFixnum(2)); result.defineConstant("DEF_MEM_LEVEL",runtime.newFixnum(8)); result.defineConstant("MAX_MEM_LEVEL",runtime.newFixnum(9)); result.defineConstant("OS_UNIX",runtime.newFixnum(3)); result.defineConstant("OS_UNKNOWN",runtime.newFixnum(255)); result.defineConstant("OS_CODE",runtime.newFixnum(11)); result.defineConstant("OS_ZSYSTEM",runtime.newFixnum(8)); result.defineConstant("OS_VMCMS",runtime.newFixnum(4)); result.defineConstant("OS_VMS",runtime.newFixnum(2)); result.defineConstant("OS_RISCOS",runtime.newFixnum(13)); result.defineConstant("OS_MACOS",runtime.newFixnum(7)); result.defineConstant("OS_OS2",runtime.newFixnum(6)); result.defineConstant("OS_AMIGA",runtime.newFixnum(1)); result.defineConstant("OS_QDOS",runtime.newFixnum(12)); result.defineConstant("OS_WIN32",runtime.newFixnum(11)); result.defineConstant("OS_ATARI",runtime.newFixnum(5)); result.defineConstant("OS_MSDOS",runtime.newFixnum(0)); result.defineConstant("OS_CPM",runtime.newFixnum(9)); result.defineConstant("OS_TOPS20",runtime.newFixnum(10)); result.defineConstant("DEFAULT_STRATEGY",runtime.newFixnum(0)); result.defineConstant("FILTERED",runtime.newFixnum(1)); result.defineConstant("HUFFMAN_ONLY",runtime.newFixnum(2)); result.defineConstant("NO_FLUSH",runtime.newFixnum(0)); result.defineConstant("SYNC_FLUSH",runtime.newFixnum(2)); result.defineConstant("FULL_FLUSH",runtime.newFixnum(3)); result.defineConstant("FINISH",runtime.newFixnum(4)); result.defineConstant("NO_COMPRESSION",runtime.newFixnum(0)); result.defineConstant("BEST_SPEED",runtime.newFixnum(1)); result.defineConstant("DEFAULT_COMPRESSION",runtime.newFixnum(-1)); result.defineConstant("BEST_COMPRESSION",runtime.newFixnum(9)); result.defineConstant("MAX_WBITS",runtime.newFixnum(15)); CallbackFactory cf = runtime.callbackFactory(RubyZlib.class); result.defineModuleFunction("zlib_version",cf.getSingletonMethod("zlib_version")); result.defineModuleFunction("version",cf.getSingletonMethod("version")); result.defineModuleFunction("adler32",cf.getOptSingletonMethod("adler32")); result.defineModuleFunction("crc32",cf.getOptSingletonMethod("crc32")); result.defineModuleFunction("crc_table",cf.getSingletonMethod("crc_table")); result.defineClassUnder("StreamEnd",zlibError); result.defineClassUnder("StreamError",zlibError); result.defineClassUnder("BufError",zlibError); result.defineClassUnder("NeedDict",zlibError); result.defineClassUnder("MemError",zlibError); result.defineClassUnder("VersionError",zlibError); result.defineClassUnder("DataError",zlibError); RubyClass gzError = gzfile.defineClassUnder("Error",zlibError); gzfile.defineClassUnder("CRCError",gzError); gzfile.defineClassUnder("NoFooter",gzError); gzfile.defineClassUnder("LengthError",gzError); RubyClass zstream = result.defineClassUnder("ZStream", runtime.getObject()); CallbackFactory zstreamcb = runtime.callbackFactory(ZStream.class); zstream.defineMethod("initialize",zstreamcb.getMethod("initialize")); zstream.defineMethod("flush_next_out",zstreamcb.getMethod("flush_next_out")); zstream.defineMethod("total_out",zstreamcb.getMethod("total_out")); zstream.defineMethod("stream_end?",zstreamcb.getMethod("stream_end_p")); zstream.defineMethod("data_type",zstreamcb.getMethod("data_type")); zstream.defineMethod("closed?",zstreamcb.getMethod("closed_p")); zstream.defineMethod("ended?",zstreamcb.getMethod("ended_p")); zstream.defineMethod("end",zstreamcb.getMethod("end")); zstream.defineMethod("reset",zstreamcb.getMethod("reset")); zstream.defineMethod("avail_out",zstreamcb.getMethod("avail_out")); zstream.defineMethod("avail_out=",zstreamcb.getMethod("set_avail_out",IRubyObject.class)); zstream.defineMethod("adler",zstreamcb.getMethod("adler")); zstream.defineMethod("finish",zstreamcb.getMethod("finish")); zstream.defineMethod("avail_in",zstreamcb.getMethod("avail_in")); zstream.defineMethod("flush_next_in",zstreamcb.getMethod("flush_next_in")); zstream.defineMethod("total_in",zstreamcb.getMethod("total_in")); zstream.defineMethod("finished?",zstreamcb.getMethod("finished_p")); zstream.defineMethod("close",zstreamcb.getMethod("close")); RubyClass infl = result.defineClassUnder("Inflate", zstream); CallbackFactory inflcb = runtime.callbackFactory(Inflate.class); infl.defineSingletonMethod("new",inflcb.getOptSingletonMethod("newInstance")); infl.defineSingletonMethod("inflate",inflcb.getSingletonMethod("s_inflate",IRubyObject.class)); infl.defineMethod("initialize",inflcb.getOptMethod("_initialize")); infl.defineMethod("<<",inflcb.getMethod("append",IRubyObject.class)); infl.defineMethod("sync_point?",inflcb.getMethod("sync_point_p")); infl.defineMethod("set_dictionary",inflcb.getMethod("set_dictionary",IRubyObject.class)); infl.defineMethod("inflate",inflcb.getMethod("inflate",IRubyObject.class)); infl.defineMethod("sync",inflcb.getMethod("sync",IRubyObject.class)); RubyClass defl = result.defineClassUnder("Deflate", zstream); CallbackFactory deflcb = runtime.callbackFactory(Deflate.class); defl.defineSingletonMethod("new",deflcb.getOptSingletonMethod("newInstance")); defl.defineSingletonMethod("deflate",deflcb.getOptSingletonMethod("s_deflate")); defl.defineMethod("initialize",deflcb.getOptMethod("_initialize")); defl.defineMethod("<<",deflcb.getMethod("append",IRubyObject.class)); defl.defineMethod("params",deflcb.getMethod("params",IRubyObject.class,IRubyObject.class)); defl.defineMethod("set_dictionary",deflcb.getMethod("set_dictionary",IRubyObject.class)); defl.defineMethod("flush",deflcb.getOptMethod("flush")); defl.defineMethod("deflate",deflcb.getOptMethod("deflate")); runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newString("stringio")); | public static RubyModule createZlibModule(IRuby runtime) { RubyModule result = runtime.defineModule("Zlib"); RubyClass gzfile = result.defineClassUnder("GzipFile", runtime.getObject()); CallbackFactory callbackFactory = runtime.callbackFactory(RubyGzipFile.class); gzfile.defineSingletonMethod("wrap", callbackFactory.getSingletonMethod("wrap", RubyGzipFile.class, IRubyObject.class)); gzfile.defineSingletonMethod("new", callbackFactory.getSingletonMethod("newCreate")); gzfile.defineMethod("os_code", callbackFactory.getMethod("os_code")); gzfile.defineMethod("closed?", callbackFactory.getMethod("closed_p")); gzfile.defineMethod("orig_name", callbackFactory.getMethod("orig_name")); gzfile.defineMethod("to_io", callbackFactory.getMethod("to_io")); gzfile.defineMethod("finish", callbackFactory.getMethod("finish")); gzfile.defineMethod("comment", callbackFactory.getMethod("comment")); gzfile.defineMethod("crc", callbackFactory.getMethod("crc")); gzfile.defineMethod("mtime", callbackFactory.getMethod("mtime")); gzfile.defineMethod("sync", callbackFactory.getMethod("sync")); gzfile.defineMethod("close", callbackFactory.getMethod("close")); gzfile.defineMethod("level", callbackFactory.getMethod("level")); gzfile.defineMethod("sync=", callbackFactory.getMethod("set_sync", IRubyObject.class)); RubyClass gzreader = result.defineClassUnder("GzipReader", gzfile); gzreader.includeModule(runtime.getModule("Enumerable")); CallbackFactory callbackFactory2 = runtime.callbackFactory(RubyGzipReader.class); gzreader.defineSingletonMethod("open", callbackFactory2.getSingletonMethod("open", RubyString.class)); gzreader.defineSingletonMethod("new", callbackFactory2.getOptSingletonMethod("newCreate")); gzreader.defineMethod("initialize", callbackFactory2.getMethod("initialize", IRubyObject.class)); gzreader.defineMethod("rewind", callbackFactory2.getMethod("rewind")); gzreader.defineMethod("lineno", callbackFactory2.getMethod("lineno")); gzreader.defineMethod("readline", callbackFactory2.getMethod("readline")); gzreader.defineMethod("read", callbackFactory2.getOptMethod("read")); gzreader.defineMethod("lineno=", callbackFactory2.getMethod("set_lineno", RubyNumeric.class)); gzreader.defineMethod("pos", callbackFactory2.getMethod("pos")); gzreader.defineMethod("readchar", callbackFactory2.getMethod("readchar")); gzreader.defineMethod("readlines", callbackFactory2.getOptMethod("readlines")); gzreader.defineMethod("each_byte", callbackFactory2.getMethod("each_byte")); gzreader.defineMethod("getc", callbackFactory2.getMethod("getc")); gzreader.defineMethod("eof", callbackFactory2.getMethod("eof")); gzreader.defineMethod("ungetc", callbackFactory2.getMethod("ungetc", RubyNumeric.class)); gzreader.defineMethod("each", callbackFactory2.getOptMethod("each")); gzreader.defineMethod("unused", callbackFactory2.getMethod("unused")); gzreader.defineMethod("eof?", callbackFactory2.getMethod("eof_p")); gzreader.defineMethod("gets", callbackFactory2.getOptMethod("gets")); gzreader.defineMethod("tell", callbackFactory2.getMethod("tell")); RubyClass zlibError = result.defineClassUnder("Error", runtime.getClass("StandardError")); gzreader.defineClassUnder("Error", zlibError); RubyClass gzwriter = result.defineClassUnder("GzipWriter", gzfile); CallbackFactory callbackFactory3 = runtime.callbackFactory(RubyGzipWriter.class); gzwriter.defineSingletonMethod("open", callbackFactory3.getOptSingletonMethod("open")); gzwriter.defineSingletonMethod("new", callbackFactory3.getOptSingletonMethod("newCreate")); gzwriter.defineMethod("initialize", callbackFactory3.getOptMethod("initialize2")); gzwriter.defineMethod("<<", callbackFactory3.getMethod("append", IRubyObject.class)); gzwriter.defineMethod("printf", callbackFactory3.getOptMethod("printf")); gzwriter.defineMethod("pos", callbackFactory3.getMethod("pos")); gzwriter.defineMethod("orig_name=", callbackFactory3.getMethod("set_orig_name", RubyString.class)); gzwriter.defineMethod("putc", callbackFactory3.getMethod("putc", RubyNumeric.class)); gzwriter.defineMethod("comment=", callbackFactory3.getMethod("set_comment", RubyString.class)); gzwriter.defineMethod("puts", callbackFactory3.getOptMethod("puts")); gzwriter.defineMethod("flush", callbackFactory3.getOptMethod("flush")); gzwriter.defineMethod("mtime=", callbackFactory3.getMethod("set_mtime", IRubyObject.class)); gzwriter.defineMethod("tell", callbackFactory3.getMethod("tell")); gzwriter.defineMethod("write", callbackFactory3.getMethod("write", IRubyObject.class)); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/510a41b06f3103200e881725915b7cc1a5a10b39/RubyZlib.java/buggy/src/org/jruby/RubyZlib.java |
|
original = annotation.getDataset(); | public void test_annotating_a_dataset_three() throws Exception { String name = " two rows "+System.currentTimeMillis(); String text = " two rows content "+System.currentTimeMillis(); String desc = " new description "+System.currentTimeMillis(); // Setup: original is our in-memory, used every where object. Dataset original = new Dataset(); original.setName( name ); original = (Dataset) iPojos.createDataObject( original, null ); assertTrue( original.getDetails().getCounts() == null || original.getDetails().getCounts().get( Dataset.ANNOTATIONS ) == null ); original.setDescription( desc ); DatasetAnnotation annotation = new DatasetAnnotation(); annotation.setContent( text ); annotation.setDataset( original ); annotation = (DatasetAnnotation) iPojos.createDataObject( annotation, null ); assertUniqueAnnotationCreation(name, text); Dataset test = (Dataset) iQuery.getById( Dataset.class, original.getId().longValue() ); assertTrue( desc.equals( test.getDescription() )); assertNotNull(original.getDetails().getCounts()); assertNotNull(original.getDetails().getCounts().get( Dataset.ANNOTATIONS )); assertTrue( ((Integer) original.getDetails().getCounts().get( Dataset.ANNOTATIONS)).intValue() > 0 ); System.out.println( original.getDetails().getCounts()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/PojosServiceTest.java/clean/components/shoola-adapter/test/ome/adapters/pojos/itests/PojosServiceTest.java |
|
Object o = iQuery.getById( DatasetAnnotation.class, a.getId().longValue() ); assertNull( o ); | public void test_delete_annotation() throws Exception { String string = "delete_annotation"+System.currentTimeMillis(); Dataset d = new Dataset(); d.setName( string ); DatasetAnnotation a = new DatasetAnnotation(); a.setDataset( d ); a.setContent( string ); a = (DatasetAnnotation) iPojos.createDataObject( a, null ); iPojos.deleteDataObject( a, null ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/PojosServiceTest.java/clean/components/shoola-adapter/test/ome/adapters/pojos/itests/PojosServiceTest.java |
|
p.linkDataset( d1 ); p.linkDataset( d2 ); | ProjectDatasetLink l1 = new ProjectDatasetLink(); ProjectDatasetLink l2 = new ProjectDatasetLink(); l1.setParent( p ); l1.setChild( d1 ); l2.setParent( p ); l2.setChild( d2 ); p.addProjectDatasetLink( l1, true ); p.addProjectDatasetLink( l2, true ); | public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/PojosServiceTest.java/clean/components/shoola-adapter/test/ome/adapters/pojos/itests/PojosServiceTest.java |
Iterator it = p.linkedDatasetIterator(); Dataset test = null; | Iterator it = p.iterateDatasetLinks(); | public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/PojosServiceTest.java/clean/components/shoola-adapter/test/ome/adapters/pojos/itests/PojosServiceTest.java |
test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; | ProjectDatasetLink link = (ProjectDatasetLink) it.next(); if ( link.child().getId().equals( d1.getId() )) { l1 = link; d1 = link.child(); } else if ( link.child().getId().equals( d2.getId() )) { l2 = link; d2 = link.child(); } else { fail( " Links aren't set up propertly"); } | public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/PojosServiceTest.java/clean/components/shoola-adapter/test/ome/adapters/pojos/itests/PojosServiceTest.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.