rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
test.setDescription( name ); | d1.setDescription( name ); | 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) iPojos.updateDataObject( test, null ); | Dataset test = (Dataset) iPojos.updateDataObject( d1, null ); | 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 |
ProjectDatasetLink link1 = (ProjectDatasetLink) iQuery.getById( ProjectDatasetLink.class, l1.getId().longValue() ); assertNotNull( link1 ); assertTrue( link1.parent().getId().equals( p.getId())); assertTrue( link1.child().getId().equals( d1.getId() )); ProjectDatasetLink link2 = (ProjectDatasetLink) iQuery.getById( ProjectDatasetLink.class, l2.getId().longValue() ); assertNotNull( link2 ); assertTrue( link2.parent().getId().equals( p.getId())); assertTrue( link2.child().getId().equals( d2.getId() )); | 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 |
|
else if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); | } | public void execute() throws BuildException { if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } if (branchRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchRate); } if (lineRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineRate); } if (totalBranchRate != null) { getJava().createArg().setValue("--totalbranch"); getJava().createArg().setValue(totalBranchRate); } if (totalLineRate != null) { getJava().createArg().setValue("--totalline"); getJava().createArg().setValue(totalLineRate); } Iterator iter = regexes.iterator(); while (iter.hasNext()) { getJava().createArg().setValue("--regex"); getJava().createArg().setValue(iter.next().toString()); } int returnCode = getJava().executeJava(); // Check the return code and print a message if (returnCode == 0) System.out.println("All checks passed."); else if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); else System.err.println("Coverage check failed. See messages above."); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ee8c521f630a11084a33f76a785fc79f30c4ca86/CheckTask.java/clean/cobertura/src/net/sourceforge/cobertura/ant/CheckTask.java |
System.err.println("Coverage check failed. See messages above."); | { if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); else if (failureProperty != null) getProject().setProperty(failureProperty, "true"); else System.err .println("Coverage check failed. See messages above."); } | public void execute() throws BuildException { if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } if (branchRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchRate); } if (lineRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineRate); } if (totalBranchRate != null) { getJava().createArg().setValue("--totalbranch"); getJava().createArg().setValue(totalBranchRate); } if (totalLineRate != null) { getJava().createArg().setValue("--totalline"); getJava().createArg().setValue(totalLineRate); } Iterator iter = regexes.iterator(); while (iter.hasNext()) { getJava().createArg().setValue("--regex"); getJava().createArg().setValue(iter.next().toString()); } int returnCode = getJava().executeJava(); // Check the return code and print a message if (returnCode == 0) System.out.println("All checks passed."); else if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); else System.err.println("Coverage check failed. See messages above."); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ee8c521f630a11084a33f76a785fc79f30c4ca86/CheckTask.java/clean/cobertura/src/net/sourceforge/cobertura/ant/CheckTask.java |
return context.getProperty(_names[0]); | return context.getProperty(_names); | public Object getValue (Context context) throws PropertyException { return context.getProperty(_names[0]); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/21a2f3f314f3b089827442856f520ede9bc43c20/FunctionVariable.java/buggy/webmacro/src/org/webmacro/engine/FunctionVariable.java |
if (pref.isHideChatHistory()) { | if (!pref.isChatHistoryEnabled()) { | public void chatRoomOpened(final ChatRoom room) { LocalPreferences pref = SettingsManager.getLocalPreferences(); if (pref.isHideChatHistory()) { return; } final String jid = room.getRoomname(); File transcriptFile = ChatTranscripts.getTranscriptFile(jid); if (!transcriptFile.exists()) { return; } final TranscriptWindow roomWindow = room.getTranscriptWindow(); final TranscriptWindow window = new TranscriptWindow(); window.setEditable(false); window.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { room.getChatInputEditor().requestFocusInWindow(); } }); insertHistory(room, roomWindow); if (room instanceof ChatRoomImpl) { // Add History Button ChatRoomButton chatRoomButton = new ChatRoomButton(SparkRes.getImageIcon(SparkRes.HISTORY_24x24_IMAGE)); room.getToolBar().addChatRoomButton(chatRoomButton); chatRoomButton.setToolTipText("View history"); chatRoomButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { ChatRoomImpl roomImpl = (ChatRoomImpl)room; showHistory(roomImpl.getParticipantJID()); } }); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ChatTranscriptPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java |
if (pref.isHideChatHistory()) { | if (!pref.isChatHistoryEnabled()) { | private void persistChatRoom(final ChatRoom room) { LocalPreferences pref = SettingsManager.getLocalPreferences(); if (pref.isHideChatHistory()) { return; } final String jid = room.getRoomname(); List transcripts = room.getTranscripts(); Iterator messages = transcripts.iterator(); ChatTranscript transcript = ChatTranscripts.getChatTranscript(jid); while (messages.hasNext()) { Message message = (Message)messages.next(); HistoryMessage history = new HistoryMessage(); history.setTo(message.getTo()); history.setFrom(message.getFrom()); history.setBody(message.getBody()); Date date = (Date)message.getProperty("date"); if (date != null) { history.setDate(date); } else { history.setDate(new Date()); } transcript.addHistoryMessage(history); } ChatTranscripts.saveTranscript(jid); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ChatTranscriptPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java |
return ChatTranscripts.getChatTranscript(jid); | String bareJID = StringUtils.parseBareAddress(jid); return ChatTranscripts.getChatTranscript(bareJID); | private void showHistory(final String jid) { SwingWorker transcriptLoader = new SwingWorker() { public Object construct() { return ChatTranscripts.getChatTranscript(jid); } public void finished() { final JPanel mainPanel = new BackgroundPanel(); mainPanel.setLayout(new BorderLayout()); final VCardPanel topPanel = new VCardPanel(jid); mainPanel.add(topPanel, BorderLayout.NORTH); final TranscriptWindow window = new TranscriptWindow(); final JScrollPane pane = new JScrollPane(window); pane.getVerticalScrollBar().setBlockIncrement(50); pane.getVerticalScrollBar().setUnitIncrement(20); mainPanel.add(pane, BorderLayout.CENTER); ChatTranscript transcript = (ChatTranscript)get(); List<HistoryMessage> list = transcript.getMessages(); Collections.sort(list, dateComparator); for (HistoryMessage message : list) { String from = message.getFrom(); String nickname = StringUtils.parseName(from); final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm a"); final String date = formatter.format(message.getDate()); String prefix = nickname + " [" + date + "]"; if (from.equals(SparkManager.getSessionManager().getJID())) { window.insertCustomMessage(prefix, message.getBody()); } else { window.insertCustomOtherMessage(prefix, message.getBody()); } } // Handle no history if (transcript.getMessages().size() == 0) { window.setText("There is no current chat history."); } final JFrame frame = new JFrame("History For " + jid); frame.setIconImage(SparkRes.getImageIcon(SparkRes.HISTORY_16x16).getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack(); frame.setSize(600, 400); window.setCaretPosition(0); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); } }; transcriptLoader.start(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ChatTranscriptPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java |
Collections.sort(list, dateComparator); | private void showHistory(final String jid) { SwingWorker transcriptLoader = new SwingWorker() { public Object construct() { return ChatTranscripts.getChatTranscript(jid); } public void finished() { final JPanel mainPanel = new BackgroundPanel(); mainPanel.setLayout(new BorderLayout()); final VCardPanel topPanel = new VCardPanel(jid); mainPanel.add(topPanel, BorderLayout.NORTH); final TranscriptWindow window = new TranscriptWindow(); final JScrollPane pane = new JScrollPane(window); pane.getVerticalScrollBar().setBlockIncrement(50); pane.getVerticalScrollBar().setUnitIncrement(20); mainPanel.add(pane, BorderLayout.CENTER); ChatTranscript transcript = (ChatTranscript)get(); List<HistoryMessage> list = transcript.getMessages(); Collections.sort(list, dateComparator); for (HistoryMessage message : list) { String from = message.getFrom(); String nickname = StringUtils.parseName(from); final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm a"); final String date = formatter.format(message.getDate()); String prefix = nickname + " [" + date + "]"; if (from.equals(SparkManager.getSessionManager().getJID())) { window.insertCustomMessage(prefix, message.getBody()); } else { window.insertCustomOtherMessage(prefix, message.getBody()); } } // Handle no history if (transcript.getMessages().size() == 0) { window.setText("There is no current chat history."); } final JFrame frame = new JFrame("History For " + jid); frame.setIconImage(SparkRes.getImageIcon(SparkRes.HISTORY_16x16).getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack(); frame.setSize(600, 400); window.setCaretPosition(0); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); } }; transcriptLoader.start(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ChatTranscriptPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java |
|
return ChatTranscripts.getChatTranscript(jid); | String bareJID = StringUtils.parseBareAddress(jid); return ChatTranscripts.getChatTranscript(bareJID); | public Object construct() { return ChatTranscripts.getChatTranscript(jid); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ChatTranscriptPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java |
Collections.sort(list, dateComparator); | public void finished() { final JPanel mainPanel = new BackgroundPanel(); mainPanel.setLayout(new BorderLayout()); final VCardPanel topPanel = new VCardPanel(jid); mainPanel.add(topPanel, BorderLayout.NORTH); final TranscriptWindow window = new TranscriptWindow(); final JScrollPane pane = new JScrollPane(window); pane.getVerticalScrollBar().setBlockIncrement(50); pane.getVerticalScrollBar().setUnitIncrement(20); mainPanel.add(pane, BorderLayout.CENTER); ChatTranscript transcript = (ChatTranscript)get(); List<HistoryMessage> list = transcript.getMessages(); Collections.sort(list, dateComparator); for (HistoryMessage message : list) { String from = message.getFrom(); String nickname = StringUtils.parseName(from); final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm a"); final String date = formatter.format(message.getDate()); String prefix = nickname + " [" + date + "]"; if (from.equals(SparkManager.getSessionManager().getJID())) { window.insertCustomMessage(prefix, message.getBody()); } else { window.insertCustomOtherMessage(prefix, message.getBody()); } } // Handle no history if (transcript.getMessages().size() == 0) { window.setText("There is no current chat history."); } final JFrame frame = new JFrame("History For " + jid); frame.setIconImage(SparkRes.getImageIcon(SparkRes.HISTORY_16x16).getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack(); frame.setSize(600, 400); window.setCaretPosition(0); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/ChatTranscriptPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java |
|
node.setLocation((int) (r.x*factor/sf), (int) (r.y*factor/sf)); | double ratio = factor/sf; if (ratio < 1) ratio += EPSILON; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); | public void visit(ImageNode node) { Rectangle r = node.getBounds(); Thumbnail th = node.getThumbnail(); double sf = th.getScalingFactor(); if (sf != factor) { th.scale(factor); node.setLocation((int) (r.x*factor/sf), (int) (r.y*factor/sf)); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b1b09608165b0b1c6218fe61228bb60c9c8df6f/ZoomVisitor.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/ZoomVisitor.java |
public ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, ClassLoader classLoader, Object service, Set unsatisfiedConditions) { | public ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, ClassLoader classLoader, Object service) { | public ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, ClassLoader classLoader, Object service, Set unsatisfiedConditions) { this.eventId = eventId; this.kernel = kernel; this.serviceName = serviceName; this.serviceFactory = serviceFactory; this.classLoader = classLoader; this.service = service; this.unsatisfiedConditions = unsatisfiedConditions; cause = null; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceEvent.java/buggy/kernel/src/java/org/gbean/kernel/ServiceEvent.java |
this.unsatisfiedConditions = unsatisfiedConditions; | public ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, ClassLoader classLoader, Object service, Set unsatisfiedConditions) { this.eventId = eventId; this.kernel = kernel; this.serviceName = serviceName; this.serviceFactory = serviceFactory; this.classLoader = classLoader; this.service = service; this.unsatisfiedConditions = unsatisfiedConditions; cause = null; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceEvent.java/buggy/kernel/src/java/org/gbean/kernel/ServiceEvent.java |
|
unsatisfiedConditions = null; | public ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, ClassLoader classLoader, Object service, Set unsatisfiedConditions) { this.eventId = eventId; this.kernel = kernel; this.serviceName = serviceName; this.serviceFactory = serviceFactory; this.classLoader = classLoader; this.service = service; this.unsatisfiedConditions = unsatisfiedConditions; cause = null; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceEvent.java/buggy/kernel/src/java/org/gbean/kernel/ServiceEvent.java |
|
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); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ea7509babe2344eb702969105eb77096cc5b6bcf/TreeCellRenderer.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/util/TreeCellRenderer.java |
||
} else setText(set.toString()); | } else { setText(set.toString()); w += fm.stringWidth(getText()); } | 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); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ea7509babe2344eb702969105eb77096cc5b6bcf/TreeCellRenderer.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/util/TreeCellRenderer.java |
} else setText(imgNode.toString()); | } else { setText(imgNode.toString()); w += fm.stringWidth(getText()); } | 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); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ea7509babe2344eb702969105eb77096cc5b6bcf/TreeCellRenderer.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/util/TreeCellRenderer.java |
w += fm.stringWidth(node.toString()); | w += fm.stringWidth(getText()); | 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); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ea7509babe2344eb702969105eb77096cc5b6bcf/TreeCellRenderer.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/util/TreeCellRenderer.java |
w += getIcon().getIconWidth(); | if (getIcon() != null) w += getIcon().getIconWidth(); | 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); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ea7509babe2344eb702969105eb77096cc5b6bcf/TreeCellRenderer.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/util/TreeCellRenderer.java |
double ccn = Util.getCCN(finder.findFile(packageData.getSourceFileName()), false); | double ccn = packageData.getCCN(finder); | private void dumpPackage(PackageData packageData) { logger.debug("Dumping package " + packageData.getName()); double ccn = Util.getCCN(finder.findFile(packageData.getSourceFileName()), false); println("<package name=\"" + packageData.getName() + "\" line-rate=\"" + packageData.getLineCoverageRate() + "\" branch-rate=\"" + packageData.getBranchCoverageRate() + "\" complexity=\"" + ccn + "\"" + ">"); increaseIndentation(); dumpSourceFiles(packageData); decreaseIndentation(); println("</package>"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/3e8a06cb6e7e9c5e2474adf5e83e4b6ddcc7a464/XMLReport.java/buggy/cobertura/src/net/sourceforge/cobertura/reporting/xml/XMLReport.java |
public ArticleBlock(String titleKey, WFTabListener taskbarListener) { super(titleKey); setId(ARTICLE_BLOCK_ID); getTitlebar().setValueRefTitle(true); setMainAreaStyleClass(null); String bref = WFPage.CONTENT_BUNDLE + "."; WFTabBar tb = new WFTabBar(); tb.setId(TASKBAR_ID); add(tb); tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditContainer()); tb.addButtonVB(TASK_ID_PREVIEW, bref + "preview", getPreviewContainer()); tb.setSelectedButtonId(TASK_ID_EDIT); if (taskbarListener != null) { tb.addTaskbarListener(taskbarListener); } | public ArticleBlock() { | public ArticleBlock(String titleKey, WFTabListener taskbarListener) { super(titleKey); setId(ARTICLE_BLOCK_ID); getTitlebar().setValueRefTitle(true); setMainAreaStyleClass(null); String bref = WFPage.CONTENT_BUNDLE + "."; WFTabBar tb = new WFTabBar(); tb.setId(TASKBAR_ID); add(tb); tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditContainer()); tb.addButtonVB(TASK_ID_PREVIEW, bref + "preview", getPreviewContainer());// tb.addButtonVB(TASK_ID_MESSAGES, bref + "messages", getMessageContainer()); tb.setSelectedButtonId(TASK_ID_EDIT); if (taskbarListener != null) { tb.addTaskbarListener(taskbarListener); } } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/ArticleBlock.java/clean/src/java/com/idega/block/article/component/ArticleBlock.java |
return new IOModes(getRuntime(), ((RubyString)object).getValue()); | return new IOModes(getRuntime(), ((RubyString)object).toString()); | private IOModes getModes(IRubyObject object) { if (object instanceof RubyString) { return new IOModes(getRuntime(), ((RubyString)object).getValue()); } else if (object instanceof RubyFixnum) { return new IOModes(getRuntime(), ((RubyFixnum)object).getLongValue()); } throw getRuntime().newTypeError("Invalid type for modes"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/RubyFile.java/buggy/src/org/jruby/RubyFile.java |
model.setDefaultLayoutMethod(new NumColsLayoutMethod(8)); | public void loadDataset(int datasetID) { BrowserManager manager = env.getBrowserManager(); int index; if((index = manager.hasBrowser(datasetID)) != BrowserManager.NOT_FOUND) { manager.setActiveBrowser(index); return; } DataManagementService dms = registry.getDataManagementService(); DatasetData dataset; final BrowserModel model = new BrowserModel(); model.setLayoutMethod(new NumColsLayoutMethod(8)); BrowserTopModel topModel = new BrowserTopModel(); BPalette optionPalette = PaletteFactory.getOptionPalette(model,topModel); topModel.addPalette(UIConstants.OPTIONS_PALETTE_NAME,optionPalette); topModel.hidePalette(optionPalette); optionPalette.setOffset(0,0); BrowserView view = new BrowserView(model,topModel); BrowserController controller = new BrowserController(model,topModel,view); controller.setStatusView(new StatusBar()); final int browserIndex = 0; // default behavior for new browser final BrowserInternalFrame bif = new BrowserInternalFrame(controller); env.getBrowserManager().addBrowser(bif); StatusBar status = controller.getStatusView(); tf.addToDesktop(bif,TopFrame.PALETTE_LAYER); bif.setClosable(true); bif.setIconifiable(true); bif.setMaximizable(true); bif.setResizable(true); bif.show(); final int theDataset = datasetID; KillableThread retrieveThread = new KillableThread() { public void run() { addLoaderThread(bif.getController(),this); try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); if(!kill) { bif.setTitle("Image Browser: "+dataset.getName()); loadDataset(browserIndex,dataset); } else { System.err.println("killed OK"); } } catch(DSAccessException dsae) { UserNotifier notifier = registry.getUserNotifier(); notifier.notifyError("Data retrieval failure", "Unable to retrieve dataset (id = " + theDataset + ")", dsae); return; } catch(DSOutOfServiceException dsoe) { // pop up new login window (eventually caught) throw new RuntimeException(dsoe); } removeLoaderThread(bif.getController(),this); } }; retrieveThread.start(); writeStatusImmediately(status,"Loading dataset from DB..."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f82d914fe97ef0c74bef944bf12ae4961776c814/BrowserAgent.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
|
model.setDefaultLayoutMethod(lm); | public void run() { addLoaderThread(controller,this); final List thumbnails = new ArrayList(); int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { // explicit break out if(kill) { j=refInfo.getNumCols(); i=refInfo.getNumRows(); break; } String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } List classificationList = (List)refClassifications.get(new Integer(sum.getID())); if(classificationList != null) { for(Iterator iter = classificationList.iterator(); iter.hasNext();) { Classification c = (Classification)iter.next(); tdm.getAttributeMap().putAttribute(c); } } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { thumbnails.add(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } List classificationList = (List)refClassifications.get(new Integer(sum.getID())); if(classificationList != null) { for(Iterator iter = classificationList.iterator(); iter.hasNext();) { Classification c = (Classification)iter.next(); tdm.getAttributeMap().putAttribute(c); } } images[k] = image; models[k] = tdm; count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); } }; SwingUtilities.invokeLater(addTask); } } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } else { System.err.println("killed OK"); } removeLoaderThread(controller,this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f82d914fe97ef0c74bef944bf12ae4961776c814/BrowserAgent.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
|
if(browserManager != null) { browserManager.addSelectionListener(colorMapManager); } | public void setColorMapManager(ColorMapManager manager) { this.colorMapManager = manager; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e83036080b3a8ade884eca150f3f3c2004b556c9/BrowserEnvironment.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserEnvironment.java |
|
public void hidePalette(BPalette palette) | public void hidePalette(String name) | public void hidePalette(BPalette palette) { if(palette != null && paletteMap.containsValue(palette)) { for(Iterator iter = modelListeners.iterator(); iter.hasNext();) { BrowserTopModelListener listener = (BrowserTopModelListener)iter.next(); listener.hidePalette(palette); } paletteStatusMap.put(palette,new Integer(PALETTE_HIDDEN)); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserTopModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserTopModel.java |
if(palette != null && paletteMap.containsValue(palette)) { for(Iterator iter = modelListeners.iterator(); iter.hasNext();) { BrowserTopModelListener listener = (BrowserTopModelListener)iter.next(); listener.hidePalette(palette); } paletteStatusMap.put(palette,new Integer(PALETTE_HIDDEN)); } | BPalette palette = (BPalette)paletteMap.get(name); hidePalette(palette); | public void hidePalette(BPalette palette) { if(palette != null && paletteMap.containsValue(palette)) { for(Iterator iter = modelListeners.iterator(); iter.hasNext();) { BrowserTopModelListener listener = (BrowserTopModelListener)iter.next(); listener.hidePalette(palette); } paletteStatusMap.put(palette,new Integer(PALETTE_HIDDEN)); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserTopModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserTopModel.java |
if(datasetID == datasetShown) { embeddedUI.modelChanged(model); } | public void putColorMapModel(ColorMapModel model) { if(model == null) return; BrowserModel browserModel = model.getSource(); int datasetID = browserModel.getDataset().getID(); datasetModelMap.put(new Integer(datasetID),model); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0e4e3c4b5f21d2217fc02b1e6846dac6de60570f/ColorMapManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/colormap/ColorMapManager.java |
|
if (ChainBuilderAgent.DEBUG) | if (ChainBuilderAgent.DEBUG_TIMING) | public void buildGUI(ModulesData modData) { Container content = getContentPane(); content.setLayout(new BorderLayout()); // what is the window that the chain modules are in? ChainModuleData.setMainWindow(this); JToolBar tb = new JToolBar(); Icon smallChain = icons.getIcon("chains-small.png"); JButton newChain = new JButton(smallChain); newChain.setToolTipText("Create a new chain"); newChain.addActionListener(cmdTable.lookupActionListener("new chain")); tb.setFloatable(false); tb.add(newChain); content.add(tb,BorderLayout.NORTH); moduleCanvas = new ModulePaletteCanvas(this); moduleCanvas.setContents(modData); long start; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); moduleCanvas.layoutContents(); if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time to layout module palette.."+end); } split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,null,moduleCanvas); split.setPreferredSize(new Dimension(2*SIDE,SIDE)); configureTreeNode(); content.add(split,BorderLayout.CENTER); addComponentListener(this); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { uiManager.closeWindows(); setVisible(false); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/630a53d68f5d29c53d2485557b18599785befb83/ModulePaletteWindow.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ModulePaletteWindow.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public void buildGUI(ModulesData modData) { Container content = getContentPane(); content.setLayout(new BorderLayout()); // what is the window that the chain modules are in? ChainModuleData.setMainWindow(this); JToolBar tb = new JToolBar(); Icon smallChain = icons.getIcon("chains-small.png"); JButton newChain = new JButton(smallChain); newChain.setToolTipText("Create a new chain"); newChain.addActionListener(cmdTable.lookupActionListener("new chain")); tb.setFloatable(false); tb.add(newChain); content.add(tb,BorderLayout.NORTH); moduleCanvas = new ModulePaletteCanvas(this); moduleCanvas.setContents(modData); long start; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); moduleCanvas.layoutContents(); if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time to layout module palette.."+end); } split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,null,moduleCanvas); split.setPreferredSize(new Dimension(2*SIDE,SIDE)); configureTreeNode(); content.add(split,BorderLayout.CENTER); addComponentListener(this); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { uiManager.closeWindows(); setVisible(false); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/630a53d68f5d29c53d2485557b18599785befb83/ModulePaletteWindow.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ModulePaletteWindow.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public void contentComplete() { if (dataManager.getChains() != null || dataManager.getModules() != null) { long guiStart =System.currentTimeMillis(); buildGUI((ModulesData) modLoader.getContents()); if (ChainBuilderAgent.DEBUG) { long guiTime =System.currentTimeMillis()-guiStart; System.err.println("time spent on module palette .."+guiTime); } uiManager.contentComplete(); topWindowManager.continueHandleDisplay(); if (ChainBuilderAgent.DEBUG) { totalTime = System.currentTimeMillis()-start; System.err.println("time for chainbuilder start..."+totalTime); } dataState = LOADED; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/630a53d68f5d29c53d2485557b18599785befb83/ModulePaletteWindow.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ModulePaletteWindow.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public void contentComplete() { if (dataManager.getChains() != null || dataManager.getModules() != null) { long guiStart =System.currentTimeMillis(); buildGUI((ModulesData) modLoader.getContents()); if (ChainBuilderAgent.DEBUG) { long guiTime =System.currentTimeMillis()-guiStart; System.err.println("time spent on module palette .."+guiTime); } uiManager.contentComplete(); topWindowManager.continueHandleDisplay(); if (ChainBuilderAgent.DEBUG) { totalTime = System.currentTimeMillis()-start; System.err.println("time for chainbuilder start..."+totalTime); } dataState = LOADED; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/630a53d68f5d29c53d2485557b18599785befb83/ModulePaletteWindow.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ModulePaletteWindow.java |
return Collections.EMPTY_LIST; | return EMPTY_LIST; | public List childNodes() { return Collections.EMPTY_LIST; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/FloatNode.java/clean/src/org/jruby/ast/FloatNode.java |
interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); | interfaces.addAll( getFullyQualifiedNames( javaClass.getImplementedInterfaces() ) ); | private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/0e1956728573d840a0b90e5409700410c4c9bd55/QdoxMappingLoader.java/buggy/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java |
System.out.println("Checking: "+javaClass.getFullyQualifiedName()); | System.out.println("Checking: "+javaClass.getFullyQualifiedName()); | private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/0e1956728573d840a0b90e5409700410c4c9bd55/QdoxMappingLoader.java/buggy/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java |
ArrayList superClasses = new ArrayList(); | ArrayList superClasses = new ArrayList(); | private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/0e1956728573d840a0b90e5409700410c4c9bd55/QdoxMappingLoader.java/buggy/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java |
JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; | JavaClass s = p.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; | private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/0e1956728573d840a0b90e5409700410c4c9bd55/QdoxMappingLoader.java/buggy/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java |
p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); | p = s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQualifiedNames( p.getImplementedInterfaces() ) ); | private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/0e1956728573d840a0b90e5409700410c4c9bd55/QdoxMappingLoader.java/buggy/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java |
String contentProperty, Set attributes, List constructors, List flatProperties, Map maps, Map flatCollections) { if (namespace == null) throw new NullPointerException("namespace"); | String contentProperty, Set attributes, List constructors, List flatProperties, Map maps, Map flatCollections, List superClasses, HashSet interfaces) { this.superClasses = superClasses; this.interfaces = interfaces; if (namespace == null) throw new NullPointerException("namespace"); | public ElementMapping(String namespace, String elementName, String className, String description, boolean rootElement, String initMethod, String destroyMethod, String factoryMethod, String contentProperty, Set attributes, List constructors, List flatProperties, Map maps, Map flatCollections) { if (namespace == null) throw new NullPointerException("namespace"); if (elementName == null) throw new NullPointerException("elementName"); if (className == null) throw new NullPointerException("className"); if (attributes == null) throw new NullPointerException("attributes"); if (constructors == null) throw new NullPointerException("constructors"); this.namespace = namespace; this.elementName = elementName; this.className = className; this.description = description; this.rootElement = rootElement; this.initMethod = initMethod; this.destroyMethod = destroyMethod; this.factoryMethod = factoryMethod; this.contentProperty = contentProperty; this.constructors = constructors; this.attributes = Collections.unmodifiableSet(new TreeSet(attributes)); this.maps = Collections.unmodifiableMap(maps); this.flatProperties = Collections.unmodifiableList(flatProperties); this.flatCollections = Collections.unmodifiableMap(flatCollections); Map attributesByName = new HashMap(); for (Iterator iterator = attributes.iterator(); iterator.hasNext();) { AttributeMapping attribute = (AttributeMapping) iterator.next(); attributesByName.put(attribute.getAttributeName(), attribute); } this.attributesByName = Collections.unmodifiableMap(attributesByName); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/82f8c1592f773a8e10d7a95ab3c2405dc29d8a3e/ElementMapping.java/buggy/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/ElementMapping.java |
c = AnnotationMapper.buildImageAnnotationCriteria(ids); | c = AnnotationMapper.buildImageAnnotationCriteria(ids, uc.getUserID()); | public List retrieveImagesWithAnnotations(int datasetID, ImageSummary retVal) throws DSOutOfServiceException, DSAccessException { //Create a new dataObject if none provided. //Object used as prototype. if (retVal == null) retVal = new ImageSummary(); //Define the criteria by which the object graph is pulled out. List datasetIDs = new ArrayList(); datasetIDs.add(new Integer(datasetID)); Criteria c = DatasetMapper.buildImagesCriteria(datasetIDs); //Load the graph defined by criteria. Dataset dataset = (Dataset) gateway.retrieveData(Dataset.class, c); //List of image summary object. List images = new ArrayList(); //Put the server data into the corresponding client object. if (dataset == null) return images; //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); List ids = DatasetMapper.prepareListImagesID(dataset); c = AnnotationMapper.buildImageAnnotationCriteria(ids); if (ids != null && ids.size() != 0) { List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, uc.getUserID(), images); } return images; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/DMSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/DMSAdapter.java |
DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, uc.getUserID(), images); | DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, images); | public List retrieveImagesWithAnnotations(int datasetID, ImageSummary retVal) throws DSOutOfServiceException, DSAccessException { //Create a new dataObject if none provided. //Object used as prototype. if (retVal == null) retVal = new ImageSummary(); //Define the criteria by which the object graph is pulled out. List datasetIDs = new ArrayList(); datasetIDs.add(new Integer(datasetID)); Criteria c = DatasetMapper.buildImagesCriteria(datasetIDs); //Load the graph defined by criteria. Dataset dataset = (Dataset) gateway.retrieveData(Dataset.class, c); //List of image summary object. List images = new ArrayList(); //Put the server data into the corresponding client object. if (dataset == null) return images; //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); List ids = DatasetMapper.prepareListImagesID(dataset); c = AnnotationMapper.buildImageAnnotationCriteria(ids); if (ids != null && ids.size() != 0) { List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, uc.getUserID(), images); } return images; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/DMSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/DMSAdapter.java |
empty.setCreated(Timestamp.valueOf(image.getCreated())); empty.setInserted(Timestamp.valueOf(image.getInserted())); | empty.setCreated(PrimitiveTypesMapper.getTimestamp(image.getCreated())); empty.setInserted( PrimitiveTypesMapper.getTimestamp(image.getInserted())); | public static void fillImage(Image image, ImageData empty) { //Fill in the data coming from OMEDS object. empty.setID(image.getID()); empty.setName(image.getName()); empty.setDescription(image.getDescription()); empty.setCreated(Timestamp.valueOf(image.getCreated())); empty.setInserted(Timestamp.valueOf(image.getInserted())); //Fill in the data coming from Experimenter. Experimenter owner = image.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //dataset summary list. List datasets = new ArrayList(); Iterator i = image.getDatasets().iterator(); Dataset d; while (i.hasNext()) { d = (Dataset) i.next(); datasets.add(new DatasetSummary(d.getID(), d.getName())); } empty.setDatasets(datasets); // pixelsDescription list. if (image.getDefaultPixels() != null) { List pixels = fillPixels(image.getDefaultPixels()); empty.setPixels(pixels); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5dbbc3e7786c9d237cda00632eddf9d6b5a29870/ImageMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/ImageMapper.java |
int userID, List images) | List images) | public static List fillListAnnotatedImages(Dataset dataset, ImageSummary iProto, List annotations, int userID, List images) { Iterator i = dataset.getImages().iterator(); Image image; ImageSummary is; int id; Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); while (i.hasNext()) { image = (Image) i.next(); //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); id = image.getID(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(id)))); is.setID(id); is.setName(image.getName()); is.setDate(PrimitiveTypesMapper.getTimestamp(image.getCreated())); is.setPixelsIDs(fillListPixelsID(image)); is.setDefaultPixels(fillDefaultPixels(image.getDefaultPixels())); //Add the image summary object to the list. images.add(is); } return images; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); | Map ids = AnnotationMapper.reverseListImageAnnotations(annotations); | public static List fillListAnnotatedImages(Dataset dataset, ImageSummary iProto, List annotations, int userID, List images) { Iterator i = dataset.getImages().iterator(); Image image; ImageSummary is; int id; Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); while (i.hasNext()) { image = (Image) i.next(); //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); id = image.getID(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(id)))); is.setID(id); is.setName(image.getName()); is.setDate(PrimitiveTypesMapper.getTimestamp(image.getCreated())); is.setPixelsIDs(fillListPixelsID(image)); is.setDefaultPixels(fillDefaultPixels(image.getDefaultPixels())); //Add the image summary object to the list. images.add(is); } return images; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
pProto, DatasetSummary dProto, List annotations, int userID, | pProto, DatasetSummary dProto, List annotations, | public static List fillListAnnotatedDatasets(List projects, ProjectSummary pProto, DatasetSummary dProto, List annotations, int userID, List projectsList) { Map ids = AnnotationMapper.reverseListDatasetAnnotations(annotations, userID); Map datasetsMap = new HashMap(); Iterator i = projects.iterator(); //DataObject. ProjectSummary ps; DatasetSummary ds; Project p; Dataset d; Iterator j; List datasets; Integer id; //For each p in projects... while (i.hasNext()) { p = (Project) i.next(); //Make a new DataObject and fill it up. ps = (ProjectSummary) pProto.makeNew(); ps.setID(p.getID()); ps.setName(p.getName()); j = p.getDatasets().iterator(); datasets = new ArrayList(); while (j.hasNext()) { d = (Dataset) j.next(); id = new Integer(d.getID()); ds = (DatasetSummary) datasetsMap.get(id); if (ds == null) { //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(id.intValue()); ds.setName(d.getName()); ds.setAnnotation(AnnotationMapper.fillDatasetAnnotation( (DatasetAnnotation) ids.get(id))); datasetsMap.put(id, ds); } //object already created this object. //Add the dataset to this project's list. datasets.add(ds); } //Link the datasets to this project. ps.setDatasets(datasets); //Add the project to the list of returned projects. projectsList.add(ps); } return projectsList; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/ProjectMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/ProjectMapper.java |
Map ids = AnnotationMapper.reverseListDatasetAnnotations(annotations, userID); | Map ids = AnnotationMapper.reverseListDatasetAnnotations(annotations); | public static List fillListAnnotatedDatasets(List projects, ProjectSummary pProto, DatasetSummary dProto, List annotations, int userID, List projectsList) { Map ids = AnnotationMapper.reverseListDatasetAnnotations(annotations, userID); Map datasetsMap = new HashMap(); Iterator i = projects.iterator(); //DataObject. ProjectSummary ps; DatasetSummary ds; Project p; Dataset d; Iterator j; List datasets; Integer id; //For each p in projects... while (i.hasNext()) { p = (Project) i.next(); //Make a new DataObject and fill it up. ps = (ProjectSummary) pProto.makeNew(); ps.setID(p.getID()); ps.setName(p.getName()); j = p.getDatasets().iterator(); datasets = new ArrayList(); while (j.hasNext()) { d = (Dataset) j.next(); id = new Integer(d.getID()); ds = (DatasetSummary) datasetsMap.get(id); if (ds == null) { //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(id.intValue()); ds.setName(d.getName()); ds.setAnnotation(AnnotationMapper.fillDatasetAnnotation( (DatasetAnnotation) ids.get(id))); datasetsMap.put(id, ds); } //object already created this object. //Add the dataset to this project's list. datasets.add(ds); } //Link the datasets to this project. ps.setDatasets(datasets); //Add the project to the list of returned projects. projectsList.add(ps); } return projectsList; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/ProjectMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/ProjectMapper.java |
protected GeneralPath drawBezierCurve(Point2D[] pts) { GeneralPath p = new GeneralPath(); int n = pts.length; //System.err.println("drawing bezier. "+n+" points"); // width of space? int w2=100; double width =w2; double step = 1./width; double t = step; float x; float y; double newx=0; double newy=0; //System.err.println("width is "+width+", step is "+step); double[] pxi = new double[n]; double[] pyi = new double[n]; double[] px = new double[n]; double[] py = new double[n]; //more convenient notation... for (int i = 0; i < n; i++) { px[i] = pts[i].getX(); py[i]=pts[i].getY(); } p.moveTo((float) px[0],(float) py[0]); for (int k = 1; k < w2; k++){ System.arraycopy(px,0,pxi,0,n); System.arraycopy(py,0,pyi,0,n); for (int j = n-1; j > 0; j--) { // points calculation for (int i = 0; i < j; i++) { px[i]=(1-t)*pxi[i]+t*pxi[i+1]; py[i]=(1-t)*pyi[i]+t*pyi[i+1]; } } p.lineTo((float)pxi[0],(float)pyi[0]); t += step; } return p; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/Link.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/Link.java |
||
protected GeneralPath drawBezierCurve(Point2D[] pts) { GeneralPath p = new GeneralPath(); int n = pts.length; //System.err.println("drawing bezier. "+n+" points"); // width of space? int w2=100; double width =w2; double step = 1./width; double t = step; float x; float y; double newx=0; double newy=0; //System.err.println("width is "+width+", step is "+step); double[] pxi = new double[n]; double[] pyi = new double[n]; double[] px = new double[n]; double[] py = new double[n]; //more convenient notation... for (int i = 0; i < n; i++) { px[i] = pts[i].getX(); py[i]=pts[i].getY(); } p.moveTo((float) px[0],(float) py[0]); for (int k = 1; k < w2; k++){ System.arraycopy(px,0,pxi,0,n); System.arraycopy(py,0,pyi,0,n); for (int j = n-1; j > 0; j--) { // points calculation for (int i = 0; i < j; i++) { px[i]=(1-t)*pxi[i]+t*pxi[i+1]; py[i]=(1-t)*pyi[i]+t*pyi[i+1]; } } p.lineTo((float)pxi[0],(float)pyi[0]); t += step; } return p; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/Link.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/Link.java |
||
if (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); | public void setEndCoords(float x,float y) { //System.err.println("adding link end point "+x+","+y); setPoint(pointCount,new Point2D.Float(x,y)); setLine(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/Link.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/Link.java |
|
if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); | public void setPoint(int index,Point2D pt) { //System.err.println("setting point # "+index+", # of points is "+points.size()); if (points.size() <= index) { points.add(index,pt); } else points.set(index,pt); updateBounds(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/Link.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/Link.java |
|
if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); | public void setSelected(boolean v) { //System.err.println(" setting a link to be selected.."); LinkTarget startTarget = getStartLinkTarget(); LinkTarget endTarget = getEndLinkTarget(); startTarget.setSelected(v); endTarget.setSelected(v); targets.removeAllChildren(); if (v == true) { // set up children bulb.setPaint(Constants.LINK_HIGHLIGHT_COLOR); targets.setVisible(true); int count = points.size(); for (int i = 1; i < count-1; i++) { LinkSelectionTarget t = new LinkSelectionTarget(this,i); targets.addChild(t); Point2D pt = (Point2D) points.get(i); t.setOffset((float)pt.getX()-Constants.LINK_TARGET_HALF_SIZE, (float)pt.getY()-Constants.LINK_TARGET_HALF_SIZE); t.setSelected(v); } } else bulb.setPaint(Constants.DEFAULT_COLOR); repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/Link.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/Link.java |
|
WebDAVCategories categoriesUI = (WebDAVCategories)findComponent(WebDAVCategories.CATEGORIES_BLOCK_ID); | WebDAVCategories categoriesUI = (WebDAVCategories)findComponent(CATEGORY_EDITOR_ID); | private UIComponent getCategoryEditor() { WebDAVCategories categoriesUI = (WebDAVCategories)findComponent(WebDAVCategories.CATEGORIES_BLOCK_ID); if(categoriesUI==null){ //id on the component is set implicitly categoriesUI=new WebDAVCategories(); //we want to set the categories also on the parent ".article" folder: categoriesUI.setCategoriesOnParent(true); categoriesUI.setDisplaySaveButton(false); categoriesUI.setDisplayHeader(false); //categoriesUI.setId(CATEGORY_EDITOR_ID); FacesContext context = getFacesContext(); String setCategories = (String) context.getExternalContext().getRequestParameterMap().get(ContentItemToolbar.PARAMETER_CATEGORIES); if(setCategories!=null){ categoriesUI.setCategories(setCategories); } //Categories are set in encodeBegin: //if(!isInCreateMode()){ //there is no resourcepath set for the article if it's about to be created // categoriesUI.setResourcePath(resourcePath); //} //parent.getChildren().add(categoriesUI); } return categoriesUI; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java |
categoriesUI.setId(CATEGORY_EDITOR_ID); | private UIComponent getCategoryEditor() { WebDAVCategories categoriesUI = (WebDAVCategories)findComponent(WebDAVCategories.CATEGORIES_BLOCK_ID); if(categoriesUI==null){ //id on the component is set implicitly categoriesUI=new WebDAVCategories(); //we want to set the categories also on the parent ".article" folder: categoriesUI.setCategoriesOnParent(true); categoriesUI.setDisplaySaveButton(false); categoriesUI.setDisplayHeader(false); //categoriesUI.setId(CATEGORY_EDITOR_ID); FacesContext context = getFacesContext(); String setCategories = (String) context.getExternalContext().getRequestParameterMap().get(ContentItemToolbar.PARAMETER_CATEGORIES); if(setCategories!=null){ categoriesUI.setCategories(setCategories); } //Categories are set in encodeBegin: //if(!isInCreateMode()){ //there is no resourcepath set for the article if it's about to be created // categoriesUI.setResourcePath(resourcePath); //} //parent.getChildren().add(categoriesUI); } return categoriesUI; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java |
|
bodyArea.addValueChangeListener(this); bodyArea.setImmediate(true); | public UIComponent getEditContainer() { FacesContext context = FacesContext.getCurrentInstance(); IWContext iwc = IWContext.getIWContext(context); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle();// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = getMainContainer(); //Language dropdown UIComponent langDropdown = getLanguageDropdownMenu(); UIComponent languageText = WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":")); HtmlOutputLabel languageLabel = new HtmlOutputLabel(); languageLabel.getChildren().add(languageText); languageLabel.setFor(langDropdown.getClientId(context)); WFFormItem languageItem = new WFFormItem(); languageItem.add(languageLabel); languageItem.add(langDropdown); mainContainer.add(languageItem); //Headline input HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(70); UIComponent headlineText = WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")); HtmlOutputLabel headlineLabel = new HtmlOutputLabel(); headlineLabel.getChildren().add(headlineText); headlineLabel.setFor(headlineInput.getClientId(context)); WFFormItem headlineItem = new WFFormItem(); headlineItem.add(headlineLabel); headlineItem.add(headlineInput); mainContainer.add(headlineItem); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); //Author input HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); User user = iwc.getCurrentUser(); if(user!=null){ String userName = user.getName(); getArticleItemBean().setAuthor(userName); } UIComponent authorText = WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":")); HtmlOutputLabel authorLabel = new HtmlOutputLabel(); authorLabel.getChildren().add(authorText); authorLabel.setFor(authorInput.getClientId(context)); WFFormItem authorItem = new WFFormItem(); authorItem.add(authorLabel); authorItem.add(authorInput); mainContainer.add(authorItem); //Article body HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "500px", "400px"); //HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body"); bodyArea.setAllowFontSelection(false);// bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS);// bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3");// bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3");// bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU);// bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE);// bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP);// bodyArea.addPlugin("TableOperations");// bodyArea.addPlugin("Template");// bodyArea.addPlugin("Forms");// bodyArea.addPlugin("FormOperations");// bodyArea.addPlugin("EditTag");// bodyArea.addPlugin("Stylist");// bodyArea.addPlugin("CSS");// bodyArea.addPlugin("DynamicCSS");// bodyArea.addPlugin("FullPage");// bodyArea.addPlugin("NoteServer");// bodyArea.addPlugin("QuickTag");// bodyArea.addPlugin("InsertSmiley");// bodyArea.addPlugin("InsertWords");// bodyArea.addPlugin("ContextMenu");// bodyArea.addPlugin("LangMarks");// bodyArea.addPlugin("DoubleClick");// bodyArea.addPlugin("ListType");// bodyArea.addPlugin("ImageManager"); UIComponent bodyText = WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":")); HtmlOutputLabel bodyLabel = new HtmlOutputLabel(); bodyLabel.getChildren().add(bodyText); bodyLabel.setFor(bodyArea.getClientId(context)); WFFormItem bodyItem = new WFFormItem(); bodyItem.add(bodyLabel); bodyItem.add(bodyArea); mainContainer.add(bodyItem); //Teaser input HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "500px", "60px"); UIComponent teaserText = WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":")); HtmlOutputLabel teaserLabel = new HtmlOutputLabel(); teaserLabel.getChildren().add(teaserText); teaserLabel.setFor(teaserArea.getClientId(context)); WFFormItem teaserItem = new WFFormItem(); teaserItem.add(teaserLabel); teaserItem.add(teaserArea); mainContainer.add(teaserItem); //Source input HtmlInputText sourceInput = WFUtil.getInputText(SOURCE_ID, ref + "source"); UIComponent sourceText = WFUtil.group(localizer.getTextVB("source"), WFUtil.getText(":")); HtmlOutputLabel sourceLabel = new HtmlOutputLabel(); sourceLabel.getChildren().add(sourceText); sourceLabel.setFor(sourceInput.getClientId(context)); WFFormItem sourceItem = new WFFormItem(); sourceItem.add(sourceLabel); sourceItem.add(sourceInput); mainContainer.add(sourceItem); //Status field HtmlOutputText statusValue = WFUtil.getTextVB(ref + "status"); WFContainer statusContainer = new WFContainer(); statusContainer.getChildren().add(statusValue); UIComponent statusText = WFUtil.group(localizer.getTextVB("status"), WFUtil.getText(":")); HtmlOutputLabel statusLabel = new HtmlOutputLabel(); statusLabel.getChildren().add(statusText); statusLabel.setFor(statusValue.getClientId(context)); WFFormItem statusItem = new WFFormItem(); statusItem.add(statusLabel); statusItem.add(statusContainer); mainContainer.add(statusItem); //Version field HtmlOutputText versionValue = WFUtil.getTextVB(ref + "versionName"); WFContainer versionContainer = new WFContainer(); versionContainer.add(versionValue); UIComponent versionText = WFUtil.group(localizer.getTextVB("current_version"), WFUtil.getText(":")); HtmlOutputLabel versionLabel = new HtmlOutputLabel(); versionLabel.getChildren().add(versionText); versionLabel.setFor(versionValue.getClientId(context)); WFFormItem versionItem = new WFFormItem(); versionItem.add(versionLabel); versionItem.add(versionContainer); mainContainer.add(versionItem); //Comment input HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "500px", "60px"); UIComponent commentText = WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")); HtmlOutputLabel commentLabel = new HtmlOutputLabel(); commentLabel.getChildren().add(commentText); commentLabel.setFor(commentArea.getClientId(context)); WFFormItem commentItem = new WFFormItem(); commentItem.add(commentLabel); commentItem.add(commentArea); mainContainer.add(commentItem); // WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); // mainContainer.add(p);// p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput);// mainContainer.add(p);// mainContainer.add(WFUtil.getBreak());// p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton);// Temporary taking away folderr location// p.getChildren().add(WFUtil.group(localizer.getTextVB("folder"), WFUtil.getText(":")));// HtmlInputText folderInput = WFUtil.getInputText(FOLDER_ID, ref + "folderLocation");// if(null==folderInput.getValue() || "".equals(folderInput.getValue())) {// String FolderString = ArticleUtil.getArticleYearMonthPath();// System.out.println("Folder "+FolderString);// folderInput.setValue(FolderString);// } else {// File file = new File(folderInput.getValue().toString());// folderInput.setValue(file.getParentFile().getParent());// }// folderInput.setSize(70);// p.getChildren().add(folderInput); // p.getChildren().add(WFUtil.getBreak());// Categories// WebDAVCategories categoriesUI = new WebDAVCategories();// ArticleItemBean articleItemBean = (ArticleItemBean) getArticleItemBean();// String resourcePath = articleItemBean.getArticleResourcePath(); //Categories input UIComponent categoriesContainer = getCategoryEditor(); UIComponent categoriesText = WFUtil.group(localizer.getTextVB("categories"), WFUtil.getText(":")); HtmlOutputLabel categoriesLabel = new HtmlOutputLabel(); categoriesLabel.getChildren().add(categoriesText); categoriesLabel.setFor(categoriesContainer.getClientId(context)); WFFormItem categoriesItem = new WFFormItem(); categoriesItem.add(categoriesLabel); categoriesItem.add(categoriesContainer); mainContainer.add(categoriesItem); // WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" ");// HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, WFPage.CONTENT_BUNDLE + "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); FieldSet buttons = new FieldSet(); buttons.setStyleClass("buttons"); HtmlCommandButton saveButton = localizer.getButtonVB(SAVE_ID, "save", this); buttons.getChildren().add(saveButton); mainContainer.getChildren().add(buttons); return mainContainer; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java |
|
categoriesUI.saveCategoriesSettings(fileResourcePath, categoriesUI); | categoriesUI.saveCategoriesSettings(); | public void processAction(ActionEvent event) { String id = event.getComponent().getId(); UIComponent rootParent = rootParent = event.getComponent().getParent().getParent().getParent(); EditArticleView ab = (EditArticleView) rootParent.findComponent(EDIT_ARTICLE_BLOCK_ID); if (id.equals(SAVE_ID)) { //We have the save button pressed boolean saveSuccessful=false; saveSuccessful = ab.storeArticle(); if(saveSuccessful){ ArticleItemBean articleItemBean = getArticleItemBean(); String fileResourcePath = articleItemBean.getLocalizedArticle().getResourcePath(); WebDAVCategories categoriesUI = (WebDAVCategories) ab.getCategoryEditor(); if(categoriesUI!=null){ categoriesUI.setResourcePath(fileResourcePath); categoriesUI.saveCategoriesSettings(fileResourcePath, categoriesUI); } } clearOnInit=false; } else if (id.equals(DELETE_ID)) { //we are deleting ArticleItemBean articleItemBean = getArticleItemBean(); articleItemBean.delete(); WFUtil.addMessageVB(ab.findComponent(DELETE_ID),ArticleUtil.IW_BUNDLE_IDENTIFIER, "delete_successful"); } /* else if (id.equals(FOR_REVIEW_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setRequestedStatus", ContentItemCase.STATUS_READY_FOR_REVIEW); ab.storeArticle(); } else if (id.equals(PUBLISH_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setRequestedStatus", ContentItemCase.STATUS_PUBLISHED); ab.storeArticle(); } else if (id.equals(REWRITE_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setRequestedStatus", ContentItemCase.STATUS_REWRITE); ab.storeArticle(); } else if (id.equals(REJECT_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setRequestedStatus", ContentItemCase.STATUS_DELETED); ab.storeArticle(); } else if (id.equals(DELETE_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setRequestedStatus", ContentItemCase.STATUS_DELETED); ab.storeArticle(); } else if (id.equals(ADD_IMAGE_ID)) { ab.setEditView(FILE_UPLOAD_FORM_ID); } else if (id.equals(FILE_UPLOAD_CANCEL_ID)) { ab.setEditView(ARTICLE_EDITOR_ID); } else if (id.equals(FILE_UPLOAD_ID)) { ab.setEditView(ARTICLE_EDITOR_ID); } else if (id.equals(CaseListBean.CASE_ID)){ String itemId = WFUtil.getParameter(event.getComponent(), "id"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "addRelatedContentItem", new Integer(itemId)); ab.setEditView(ARTICLE_EDITOR_ID); }*/ } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java |
public void processValueChange(ValueChangeEvent arg0) throws AbortProcessingException { if(arg0.getOldValue()==null) { return; } if(arg0.getNewValue()==null) { return; } System.out.println("Language value has changed from "+arg0.getOldValue()+" to "+arg0.getNewValue()); | public void processValueChange(ValueChangeEvent event) throws AbortProcessingException { | public void processValueChange(ValueChangeEvent arg0) throws AbortProcessingException { if(arg0.getOldValue()==null) { return; } if(arg0.getNewValue()==null) { return; } System.out.println("Language value has changed from "+arg0.getOldValue()+" to "+arg0.getNewValue()); ArticleItemBean bean = getArticleItemBean(); //String articlePath = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getArticlePath"); String articlePath = bean.getResourcePath(); //String language = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getContentLanguage"); //String language = bean.getContentLanguage(); if(null==articlePath) { //Article has not been stored previously, so nothing has to be done return; } System.out.println("processValueChange: Article path: "+articlePath); //boolean result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+arg0.getNewValue()+ArticleItemBean.ARTICLE_SUFFIX)).booleanValue(); //System.out.println("loading other language "+result); //if(result) { //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLanguageChange",arg0.getNewValue().toString()); String langChange = arg0.getNewValue().toString(); bean.setLanguageChange(langChange); Locale locale = new Locale(langChange); bean.setLocale(locale); System.out.println("processValueChange: changint to other language "+langChange); //}else { //if(null!=language) { //result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+language+ArticleItemBean.ARTICLE_SUFFIX)).booleanValue(); //bean.setLanguageChange(language); //bean.setLocale(new Locale(language)); //System.out.println("loading other language "+result); //} //} } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java |
ArticleItemBean bean = getArticleItemBean(); String articlePath = bean.getResourcePath(); if(null==articlePath) { return; } System.out.println("processValueChange: Article path: "+articlePath); | if(event.getComponent().getId().equals(LOCALE_ID)){ if(event.getOldValue()==null) { return; } if(event.getNewValue()==null) { return; } System.out.println("Language value has changed from "+event.getOldValue()+" to "+event.getNewValue()); ArticleItemBean bean = getArticleItemBean(); String articlePath = bean.getResourcePath(); if(null==articlePath) { return; } System.out.println("processValueChange: Article path: "+articlePath); | public void processValueChange(ValueChangeEvent arg0) throws AbortProcessingException { if(arg0.getOldValue()==null) { return; } if(arg0.getNewValue()==null) { return; } System.out.println("Language value has changed from "+arg0.getOldValue()+" to "+arg0.getNewValue()); ArticleItemBean bean = getArticleItemBean(); //String articlePath = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getArticlePath"); String articlePath = bean.getResourcePath(); //String language = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getContentLanguage"); //String language = bean.getContentLanguage(); if(null==articlePath) { //Article has not been stored previously, so nothing has to be done return; } System.out.println("processValueChange: Article path: "+articlePath); //boolean result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+arg0.getNewValue()+ArticleItemBean.ARTICLE_SUFFIX)).booleanValue(); //System.out.println("loading other language "+result); //if(result) { //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLanguageChange",arg0.getNewValue().toString()); String langChange = arg0.getNewValue().toString(); bean.setLanguageChange(langChange); Locale locale = new Locale(langChange); bean.setLocale(locale); System.out.println("processValueChange: changint to other language "+langChange); //}else { //if(null!=language) { //result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+language+ArticleItemBean.ARTICLE_SUFFIX)).booleanValue(); //bean.setLanguageChange(language); //bean.setLocale(new Locale(language)); //System.out.println("loading other language "+result); //} //} } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java |
String langChange = arg0.getNewValue().toString(); | String langChange = event.getNewValue().toString(); | public void processValueChange(ValueChangeEvent arg0) throws AbortProcessingException { if(arg0.getOldValue()==null) { return; } if(arg0.getNewValue()==null) { return; } System.out.println("Language value has changed from "+arg0.getOldValue()+" to "+arg0.getNewValue()); ArticleItemBean bean = getArticleItemBean(); //String articlePath = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getArticlePath"); String articlePath = bean.getResourcePath(); //String language = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getContentLanguage"); //String language = bean.getContentLanguage(); if(null==articlePath) { //Article has not been stored previously, so nothing has to be done return; } System.out.println("processValueChange: Article path: "+articlePath); //boolean result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+arg0.getNewValue()+ArticleItemBean.ARTICLE_SUFFIX)).booleanValue(); //System.out.println("loading other language "+result); //if(result) { //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLanguageChange",arg0.getNewValue().toString()); String langChange = arg0.getNewValue().toString(); bean.setLanguageChange(langChange); Locale locale = new Locale(langChange); bean.setLocale(locale); System.out.println("processValueChange: changint to other language "+langChange); //}else { //if(null!=language) { //result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+language+ArticleItemBean.ARTICLE_SUFFIX)).booleanValue(); //bean.setLanguageChange(language); //bean.setLocale(new Locale(language)); //System.out.println("loading other language "+result); //} //} } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java |
} else if(event.getComponent().getId().equals(BODY_ID)){ String newBodyValue = event.getNewValue().toString(); getArticleItemBean().setBody(newBodyValue); } else if(event.getComponent().getId().equals(HEADLINE_ID)){ String newValue = event.getNewValue().toString(); getArticleItemBean().setHeadline(newValue); } else if(event.getComponent().getId().equals(AUTHOR_ID)){ String newValue = event.getNewValue().toString(); getArticleItemBean().setAuthor(newValue); } | public void processValueChange(ValueChangeEvent arg0) throws AbortProcessingException { if(arg0.getOldValue()==null) { return; } if(arg0.getNewValue()==null) { return; } System.out.println("Language value has changed from "+arg0.getOldValue()+" to "+arg0.getNewValue()); ArticleItemBean bean = getArticleItemBean(); //String articlePath = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getArticlePath"); String articlePath = bean.getResourcePath(); //String language = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getContentLanguage"); //String language = bean.getContentLanguage(); if(null==articlePath) { //Article has not been stored previously, so nothing has to be done return; } System.out.println("processValueChange: Article path: "+articlePath); //boolean result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+arg0.getNewValue()+ArticleItemBean.ARTICLE_SUFFIX)).booleanValue(); //System.out.println("loading other language "+result); //if(result) { //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLanguageChange",arg0.getNewValue().toString()); String langChange = arg0.getNewValue().toString(); bean.setLanguageChange(langChange); Locale locale = new Locale(langChange); bean.setLocale(locale); System.out.println("processValueChange: changint to other language "+langChange); //}else { //if(null!=language) { //result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+language+ArticleItemBean.ARTICLE_SUFFIX)).booleanValue(); //bean.setLanguageChange(language); //bean.setLocale(new Locale(language)); //System.out.println("loading other language "+result); //} //} } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java |
|
view.onDisplayChange( model.getParentModel().getBrowser().getSelectedDisplay()); | ImageDisplay node = model.getParentModel().getBrowser().getSelectedDisplay(); view.onDisplayChange(node); | private void handleBrowserSelectedDisplay(PropertyChangeEvent pce) { if (!(pce.getNewValue().equals(pce.getOldValue())) && pce.getNewValue() != null) { ImageDisplay oldNode, newNode; Colors colors = Colors.getInstance(); newNode = (ImageDisplay) pce.getNewValue(); newNode.setHighlight(colors.getSelectedHighLight(newNode)); if (pce.getOldValue() != null) { oldNode = (ImageDisplay) pce.getOldValue(); oldNode.setHighlight( colors.getDeselectedHighLight(oldNode)); } } view.onDisplayChange( model.getParentModel().getBrowser().getSelectedDisplay()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/ClipBoardControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardControl.java |
else if (propName.equals(SearchResultsPane.LOCALIZE_IMAGE_DISPLAY)) { | else if (propName.equals(ClipBoard.LOCALIZE_IMAGE_DISPLAY)) { | public void propertyChange(PropertyChangeEvent pce) { String propName = pce.getPropertyName(); if (propName.equals(Browser.SELECTED_DISPLAY_PROPERTY)) handleBrowserSelectedDisplay(pce); else if (propName.equals(SearchResultsPane.LOCALIZE_IMAGE_DISPLAY)) { ImageDisplay node = (ImageDisplay) pce.getNewValue(); ImageDisplay parent = node.getParentDisplay(); scrollToNode(node.getBounds(), parent, (parent.getParentDisplay() == null)); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/ClipBoardControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardControl.java |
void setPaneIndex(int index) { component.setPaneIndex(index); } | void setPaneIndex(int index){ component.setPaneIndex(index, null); } | void setPaneIndex(int index) { component.setPaneIndex(index); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/ClipBoardControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardControl.java |
wheelwidth = this.getWidth(); | wheelwidth = this.getWidth() < this.getHeight() ? this.getWidth() : this.getHeight(); | void changePanelSize() { wheelwidth = this.getWidth(); radius = wheelwidth/2; puckColour = Color.black; puckfillColour = Color.white; img = new BufferedImage((int) wheelwidth,(int) wheelwidth, BufferedImage.TYPE_INT_ARGB); buildLUT(); createColourWheelFromLUT(); findPuck(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a120269806e5dce185dd2b5b26374a782df23119/HSVWheel.java/clean/SRC/org/openmicroscopy/shoola/util/ui/colourpicker/HSVWheel.java |
wheelwidth = this.getWidth() < this.getHeight() ? this.getWidth() : this.getHeight(); | void render(Graphics2D g) { wheelwidth = this.getWidth() < this.getHeight() ? this.getWidth() : this.getHeight(); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.drawImage(img, 0, 0, (int) wheelwidth, (int) wheelwidth, null); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); if (puck != null) { g.setStroke(new BasicStroke(1.0f)); g.setPaint(puckfillColour); g.fillRect((int) puck.x1-2, (int) puck.x2-2, 4, 4); g.setPaint(puckColour); g.drawRect((int) puck.x1-2, (int) puck.x2-2, 4, 4); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a120269806e5dce185dd2b5b26374a782df23119/HSVWheel.java/clean/SRC/org/openmicroscopy/shoola/util/ui/colourpicker/HSVWheel.java |
|
stringClass.defineMethod("to_s", CallbackFactory.getSelfMethod()); stringClass.defineMethod("to_str", CallbackFactory.getSelfMethod()); | stringClass.defineMethod("to_s", CallbackFactory.getSelfMethod(0)); stringClass.defineMethod("to_str", CallbackFactory.getSelfMethod(0)); | public static RubyClass createStringClass(Ruby ruby) { RubyClass stringClass = ruby.defineClass("String", ruby.getClasses().getObjectClass()); stringClass.includeModule(ruby.getClasses().getComparableModule()); stringClass.includeModule(ruby.getClasses().getEnumerableModule()); stringClass.defineSingletonMethod("new", CallbackFactory.getOptSingletonMethod(RubyString.class, "newInstance")); stringClass.defineMethod("initialize", CallbackFactory.getMethod(RubyString.class, "replace", RubyObject.class)); stringClass.defineMethod("clone", CallbackFactory.getMethod(RubyString.class, "rbClone")); stringClass.defineMethod("dup", CallbackFactory.getMethod(RubyString.class, "dup")); stringClass.defineMethod("<=>", CallbackFactory.getMethod(RubyString.class, "op_cmp", RubyObject.class)); stringClass.defineMethod("==", CallbackFactory.getMethod(RubyString.class, "equal", RubyObject.class)); stringClass.defineMethod("===", CallbackFactory.getMethod(RubyString.class, "equal", RubyObject.class)); stringClass.defineMethod("eql?", CallbackFactory.getMethod(RubyString.class, "equal", RubyObject.class)); stringClass.defineMethod("hash", CallbackFactory.getMethod(RubyString.class, "hash")); stringClass.defineMethod("+", CallbackFactory.getMethod(RubyString.class, "op_plus", RubyObject.class)); stringClass.defineMethod("*", CallbackFactory.getMethod(RubyString.class, "op_mul", RubyInteger.class)); stringClass.defineMethod("%", CallbackFactory.getMethod(RubyString.class, "format", RubyObject.class)); stringClass.defineMethod("[]", CallbackFactory.getOptMethod(RubyString.class, "aref")); stringClass.defineMethod("[]=", CallbackFactory.getOptMethod(RubyString.class, "aset")); stringClass.defineMethod("length", CallbackFactory.getMethod(RubyString.class, "length")); stringClass.defineMethod("size", CallbackFactory.getMethod(RubyString.class, "length")); stringClass.defineMethod("empty?", CallbackFactory.getMethod(RubyString.class, "empty")); stringClass.defineMethod("=~", CallbackFactory.getMethod(RubyString.class, "match", RubyObject.class)); stringClass.defineMethod("~", CallbackFactory.getMethod(RubyString.class, "match2")); stringClass.defineMethod("succ", CallbackFactory.getMethod(RubyString.class, "succ")); stringClass.defineMethod("succ!", CallbackFactory.getMethod(RubyString.class, "succ_bang")); stringClass.defineMethod("next", CallbackFactory.getMethod(RubyString.class, "succ")); stringClass.defineMethod("next!", CallbackFactory.getMethod(RubyString.class, "succ_bang")); stringClass.defineMethod("upto", CallbackFactory.getMethod(RubyString.class, "upto", RubyObject.class)); stringClass.defineMethod("index", CallbackFactory.getOptMethod(RubyString.class, "index")); stringClass.defineMethod("rindex", CallbackFactory.getOptMethod(RubyString.class, "rindex")); stringClass.defineMethod("replace", CallbackFactory.getMethod(RubyString.class, "replace", RubyObject.class)); stringClass.defineMethod("to_i", CallbackFactory.getMethod(RubyString.class, "to_i")); stringClass.defineMethod("to_f", CallbackFactory.getMethod(RubyString.class, "to_f")); stringClass.defineMethod("to_s", CallbackFactory.getSelfMethod()); stringClass.defineMethod("to_str", CallbackFactory.getSelfMethod()); stringClass.defineMethod("inspect", CallbackFactory.getMethod(RubyString.class, "inspect")); stringClass.defineMethod("dump", CallbackFactory.getMethod(RubyString.class, "dump")); stringClass.defineMethod("upcase", CallbackFactory.getMethod(RubyString.class, "upcase")); stringClass.defineMethod("downcase", CallbackFactory.getMethod(RubyString.class, "downcase")); stringClass.defineMethod("capitalize", CallbackFactory.getMethod(RubyString.class, "capitalize")); stringClass.defineMethod("swapcase", CallbackFactory.getMethod(RubyString.class, "swapcase")); stringClass.defineMethod("upcase!", CallbackFactory.getMethod(RubyString.class, "upcase_bang")); stringClass.defineMethod("downcase!", CallbackFactory.getMethod(RubyString.class, "downcase_bang")); stringClass.defineMethod("capitalize!", CallbackFactory.getMethod(RubyString.class, "capitalize_bang")); stringClass.defineMethod("swapcase!", CallbackFactory.getMethod(RubyString.class, "swapcase_bang")); stringClass.defineMethod("hex", CallbackFactory.getMethod(RubyString.class, "hex")); stringClass.defineMethod("oct", CallbackFactory.getMethod(RubyString.class, "oct")); stringClass.defineMethod("split", CallbackFactory.getOptMethod(RubyString.class, "split")); stringClass.defineMethod("reverse", CallbackFactory.getMethod(RubyString.class, "reverse")); stringClass.defineMethod("reverse!", CallbackFactory.getMethod(RubyString.class, "reverse_bang")); stringClass.defineMethod("concat", CallbackFactory.getMethod(RubyString.class, "concat", RubyObject.class)); stringClass.defineMethod("<<", CallbackFactory.getMethod(RubyString.class, "concat", RubyObject.class)); // rb_define_method(rb_cString, "crypt", rb_str_crypt, 1); stringClass.defineMethod("intern", CallbackFactory.getMethod(RubyString.class, "intern")); stringClass.defineMethod("include?", CallbackFactory.getMethod(RubyString.class, "include", RubyObject.class)); stringClass.defineMethod("scan", CallbackFactory.getMethod(RubyString.class, "scan", RubyObject.class)); stringClass.defineMethod("ljust", CallbackFactory.getMethod(RubyString.class, "ljust", RubyObject.class)); stringClass.defineMethod("rjust", CallbackFactory.getMethod(RubyString.class, "rjust", RubyObject.class)); stringClass.defineMethod("center", CallbackFactory.getMethod(RubyString.class, "center", RubyObject.class)); stringClass.defineMethod("sub", CallbackFactory.getOptMethod(RubyString.class, "sub")); stringClass.defineMethod("gsub", CallbackFactory.getOptMethod(RubyString.class, "gsub")); stringClass.defineMethod("chop", CallbackFactory.getMethod(RubyString.class, "chop")); stringClass.defineMethod("chomp", CallbackFactory.getOptMethod(RubyString.class, "chomp")); stringClass.defineMethod("strip", CallbackFactory.getMethod(RubyString.class, "strip")); stringClass.defineMethod("sub!", CallbackFactory.getOptMethod(RubyString.class, "sub_bang")); stringClass.defineMethod("gsub!", CallbackFactory.getOptMethod(RubyString.class, "gsub_bang")); stringClass.defineMethod("chop!", CallbackFactory.getMethod(RubyString.class, "chop_bang")); stringClass.defineMethod("chomp!", CallbackFactory.getOptMethod(RubyString.class, "chomp_bang")); stringClass.defineMethod("strip!", CallbackFactory.getMethod(RubyString.class, "strip_bang")); stringClass.defineMethod("tr", CallbackFactory.getOptMethod(RubyString.class, "tr")); stringClass.defineMethod("tr_s", CallbackFactory.getOptMethod(RubyString.class, "tr_s")); stringClass.defineMethod("delete", CallbackFactory.getOptMethod(RubyString.class, "delete")); stringClass.defineMethod("squeeze", CallbackFactory.getOptMethod(RubyString.class, "squeeze")); stringClass.defineMethod("count", CallbackFactory.getOptMethod(RubyString.class, "count")); stringClass.defineMethod("tr!", CallbackFactory.getOptMethod(RubyString.class, "tr_bang")); stringClass.defineMethod("tr_s!", CallbackFactory.getOptMethod(RubyString.class, "tr_s_bang")); stringClass.defineMethod("delete!", CallbackFactory.getOptMethod(RubyString.class, "delete_bang")); stringClass.defineMethod("squeeze!", CallbackFactory.getOptMethod(RubyString.class, "squeeze_bang")); stringClass.defineMethod("each_line", CallbackFactory.getOptMethod(RubyString.class, "each_line")); stringClass.defineMethod("each", CallbackFactory.getOptMethod(RubyString.class, "each_line")); stringClass.defineMethod("each_byte", CallbackFactory.getMethod(RubyString.class, "each_byte")); // rb_define_method(rb_cString, "sum", rb_str_sum, -1); stringClass.defineMethod("slice", CallbackFactory.getOptMethod(RubyString.class, "aref")); stringClass.defineMethod("slice!", CallbackFactory.getOptMethod(RubyString.class, "slice_bang")); // id_to_s = rb_intern("to_s"); // rb_fs = Qnil; // rb_define_hooked_variable("$;", &rb_fs, 0, rb_str_setter); // rb_define_hooked_variable("$-F", &rb_fs, 0, rb_str_setter); stringClass.defineMethod("unpack", CallbackFactory.getMethod(RubyString.class, "unpack", RubyString.class)); return stringClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyString.java/buggy/org/jruby/RubyString.java |
List contents = getContents(getDir(recv.getRuntime(), path.getValue())); for (Iterator i=contents.iterator(); i.hasNext();) { String name = (String) i.next(); recv.getRuntime().yield(new RubyString(recv.getRuntime(), name)); } | RubyDir dir = (RubyDir) newInstance(recv.getRuntime().getClasses().getDirClass(), new IRubyObject[] { path }); dir.each(); | public static IRubyObject foreach(IRubyObject recv, RubyString path) { path.checkSafeString(); List contents = getContents(getDir(recv.getRuntime(), path.getValue())); for (Iterator i=contents.iterator(); i.hasNext();) { String name = (String) i.next(); recv.getRuntime().yield(new RubyString(recv.getRuntime(), name)); } return recv.getRuntime().getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a63c3a2bda4f5cc63232e1265228dad5fdecc71e/RubyDir.java/buggy/org/jruby/RubyDir.java |
contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F11"), "viewClient"); | contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control F11"), "viewClient"); | public void initialize() { // Create IQ Filter PacketFilter packetFilter = new PacketTypeFilter(IQ.class); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { IQ iq = (IQ)packet; // Handle Version Request if (iq instanceof Version && iq.getType() == IQ.Type.GET) { // Send Version Version version = new Version(); version.setName("Spark IM Client"); version.setOs(JiveInfo.getOS()); version.setVersion(JiveInfo.getVersion()); // Send back as a reply version.setPacketID(iq.getPacketID()); version.setType(IQ.Type.RESULT); version.setTo(iq.getFrom()); version.setFrom(iq.getTo()); SparkManager.getConnection().sendPacket(version); } // Send time else if (iq instanceof Time && iq.getType() == IQ.Type.GET) { Time time = new Time(); time.setPacketID(iq.getPacketID()); time.setFrom(iq.getTo()); time.setTo(iq.getFrom()); time.setTime(new Date()); time.setType(IQ.Type.RESULT); // Send Time SparkManager.getConnection().sendPacket(time); } } }, packetFilter); final ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F11"), "viewClient"); contactList.addContextMenuListener(new ContextMenuListener() { public void poppingUp(final Object component, JPopupMenu popup) { if (!(component instanceof ContactItem)) { return; } Action versionRequest = new AbstractAction() { public void actionPerformed(ActionEvent e) { viewClient(); } }; versionRequest.putValue(Action.NAME, Res.getString("menuitem.view.client.version")); popup.add(versionRequest); } public void poppingDown(JPopupMenu popup) { } public boolean handleDefaultAction(MouseEvent e) { return false; } }); contactList.getActionMap().put("viewClient", new AbstractAction("viewClient") { public void actionPerformed(ActionEvent evt) { viewClient(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/5e1d8400b514b5787162e272df97866d10408dc2/JabberVersion.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/jabber/JabberVersion.java |
data[i][1] = is.getDate(); | data[i][1] = ""; | private ImagesTableModel() { ImageSummary is; for (int i = 0; i < images.length; i++) { is = (ImageSummary) images[i]; data[i][0] = is.getName(); data[i][1] = is.getDate(); //TODO } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3babe21fc0b956c19a60ec0a4b2e1a3f2da5a7c1/ImagesPaneManager.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/ImagesPaneManager.java |
public Image(Integer imageId, Date inserted, String name, String description, Date created, String imageGuid, org.openmicroscopy.omero.model.ImagePixel imagePixel, org.openmicroscopy.omero.model.Group group, org.openmicroscopy.omero.model.Experimenter experimenter, Set thumbnails, Set classifications, Set displayRois, Set imageInfos, Set imagePixels, Set imagePlates, Set features, Set imageAnnotations, Set moduleExecutions, Set imageDimensions, Set channelComponents, Set displayOptions, Set datasets) { this.imageId = imageId; this.inserted = inserted; this.name = name; this.description = description; this.created = created; this.imageGuid = imageGuid; this.imagePixel = imagePixel; this.group = group; this.experimenter = experimenter; this.thumbnails = thumbnails; this.classifications = classifications; this.displayRois = displayRois; this.imageInfos = imageInfos; this.imagePixels = imagePixels; this.imagePlates = imagePlates; this.features = features; this.imageAnnotations = imageAnnotations; this.moduleExecutions = moduleExecutions; this.imageDimensions = imageDimensions; this.channelComponents = channelComponents; this.displayOptions = displayOptions; this.datasets = datasets; | public Image() { | public Image(Integer imageId, Date inserted, String name, String description, Date created, String imageGuid, org.openmicroscopy.omero.model.ImagePixel imagePixel, org.openmicroscopy.omero.model.Group group, org.openmicroscopy.omero.model.Experimenter experimenter, Set thumbnails, Set classifications, Set displayRois, Set imageInfos, Set imagePixels, Set imagePlates, Set features, Set imageAnnotations, Set moduleExecutions, Set imageDimensions, Set channelComponents, Set displayOptions, Set datasets) { this.imageId = imageId; this.inserted = inserted; this.name = name; this.description = description; this.created = created; this.imageGuid = imageGuid; this.imagePixel = imagePixel; this.group = group; this.experimenter = experimenter; this.thumbnails = thumbnails; this.classifications = classifications; this.displayRois = displayRois; this.imageInfos = imageInfos; this.imagePixels = imagePixels; this.imagePlates = imagePlates; this.features = features; this.imageAnnotations = imageAnnotations; this.moduleExecutions = moduleExecutions; this.imageDimensions = imageDimensions; this.channelComponents = channelComponents; this.displayOptions = displayOptions; this.datasets = datasets; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Image.java/clean/components/common/src/org/openmicroscopy/omero/model/Image.java |
public org.openmicroscopy.omero.model.Experimenter getExperimenter() { | public Experimenter getExperimenter() { | public org.openmicroscopy.omero.model.Experimenter getExperimenter() { return this.experimenter; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Image.java/clean/components/common/src/org/openmicroscopy/omero/model/Image.java |
public org.openmicroscopy.omero.model.Group getGroup() { | public Group getGroup() { | public org.openmicroscopy.omero.model.Group getGroup() { return this.group; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Image.java/clean/components/common/src/org/openmicroscopy/omero/model/Image.java |
public org.openmicroscopy.omero.model.ImagePixel getImagePixel() { | public ImagePixel getImagePixel() { | public org.openmicroscopy.omero.model.ImagePixel getImagePixel() { return this.imagePixel; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Image.java/clean/components/common/src/org/openmicroscopy/omero/model/Image.java |
public void setExperimenter(org.openmicroscopy.omero.model.Experimenter experimenter) { | public void setExperimenter(Experimenter experimenter) { | public void setExperimenter(org.openmicroscopy.omero.model.Experimenter experimenter) { this.experimenter = experimenter; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Image.java/clean/components/common/src/org/openmicroscopy/omero/model/Image.java |
public void setGroup(org.openmicroscopy.omero.model.Group group) { | public void setGroup(Group group) { | public void setGroup(org.openmicroscopy.omero.model.Group group) { this.group = group; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Image.java/clean/components/common/src/org/openmicroscopy/omero/model/Image.java |
public void setImagePixel(org.openmicroscopy.omero.model.ImagePixel imagePixel) { | public void setImagePixel(ImagePixel imagePixel) { | public void setImagePixel(org.openmicroscopy.omero.model.ImagePixel imagePixel) { this.imagePixel = imagePixel; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Image.java/clean/components/common/src/org/openmicroscopy/omero/model/Image.java |
this.context = context; if (initializedSignal != null) { initializedSignal.countDown(); } | public void initialize(ServiceConditionContext context) { initializeCalled = true; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
|
this.context = context; if (initializedSignal != null) { initializedSignal.countDown(); } | public void initialize(ServiceConditionContext context) { initializeCalled = true; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
|
private void destroy() throws UnsatisfiedConditionsException, IllegalServiceStateException { | private void destroy(StopStrategy stopStrategy) { ServiceState initialState = serviceManager.getState(); | private void destroy() throws UnsatisfiedConditionsException, IllegalServiceStateException { serviceMonitor.reset(); serviceManager.destroy(StopStrategies.SYNCHRONOUS); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); // verify expected events fired assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNotNull(serviceMonitor.unregistered); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
serviceManager.destroy(StopStrategies.SYNCHRONOUS); | startCondition.reset(); stopCondition.reset(); kernel.reset(); try { serviceManager.destroy(stopStrategy); } catch (IllegalServiceStateException e) { assertFalse(stopCondition.satisfied); assertSame(StopStrategies.ASYNCHRONOUS, stopStrategy); } catch (UnsatisfiedConditionsException e) { assertFalse(stopCondition.satisfied); assertSame(StopStrategies.SYNCHRONOUS, stopStrategy); assertTrue(e.getUnsatisfiedConditions().contains(stopCondition)); } | private void destroy() throws UnsatisfiedConditionsException, IllegalServiceStateException { serviceMonitor.reset(); serviceManager.destroy(StopStrategies.SYNCHRONOUS); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); // verify expected events fired assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNotNull(serviceMonitor.unregistered); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNotNull(serviceMonitor.unregistered); | if (serviceFactory.restartable || initialState == ServiceState.STOPPED) { assertSame(ServiceState.STOPPED, serviceManager.getState()); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNotNull(serviceMonitor.unregistered); } else if (!stopCondition.satisfied && stopStrategy != StopStrategies.FORCE) { assertSame(ServiceState.RUNNING, serviceManager.getState()); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); assertTrue(serviceManager.getStartTime() > 0); assertNotNull(serviceManager.getService()); assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); if (stopStrategy == StopStrategies.ASYNCHRONOUS) { assertNotNull(serviceMonitor.waitingToStop); assertTrue(serviceMonitor.waitingToStop.getUnsatisfiedConditions().contains(stopCondition)); } else { assertNull(serviceMonitor.waitingToStop); } assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); } else if (serviceFactory.throwExceptionFromDestroy != true) { assertSame(ServiceState.STOPPED, serviceManager.getState()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNotNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); if (!stopCondition.satisfied && stopStrategy == StopStrategies.FORCE) { assertNotNull(serviceMonitor.stopError); } else { assertNull(serviceMonitor.stopError); } assertNotNull(serviceMonitor.stopped); assertNotNull(serviceMonitor.unregistered); if (!stopCondition.satisfied && stopStrategy == StopStrategies.FORCE) { assertEquals(serviceMonitor.stopError.getEventId() + 1, serviceMonitor.stopping.getEventId()); assertEquals(serviceMonitor.stopError.getEventId() + 2, serviceMonitor.stopped.getEventId()); assertEquals(serviceMonitor.stopError.getEventId() + 3, serviceMonitor.unregistered.getEventId()); } else { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.stopped.getEventId()); assertEquals(serviceMonitor.stopping.getEventId() + 2, serviceMonitor.unregistered.getEventId()); } assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertTrue(startCondition.destroyCalled); assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } else { assertSame(ServiceState.STOPPED, serviceManager.getState()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNotNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNotNull(serviceMonitor.stopError); assertNotNull(serviceMonitor.stopped); assertNotNull(serviceMonitor.unregistered); assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.stopError.getEventId()); assertEquals(serviceMonitor.stopping.getEventId() + 2, serviceMonitor.stopped.getEventId()); assertEquals(serviceMonitor.stopping.getEventId() + 3, serviceMonitor.unregistered.getEventId()); assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertTrue(startCondition.destroyCalled); assertTrue(stopCondition.initializeCalled); assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } | private void destroy() throws UnsatisfiedConditionsException, IllegalServiceStateException { serviceMonitor.reset(); serviceManager.destroy(StopStrategies.SYNCHRONOUS); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); // verify expected events fired assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNotNull(serviceMonitor.unregistered); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
private void disabledStart(StartStrategy startStrategy) throws Exception { serviceFactory.setEnabled(false); try { serviceManager.start(false, startStrategy); fail("A disabled service should throw an IllegalServiceStateException from start"); } catch (IllegalServiceStateException e) { // expected } // move to starting disable, move to running, and try to restart serviceFactory.setEnabled(true); startCondition.satisfied = false; start(false, StartStrategies.ASYNCHRONOUS); serviceFactory.setEnabled(false);// try {// start(false, startStrategy);// } catch (IllegalServiceStateException e) {// assertTrue(startStrategy == StartStrategies.UNREGISTER);// } catch (UnsatisfiedConditionsException e) {// assertTrue(startStrategy == StartStrategies.SYNCHRONOUS);// assertTrue(e.getUnsatisfiedConditions().contains(startCondition));// } catch (UnregisterServiceException e) {// assertEquals(StartStrategies.UNREGISTER, startStrategy);// UnsatisfiedConditionsException cause = (UnsatisfiedConditionsException) e.getCause();// assertTrue(cause.getUnsatisfiedConditions().contains(startCondition));// } startCondition.satisfied = true; try { start(false, startStrategy); } catch (IllegalServiceStateException e) { assertTrue(startStrategy == StartStrategies.UNREGISTER); } try { start(false, startStrategy); } catch (IllegalServiceStateException e) { assertTrue(startStrategy == StartStrategies.UNREGISTER); } stop(StopStrategies.ASYNCHRONOUS); try { serviceManager.start(false, startStrategy); fail("A disabled service should throw an IllegalServiceStateException from start"); } catch (IllegalServiceStateException e) { // expected } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
||
try { start(false, startStrategy); } catch (IllegalServiceStateException e) { assertTrue(startStrategy == StartStrategies.UNREGISTER); } try { start(false, startStrategy); } catch (IllegalServiceStateException e) { assertTrue(startStrategy == StartStrategies.UNREGISTER); } | start(false, startStrategy); start(false, startStrategy); | private void disabledStart(StartStrategy startStrategy) throws Exception { serviceFactory.setEnabled(false); try { serviceManager.start(false, startStrategy); fail("A disabled service should throw an IllegalServiceStateException from start"); } catch (IllegalServiceStateException e) { // expected } // move to starting disable, move to running, and try to restart serviceFactory.setEnabled(true); startCondition.satisfied = false; start(false, StartStrategies.ASYNCHRONOUS); serviceFactory.setEnabled(false);// try {// start(false, startStrategy);// } catch (IllegalServiceStateException e) {// assertTrue(startStrategy == StartStrategies.UNREGISTER);// } catch (UnsatisfiedConditionsException e) {// assertTrue(startStrategy == StartStrategies.SYNCHRONOUS);// assertTrue(e.getUnsatisfiedConditions().contains(startCondition));// } catch (UnregisterServiceException e) {// assertEquals(StartStrategies.UNREGISTER, startStrategy);// UnsatisfiedConditionsException cause = (UnsatisfiedConditionsException) e.getCause();// assertTrue(cause.getUnsatisfiedConditions().contains(startCondition));// } startCondition.satisfied = true; try { start(false, startStrategy); } catch (IllegalServiceStateException e) { assertTrue(startStrategy == StartStrategies.UNREGISTER); } try { start(false, startStrategy); } catch (IllegalServiceStateException e) { assertTrue(startStrategy == StartStrategies.UNREGISTER); } stop(StopStrategies.ASYNCHRONOUS); try { serviceManager.start(false, startStrategy); fail("A disabled service should throw an IllegalServiceStateException from start"); } catch (IllegalServiceStateException e) { // expected } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
serviceManager.initialize(); | startCondition.reset(); stopCondition.reset(); kernel.reset(); try { serviceManager.initialize(); } catch (MockCreateException e) { assertTrue(serviceFactory.throwExceptionFromCreate == true); assertSame(serviceFactory.createException, e); } catch (UnsatisfiedConditionsException e) { assertTrue(startCondition.satisfied == false); assertTrue(e.getUnsatisfiedConditions().contains(startCondition)); } catch (IllegalServiceStateException e) { assertFalse(serviceFactory.isEnabled()); } | private void initialize() throws Exception { serviceMonitor.reset(); serviceManager.initialize(); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); // verify expected events fired assertNotNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); assertNotNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); | if (serviceFactory.restartable) { assertSame(ServiceState.STOPPED, serviceManager.getState()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertNotNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertFalse(startCondition.destroyCalled); assertFalse(stopCondition.initializeCalled); assertFalse(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } else if (!serviceFactory.isEnabled()) { assertSame(ServiceState.STOPPED, serviceManager.getState()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertFalse(startCondition.destroyCalled); assertFalse(stopCondition.initializeCalled); assertFalse(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } else if (serviceFactory.throwExceptionFromCreate != true && startCondition.satisfied == true) { assertSame(ServiceState.RUNNING, serviceManager.getState()); assertSame(SERVICE, serviceManager.getService()); assertTrue(serviceManager.getStartTime() > now); assertNotNull(serviceMonitor.registered); assertNotNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNotNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); assertEquals(serviceMonitor.registered.getEventId() + 1, serviceMonitor.starting.getEventId()); assertEquals(serviceMonitor.registered.getEventId() + 2, serviceMonitor.running.getEventId()); assertTrue(startCondition.initializeCalled); assertTrue(startCondition.isSatisfiedCalled); assertFalse(startCondition.destroyCalled); assertFalse(stopCondition.initializeCalled); assertFalse(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } else { assertSame(ServiceState.STOPPED, serviceManager.getState()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertNotNull(serviceMonitor.registered); assertNotNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNotNull(serviceMonitor.stopping); assertNull(serviceMonitor.stopError); assertNotNull(serviceMonitor.stopped); assertNotNull(serviceMonitor.unregistered); assertEquals(serviceMonitor.registered.getEventId() + 1, serviceMonitor.starting.getEventId()); assertEquals(serviceMonitor.registered.getEventId() + 2, serviceMonitor.stopping.getEventId()); assertEquals(serviceMonitor.registered.getEventId() + 3, serviceMonitor.stopped.getEventId()); assertEquals(serviceMonitor.registered.getEventId() + 4, serviceMonitor.unregistered.getEventId()); assertTrue(startCondition.initializeCalled); assertTrue(startCondition.isSatisfiedCalled); assertTrue(startCondition.destroyCalled); assertFalse(stopCondition.initializeCalled); assertFalse(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } | private void initialize() throws Exception { serviceMonitor.reset(); serviceManager.initialize(); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); // verify expected events fired assertNotNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
private void startException(StartStrategy startStrategy) throws Exception { | private void startException(StartStrategy startStrategy, boolean recursive) throws Exception { | private void startException(StartStrategy startStrategy) throws Exception { serviceFactory.throwExceptionFromCreate = true; try { start(false, startStrategy); } catch (MockCreateException e) { assertTrue(startStrategy == StartStrategies.SYNCHRONOUS || startStrategy == StartStrategies.BLOCK); assertEquals(serviceFactory.createException, e); } catch (UnregisterServiceException e) { assertEquals(StartStrategies.UNREGISTER, startStrategy); assertSame(serviceFactory.createException, e.getCause()); } stop(StopStrategies.SYNCHRONOUS); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
start(false, startStrategy); | start(recursive, startStrategy); | private void startException(StartStrategy startStrategy) throws Exception { serviceFactory.throwExceptionFromCreate = true; try { start(false, startStrategy); } catch (MockCreateException e) { assertTrue(startStrategy == StartStrategies.SYNCHRONOUS || startStrategy == StartStrategies.BLOCK); assertEquals(serviceFactory.createException, e); } catch (UnregisterServiceException e) { assertEquals(StartStrategies.UNREGISTER, startStrategy); assertSame(serviceFactory.createException, e.getCause()); } stop(StopStrategies.SYNCHRONOUS); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
private void startStop(StartStrategy startStrategy) throws Exception { start(false, startStrategy); | private void startStop(StartStrategy startStrategy, boolean recursive) throws Exception { start(recursive, startStrategy); | private void startStop(StartStrategy startStrategy) throws Exception { start(false, startStrategy); stop(StopStrategies.SYNCHRONOUS); start(false, startStrategy); start(false, startStrategy); stop(StopStrategies.SYNCHRONOUS); stop(StopStrategies.SYNCHRONOUS); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
start(false, startStrategy); start(false, startStrategy); | start(recursive, startStrategy); start(recursive, startStrategy); | private void startStop(StartStrategy startStrategy) throws Exception { start(false, startStrategy); stop(StopStrategies.SYNCHRONOUS); start(false, startStrategy); start(false, startStrategy); stop(StopStrategies.SYNCHRONOUS); stop(StopStrategies.SYNCHRONOUS); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
} else if (!stopCondition.satisfied) { | } else if (!stopCondition.satisfied && stopStrategy != StopStrategies.FORCE) { | private void stop(StopStrategy stopStrategy) throws Exception { serviceMonitor.reset(); startCondition.reset(); stopCondition.reset(); ServiceState initialState = serviceManager.getState(); serviceManager.stop(stopStrategy); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); // these events should never fire in response to start assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); if (initialState == ServiceState.STOPPED) { // // We were alredy stopped so nothing should have happened // assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertFalse(startCondition.destroyCalled); // stop condition methods assertFalse(stopCondition.initializeCalled); assertFalse(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } else if (!stopCondition.satisfied) { // // waiting to stop // assertSame(ServiceState.STOPPING, serviceManager.getState()); assertTrue(serviceManager.getStartTime() > 0); assertSame(SERVICE, serviceManager.getService()); // verify expected events fired if (initialState != ServiceState.STOPPING) { assertNotNull(serviceMonitor.stopping); } assertNotNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // verify events fired in the correct order if (initialState != ServiceState.STOPPING) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.waitingToStop.getEventId()); } // our condition should be in the unsatisfied condition list assertNotNull(serviceMonitor.waitingToStop.getUnsatisfiedConditions()); assertTrue(serviceMonitor.waitingToStop.getUnsatisfiedConditions().contains(stopCondition)); // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertFalse(startCondition.destroyCalled); // stop condition methods if (initialState == ServiceState.RUNNING) { assertTrue(stopCondition.initializeCalled); } else { assertFalse(stopCondition.initializeCalled); } assertTrue(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } else if (!serviceFactory.throwExceptionFromDestroy) { // // Normal transition to STOPPED from either STARTING, RUNNING or STOPPING // assertSame(ServiceState.STOPPED, serviceManager.getState()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); // verify expected events fired if (initialState != ServiceState.STOPPING) { assertNotNull(serviceMonitor.stopping); } assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNotNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // verify events fired in the correct order if (initialState != ServiceState.STOPPING) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.stopped.getEventId()); } // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertTrue(startCondition.destroyCalled); // stop condition methods if (initialState == ServiceState.STOPPING) { assertFalse(stopCondition.initializeCalled); assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } else { assertTrue(stopCondition.initializeCalled); assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } } else { // // Throw an exception from the destroy method // assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); // verify expected events fired if (initialState != ServiceState.STOPPING) { assertNotNull(serviceMonitor.stopping); } assertNull(serviceMonitor.waitingToStop); assertNotNull(serviceMonitor.stopError); assertNotNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // verify events fired in the correct order if (initialState != ServiceState.STOPPING) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.stopError.getEventId()); assertEquals(serviceMonitor.stopping.getEventId() + 2, serviceMonitor.stopped.getEventId()); } else { assertEquals(serviceMonitor.stopError.getEventId() + 1, serviceMonitor.stopped.getEventId()); } // verify that the exception is in the reson field assertSame(serviceFactory.destroyException, serviceMonitor.stopError.getCause()); // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertTrue(startCondition.destroyCalled); // stop condition methods if (initialState == ServiceState.RUNNING) { assertTrue(stopCondition.initializeCalled); } else { assertFalse(stopCondition.initializeCalled); } assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
assertNull(serviceMonitor.stopError); | if (stopStrategy == StopStrategies.FORCE) { assertNotNull(serviceMonitor.stopError); ForcedStopException cause = (ForcedStopException) serviceMonitor.stopError.getCause(); assertTrue(cause.getUnsatisfiedConditions().contains(stopCondition)); } else { assertNull(serviceMonitor.stopError); } | private void stop(StopStrategy stopStrategy) throws Exception { serviceMonitor.reset(); startCondition.reset(); stopCondition.reset(); ServiceState initialState = serviceManager.getState(); serviceManager.stop(stopStrategy); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); // these events should never fire in response to start assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); if (initialState == ServiceState.STOPPED) { // // We were alredy stopped so nothing should have happened // assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertFalse(startCondition.destroyCalled); // stop condition methods assertFalse(stopCondition.initializeCalled); assertFalse(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } else if (!stopCondition.satisfied) { // // waiting to stop // assertSame(ServiceState.STOPPING, serviceManager.getState()); assertTrue(serviceManager.getStartTime() > 0); assertSame(SERVICE, serviceManager.getService()); // verify expected events fired if (initialState != ServiceState.STOPPING) { assertNotNull(serviceMonitor.stopping); } assertNotNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // verify events fired in the correct order if (initialState != ServiceState.STOPPING) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.waitingToStop.getEventId()); } // our condition should be in the unsatisfied condition list assertNotNull(serviceMonitor.waitingToStop.getUnsatisfiedConditions()); assertTrue(serviceMonitor.waitingToStop.getUnsatisfiedConditions().contains(stopCondition)); // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertFalse(startCondition.destroyCalled); // stop condition methods if (initialState == ServiceState.RUNNING) { assertTrue(stopCondition.initializeCalled); } else { assertFalse(stopCondition.initializeCalled); } assertTrue(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } else if (!serviceFactory.throwExceptionFromDestroy) { // // Normal transition to STOPPED from either STARTING, RUNNING or STOPPING // assertSame(ServiceState.STOPPED, serviceManager.getState()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); // verify expected events fired if (initialState != ServiceState.STOPPING) { assertNotNull(serviceMonitor.stopping); } assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNotNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // verify events fired in the correct order if (initialState != ServiceState.STOPPING) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.stopped.getEventId()); } // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertTrue(startCondition.destroyCalled); // stop condition methods if (initialState == ServiceState.STOPPING) { assertFalse(stopCondition.initializeCalled); assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } else { assertTrue(stopCondition.initializeCalled); assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } } else { // // Throw an exception from the destroy method // assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); // verify expected events fired if (initialState != ServiceState.STOPPING) { assertNotNull(serviceMonitor.stopping); } assertNull(serviceMonitor.waitingToStop); assertNotNull(serviceMonitor.stopError); assertNotNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // verify events fired in the correct order if (initialState != ServiceState.STOPPING) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.stopError.getEventId()); assertEquals(serviceMonitor.stopping.getEventId() + 2, serviceMonitor.stopped.getEventId()); } else { assertEquals(serviceMonitor.stopError.getEventId() + 1, serviceMonitor.stopped.getEventId()); } // verify that the exception is in the reson field assertSame(serviceFactory.destroyException, serviceMonitor.stopError.getCause()); // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertTrue(startCondition.destroyCalled); // stop condition methods if (initialState == ServiceState.RUNNING) { assertTrue(stopCondition.initializeCalled); } else { assertFalse(stopCondition.initializeCalled); } assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
if (initialState != ServiceState.STOPPING) { | if (stopStrategy == StopStrategies.FORCE) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.stopError.getEventId()); assertEquals(serviceMonitor.stopping.getEventId() + 2, serviceMonitor.stopped.getEventId()); } else if (initialState != ServiceState.STOPPING) { | private void stop(StopStrategy stopStrategy) throws Exception { serviceMonitor.reset(); startCondition.reset(); stopCondition.reset(); ServiceState initialState = serviceManager.getState(); serviceManager.stop(stopStrategy); assertSame(serviceName, serviceManager.getServiceName()); assertSame(serviceFactory, serviceManager.getServiceFactory()); assertSame(classLoader, serviceManager.getClassLoader()); // these events should never fire in response to start assertNull(serviceMonitor.registered); assertNull(serviceMonitor.starting); assertNull(serviceMonitor.waitingToStart); assertNull(serviceMonitor.startError); assertNull(serviceMonitor.running); if (initialState == ServiceState.STOPPED) { // // We were alredy stopped so nothing should have happened // assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); assertNull(serviceMonitor.stopping); assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertFalse(startCondition.destroyCalled); // stop condition methods assertFalse(stopCondition.initializeCalled); assertFalse(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } else if (!stopCondition.satisfied) { // // waiting to stop // assertSame(ServiceState.STOPPING, serviceManager.getState()); assertTrue(serviceManager.getStartTime() > 0); assertSame(SERVICE, serviceManager.getService()); // verify expected events fired if (initialState != ServiceState.STOPPING) { assertNotNull(serviceMonitor.stopping); } assertNotNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // verify events fired in the correct order if (initialState != ServiceState.STOPPING) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.waitingToStop.getEventId()); } // our condition should be in the unsatisfied condition list assertNotNull(serviceMonitor.waitingToStop.getUnsatisfiedConditions()); assertTrue(serviceMonitor.waitingToStop.getUnsatisfiedConditions().contains(stopCondition)); // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertFalse(startCondition.destroyCalled); // stop condition methods if (initialState == ServiceState.RUNNING) { assertTrue(stopCondition.initializeCalled); } else { assertFalse(stopCondition.initializeCalled); } assertTrue(stopCondition.isSatisfiedCalled); assertFalse(stopCondition.destroyCalled); } else if (!serviceFactory.throwExceptionFromDestroy) { // // Normal transition to STOPPED from either STARTING, RUNNING or STOPPING // assertSame(ServiceState.STOPPED, serviceManager.getState()); assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); // verify expected events fired if (initialState != ServiceState.STOPPING) { assertNotNull(serviceMonitor.stopping); } assertNull(serviceMonitor.waitingToStop); assertNull(serviceMonitor.stopError); assertNotNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // verify events fired in the correct order if (initialState != ServiceState.STOPPING) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.stopped.getEventId()); } // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertTrue(startCondition.destroyCalled); // stop condition methods if (initialState == ServiceState.STOPPING) { assertFalse(stopCondition.initializeCalled); assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } else { assertTrue(stopCondition.initializeCalled); assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } } else { // // Throw an exception from the destroy method // assertEquals(0, serviceManager.getStartTime()); assertNull(serviceManager.getService()); assertSame(ServiceState.STOPPED, serviceManager.getState()); // verify expected events fired if (initialState != ServiceState.STOPPING) { assertNotNull(serviceMonitor.stopping); } assertNull(serviceMonitor.waitingToStop); assertNotNull(serviceMonitor.stopError); assertNotNull(serviceMonitor.stopped); assertNull(serviceMonitor.unregistered); // verify events fired in the correct order if (initialState != ServiceState.STOPPING) { assertEquals(serviceMonitor.stopping.getEventId() + 1, serviceMonitor.stopError.getEventId()); assertEquals(serviceMonitor.stopping.getEventId() + 2, serviceMonitor.stopped.getEventId()); } else { assertEquals(serviceMonitor.stopError.getEventId() + 1, serviceMonitor.stopped.getEventId()); } // verify that the exception is in the reson field assertSame(serviceFactory.destroyException, serviceMonitor.stopError.getCause()); // start condition methods assertFalse(startCondition.initializeCalled); assertFalse(startCondition.isSatisfiedCalled); assertTrue(startCondition.destroyCalled); // stop condition methods if (initialState == ServiceState.RUNNING) { assertTrue(stopCondition.initializeCalled); } else { assertFalse(stopCondition.initializeCalled); } assertTrue(stopCondition.isSatisfiedCalled); assertTrue(stopCondition.destroyCalled); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
destroy(); | destroy(StopStrategies.SYNCHRONOUS); | public void testInitializeDestroy() throws Exception { initialize(); destroy(); initialize(); destroy(); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
destroy(); | destroy(StopStrategies.SYNCHRONOUS); | public void testInitializeDestroy() throws Exception { initialize(); destroy(); initialize(); destroy(); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
startException(StartStrategies.ASYNCHRONOUS); startException(StartStrategies.SYNCHRONOUS); startException(StartStrategies.UNREGISTER); startException(StartStrategies.BLOCK); | startException(StartStrategies.ASYNCHRONOUS, false); startException(StartStrategies.SYNCHRONOUS, false); startException(StartStrategies.UNREGISTER, false); startException(StartStrategies.BLOCK, false); | public void testStartException() throws Exception { startException(StartStrategies.ASYNCHRONOUS); startException(StartStrategies.SYNCHRONOUS); startException(StartStrategies.UNREGISTER); startException(StartStrategies.BLOCK); startException(StartStrategies.ASYNCHRONOUS); startException(StartStrategies.SYNCHRONOUS); startException(StartStrategies.UNREGISTER); startException(StartStrategies.BLOCK); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
startException(StartStrategies.ASYNCHRONOUS); startException(StartStrategies.SYNCHRONOUS); startException(StartStrategies.UNREGISTER); startException(StartStrategies.BLOCK); | startException(StartStrategies.ASYNCHRONOUS, false); startException(StartStrategies.SYNCHRONOUS, false); startException(StartStrategies.UNREGISTER, false); startException(StartStrategies.BLOCK, false); | public void testStartException() throws Exception { startException(StartStrategies.ASYNCHRONOUS); startException(StartStrategies.SYNCHRONOUS); startException(StartStrategies.UNREGISTER); startException(StartStrategies.BLOCK); startException(StartStrategies.ASYNCHRONOUS); startException(StartStrategies.SYNCHRONOUS); startException(StartStrategies.UNREGISTER); startException(StartStrategies.BLOCK); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
startRecursive(StartStrategies.ASYNCHRONOUS); startRecursive(StartStrategies.SYNCHRONOUS); startRecursive(StartStrategies.UNREGISTER); startRecursive(StartStrategies.BLOCK); | startStop(StartStrategies.ASYNCHRONOUS, true); startStop(StartStrategies.SYNCHRONOUS, true); startStop(StartStrategies.UNREGISTER, true); startStop(StartStrategies.BLOCK, true); | public void testStartRecursive() throws Exception { startRecursive(StartStrategies.ASYNCHRONOUS); startRecursive(StartStrategies.SYNCHRONOUS); startRecursive(StartStrategies.UNREGISTER); startRecursive(StartStrategies.BLOCK); startRecursive(StartStrategies.ASYNCHRONOUS); startRecursive(StartStrategies.SYNCHRONOUS); startRecursive(StartStrategies.UNREGISTER); startRecursive(StartStrategies.BLOCK); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
startRecursive(StartStrategies.ASYNCHRONOUS); startRecursive(StartStrategies.SYNCHRONOUS); startRecursive(StartStrategies.UNREGISTER); startRecursive(StartStrategies.BLOCK); | startStop(StartStrategies.ASYNCHRONOUS, true); startStop(StartStrategies.SYNCHRONOUS, true); startStop(StartStrategies.UNREGISTER, true); startStop(StartStrategies.BLOCK, true); | public void testStartRecursive() throws Exception { startRecursive(StartStrategies.ASYNCHRONOUS); startRecursive(StartStrategies.SYNCHRONOUS); startRecursive(StartStrategies.UNREGISTER); startRecursive(StartStrategies.BLOCK); startRecursive(StartStrategies.ASYNCHRONOUS); startRecursive(StartStrategies.SYNCHRONOUS); startRecursive(StartStrategies.UNREGISTER); startRecursive(StartStrategies.BLOCK); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
startStop(StartStrategies.ASYNCHRONOUS); startStop(StartStrategies.SYNCHRONOUS); startStop(StartStrategies.UNREGISTER); startStop(StartStrategies.BLOCK); | startStop(StartStrategies.ASYNCHRONOUS, false); startStop(StartStrategies.SYNCHRONOUS, false); startStop(StartStrategies.UNREGISTER, false); startStop(StartStrategies.BLOCK, false); | public void testStartStop() throws Exception { startStop(StartStrategies.ASYNCHRONOUS); startStop(StartStrategies.SYNCHRONOUS); startStop(StartStrategies.UNREGISTER); startStop(StartStrategies.BLOCK); startStop(StartStrategies.ASYNCHRONOUS); startStop(StartStrategies.SYNCHRONOUS); startStop(StartStrategies.UNREGISTER); startStop(StartStrategies.BLOCK); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/40d54ab7cee698a58def76b8baef5ca243beb305/ServiceManagerTest.java/clean/kernel/src/test/org/gbean/kernel/standard/ServiceManagerTest.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.