rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
return pos; | return this; | public IRubyObject seek(RubyFixnum pos) { this.pos = (int) pos.getLongValue(); return pos; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/af80e8f70b3c6d7fab314143b5f1e641350602b1/RubyDir.java/buggy/src/org/jruby/RubyDir.java |
return (new ArticleActionURIHandler()).getHandlerIdentifier(); | return ArticleActionURIHandler.HANDLER_IDENTIFIER; | public String getIWActionURIHandlerIdentifier() { return (new ArticleActionURIHandler()).getHandlerIdentifier(); } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/44c7553551d463f44b7cb7cf5d0a43b62412701b/ArticleListManagedBean.java/buggy/src/java/com/idega/block/article/bean/ArticleListManagedBean.java |
public void open() { quickLaunchBtn.doClick(); } | public void open() { quickLaunchBtn.doClick(); } | public void open() { quickLaunchBtn.doClick(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/cf83d7e74fdf42d9c4357c3e575c08395991a878/TopWindow.java/clean/SRC/org/openmicroscopy/shoola/env/ui/TopWindow.java |
public void postHandleDisplay() { } | public void postHandleDisplay() {} | public void postHandleDisplay() { } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/cf83d7e74fdf42d9c4357c3e575c08395991a878/TopWindow.java/clean/SRC/org/openmicroscopy/shoola/env/ui/TopWindow.java |
public ManageableTopWindow(String s) { super(s); | public ManageableTopWindow() { super(); | public ManageableTopWindow(String s) { super(s); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/cf83d7e74fdf42d9c4357c3e575c08395991a878/ManageableTopWindow.java/buggy/SRC/org/openmicroscopy/shoola/env/ui/ManageableTopWindow.java |
String id = articleItemBean[i].getFolderLocation()+"/"+articleItemBean[i].getHeadline()+".xml"; | String id = articleItemBean[i].getFolderLocation()+"/"+articleItemBean[i].getHeadline()+ArticleItemBean.ARTICLE_SUFFIX; | public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } try {// ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").toArray(new ArticleItemBean[0]); ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder(ContentUtil.ARTICLE_PATH).toArray(new ArticleItemBean[0]); int availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) { //TODO we don't have published in the article item bean String id = articleItemBean[i].getFolderLocation()+"/"+articleItemBean[i].getHeadline()+".xml"; ListArticlesBean bean = new ListArticlesBean(id, articleItemBean[i].getHeadline(), ""); _dataModel.set(bean, i); } _dataModel.setRowCount(availableRows); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/e75e5a35d9b917c44d8a58d117a43ccf5ad660b4/ListArticlesBean.java/clean/src/java/com/idega/block/article/bean/ListArticlesBean.java |
setQuantumStrategy(QuantumFactory.DEPTH_8BIT); setCodomainInterval(0, QuantumFactory.DEPTH_8BIT); | resetDefaults(rndDef, getMetadata(), iPixels); setModel(rndDef.getModel()); | public void resetDefaults() { // Reset the bit resolution. setQuantumStrategy(QuantumFactory.DEPTH_8BIT); // NB: Java locks are setCodomainInterval(0, QuantumFactory.DEPTH_8BIT); // re-entrant. // Set the each channel's window to the channel's [min, max]. // Make active only the first channel. ChannelBinding[] cb = getChannelBindings(); boolean active = false; RenderingModel model = PlaneFactory.getRenderingModel(iPixels, MODEL_GREYSCALE); List channels = getMetadata().getChannels(); int w = 0; for (Iterator i = channels.iterator(); i.hasNext();) { // The channel we're operating on Channel channel = (Channel) i.next(); if (channel.getPixels().getAcquisitionContext(). getPhotometricInterpretation().getValue() == PHOTOMETRIC_RGB) { active = true; model = PlaneFactory.getRenderingModel(iPixels, MODEL_RGB); } cb[w].setActive(Boolean.valueOf(active)); double start = channel.getStatsInfo().getGlobalMin().doubleValue(); double end = channel.getStatsInfo().getGlobalMax().doubleValue(); setChannelWindow(w, start, end); Color c = ColorsFactory.getColor(w, channel); setRGBA(w, c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()); w++; } cb[0].setActive(Boolean.valueOf(active)); // Remove all the codomainMapCtx except the identity. getCodomainChain().remove(); // Fall back to the default strategy. setModel(model); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java |
ChannelBinding[] cb = getChannelBindings(); boolean active = false; RenderingModel model = PlaneFactory.getRenderingModel(iPixels, MODEL_GREYSCALE); List channels = getMetadata().getChannels(); int w = 0; for (Iterator i = channels.iterator(); i.hasNext();) { Channel channel = (Channel) i.next(); if (channel.getPixels().getAcquisitionContext(). getPhotometricInterpretation().getValue() == PHOTOMETRIC_RGB) { active = true; model = PlaneFactory.getRenderingModel(iPixels, MODEL_RGB); } cb[w].setActive(Boolean.valueOf(active)); double start = channel.getStatsInfo().getGlobalMin().doubleValue(); double end = channel.getStatsInfo().getGlobalMax().doubleValue(); setChannelWindow(w, start, end); Color c = ColorsFactory.getColor(w, channel); setRGBA(w, c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()); w++; } cb[0].setActive(Boolean.valueOf(active)); getCodomainChain().remove(); setModel(model); | if (getCodomainChain() != null) getCodomainChain().remove(); iPixels.saveRndSettings(rndDef); | public void resetDefaults() { // Reset the bit resolution. setQuantumStrategy(QuantumFactory.DEPTH_8BIT); // NB: Java locks are setCodomainInterval(0, QuantumFactory.DEPTH_8BIT); // re-entrant. // Set the each channel's window to the channel's [min, max]. // Make active only the first channel. ChannelBinding[] cb = getChannelBindings(); boolean active = false; RenderingModel model = PlaneFactory.getRenderingModel(iPixels, MODEL_GREYSCALE); List channels = getMetadata().getChannels(); int w = 0; for (Iterator i = channels.iterator(); i.hasNext();) { // The channel we're operating on Channel channel = (Channel) i.next(); if (channel.getPixels().getAcquisitionContext(). getPhotometricInterpretation().getValue() == PHOTOMETRIC_RGB) { active = true; model = PlaneFactory.getRenderingModel(iPixels, MODEL_RGB); } cb[w].setActive(Boolean.valueOf(active)); double start = channel.getStatsInfo().getGlobalMin().doubleValue(); double end = channel.getStatsInfo().getGlobalMax().doubleValue(); setChannelWindow(w, start, end); Color c = ColorsFactory.getColor(w, channel); setRGBA(w, c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()); w++; } cb[0].setActive(Boolean.valueOf(active)); // Remove all the codomainMapCtx except the identity. getCodomainChain().remove(); // Fall back to the default strategy. setModel(model); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/Renderer.java/buggy/components/rendering/src/omeis/providers/re/Renderer.java |
case M_HASH: return hash(); | public RubyObject callIndexed(int index, RubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); } Asserts.assertNotReached(); return null; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f0907240b4b4a4379424377e971ed0ca23f1dcb/RubyFixnum.java/clean/org/jruby/RubyFixnum.java |
|
fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); | public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.includeModule(ruby.getClasses().getPrecisionModule()); fixnumClass.defineSingletonMethod("induced_from", CallbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", RubyObject.class)); fixnumClass.defineMethod("to_f", IndexedCallback.create(M_TO_F, 0)); fixnumClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("to_str", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("<<", IndexedCallback.create(M_OP_LSHIFT, 1)); fixnumClass.defineMethod(">>", IndexedCallback.create(M_OP_RSHIFT, 1)); fixnumClass.defineMethod("+", IndexedCallback.create(M_OP_PLUS, 1)); fixnumClass.defineMethod("-", IndexedCallback.create(M_OP_MINUS, 1)); fixnumClass.defineMethod("*", IndexedCallback.create(M_OP_MUL, 1)); fixnumClass.defineMethod("/", IndexedCallback.create(M_OP_DIV, 1)); fixnumClass.defineMethod("%", IndexedCallback.create(M_OP_MOD, 1)); fixnumClass.defineMethod("**", IndexedCallback.create(M_OP_POW, 1)); fixnumClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("eql?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("equal?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("<=>", IndexedCallback.create(M_OP_CMP, 1)); fixnumClass.defineMethod(">", IndexedCallback.create(M_OP_GT, 1)); fixnumClass.defineMethod(">=", IndexedCallback.create(M_OP_GE, 1)); fixnumClass.defineMethod("<", IndexedCallback.create(M_OP_LT, 1)); fixnumClass.defineMethod("<=", IndexedCallback.create(M_OP_LE, 1)); fixnumClass.defineMethod("&", IndexedCallback.create(M_OP_AND, 1)); fixnumClass.defineMethod("|", CallbackFactory.getMethod(RubyFixnum.class, "op_or", RubyInteger.class)); fixnumClass.defineMethod("^", CallbackFactory.getMethod(RubyFixnum.class, "op_xor", RubyInteger.class)); fixnumClass.defineMethod("size", IndexedCallback.create(M_SIZE, 0)); fixnumClass.defineMethod("[]", CallbackFactory.getMethod(RubyFixnum.class, "aref", RubyInteger.class)); return fixnumClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f0907240b4b4a4379424377e971ed0ca23f1dcb/RubyFixnum.java/clean/org/jruby/RubyFixnum.java |
|
bindStreams(inputStream, outputStream); | try { handler = new IOHandlerSocket(getRuntime(), inputStream, outputStream); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } registerIOHandler(handler); modes = handler.getModes(); | public IRubyObject initialize(IRubyObject[] args) { IRubyObject input = args[0]; IRubyObject output = args[1]; InputStream inputStream = (InputStream) extractStream(input); OutputStream outputStream = (OutputStream) extractStream(output); bindStreams(inputStream, outputStream); return this; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/955df6c6347fe40e2cb6502680208323eef890e2/RubyBasicSocket.java/clean/src/org/jruby/RubyBasicSocket.java |
catch (Exception e) { throw new PropertyException ("Unable to iterate list", e); } | public void write(FastWriter out, Context context) throws PropertyException, IOException { Object l, limit, from; int loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (limit instanceof Macro) limit = ((Macro) limit).evaluate(context); if (Expression.isNumber(limit)) loopLimit = (int) Expression.numberValue(limit); else { String warning = "#foreach: Cannot evaluate limit"; context.getLog("engine").warning(warning); writeWarning(warning, context, out); } } if (index != null && indexFromExpr != null) { from = indexFromExpr; while (from instanceof Macro) from = ((Macro) from).evaluate(context); if (Expression.isNumber(from)) loopStart = (int) Expression.numberValue(from); else { String warning = "#foreach: Cannot evaluate loop start"; context.getLog("engine").warning(warning); writeWarning(warning, context, out); } } Iterator iter; try { iter = context.getBroker()._propertyOperators.getIterator(l); } catch (Exception e) { String warning = "#foreach: list argument is not a list: " + l; context.getLog("engine").warning(warning + "; " + e); writeWarning(warning, context, out); return; } while(iter.hasNext() && ((loopLimit == -1) || (loopLimit > loopIndex))) { try { target.setValue(context, iter.next()); if (index != null) index.setValue(context, new Integer(loopIndex + loopStart)); } catch (PropertyException e) { String errorText = "#foreach: Unable to set list index"; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } body.write(out, context); ++loopIndex; } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f6d51f5ec2ae25d44756c8da8932f1833850935a/ForeachDirective.java/clean/webmacro/src/org/webmacro/directive/ForeachDirective.java |
|
String pageName = wc.getForm ("save"); | String pageName = getWikiPageName(wiki, wc); | protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); // make sure to save the page wiki.savePage (newPage); return newPage; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/63e182a593c47d9b882560d480b0bab109616dc8/SavePageAction.java/clean/wiki/src/org/tcdi/opensource/wiki/servlet/SavePageAction.java |
return wc.getForm ("save"); | String pageName = wc.getForm ("save"); pageName = WikiUtil.formatAsWikiTitle(pageName); return pageName; | public String getWikiPageName(WikiSystem wiki, WebContext wc) { return wc.getForm ("save"); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/63e182a593c47d9b882560d480b0bab109616dc8/SavePageAction.java/clean/wiki/src/org/tcdi/opensource/wiki/servlet/SavePageAction.java |
println("<method nameAndSignature=\"" + methodNameAndSignature + "\">"); | println("<method nameAndSignature=\"" + xmlEscape(methodNameAndSignature) + "\">"); | private void dumpMethods(CoverageData instrumentation) { Iterator iter = instrumentation.getMethodNamesAndDescriptors() .iterator(); while (iter.hasNext()) { String methodNameAndSignature = (String)iter.next(); println("<method nameAndSignature=\"" + methodNameAndSignature + "\">"); increaseIndentation(); try { println("<line rate=\"" + instrumentation .getLineCoverageRate(methodNameAndSignature) + "\"/>"); println("<branch rate=\"" + instrumentation .getBranchCoverageRate(methodNameAndSignature) + "\"/>"); } catch (IllegalArgumentException ex) { logger.warn(ex); } decreaseIndentation(); println("</method>"); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/e99865317a5efeb3b1f3deb3463354ec351d77a4/XMLReport.java/buggy/cobertura/src/net/sourceforge/cobertura/reporting/xml/XMLReport.java |
return t; | return null; | final public Template getTemplate(String fileName) { File tFile = findTemplate (fileName); Template t = null; try { t = new FileTemplate (_broker, tFile); t.parse (); _lastModifiedCache.put (fileName, new Long (tFile.lastModified())); } catch (NullPointerException npe) { _log.warning ("TemplateProvider: Template not found: " + fileName, npe); } catch (Exception e) { // this probably occured b/c of a parsing error. // should throw some kind of ParseErrorException here instead _log.warning ("TemplateProvider: Error occured while getting " + fileName, e); } return t; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/e9a3ed7ab80a712ee6fbc4fd902c3cffa556335a/TemplateProvider.java/buggy/webmacro/src/org/webmacro/resource/TemplateProvider.java |
return chatPreferences.getNickname(); | LocalPreferences pref = SettingsManager.getLocalPreferences(); return pref.getNickname(); | public String getNickname() { return chatPreferences.getNickname(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/ChatRoom.java/clean/src/java/org/jivesoftware/spark/ui/ChatRoom.java |
chatPreferences = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); | private void init() { setLayout(new GridBagLayout()); add(splitPane, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); add(notificationLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 2, 5, 0), 0, 0)); // Remove Default Beveled Borders splitPane.setBorder(null); verticalSplit.setBorder(null); splitPane.setLeftComponent(verticalSplit); // Load Preferences for this instance chatPreferences = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); textScroller.setAutoscrolls(true); // Speed up scrolling. It was way too slow. textScroller.getVerticalScrollBar().setBlockIncrement(50); textScroller.getVerticalScrollBar().setUnitIncrement(20); chatWindowPanel = new JPanel(); chatWindowPanel.setLayout(new GridBagLayout()); chatWindowPanel.add(textScroller, new GridBagConstraints(0, 10, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); chatWindowPanel.setOpaque(false); // Layout Components chatPanel.add(chatWindowPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); // Add edit buttons to Chat Room editorBar.setOpaque(false); chatPanel.setOpaque(false); editorBar.add(new JSeparator(JSeparator.VERTICAL)); bottomPanel.setOpaque(false); splitPane.setOpaque(false); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(chatAreaButton, new GridBagConstraints(0, 1, 5, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 30)); bottomPanel.add(editorBar, new GridBagConstraints(0, 0, 5, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); verticalSplit.setOpaque(false); verticalSplit.setTopComponent(chatPanel); verticalSplit.setBottomComponent(bottomPanel); verticalSplit.setResizeWeight(1.0); verticalSplit.setDividerSize(2); // Add listener to send button chatAreaButton.getButton().addActionListener(this); // Add Key Listener to Send Field getChatInputEditor().getDocument().addDocumentListener(this); // Add Key Listener to Send Field getChatInputEditor().addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { checkForEnter(e); } }); getChatInputEditor().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ctrl F4"), "closeTheRoom"); getChatInputEditor().getActionMap().put("closeTheRoom", new AbstractAction("closeTheRoom") { public void actionPerformed(ActionEvent evt) { final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to close this chat?", "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { // Leave this chat. closeChatRoom(); } } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/ChatRoom.java/clean/src/java/org/jivesoftware/spark/ui/ChatRoom.java |
|
return "Image"+(imageId==null ? ":Hash"+this.hashCode() : ":"+imageId); | return "Image"+(imageId==null ? ":Hash_"+this.hashCode() : ":Id_"+imageId); | public String toString(){ return "Image"+(imageId==null ? ":Hash"+this.hashCode() : ":"+imageId); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/Image.java/buggy/components/common/src/ome/model/Image.java |
setImages(new HashSet( c.eachLinkedImage( block ))); | setImages( makeSet( c.sizeOfImageLinks(), c.eachLinkedImage( block ))); | public void copy(IObject model, ModelMapper mapper) { if (model instanceof Category) { Category c = (Category) model; super.copy(model,mapper); // Details Details details = c.getDetails(); if (details!=null){ this.setOwner((ExperimenterData) mapper.findTarget(details.getOwner())); } // Fields this.setName(c.getName()); this.setDescription(c.getDescription()); // Collections MapperBlock block = new MapperBlock( mapper ); setImages(new HashSet( c.eachLinkedImage( block ))); List cgs = c.eachLinkedCategoryGroup( block ); this.setGroup( cgs.size() > 0 ? (CategoryGroupData) cgs.get(0) : null); if ( cgs.size() > 1 ) { // FIXME and if size > 1 } } else { throw new IllegalArgumentException("CategoryData can only copy Category type."); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9638b50efec05ce0b3d19bbef1c149c757b964aa/CategoryData.java/buggy/components/shoola-adapter/src/pojos/CategoryData.java |
log.info(getData()); | OMEData data = new OMEPerformanceData(); OMEData old = getData(); Set imgs = new HashSet(); imgs.add(new Integer(101)); imgs.add(new Integer(12)); imgs.add(new Integer(5393)); imgs.add(new Integer(4954)); imgs.add(new Integer(3919)); imgs.add(new Integer(1273)); data.imgsCGCI=imgs; setData(data); Object o = this.testFindCGCIHierarchies(); Utils.structureSize(o); setData(old); log.info(getData()); | public void testHessian(){ log.info(getData()); Utils.structureSize(this.testFindCGCIHierarchies()); Utils.structureSize(this.testFindDatasetAnnotationsSet()); Utils.structureSize(this.testFindDatasetAnnotationsSetForExperimenter()); Utils.structureSize(this.testFindImageAnnotationsSet()); Utils.structureSize(this.testFindImageAnnotationsSetForExperimenter()); Utils.structureSize(this.testFindPDIHierarchies()); Utils.structureSize(this.testLoadCGCIHierarchyCategory()); Utils.structureSize(this.testLoadCGCIHierarchyCategoryGroup()); Utils.structureSize(this.testLoadPDIHierarchyDataset()); Utils.structureSize(this.testLoadPDIHierarchyProject()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/OmeroServiceTest.java/buggy/components/server/test/org/openmicroscopy/omero/server/itests/OmeroServiceTest.java |
log.debug("Null date."); | static public Timestamp convertDate(Date date){ if (null==date){ log.debug("Null date."); return null; } return new Timestamp(date.getTime()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/AdapterUtils.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java |
|
log.debug(nullId+p); | if (log.isDebugEnabled())log.debug(nullId+p); | static public ProjectData go(Project p, Map cache) { if (check(cache,p)) { return (ProjectData) from(cache, p); } ProjectData pd = new ProjectData(); to(cache, p, pd); if (null == p.getProjectId()) { log.debug(nullId+p); } else { pd.setID(p.getProjectId().intValue()); } pd.setName(p.getName()); pd.setDescription(p.getDescription()); if (null==p.getExperimenter()){ log.debug(nullExp + p); } else { pd.setOwnerFirstName(p.getExperimenter().getFirstname()); } //TODO if (null==p.getDatasets()){ log.debug(nullDs + p); } else { Set set = new HashSet(); for (Iterator i = p.getDatasets().iterator(); i.hasNext();) { Dataset d = (Dataset) i.next(); set.add(go(d,cache)); } pd.setDatasets(new ArrayList(set)); } return pd; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/AdapterUtils.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java |
log.debug(nullExp + p); | if (log.isDebugEnabled())log.debug(nullExp + p); | static public ProjectData go(Project p, Map cache) { if (check(cache,p)) { return (ProjectData) from(cache, p); } ProjectData pd = new ProjectData(); to(cache, p, pd); if (null == p.getProjectId()) { log.debug(nullId+p); } else { pd.setID(p.getProjectId().intValue()); } pd.setName(p.getName()); pd.setDescription(p.getDescription()); if (null==p.getExperimenter()){ log.debug(nullExp + p); } else { pd.setOwnerFirstName(p.getExperimenter().getFirstname()); } //TODO if (null==p.getDatasets()){ log.debug(nullDs + p); } else { Set set = new HashSet(); for (Iterator i = p.getDatasets().iterator(); i.hasNext();) { Dataset d = (Dataset) i.next(); set.add(go(d,cache)); } pd.setDatasets(new ArrayList(set)); } return pd; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/AdapterUtils.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java |
log.debug(nullDs + p); | if (log.isDebugEnabled())log.debug(nullDs + p); | static public ProjectData go(Project p, Map cache) { if (check(cache,p)) { return (ProjectData) from(cache, p); } ProjectData pd = new ProjectData(); to(cache, p, pd); if (null == p.getProjectId()) { log.debug(nullId+p); } else { pd.setID(p.getProjectId().intValue()); } pd.setName(p.getName()); pd.setDescription(p.getDescription()); if (null==p.getExperimenter()){ log.debug(nullExp + p); } else { pd.setOwnerFirstName(p.getExperimenter().getFirstname()); } //TODO if (null==p.getDatasets()){ log.debug(nullDs + p); } else { Set set = new HashSet(); for (Iterator i = p.getDatasets().iterator(); i.hasNext();) { Dataset d = (Dataset) i.next(); set.add(go(d,cache)); } pd.setDatasets(new ArrayList(set)); } return pd; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/AdapterUtils.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java |
File file = new File("target/SpringLoaderTest.jar"); | File file = new File(basedir, "target/SpringLoaderTest.jar"); | private static File createJarFile() throws IOException { File file = new File("target/SpringLoaderTest.jar"); FileOutputStream out = new FileOutputStream(file); JarOutputStream jarOut = new JarOutputStream(out); jarOut.putNextEntry(new JarEntry(CLASS_NAME + ".class")); jarOut.write(createClass(CLASS_NAME)); jarOut.putNextEntry(new JarEntry(ENTRY_NAME)); jarOut.write(ENTRY_VALUE.getBytes()); jarOut.close(); out.close(); return file; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c06ecd608700a5a1d16363b667e5a08286b3438a/SpringLoaderTest.java/buggy/server/src/test/org/xbean/server/spring/loader/SpringLoaderTest.java |
File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); | File xbeanDir = new File(basedir, "src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", xbeanDir.getAbsolutePath()); | public void testLoad() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertTrue(testService instanceof SortedSet); } finally { kernel.destroy(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c06ecd608700a5a1d16363b667e5a08286b3438a/SpringLoaderTest.java/buggy/server/src/test/org/xbean/server/spring/loader/SpringLoaderTest.java |
FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); | FileSystemRepository repository = new FileSystemRepository(new File(basedir).getAbsoluteFile()); | public void testLoad() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertTrue(testService instanceof SortedSet); } finally { kernel.destroy(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c06ecd608700a5a1d16363b667e5a08286b3438a/SpringLoaderTest.java/buggy/server/src/test/org/xbean/server/spring/loader/SpringLoaderTest.java |
springLoader.setBaseDir(baseDir); | springLoader.setBaseDir(xbeanDir); | public void testLoad() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertTrue(testService instanceof SortedSet); } finally { kernel.destroy(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c06ecd608700a5a1d16363b667e5a08286b3438a/SpringLoaderTest.java/buggy/server/src/test/org/xbean/server/spring/loader/SpringLoaderTest.java |
File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); | File xbeanDir = new File(basedir, "src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", xbeanDir.getAbsolutePath()); | public void testReload() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); SpringConfigurationServiceFactory serviceFactory = (SpringConfigurationServiceFactory) kernel.getServiceFactory(configurationName); SpringApplicationContext applicationContext = serviceFactory.getApplicationContext(); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), testService.getClass().getClassLoader()); assertTrue(testService instanceof SortedSet); kernel.stopService(configurationName); kernel.startService(configurationName); Object newTestService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", newTestService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), newTestService.getClass().getClassLoader()); assertTrue(newTestService instanceof SortedSet); assertNotSame("test service should be a new instance", testService, newTestService); assertNotSame("test service should have been loaded from a different classloader", testService.getClass().getClassLoader(), newTestService.getClass().getClassLoader()); } finally { kernel.destroy(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c06ecd608700a5a1d16363b667e5a08286b3438a/SpringLoaderTest.java/buggy/server/src/test/org/xbean/server/spring/loader/SpringLoaderTest.java |
FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); | FileSystemRepository repository = new FileSystemRepository(new File(basedir).getAbsoluteFile()); | public void testReload() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); SpringConfigurationServiceFactory serviceFactory = (SpringConfigurationServiceFactory) kernel.getServiceFactory(configurationName); SpringApplicationContext applicationContext = serviceFactory.getApplicationContext(); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), testService.getClass().getClassLoader()); assertTrue(testService instanceof SortedSet); kernel.stopService(configurationName); kernel.startService(configurationName); Object newTestService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", newTestService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), newTestService.getClass().getClassLoader()); assertTrue(newTestService instanceof SortedSet); assertNotSame("test service should be a new instance", testService, newTestService); assertNotSame("test service should have been loaded from a different classloader", testService.getClass().getClassLoader(), newTestService.getClass().getClassLoader()); } finally { kernel.destroy(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c06ecd608700a5a1d16363b667e5a08286b3438a/SpringLoaderTest.java/buggy/server/src/test/org/xbean/server/spring/loader/SpringLoaderTest.java |
springLoader.setBaseDir(baseDir); | springLoader.setBaseDir(xbeanDir); | public void testReload() throws Exception{ Kernel kernel = KernelFactory.newInstance().createKernel("test"); try { File baseDir = new File("src/test/org/xbean/server/spring/loader/").getAbsoluteFile(); System.setProperty("xbean.base.dir", baseDir.getAbsolutePath()); FileSystemRepository repository = new FileSystemRepository(new File(".").getAbsoluteFile()); ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository); List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor); SpringLoader springLoader = new SpringLoader(); springLoader.setKernel(kernel); springLoader.setBaseDir(baseDir); springLoader.setXmlPreprocessors(xmlPreprocessors); ServiceName configurationName = springLoader.load("classpath-xbean"); SpringConfigurationServiceFactory serviceFactory = (SpringConfigurationServiceFactory) kernel.getServiceFactory(configurationName); SpringApplicationContext applicationContext = serviceFactory.getApplicationContext(); kernel.startService(configurationName); Object testService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", testService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), testService.getClass().getClassLoader()); assertTrue(testService instanceof SortedSet); kernel.stopService(configurationName); kernel.startService(configurationName); Object newTestService = kernel.getService(new StringServiceName("test")); assertEquals("TestClass", newTestService.getClass().getName()); assertEquals(applicationContext.getClassLoader(), newTestService.getClass().getClassLoader()); assertTrue(newTestService instanceof SortedSet); assertNotSame("test service should be a new instance", testService, newTestService); assertNotSame("test service should have been loaded from a different classloader", testService.getClass().getClassLoader(), newTestService.getClass().getClassLoader()); } finally { kernel.destroy(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c06ecd608700a5a1d16363b667e5a08286b3438a/SpringLoaderTest.java/buggy/server/src/test/org/xbean/server/spring/loader/SpringLoaderTest.java |
public FileSystemRepository(File root) { this.root = root; | public FileSystemRepository() { | public FileSystemRepository(File root) { this.root = root; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/438aa707be746e2381b40041b37ebd6b00c23429/FileSystemRepository.java/buggy/server/src/java/org/xbean/server/repository/FileSystemRepository.java |
d.setPermissions( new Permissions() ); | public void testAllowLoad() { prepareMocksWithUserDetails(); Details d = new Details(); d.setOwner(new Experimenter(2L)); d.setGroup(new ExperimenterGroup(2L)); sec.setCurrentDetails(); assertTrue(sec.allowLoad(Image.class,d)); d.setPermissions(new Permissions().revoke(WORLD,READ)); assertFalse(sec.allowLoad(Image.class, d)); // now in my group where i'm PI d.setPermissions(new Permissions().revoke(GROUP,READ)); d.setGroup(group); assertTrue(sec.allowLoad(Image.class,d)); sec.clearCurrentDetails(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0172174c25a126f3473655022bb846c98e246c25/SecuritySystemTest.java/buggy/components/server/test/ome/server/utests/sec/SecuritySystemTest.java |
|
point = new PlanePoint(x, v); | point = new PlanePoint(x, v); | private Object[] getGraphicDataZ(Map xAxis, Map yAxis) { Object[] result = new Object[5]; Iterator i = (yAxis.keySet()).iterator(); Iterator j; Integer key; PlanePoint point;//Coordinate ArrayList list; TreeMap values = new TreeMap(); double v, maxY = 0, minY = 0; int x, c, minX = 0, maxX = 0; c = 0; while (i.hasNext()) { key = (Integer) i.next(); j = (xAxis.keySet()).iterator(); list = new ArrayList(); while (j.hasNext()) { x = ((Integer) j.next()).intValue(); v = getValue(x, key.intValue()); if (c == 0) { minY = v; maxY = v; minX = x; maxX = x; } else { minY = Math.min(v, minY); maxY = Math.max(v, maxY); minX = Math.min(minX, x); maxX = Math.max(maxX, x); } c++; point = new PlanePoint(x, v); list.add(point); } values.put(key, list); } result[0] = new Integer(minX); result[1] = new Integer(maxX); result[2] = new Double(minY); result[3] = new Double(maxY); result[4] = values; return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/StatsResultsPaneMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/stats/StatsResultsPaneMng.java |
graphicCanvas.acrossT(tSelected, ((Integer) result[0]).intValue(), | graphicCanvas.acrossZ(tSelected, ((Integer) result[0]).intValue(), | public void showGraphic(int statsIndex, int axis, Map zSelected, Map tSelected) { this.statsIndex = statsIndex; resultIndex = GRAPHIC_RESULT; graphicCanvas = new GraphicCanvas(this, StatsResultsPane.zAndtFieldNames[statsIndex]); Object[] result; if (axis == T_AXIS) { result = getGraphicDataT(tSelected, zSelected); graphicCanvas.acrossT(zSelected, ((Integer) result[0]).intValue(), ((Integer) result[1]).intValue(), ((Double) result[2]).doubleValue(), ((Double) result[3]).doubleValue(), (Map) result[4]); } else if (axis == Z_AXIS) { result = getGraphicDataZ(zSelected, tSelected); graphicCanvas.acrossT(tSelected, ((Integer) result[0]).intValue(), ((Integer) result[1]).intValue(), ((Double) result[2]).doubleValue(), ((Double) result[3]).doubleValue(), (Map) result[4]); } view.bar.setEnabledButtons(false); view.addGraphic(graphicCanvas); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/StatsResultsPaneMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/stats/StatsResultsPaneMng.java |
while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.setContext(agentInfo.getRegistry()); | try { while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.setContext(agentInfo.getRegistry()); } i = agents.iterator(); while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.activate(); } RenderingEngine re = RenderingEngine.getInstance(this); re.activate(); LoginManager lm = LoginManager.getInstance(this); lm.activate(); } catch (Throwable t) { AbnormalExitHandler.terminate(t); | public void startService() { List agents = (List) singleton.registry.lookup(LookupNames.AGENTS); Iterator i = agents.iterator(); AgentInfo agentInfo; Agent a; //Agents linking phase. while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.setContext(agentInfo.getRegistry()); } //Agents activation phase. i = agents.iterator(); while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.activate(); } //TODO: activate services (EventBus, what else?). RenderingEngine re = RenderingEngine.getInstance(this); re.activate(); LoginManager lm = LoginManager.getInstance(this); lm.activate(); //TODO: RE threads should be spawn during an init task. //This is subject to change (see class javadoc). AWTExceptionHanlder.configure(this); //Get ready to interact with the user... TopFrame tf = singleton.registry.getTopFrame(); tf.open(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a8120868e0e5ade5c98b188e8361f7deb0d651d3/Container.java/clean/SRC/org/openmicroscopy/shoola/env/Container.java |
i = agents.iterator(); while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.activate(); } RenderingEngine re = RenderingEngine.getInstance(this); re.activate(); LoginManager lm = LoginManager.getInstance(this); lm.activate(); AWTExceptionHanlder.configure(this); | public void startService() { List agents = (List) singleton.registry.lookup(LookupNames.AGENTS); Iterator i = agents.iterator(); AgentInfo agentInfo; Agent a; //Agents linking phase. while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.setContext(agentInfo.getRegistry()); } //Agents activation phase. i = agents.iterator(); while (i.hasNext()) { agentInfo = (AgentInfo) i.next(); a = agentInfo.getAgent(); a.activate(); } //TODO: activate services (EventBus, what else?). RenderingEngine re = RenderingEngine.getInstance(this); re.activate(); LoginManager lm = LoginManager.getInstance(this); lm.activate(); //TODO: RE threads should be spawn during an init task. //This is subject to change (see class javadoc). AWTExceptionHanlder.configure(this); //Get ready to interact with the user... TopFrame tf = singleton.registry.getTopFrame(); tf.open(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a8120868e0e5ade5c98b188e8361f7deb0d651d3/Container.java/clean/SRC/org/openmicroscopy/shoola/env/Container.java |
|
StringBuffer buf = new StringBuffer(); buf.append("Error message: "+se.getMessage()); buf.append("Originated by: "+se.getOriginator()); UserNotifier un = UIFactory.makeUserNotifier(); un.notifyInitError("Initialization Error", buf.toString(), se); System.exit(1); | AbnormalExitHandler.terminate(se); } catch (Throwable t) { AbnormalExitHandler.terminate(t); | public static void startup(String home) { Initializer initManager = null; if (singleton == null) { try { singleton = new Container(home); initManager = new Initializer(singleton); initManager.configure(); initManager.doInit(); //startService() called by Initializer at end of doInit(). } catch (StartupException se) { if (initManager != null) initManager.rollback(); StringBuffer buf = new StringBuffer(); buf.append("Error message: "+se.getMessage()); buf.append("Originated by: "+se.getOriginator()); UserNotifier un = UIFactory.makeUserNotifier(); un.notifyInitError("Initialization Error", buf.toString(), se); System.exit(1); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a8120868e0e5ade5c98b188e8361f7deb0d651d3/Container.java/clean/SRC/org/openmicroscopy/shoola/env/Container.java |
this.setAllPixels((Set) mapper.findCollection(i.collectFromPixels(null))); this.setAnnotations((Set) mapper.findCollection(i.collectFromAnnotations(null))); | public void copy(IObject model, ModelMapper mapper) { if (model instanceof Image) { Image i = (Image) model; super.copy(model,mapper); // Details if (i.getDetails() != null){ Details d = i.getDetails(); this.setCreated(mapper.event2timestamp(d.getCreationEvent())); this.setInserted(mapper.event2timestamp(d.getUpdateEvent()));//TODO this.setOwner((ExperimenterData) mapper.findTarget(d.getOwner())); if ( d.getCounts() != null ) { Object annotationCount = d.getCounts().get( Image.ANNOTATIONS ); if ( annotationCount instanceof Integer ) this.setAnnotationCount( (Integer) annotationCount ); Object classificationCount = d.getCounts().get( Image.CATEGORYLINKS ); if ( classificationCount instanceof Integer ) this.setClassificationCount( (Integer) classificationCount ); } } // Fields this.setName(i.getName()); this.setDescription(i.getDescription()); this.setDefaultPixels((PixelsData)mapper.findTarget(i.getDefaultPixels())); this.setAllPixels((Set) mapper.findCollection(i.collectFromPixels(null))); this.setAnnotations((Set) mapper.findCollection(i.collectFromAnnotations(null))); // Collections MapperBlock block = new MapperBlock( mapper ); setDatasets( new HashSet( i.collectFromDatasetLinks( block ))); } else { throw new IllegalArgumentException("ImageData copies only from Image"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a39e29573bdd486ca5c91592a592b445e6d4625e/ImageData.java/buggy/components/shoola-adapter/src/pojos/ImageData.java |
|
setAllPixels( new HashSet( i.collectFromPixels( block ))); setAnnotations( new HashSet( i.collectFromAnnotations( block ))); | public void copy(IObject model, ModelMapper mapper) { if (model instanceof Image) { Image i = (Image) model; super.copy(model,mapper); // Details if (i.getDetails() != null){ Details d = i.getDetails(); this.setCreated(mapper.event2timestamp(d.getCreationEvent())); this.setInserted(mapper.event2timestamp(d.getUpdateEvent()));//TODO this.setOwner((ExperimenterData) mapper.findTarget(d.getOwner())); if ( d.getCounts() != null ) { Object annotationCount = d.getCounts().get( Image.ANNOTATIONS ); if ( annotationCount instanceof Integer ) this.setAnnotationCount( (Integer) annotationCount ); Object classificationCount = d.getCounts().get( Image.CATEGORYLINKS ); if ( classificationCount instanceof Integer ) this.setClassificationCount( (Integer) classificationCount ); } } // Fields this.setName(i.getName()); this.setDescription(i.getDescription()); this.setDefaultPixels((PixelsData)mapper.findTarget(i.getDefaultPixels())); this.setAllPixels((Set) mapper.findCollection(i.collectFromPixels(null))); this.setAnnotations((Set) mapper.findCollection(i.collectFromAnnotations(null))); // Collections MapperBlock block = new MapperBlock( mapper ); setDatasets( new HashSet( i.collectFromDatasetLinks( block ))); } else { throw new IllegalArgumentException("ImageData copies only from Image"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a39e29573bdd486ca5c91592a592b445e6d4625e/ImageData.java/buggy/components/shoola-adapter/src/pojos/ImageData.java |
|
public ASCII_UCodeESC_CharStream(java.io.Reader dstream, int startline, int startcolumn, | private ASCII_UCodeESC_CharStream(java.io.Reader dstream, int startline, int startcolumn, | public ASCII_UCodeESC_CharStream(java.io.Reader dstream, int startline, int startcolumn, int buffersize) { inputStream = dstream; line = startline; column = startcolumn - 1; available = bufsize = buffersize; buffer = new char[buffersize]; bufline = new int[buffersize]; bufcolumn = new int[buffersize]; nextCharBuf = new char[4096]; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
static final int hexval(char c) throws java.io.IOException | private static final int hexval(char c) throws java.io.IOException | static final int hexval(char c) throws java.io.IOException { switch (c) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9; case 'a': case 'A': return 10; case 'b': case 'B': return 11; case 'c': case 'C': return 12; case 'd': case 'D': return 13; case 'e': case 'E': return 14; case 'f': case 'F': return 15; } throw new java.io.IOException(); // Should never come here } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
AdjustBuffSize(); | adjustBuffSize(); | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) | if (((buffer[bufpos] = c = (char)((char)0xff & readByte())) == '\\')) | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
UpdateLineColumn(c); | updateLineColumn(c); | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
AdjustBuffSize(); | adjustBuffSize(); | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') | if ((buffer[bufpos] = c = (char)((char)0xff & readByte())) != '\\') | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
UpdateLineColumn(c); | updateLineColumn(c); | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
UpdateLineColumn(c); | updateLineColumn(c); | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
while ((c = (char)((char)0xff & ReadByte())) == 'u') | while ((c = (char)((char)0xff & readByte())) == 'u') | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
| hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); | | hexval((char)((char)0xff & readByte())) << 8 | hexval((char)((char)0xff & readByte())) << 4 | hexval((char)((char)0xff & readByte()))); | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
UpdateLineColumn(c); | updateLineColumn(c); | public final char readChar() throws java.io.IOException { if (inBuf > 0) { --inBuf; return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; } char c; if (++bufpos == available) AdjustBuffSize(); if (((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) == '\\')) { UpdateLineColumn(c); int backSlashCnt = 1; for (;;) // Read all the backslashes { if (++bufpos == available) AdjustBuffSize(); try { if ((buffer[bufpos] = c = (char)((char)0xff & ReadByte())) != '\\') { UpdateLineColumn(c); // found a non-backslash char. if ((c == 'u') && ((backSlashCnt & 1) == 1)) { if (--bufpos < 0) bufpos = bufsize - 1; break; } backup(backSlashCnt); return '\\'; } } catch (java.io.IOException e) { if (backSlashCnt > 1) backup(backSlashCnt); return '\\'; } UpdateLineColumn(c); backSlashCnt++; } // Here, we have seen an odd number of backslash's followed by a 'u' try { while ((c = (char)((char)0xff & ReadByte())) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval((char)((char)0xff & ReadByte())) << 8 | hexval((char)((char)0xff & ReadByte())) << 4 | hexval((char)((char)0xff & ReadByte()))); column += 4; } catch (java.io.IOException e) { throw new Error("Invalid escape character at line " + line + " column " + column + "."); } if (backSlashCnt == 1) return c; backup(backSlashCnt - 1); return '\\'; } UpdateLineColumn(c); return (c); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/56b5525edc49962bc040c60be12062884232fcc7/ASCII_UCodeESC_CharStream.java/buggy/cobertura/src/de/kclee/clemens/javancss/ASCII_UCodeESC_CharStream.java |
junit.textui.TestRunner.run(SpringFacadeTest.class); | junit.textui.TestRunner.run(OmeroPercentTest.class); | public static void main(String[] args) { junit.textui.TestRunner.run(SpringFacadeTest.class); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8442e37c365d8ade04f3bf94b6b000049c740d2a/SpringFacadeTest.java/clean/components/jars/client/src/test/org/ome/tests/client/SpringFacadeTest.java |
support.unread(); | char tokadd_string(StrTermNode node) { int func = node.getFunc(); int paren = node.getParen(); int term = node.getTerm(); char c; while ((c = support.read()) != EOF) { if (paren != 0 && c == paren) { node.setNest(node.getNest()+1); } else if (c == term) { if (node.getNest() == 0) { support.unread(); break; } node.setNest(node.getNest()-1); } else if ((func & STR_FUNC_EXPAND) != 0 && c == '#' && support.isEOL() == false) { char c2 = support.read(); if (c2 == '$' || c2 == '@' || c2 == '{') { support.unreadMany(2); // c2,c break; } } else if (c == '\\') { c = support.read(); switch (c) { case '\n': if ((func & STR_FUNC_QWORDS) != 0) break; if ((func & STR_FUNC_EXPAND) != 0) continue; tokadd('\\'); break; case '\\': if ((func & STR_FUNC_ESCAPE) != 0) tokadd((char)c); break; default: if ((func & STR_FUNC_REGEXP) != 0) { support.unread(); if (tokadd_escape(term) == false) return 0; continue; } else if ((func & STR_FUNC_EXPAND) != 0) { support.unread(); if ((func & STR_FUNC_ESCAPE) != 0) tokadd('\\'); c = (char)read_escape(); } else if ((func & STR_FUNC_QWORDS) != 0 && Character.isWhitespace(c)) { /* ignore backslashed spaces in %w */ } else if (c != term && !(paren != 0 && c == paren)) { tokadd('\\'); } } } else if (ismbchar(c)) { int i, len = mbclen(c)-1; for (i = 0; i < len; i++) { tokadd(c); c = support.read(); } } else if ((func & STR_FUNC_QWORDS) != 0 && Character.isWhitespace(c)) { support.unread(); break; } if (c == 0 && (func & STR_FUNC_SYMBOL) != 0) { func &= ~STR_FUNC_SYMBOL; rb_compile_error("symbol cannot contain '\\0'"); continue; } tokadd(c); } return c; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8ce27f029c7dbaced0850b02dedc1e2c73a48589/RubyYaccLexer.java/clean/src/org/jruby/lexer/yacc/RubyYaccLexer.java |
|
support.readLine(); | private int yylex() { char c; boolean spaceSeen = false; boolean commandState; if (lex_strterm != null) { if (lex_strterm instanceof HereDocNode) { int token = hereDocument(); if (token == Token.tSTRING_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } else { int token = parseString(); if (token == Token.tSTRING_END || token == Token.tREGEXP_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } } currentPos = support.getPosition(); commandState = commandStart; commandStart = false; retry: for(;;) { c = support.read(); switch(c) { case '\004': /* ^D */ case '\032': /* ^Z */ case 0: /* end of script. */ return 0; /* white spaces */ case ' ': case '\t': case '\f': case '\r': case '\13': /* '\v' */ spaceSeen = true; continue retry; case '#': /* it's a comment */ while ((c = support.read()) != '\n') { if (c == EOF) { return 0; } } /* fall through */ case '\n': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_CLASS) { continue retry; } commandStart = true; lex_state = LexState.EXPR_BEG; return '\n'; case '*': if ((c = support.read()) == '*') { if ((c = support.read()) == '=') { yaccValue = "**"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); c = Token.tPOW; } else { if (c == '=') { yaccValue = "*"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { errorHandler.handleError(IErrors.WARNING, support.getPosition(), "`*' interpreted as argument prefix"); c = Token.tSTAR; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tSTAR; } else { c = '*'; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '!': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { return Token.tNEQ; } if (c == '~') { return Token.tNMATCH; } support.unread(); return '!'; case '=': // Skip documentation nodes if (was_bol()) { /* skip embedded rd document */ if (support.isNextNoCase("begin")) { c = support.read(); if (Character.isWhitespace(c)) { // In case last next was the newline. support.unread(); for (;;) { support.readLine(); c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "embedded document meets end of file"); return 0; } if (c != '=') continue; if (support.isNextNoCase("end")) { if (support.isEOL()) { break; } c = support.read(); if (Character.isWhitespace(c)) { support.readLine(); break; } else { support.unread(); } } } continue retry; } else { support.unread(); } } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } c = support.read(); if (c == '=') { c = support.read(); if (c == '=') { return Token.tEQQ; } support.unread(); return Token.tEQ; } if (c == '~') { return Token.tMATCH; } else if (c == '>') { return Token.tASSOC; } support.unread(); return '='; case '<': c = support.read(); if (c == '<' && lex_state != LexState.EXPR_END && lex_state != LexState.EXPR_DOT && lex_state != LexState.EXPR_ENDARG && lex_state != LexState.EXPR_CLASS && (!lex_state.isArgument() || spaceSeen)) { int token = hereDocumentIdentifier(); if (token != 0) return token; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if (c == '=') { if ((c = support.read()) == '>') { return Token.tCMP; } support.unread(); return Token.tLEQ; } if (c == '<') { if ((c = support.read()) == '=') { yaccValue = "<<"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tLSHFT; } support.unread(); return '<'; case '>': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if ((c = support.read()) == '=') { return Token.tGEQ; } if (c == '>') { if ((c = support.read()) == '=') { yaccValue = ">>"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tRSHFT; } support.unread(); return '>'; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dquote, '"', 0); return Token.tSTRING_BEG; case '`': if (lex_state == LexState.EXPR_FNAME) { lex_state = LexState.EXPR_END; return c; } if (lex_state == LexState.EXPR_DOT) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } return c; } lex_strterm = new StrTermNode(support.getPosition(), str_xquote, '`', 0); return Token.tXSTRING_BEG; case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_squote, '\'', 0); return Token.tSTRING_BEG; case '?': if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG) { lex_state = LexState.EXPR_BEG; return '?'; } c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "incomplete character syntax"); return 0; } if (Character.isWhitespace(c)){ if (!lex_state.isArgument()){ int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; /* What is \v in C? case '\v': c2 = 'v'; break; */ case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2 != 0) { rb_warn("invalid character syntax; use ?\\" + c2); } } support.unread(); lex_state = LexState.EXPR_BEG; return '?'; /*} else if (ismbchar(c)) { // ruby - we don't support them either? rb_warn("multibyte character literal not supported yet; use ?\\" + c); support.unread(); lexState = LexState.EXPR_BEG; return '?';*/ } else if ((Character.isLetterOrDigit(c) || c == '_') && support.isEOL() == false && isNext_identchar()) { support.unread(); lex_state = LexState.EXPR_BEG; return '?'; } else if (c == '\\') { c = (char)read_escape(); } c &= 0xff; lex_state = LexState.EXPR_END; yaccValue = new Long(c); return Token.tINTEGER; case '&': if ((c = support.read()) == '&') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "&&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tANDOP; } else if (c == '=') { yaccValue = "&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)){ rb_warning("`&' interpreted as argument prefix"); c = Token.tAMPER; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tAMPER; } else { c = '&'; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '|': if ((c = support.read()) == '|') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "||"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tOROP; } if (c == '=') { yaccValue = "|"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '|'; case '+': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUPLUS; } support.unread(); return '+'; } if (c == '=') { yaccValue = "+"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { c = '+'; return parseNumber(c); } return Token.tUPLUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '+'; case '-': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUMINUS; } support.unread(); return '-'; } if (c == '=') { yaccValue = "-"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { return Token.tUMINUS_NUM; } return Token.tUMINUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '-'; case '.': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '.') { if ((c = support.read()) == '.') { return Token.tDOT3; } support.unread(); return Token.tDOT2; } support.unread(); if (!Character.isDigit(c)) { lex_state = LexState.EXPR_DOT; return '.'; } c = '.'; // fall through //start_num: case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : return parseNumber(c); case ']': case '}': case ')': conditionState.restart(); cmdArgumentState.restart(); lex_state = LexState.EXPR_END; return c; case ':': c = support.read(); if (c == ':') { if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_CLASS || (lex_state.isArgument() && spaceSeen)) { lex_state = LexState.EXPR_BEG; return Token.tCOLON3; } lex_state = LexState.EXPR_DOT; return Token.tCOLON2; } if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG || Character.isWhitespace(c)) { support.unread(); lex_state = LexState.EXPR_BEG; return ':'; } switch (c) { case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_ssym, c, 0); break; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dsym, c, 0); break; default: support.unread(); break; } lex_state = LexState.EXPR_FNAME; return Token.tSYMBEG; case '/': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } if ((c = support.read()) == '=') { yaccValue = "/"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen) { if (!Character.isWhitespace(c)) { arg_ambiguous(); lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '/'; case '^': if ((c = support.read()) == '=') { yaccValue = "^"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '^'; case ';': commandStart = true; case ',': lex_state = LexState.EXPR_BEG; return c; case '~': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { if ((c = support.read()) != '@') { support.unread(); } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '~'; case '(': commandStart = true; if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLPAREN; } else if (spaceSeen) { if (lex_state == LexState.EXPR_CMDARG) { c = Token.tLPAREN_ARG; } else if (lex_state == LexState.EXPR_ARG) { rb_warn("don't put space before argument parentheses"); c = '('; } } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '[': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if ((c = support.read()) == ']') { if ((c = support.read()) == '=') { return Token.tASET; } support.unread(); return Token.tAREF; } support.unread(); return '['; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLBRACK; } else if (lex_state.isArgument() && spaceSeen) { c = Token.tLBRACK; } lex_state = LexState.EXPR_BEG; conditionState.stop(); cmdArgumentState.stop(); return c; case '{': if (lex_state.isArgument() || lex_state == LexState.EXPR_END) { c = '{'; /* block (primary) */ } else if (lex_state == LexState.EXPR_ENDARG) { c = Token.tLBRACE_ARG; /* block (expr) */ } else { c = Token.tLBRACE; /* hash */ } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '\\': c = support.read(); if (c == '\n') { spaceSeen = true; continue retry; /* skip \\n */ } support.unread(); return '\\'; case '%': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { return parseQuote(support.read()); } if ((c = support.read()) == '=') { yaccValue = "%"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { return parseQuote(c); } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '%'; case '$': lex_state = LexState.EXPR_END; newToken(); c = support.read(); switch (c) { case '_': /* $_: last read line string */ c = support.read(); if (isIdentifierChar(c)) { tokadd('$'); tokadd('_'); break; } support.unread(); c = '_'; /* fall through */ case '~': /* $~: match-data */ // Enebo: We had following line replace line after that, // but it is commented out... //parserSupport.getLocalNames().getLocalIndex(String.valueOf(c)); //local_cnt(c); /* fall through */ case '*': /* $*: argv */ case '$': /* $$: pid */ case '?': /* $?: last status */ case '!': /* $!: error string */ case '@': /* $@: error position */ case '/': /* $/: input record separator */ case '\\': /* $\: output record separator */ case ';': /* $;: field separator */ case ',': /* $,: output field separator */ case '.': /* $.: last read line number */ case '=': /* $=: ignorecase */ case ':': /* $:: load path */ case '<': /* $<: reading filename */ case '>': /* $>: default output handle */ case '\"': /* $": already loaded files */ tokadd('$'); tokadd(c); yaccValue = tok(); return Token.tGVAR; case '-': tokadd('$'); tokadd(c); c = support.read(); tokadd(c); yaccValue = tok(); /* xxx shouldn't check if valid option variable */ return Token.tGVAR; case '&': /* $&: last match */ case '`': /* $`: string before last match */ case '\'': /* $': string after last match */ case '+': /* $+: string matches last paren. */ yaccValue = new BackRefNode(support.getPosition(), c); return Token.tBACK_REF; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tokadd('$'); do { tokadd(c); c = support.read(); } while (Character.isDigit(c)); support.unread(); yaccValue = new NthRefNode(support.getPosition(), Integer.parseInt(tok().substring(1))); return Token.tNTH_REF; default: if (!isIdentifierChar(c)) { support.unread(); return '$'; } case '0': tokadd('$'); } break; case '@': c = support.read(); newToken(); tokadd('@'); if (c == '@') { tokadd('@'); c = support.read(); } if (Character.isDigit(c)) { if (toklen() == 1) { rb_compile_error("`@" + c + "' is not allowed as an instance variable name"); } else { rb_compile_error("`@@" + c + "' is not allowed as a class variable name"); } } if (!isIdentifierChar(c)) { support.unread(); return '@'; } break; case '_': if (was_bol() && whole_match_p("__END__", false)) { return 0; } newToken(); break; default: if (!isIdentifierChar(c)) { rb_compile_error("Invalid char `\\" + c + "' in expression"); continue retry; } newToken(); break; } do { tokadd(c); if (ismbchar(c)) { int i, len = mbclen(c)-1; for (i = 0; i < len; i++) { c = support.read(); tokadd(c); } } c = support.read(); } while (isIdentifierChar(c)); char peek = support.read(); if ((c == '!' || c == '?') && isIdentifierChar(tok().charAt(0)) && peek != '=') { support.unread(); // put peek back. tokadd(c); } else { support.unreadMany(2); // put peek back. } int result = 0; switch (tok().charAt(0)) { case '$': lex_state = LexState.EXPR_END; result = Token.tGVAR; break; case '@': lex_state = LexState.EXPR_END; if (tok().charAt(1) == '@') { result = Token.tCVAR; } else { result = Token.tIVAR; } break; default: if (toklast() == '!' || toklast() == '?') { result = Token.tFID; } else { if (lex_state == LexState.EXPR_FNAME) { if ((c = support.read()) == '=' && !peek('~') && !peek('>') && (!peek('=') || (support.isEOL() && support.getCharAt(1) == '>'))) { result = Token.tIDENTIFIER; tokadd(c); } else { support.unread(); } } if (result == 0 && ISUPPER(tok().charAt(0))) { result = Token.tCONSTANT; } else { result = Token.tIDENTIFIER; } } if (lex_state != LexState.EXPR_DOT) { /* See if it is a reserved word. */ Keyword keyword = getKeyword(tok(), toklen()); if (keyword != null) { // enum lex_state LexState state = lex_state; lex_state = keyword.state; if (state.isExprFName()) { yaccValue = keyword.name; } if (keyword.id0 == Token.kDO) { if (conditionState.isInState()) { return Token.kDO_COND; } if (cmdArgumentState.isInState() && state != LexState.EXPR_CMDARG) { return Token.kDO_BLOCK; } if (state == LexState.EXPR_ENDARG) { return Token.kDO_BLOCK; } return Token.kDO; } if (state == LexState.EXPR_BEG) { return keyword.id0; } else { if (keyword.id0 != keyword.id1) lex_state = LexState.EXPR_BEG; return keyword.id1; } } } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_ARG || lex_state == LexState.EXPR_CMDARG) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } } else { lex_state = LexState.EXPR_END; } } yaccValue = tok(); // Lame: parsing logic made it into lexer in ruby...So we // are emulating if (IdUtil.isLocal((String)yaccValue) && ((parserSupport.getBlockNames().isInBlock() && parserSupport.getBlockNames().isDefined((String) yaccValue)) || parserSupport.getLocalNames().isLocalRegistered((String) yaccValue))) { lex_state = LexState.EXPR_END; } return result; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8ce27f029c7dbaced0850b02dedc1e2c73a48589/RubyYaccLexer.java/clean/src/org/jruby/lexer/yacc/RubyYaccLexer.java |
|
if (was_bol() && whole_match_p("__END__", false)) { | if (was_bol() && whole_match_p("_END__", false)) { | private int yylex() { char c; boolean spaceSeen = false; boolean commandState; if (lex_strterm != null) { if (lex_strterm instanceof HereDocNode) { int token = hereDocument(); if (token == Token.tSTRING_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } else { int token = parseString(); if (token == Token.tSTRING_END || token == Token.tREGEXP_END) { lex_strterm = null; lex_state = LexState.EXPR_END; } return token; } } currentPos = support.getPosition(); commandState = commandStart; commandStart = false; retry: for(;;) { c = support.read(); switch(c) { case '\004': /* ^D */ case '\032': /* ^Z */ case 0: /* end of script. */ return 0; /* white spaces */ case ' ': case '\t': case '\f': case '\r': case '\13': /* '\v' */ spaceSeen = true; continue retry; case '#': /* it's a comment */ while ((c = support.read()) != '\n') { if (c == EOF) { return 0; } } /* fall through */ case '\n': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_CLASS) { continue retry; } commandStart = true; lex_state = LexState.EXPR_BEG; return '\n'; case '*': if ((c = support.read()) == '*') { if ((c = support.read()) == '=') { yaccValue = "**"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); c = Token.tPOW; } else { if (c == '=') { yaccValue = "*"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { errorHandler.handleError(IErrors.WARNING, support.getPosition(), "`*' interpreted as argument prefix"); c = Token.tSTAR; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tSTAR; } else { c = '*'; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '!': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { return Token.tNEQ; } if (c == '~') { return Token.tNMATCH; } support.unread(); return '!'; case '=': // Skip documentation nodes if (was_bol()) { /* skip embedded rd document */ if (support.isNextNoCase("begin")) { c = support.read(); if (Character.isWhitespace(c)) { // In case last next was the newline. support.unread(); for (;;) { support.readLine(); c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "embedded document meets end of file"); return 0; } if (c != '=') continue; if (support.isNextNoCase("end")) { if (support.isEOL()) { break; } c = support.read(); if (Character.isWhitespace(c)) { support.readLine(); break; } else { support.unread(); } } } continue retry; } else { support.unread(); } } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } c = support.read(); if (c == '=') { c = support.read(); if (c == '=') { return Token.tEQQ; } support.unread(); return Token.tEQ; } if (c == '~') { return Token.tMATCH; } else if (c == '>') { return Token.tASSOC; } support.unread(); return '='; case '<': c = support.read(); if (c == '<' && lex_state != LexState.EXPR_END && lex_state != LexState.EXPR_DOT && lex_state != LexState.EXPR_ENDARG && lex_state != LexState.EXPR_CLASS && (!lex_state.isArgument() || spaceSeen)) { int token = hereDocumentIdentifier(); if (token != 0) return token; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if (c == '=') { if ((c = support.read()) == '>') { return Token.tCMP; } support.unread(); return Token.tLEQ; } if (c == '<') { if ((c = support.read()) == '=') { yaccValue = "<<"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tLSHFT; } support.unread(); return '<'; case '>': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } if ((c = support.read()) == '=') { return Token.tGEQ; } if (c == '>') { if ((c = support.read()) == '=') { yaccValue = ">>"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tRSHFT; } support.unread(); return '>'; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dquote, '"', 0); return Token.tSTRING_BEG; case '`': if (lex_state == LexState.EXPR_FNAME) { lex_state = LexState.EXPR_END; return c; } if (lex_state == LexState.EXPR_DOT) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } return c; } lex_strterm = new StrTermNode(support.getPosition(), str_xquote, '`', 0); return Token.tXSTRING_BEG; case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_squote, '\'', 0); return Token.tSTRING_BEG; case '?': if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG) { lex_state = LexState.EXPR_BEG; return '?'; } c = support.read(); if (c == EOF) { errorHandler.handleError(IErrors.COMPILE_ERROR, support.getPosition(), "incomplete character syntax"); return 0; } if (Character.isWhitespace(c)){ if (!lex_state.isArgument()){ int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; /* What is \v in C? case '\v': c2 = 'v'; break; */ case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2 != 0) { rb_warn("invalid character syntax; use ?\\" + c2); } } support.unread(); lex_state = LexState.EXPR_BEG; return '?'; /*} else if (ismbchar(c)) { // ruby - we don't support them either? rb_warn("multibyte character literal not supported yet; use ?\\" + c); support.unread(); lexState = LexState.EXPR_BEG; return '?';*/ } else if ((Character.isLetterOrDigit(c) || c == '_') && support.isEOL() == false && isNext_identchar()) { support.unread(); lex_state = LexState.EXPR_BEG; return '?'; } else if (c == '\\') { c = (char)read_escape(); } c &= 0xff; lex_state = LexState.EXPR_END; yaccValue = new Long(c); return Token.tINTEGER; case '&': if ((c = support.read()) == '&') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "&&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tANDOP; } else if (c == '=') { yaccValue = "&"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)){ rb_warning("`&' interpreted as argument prefix"); c = Token.tAMPER; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tAMPER; } else { c = '&'; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return c; case '|': if ((c = support.read()) == '|') { lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '=') { yaccValue = "||"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); return Token.tOROP; } if (c == '=') { yaccValue = "|"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '|'; case '+': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUPLUS; } support.unread(); return '+'; } if (c == '=') { yaccValue = "+"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { c = '+'; return parseNumber(c); } return Token.tUPLUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '+'; case '-': c = support.read(); if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if (c == '@') { return Token.tUMINUS; } support.unread(); return '-'; } if (c == '=') { yaccValue = "-"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c))) { if (lex_state.isArgument()) arg_ambiguous(); lex_state = LexState.EXPR_BEG; support.unread(); if (Character.isDigit(c)) { return Token.tUMINUS_NUM; } return Token.tUMINUS; } lex_state = LexState.EXPR_BEG; support.unread(); return '-'; case '.': lex_state = LexState.EXPR_BEG; if ((c = support.read()) == '.') { if ((c = support.read()) == '.') { return Token.tDOT3; } support.unread(); return Token.tDOT2; } support.unread(); if (!Character.isDigit(c)) { lex_state = LexState.EXPR_DOT; return '.'; } c = '.'; // fall through //start_num: case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : return parseNumber(c); case ']': case '}': case ')': conditionState.restart(); cmdArgumentState.restart(); lex_state = LexState.EXPR_END; return c; case ':': c = support.read(); if (c == ':') { if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_CLASS || (lex_state.isArgument() && spaceSeen)) { lex_state = LexState.EXPR_BEG; return Token.tCOLON3; } lex_state = LexState.EXPR_DOT; return Token.tCOLON2; } if (lex_state == LexState.EXPR_END || lex_state == LexState.EXPR_ENDARG || Character.isWhitespace(c)) { support.unread(); lex_state = LexState.EXPR_BEG; return ':'; } switch (c) { case '\'': lex_strterm = new StrTermNode(support.getPosition(), str_ssym, c, 0); break; case '"': lex_strterm = new StrTermNode(support.getPosition(), str_dsym, c, 0); break; default: support.unread(); break; } lex_state = LexState.EXPR_FNAME; return Token.tSYMBEG; case '/': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } if ((c = support.read()) == '=') { yaccValue = "/"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } support.unread(); if (lex_state.isArgument() && spaceSeen) { if (!Character.isWhitespace(c)) { arg_ambiguous(); lex_strterm = new StrTermNode(support.getPosition(), str_regexp, '/', 0); return Token.tREGEXP_BEG; } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '/'; case '^': if ((c = support.read()) == '=') { yaccValue = "^"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '^'; case ';': commandStart = true; case ',': lex_state = LexState.EXPR_BEG; return c; case '~': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { if ((c = support.read()) != '@') { support.unread(); } } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } return '~'; case '(': commandStart = true; if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLPAREN; } else if (spaceSeen) { if (lex_state == LexState.EXPR_CMDARG) { c = Token.tLPAREN_ARG; } else if (lex_state == LexState.EXPR_ARG) { rb_warn("don't put space before argument parentheses"); c = '('; } } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '[': if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; if ((c = support.read()) == ']') { if ((c = support.read()) == '=') { return Token.tASET; } support.unread(); return Token.tAREF; } support.unread(); return '['; } else if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { c = Token.tLBRACK; } else if (lex_state.isArgument() && spaceSeen) { c = Token.tLBRACK; } lex_state = LexState.EXPR_BEG; conditionState.stop(); cmdArgumentState.stop(); return c; case '{': if (lex_state.isArgument() || lex_state == LexState.EXPR_END) { c = '{'; /* block (primary) */ } else if (lex_state == LexState.EXPR_ENDARG) { c = Token.tLBRACE_ARG; /* block (expr) */ } else { c = Token.tLBRACE; /* hash */ } conditionState.stop(); cmdArgumentState.stop(); lex_state = LexState.EXPR_BEG; return c; case '\\': c = support.read(); if (c == '\n') { spaceSeen = true; continue retry; /* skip \\n */ } support.unread(); return '\\'; case '%': if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID) { return parseQuote(support.read()); } if ((c = support.read()) == '=') { yaccValue = "%"; lex_state = LexState.EXPR_BEG; return Token.tOP_ASGN; } if (lex_state.isArgument() && spaceSeen && !Character.isWhitespace(c)) { return parseQuote(c); } if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) { lex_state = LexState.EXPR_ARG; } else { lex_state = LexState.EXPR_BEG; } support.unread(); return '%'; case '$': lex_state = LexState.EXPR_END; newToken(); c = support.read(); switch (c) { case '_': /* $_: last read line string */ c = support.read(); if (isIdentifierChar(c)) { tokadd('$'); tokadd('_'); break; } support.unread(); c = '_'; /* fall through */ case '~': /* $~: match-data */ // Enebo: We had following line replace line after that, // but it is commented out... //parserSupport.getLocalNames().getLocalIndex(String.valueOf(c)); //local_cnt(c); /* fall through */ case '*': /* $*: argv */ case '$': /* $$: pid */ case '?': /* $?: last status */ case '!': /* $!: error string */ case '@': /* $@: error position */ case '/': /* $/: input record separator */ case '\\': /* $\: output record separator */ case ';': /* $;: field separator */ case ',': /* $,: output field separator */ case '.': /* $.: last read line number */ case '=': /* $=: ignorecase */ case ':': /* $:: load path */ case '<': /* $<: reading filename */ case '>': /* $>: default output handle */ case '\"': /* $": already loaded files */ tokadd('$'); tokadd(c); yaccValue = tok(); return Token.tGVAR; case '-': tokadd('$'); tokadd(c); c = support.read(); tokadd(c); yaccValue = tok(); /* xxx shouldn't check if valid option variable */ return Token.tGVAR; case '&': /* $&: last match */ case '`': /* $`: string before last match */ case '\'': /* $': string after last match */ case '+': /* $+: string matches last paren. */ yaccValue = new BackRefNode(support.getPosition(), c); return Token.tBACK_REF; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tokadd('$'); do { tokadd(c); c = support.read(); } while (Character.isDigit(c)); support.unread(); yaccValue = new NthRefNode(support.getPosition(), Integer.parseInt(tok().substring(1))); return Token.tNTH_REF; default: if (!isIdentifierChar(c)) { support.unread(); return '$'; } case '0': tokadd('$'); } break; case '@': c = support.read(); newToken(); tokadd('@'); if (c == '@') { tokadd('@'); c = support.read(); } if (Character.isDigit(c)) { if (toklen() == 1) { rb_compile_error("`@" + c + "' is not allowed as an instance variable name"); } else { rb_compile_error("`@@" + c + "' is not allowed as a class variable name"); } } if (!isIdentifierChar(c)) { support.unread(); return '@'; } break; case '_': if (was_bol() && whole_match_p("__END__", false)) { return 0; } newToken(); break; default: if (!isIdentifierChar(c)) { rb_compile_error("Invalid char `\\" + c + "' in expression"); continue retry; } newToken(); break; } do { tokadd(c); if (ismbchar(c)) { int i, len = mbclen(c)-1; for (i = 0; i < len; i++) { c = support.read(); tokadd(c); } } c = support.read(); } while (isIdentifierChar(c)); char peek = support.read(); if ((c == '!' || c == '?') && isIdentifierChar(tok().charAt(0)) && peek != '=') { support.unread(); // put peek back. tokadd(c); } else { support.unreadMany(2); // put peek back. } int result = 0; switch (tok().charAt(0)) { case '$': lex_state = LexState.EXPR_END; result = Token.tGVAR; break; case '@': lex_state = LexState.EXPR_END; if (tok().charAt(1) == '@') { result = Token.tCVAR; } else { result = Token.tIVAR; } break; default: if (toklast() == '!' || toklast() == '?') { result = Token.tFID; } else { if (lex_state == LexState.EXPR_FNAME) { if ((c = support.read()) == '=' && !peek('~') && !peek('>') && (!peek('=') || (support.isEOL() && support.getCharAt(1) == '>'))) { result = Token.tIDENTIFIER; tokadd(c); } else { support.unread(); } } if (result == 0 && ISUPPER(tok().charAt(0))) { result = Token.tCONSTANT; } else { result = Token.tIDENTIFIER; } } if (lex_state != LexState.EXPR_DOT) { /* See if it is a reserved word. */ Keyword keyword = getKeyword(tok(), toklen()); if (keyword != null) { // enum lex_state LexState state = lex_state; lex_state = keyword.state; if (state.isExprFName()) { yaccValue = keyword.name; } if (keyword.id0 == Token.kDO) { if (conditionState.isInState()) { return Token.kDO_COND; } if (cmdArgumentState.isInState() && state != LexState.EXPR_CMDARG) { return Token.kDO_BLOCK; } if (state == LexState.EXPR_ENDARG) { return Token.kDO_BLOCK; } return Token.kDO; } if (state == LexState.EXPR_BEG) { return keyword.id0; } else { if (keyword.id0 != keyword.id1) lex_state = LexState.EXPR_BEG; return keyword.id1; } } } if (lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID || lex_state == LexState.EXPR_DOT || lex_state == LexState.EXPR_ARG || lex_state == LexState.EXPR_CMDARG) { if (commandState) { lex_state = LexState.EXPR_CMDARG; } else { lex_state = LexState.EXPR_ARG; } } else { lex_state = LexState.EXPR_END; } } yaccValue = tok(); // Lame: parsing logic made it into lexer in ruby...So we // are emulating if (IdUtil.isLocal((String)yaccValue) && ((parserSupport.getBlockNames().isInBlock() && parserSupport.getBlockNames().isDefined((String) yaccValue)) || parserSupport.getLocalNames().isLocalRegistered((String) yaccValue))) { lex_state = LexState.EXPR_END; } return result; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8ce27f029c7dbaced0850b02dedc1e2c73a48589/RubyYaccLexer.java/clean/src/org/jruby/lexer/yacc/RubyYaccLexer.java |
list.addAll((int) beg, repList); | list.addAll((int) beg, new ArrayList(repList)); | public void replace(long beg, long len, RubyObject repl) { int length = getLength(); if (len < 0) { throw new RubyIndexException(getRuby(), "Negative array length: " + len); } if (beg < 0) { beg += length; } if (beg < 0) { throw new RubyIndexException(getRuby(), "Index out of bounds: " + beg); } modify(); for (int i = 0; beg < length && i < len; i++) { list.remove((int) beg); } autoExpand(beg); if (repl instanceof RubyArray) { List repList = ((RubyArray) repl).getList(); list.ensureCapacity(length + repList.size()); list.addAll((int) beg, repList); } else if (!repl.isNil()) { list.add((int) beg, repl); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2f13ba47385b7584839c7f6f6f1abfee251cbe53/RubyArray.java/buggy/org/jruby/RubyArray.java |
public RubyBoolean assignable_from_p(IRubyObject other) { if (! (other instanceof JavaClass)) { throw new TypeError(getRuntime(), "assignable_from requires JavaClass (" + other.getType() + " given)"); } Class otherClass = ((JavaClass) other).getValue(); if (javaClass.isAssignableFrom(otherClass)) { return getRuntime().getTrue(); } otherClass = JavaUtil.primitiveToWrapper(otherClass); Class thisJavaClass = JavaUtil.primitiveToWrapper(javaClass); if (thisJavaClass.isAssignableFrom(otherClass)) { return getRuntime().getTrue(); } if (Number.class.isAssignableFrom(thisJavaClass)) { if (Number.class.isAssignableFrom(otherClass)) { return getRuntime().getTrue(); } if (otherClass.equals(Character.class)) { return getRuntime().getTrue(); } } if (thisJavaClass.equals(Character.class)) { if (Number.class.isAssignableFrom(otherClass)) { return getRuntime().getTrue(); } } return getRuntime().getFalse(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d41a3d6208fe2344a1c9b95a9fd6b38cb78ba69c/JavaClass.java/clean/src/org/jruby/javasupport/JavaClass.java |
||
return RubyBoolean.newBoolean(getRuntime(), javaClass.isPrimitive()); | return RubyBoolean.newBoolean(getRuntime(), isPrimitive()); | public RubyBoolean primitive_p() { return RubyBoolean.newBoolean(getRuntime(), javaClass.isPrimitive()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d41a3d6208fe2344a1c9b95a9fd6b38cb78ba69c/JavaClass.java/clean/src/org/jruby/javasupport/JavaClass.java |
if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { } } | protected InputStream loadResource(String uri) { // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } } return in; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/11df53b59b983bed2ad4569b2462495157cef4ff/XBeanNamespaceHandler.java/buggy/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanNamespaceHandler.java |
|
public NoteTree(Shell shell, Composite parent, Listener l) { | public NoteTree(Composite parent, Listener l) { | public NoteTree(Shell shell, Composite parent, Listener l) { // Tree and context menu. tree = new Tree(parent, SWT.MULTI); contextMenu = new TreeContextMenu(shell, tree, l); // Text editor for renaming tree nodes. treeEditor = new TreeEditor(tree); treeEditor.grabHorizontal = true; treeEditor.minimumWidth = 50; // Events. this.l = l; l.mapEvent(tree, SWT.MouseDoubleClick, MainController.DISPLAY_TAB); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/18ce9cf33f3e06fda4addd57f5ae5c9423a990fb/NoteTree.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTree.java |
contextMenu = new TreeContextMenu(shell, tree, l); | contextMenu = new TreeContextMenu(tree, l); | public NoteTree(Shell shell, Composite parent, Listener l) { // Tree and context menu. tree = new Tree(parent, SWT.MULTI); contextMenu = new TreeContextMenu(shell, tree, l); // Text editor for renaming tree nodes. treeEditor = new TreeEditor(tree); treeEditor.grabHorizontal = true; treeEditor.minimumWidth = 50; // Events. this.l = l; l.mapEvent(tree, SWT.MouseDoubleClick, MainController.DISPLAY_TAB); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/18ce9cf33f3e06fda4addd57f5ae5c9423a990fb/NoteTree.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTree.java |
public void initialiseTreeEditor() { TreeItem ti = tree.getSelection()[0]; if (ti == null) return; // HERE: might have to use a Rectangle for this border. // Also should make it so as soon as the text box loses // focus the editor goes away. Text treeTextEditor = new Text(tree, SWT.NONE); treeTextEditor.setText(ti.getText()); treeTextEditor.selectAll(); treeTextEditor.setFocus(); treeEditor.setEditor(treeTextEditor, ti); l.mapEvent(treeTextEditor, SWT.Modify, TreeController.RENAME_NOTE); l.mapEvent(treeTextEditor, SWT.FocusOut, TreeController.FINISH_RENAME_NOTE); l.mapEvent(treeTextEditor, SWT.KeyDown, TreeController.FINISH_RENAME_NOTE); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/18ce9cf33f3e06fda4addd57f5ae5c9423a990fb/NoteTree.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTree.java |
||
public TreeContextMenu(Shell shell, Control parent, Listener l) { | public TreeContextMenu(Control parent, Listener l) { | public TreeContextMenu(Shell shell, Control parent, Listener l) { // menu menu = new Menu(shell, SWT.POP_UP); l.mapEvent(menu, SWT.Show, TreeContextMenuController.INITIALISE_MENU); parent.setMenu(menu); // menu items addNote = createMenuItem(menu, "Add Note", l, TreeContextMenuController.ADD_NOTE); removeNotes = createMenuItem(menu, "Remove Notes", l, TreeContextMenuController.REMOVE_NOTES); renameNote = createMenuItem(menu, "Rename Note", l, TreeContextMenuController.RENAME_NOTE); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/18ce9cf33f3e06fda4addd57f5ae5c9423a990fb/TreeContextMenu.java/buggy/trunk/src/de/berlios/koalanotes/display/TreeContextMenu.java |
menu = new Menu(shell, SWT.POP_UP); | menu = new Menu(parent); | public TreeContextMenu(Shell shell, Control parent, Listener l) { // menu menu = new Menu(shell, SWT.POP_UP); l.mapEvent(menu, SWT.Show, TreeContextMenuController.INITIALISE_MENU); parent.setMenu(menu); // menu items addNote = createMenuItem(menu, "Add Note", l, TreeContextMenuController.ADD_NOTE); removeNotes = createMenuItem(menu, "Remove Notes", l, TreeContextMenuController.REMOVE_NOTES); renameNote = createMenuItem(menu, "Rename Note", l, TreeContextMenuController.RENAME_NOTE); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/18ce9cf33f3e06fda4addd57f5ae5c9423a990fb/TreeContextMenu.java/buggy/trunk/src/de/berlios/koalanotes/display/TreeContextMenu.java |
} | } | public Set findCGCIHierarchies(final Set arg0) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashSet(); } List result = containerDao.findCGCIHierarchies(arg0); Set imagesAll = new HashSet(result); if (null == imagesAll || imagesAll.size() == 0) { return new HashSet(); }//TODO log if this is empty. (input/output) update jdbc tests. // LOGIC Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Set classifications = img.getClassifications(); Set categories = new HashSet(); for (Iterator c = classifications.iterator(); c.hasNext();) { Classification cla = (Classification) c.next(); if (cla.getValid().booleanValue()) { // TODO do this in query categories.add(cla.getCategory()); } } if (categories == null || categories.size() < 1) { hierarchies.add(img); } else { Iterator c = categories.iterator(); while (c.hasNext()) { // OPTIMAL TODO looping over get!! // ??? Integer cId = (Integer) c.next(); Category2 ca = new Category2();//containerDao.loadC(cId));// TODO hql if (null == ca.images) ca.images = new HashSet(); ca.images.add(img); Integer cgId = ca.getCategoryGroup(); // and HERE ?? // FIXME CategoryGroup2 cg = new CategoryGroup2();//containerDao.loadCG(cgId)); // not a // collection?? if (cg == null) { hierarchies.add(ca); } else { if (null == cg.categories) cg.categories = new HashSet(); cg.categories.add(ca); hierarchies.add(cg); } } } } return (Set) clean(hierarchies); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
public Map findImageAnnotations(final Set arg0) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashMap(); } List result = annotationDao.findImageAnnotations(arg0); return (Map) clean(sortImageAnnotations(result)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
||
if (log.isDebugEnabled()){ log.debug("findPDIHierarchies() -- no results found:\n"+ arg0.toString()); } | public Set findPDIHierarchies(final Set arg0) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashSet(); } List result = containerDao.findPDIHierarchies(arg0); Set imagesAll = new HashSet(result); if (null == imagesAll || imagesAll.size() == 0) { return new HashSet(); } // LOGIC Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Set datasets = img.getDatasets(); if (datasets == null || datasets.size() < 1) { hierarchies.add(img); } else { Iterator d = datasets.iterator(); while (d.hasNext()) { Dataset ds = (Dataset) d.next(); if (!(ds.getImages() instanceof HashSet)) ds.setImages(new HashSet()); ds.getImages().add(img); Set projects = ds.getProjects(); if (projects == null || projects.size() < 1) { hierarchies.add(ds); } else { Iterator p = projects.iterator(); while (p.hasNext()) { Project prj = (Project) p.next(); if (!(prj.getDatasets() instanceof HashSet)) prj.setDatasets(new HashSet()); prj.getDatasets().add(ds); hierarchies.add(prj); } } } } } return (Set) clean(hierarchies); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
|
} else { | } else { | void hessianClean(Object obj, Set done) { if (null==obj) return; if (done.contains(obj)) return; done.add(obj); if (obj instanceof Map) { Map map = (Map) obj; for (Iterator i = map.values().iterator(); i.hasNext();) { Object value = i.next(); hessianClean(value,done); } } else if (obj instanceof Set) { Set set = (Set) obj; for (Iterator i = set.iterator(); i.hasNext();) { Object item = i.next(); hessianClean(item,done); } } else { // TODO can check for super class when implemented Method[] methods = obj.getClass().getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().startsWith("get")){ if (0==method.getParameterTypes().length){ Object result=invokeGetter(obj,method); if (! Hibernate.isInitialized(result)){ Method setter = getSetterForGetter(methods,method); if (null==setter){ throw new IllegalStateException("No setter for getter; this will explode"); } setToNull(obj,setter); } else { hessianClean(result,done); } } } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
e.printStackTrace(); | re.initCause(e); throw re; | Object invokeGetter(Object target, Method getter){ Object result=null; try { result = getter.invoke(target,new Object[]{}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
e.printStackTrace(); | re.initCause(e); throw re; | Object invokeGetter(Object target, Method getter){ Object result=null; try { result = getter.invoke(target,new Object[]{}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
e.printStackTrace(); | re.initCause(e); throw re; | Object invokeGetter(Object target, Method getter){ Object result=null; try { result = getter.invoke(target,new Object[]{}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
"Class parameter for loadCGCIHierarchy() must be CategoryGroup or Category."); | "Class parameter for loadCGCIHierarchy() must be CategoryGroup or Category, not "+arg0); | public Object loadCGCIHierarchy(final Class arg0, final int arg1) { // CONTRACT if (!CategoryGroup.class.equals(arg0) && !Category.class.equals(arg0)) { throw new IllegalArgumentException( "Class parameter for loadCGCIHierarchy() must be CategoryGroup or Category."); } return clean(containerDao.loadHierarchy(arg0, arg1)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
"Class parameter for loadPDIHierarchy() must be Project or Dataset."); | "Class parameter for loadPDIHierarchy() must be Project or Dataset, not "+arg0); | public Object loadPDIHierarchy(final Class arg0, final int arg1) { // CONTRACT if (!Project.class.equals(arg0) && !Dataset.class.equals(arg0)) { throw new IllegalArgumentException( "Class parameter for loadPDIHierarchy() must be Project or Dataset."); } return clean(containerDao.loadHierarchy(arg0, arg1)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
RuntimeException re = new RuntimeException("Error trying to set to null"); | RuntimeException re = new RuntimeException("Error trying to set to null."); | void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
e.printStackTrace(); | re.initCause(e); | void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
e.printStackTrace(); | re.initCause(e); | void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
e.printStackTrace(); | re.initCause(e); | void setToNull(Object obj, Method setter){ RuntimeException re = new RuntimeException("Error trying to set to null"); try { setter.invoke(obj,new Object[]{null}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); throw re; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
Set result = new HashSet(l); | Set result = new HashSet(l); | Map sortDatasetAnnotations(final List l) { Set result = new HashSet(l); // TODO this everywhere if (null == result || result.size() == 0) { return new HashMap(); } Map map = new HashMap(); // SORT Iterator i = result.iterator(); while (i.hasNext()) { DatasetAnnotation ann = (DatasetAnnotation) i.next(); Integer ds_id = ann.getDataset().getDatasetId(); if (!map.containsKey(ds_id)) { map.put(ds_id, new HashSet()); } ((Set) map.get(ds_id)).add(ann); } return map; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
Set result = new HashSet(l); | Set result = new HashSet(l); | Map sortImageAnnotations(final List l) { Set result = new HashSet(l); // TODO this everywhere if (null == result || result.size() == 0) { return new HashMap(); } Map map = new HashMap(); // SORT Iterator i = result.iterator(); while (i.hasNext()) { ImageAnnotation ann = (ImageAnnotation) i.next(); Integer img_id = ann.getImage().getImageId(); if (!map.containsKey(img_id)) { map.put(img_id, new HashSet()); } ((Set) map.get(img_id)).add(ann); } return map; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
suite.addTest(new TestSuite(TestNativeException.class)); | public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new TestSuite(TestBSF.class)); return suite; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f5308c71bb6aebeec97981ce3cb34e636a1c531b/JavaSupportTestSuite.java/buggy/test/org/jruby/javasupport/test/JavaSupportTestSuite.java |
|
CoverageDataFileHandler.setDefaultDataFile(args[++i]); | dataFile = new File(args[++i]); | private void parseArguments(String[] args) { // Parse our parameters Collection locations = new Vector(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else if (args[i].equals("--datafile")) CoverageDataFileHandler.setDefaultDataFile(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { String regex = args[++i]; try { Perl5Compiler pc = new Perl5Compiler(); this.ignoreRegexp = pc.compile(regex); } catch (MalformedPatternException e) { logger.warn("The regular expression " + regex + " is invalid: " + e.getLocalizedMessage()); } } else locations.add(args[i]); } // Load coverage data, instrument classes, save coverage data projectData = ProjectData.getGlobalProjectData(); Iterator iter = locations.iterator(); while (iter.hasNext()) addInstrumentation((String)iter.next()); ProjectData.saveGlobalProjectData(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8b78aded7bc2195ca2875df15fa36b034194b55e/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
projectData = ProjectData.getGlobalProjectData(); | projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); | private void parseArguments(String[] args) { // Parse our parameters Collection locations = new Vector(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else if (args[i].equals("--datafile")) CoverageDataFileHandler.setDefaultDataFile(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { String regex = args[++i]; try { Perl5Compiler pc = new Perl5Compiler(); this.ignoreRegexp = pc.compile(regex); } catch (MalformedPatternException e) { logger.warn("The regular expression " + regex + " is invalid: " + e.getLocalizedMessage()); } } else locations.add(args[i]); } // Load coverage data, instrument classes, save coverage data projectData = ProjectData.getGlobalProjectData(); Iterator iter = locations.iterator(); while (iter.hasNext()) addInstrumentation((String)iter.next()); ProjectData.saveGlobalProjectData(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8b78aded7bc2195ca2875df15fa36b034194b55e/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
ProjectData.saveGlobalProjectData(); | CoverageDataFileHandler.saveCoverageData(projectData, dataFile); | private void parseArguments(String[] args) { // Parse our parameters Collection locations = new Vector(); for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = new File(args[++i]); else if (args[i].equals("--datafile")) CoverageDataFileHandler.setDefaultDataFile(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { String regex = args[++i]; try { Perl5Compiler pc = new Perl5Compiler(); this.ignoreRegexp = pc.compile(regex); } catch (MalformedPatternException e) { logger.warn("The regular expression " + regex + " is invalid: " + e.getLocalizedMessage()); } } else locations.add(args[i]); } // Load coverage data, instrument classes, save coverage data projectData = ProjectData.getGlobalProjectData(); Iterator iter = locations.iterator(); while (iter.hasNext()) addInstrumentation((String)iter.next()); ProjectData.saveGlobalProjectData(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8b78aded7bc2195ca2875df15fa36b034194b55e/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
recv.getRubyClass().call(recv, getMId(), new RubyObject[] {value}, 0); | recv.getRubyClass().call(recv, getMId(), new RubyPointer(new RubyObject[] {value}), 0); | public void assign(Ruby ruby, RubyObject self, RubyObject value, boolean check) { RubyObject recv = getRecvNode().eval(ruby, self); if (getArgsNode() == null) { /* attr set */ recv.getRubyClass().call(recv, getMId(), new RubyObject[] {value}, 0); } else { RubyArray args = (RubyArray)getArgsNode().eval(ruby, self); args.push(value); recv.getRubyClass().call(recv, getMId(), args.toJavaArray(), 0); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/CallNode.java/clean/org/jruby/nodes/CallNode.java |
recv.getRubyClass().call(recv, getMId(), args.toJavaArray(), 0); | recv.getRubyClass().call(recv, getMId(), new RubyPointer(args.getList()), 0); | public void assign(Ruby ruby, RubyObject self, RubyObject value, boolean check) { RubyObject recv = getRecvNode().eval(ruby, self); if (getArgsNode() == null) { /* attr set */ recv.getRubyClass().call(recv, getMId(), new RubyObject[] {value}, 0); } else { RubyArray args = (RubyArray)getArgsNode().eval(ruby, self); args.push(value); recv.getRubyClass().call(recv, getMId(), args.toJavaArray(), 0); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/CallNode.java/clean/org/jruby/nodes/CallNode.java |
RubyObject[] args = ArgsUtil.setupArgs(ruby, self, getArgsNode()); | RubyPointer args = ArgsUtil.setupArgs(ruby, self, getArgsNode()); | public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyBlock tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject recv = getRecvNode().eval(ruby, self); RubyObject[] args = ArgsUtil.setupArgs(ruby, self, getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); return recv.getRubyClass().call(recv, getMId(), args, 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/CallNode.java/clean/org/jruby/nodes/CallNode.java |
return new ProcDefinition(ruby).getType(); | RubyClass result = ruby.defineClass("Proc", ruby.getClasses().getObjectClass()); CallbackFactory callbackFactory = ruby.callbackFactory(); result.defineMethod("arity", callbackFactory.getMethod(RubyProc.class, "arity")); result.defineMethod("call", callbackFactory.getOptMethod(RubyProc.class, "call")); result.defineMethod("[]", callbackFactory.getOptMethod(RubyProc.class, "call")); result.defineSingletonMethod("new", callbackFactory.getOptSingletonMethod(RubyProc.class, "newInstance")); return result; | public static RubyClass createProcClass(Ruby ruby) { return new ProcDefinition(ruby).getType(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyProc.java/clean/src/org/jruby/RubyProc.java |
ContactList contactList = SparkManager.getWorkspace().getContactList(); | final ContactList contactList = SparkManager.getWorkspace().getContactList(); | public void run() { ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(false); } } catch (ChatRoomNotFoundException e) { } contactList.useDefaults(from); customList.remove(StringUtils.parseBareAddress(from)); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ChatManager.java/buggy/src/java/org/jivesoftware/spark/ChatManager.java |
((ChatRoomImpl)chatRoom).showTyping(false); | ((ChatRoomImpl)chatRoom).showTyping(true); | public void run() { ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(false); } } catch (ChatRoomNotFoundException e) { } contactList.useDefaults(from); customList.remove(StringUtils.parseBareAddress(from)); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ChatManager.java/buggy/src/java/org/jivesoftware/spark/ChatManager.java |
contactList.useDefaults(from); customList.remove(StringUtils.parseBareAddress(from)); | contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); | public void run() { ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(false); } } catch (ChatRoomNotFoundException e) { } contactList.useDefaults(from); customList.remove(StringUtils.parseBareAddress(from)); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ChatManager.java/buggy/src/java/org/jivesoftware/spark/ChatManager.java |
scaleBar = new HeatMapScaleBar(); | public HeatMapUI() { super(); treePanel = new HeatMapTreeUI(null); gradPanel = new HeatMapGradientUI(); statusPanel = new HeatMapStatusUI(); modeBar = new HeatMapModeBar(); buildUI(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
|
controlPanel.add(scalePanel,BorderLayout.SOUTH); | private void buildUI() { Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); JScrollPane scrollPane = new JScrollPane(treePanel); scrollPane.setPreferredSize(new Dimension(250,200)); scrollPane.setSize(new Dimension(250,200)); mainPanel.add(scrollPane,BorderLayout.CENTER); JPanel controlPanel = new JPanel(); gradPanel.setPreferredSize(new Dimension(250,90)); gradPanel.setSize(new Dimension(250,90)); gradPanel.setEnabled(false); controlPanel.setLayout(new BorderLayout()); controlPanel.add(gradPanel,BorderLayout.CENTER); JPanel barPanel = new JPanel(); barPanel.add(modeBar,BorderLayout.CENTER); controlPanel.add(barPanel,BorderLayout.NORTH); mainPanel.add(controlPanel,BorderLayout.SOUTH); contentPane.add(mainPanel,BorderLayout.CENTER); contentPane.add(statusPanel,BorderLayout.SOUTH); if(model != null) { setTitle("HeatMap: " + model.getInfoSource().getDataset().getName()); } else { setTitle("HeatMap: [no data]"); } statusPanel.showMessage("Dataset attributes loaded."); pack(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
|
dispatcher = new HeatMapDispatcher(model,statusPanel); | dispatcher = new HeatMapDispatcher(model,statusPanel,gradPanel); dispatcher.setCurrentMode(modeBar.getCurrentMode()); dispatcher.setCurrentScale(scaleBar.getCurrentScaleType()); | public void modelChanged(HeatMapModel model) { if(model == null) { return; } this.model = model; setTitle("HeatMap: " + model.getInfoSource().getDataset().getName()); treePanel.setModel(model.getModel()); treePanel.removeListener(dispatcher); modeBar.removeListener(dispatcher); dispatcher = new HeatMapDispatcher(model,statusPanel); treePanel.addListener(dispatcher); modeBar.addListener(dispatcher); gradPanel.setEnabled(false); revalidate(); repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
scaleBar.addListener(dispatcher); | public void modelChanged(HeatMapModel model) { if(model == null) { return; } this.model = model; setTitle("HeatMap: " + model.getInfoSource().getDataset().getName()); treePanel.setModel(model.getModel()); treePanel.removeListener(dispatcher); modeBar.removeListener(dispatcher); dispatcher = new HeatMapDispatcher(model,statusPanel); treePanel.addListener(dispatcher); modeBar.addListener(dispatcher); gradPanel.setEnabled(false); revalidate(); repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
|
Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); | Block oldBlock = ruby.getBlockStack().getCurrent().cloneBlock(); | public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } public int getArity() { return -1; } }, new RubyObject[] { this }); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/RubyObject.java/buggy/org/jruby/RubyObject.java |
ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); | ruby.getBlockStack().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); | public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } public int getArity() { return -1; } }, new RubyObject[] { this }); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/RubyObject.java/buggy/org/jruby/RubyObject.java |
ruby.getBlock().setCurrent(oldBlock); | ruby.getBlockStack().setCurrent(oldBlock); | public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } public int getArity() { return -1; } }, new RubyObject[] { this }); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/RubyObject.java/buggy/org/jruby/RubyObject.java |
Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); | Block oldBlock = ruby.getBlockStack().getCurrent().cloneBlock(); | public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getCurrent().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getCurrent().getFrame().setNamespace(ruby.getCurrentFrame().getNamespace()); try { return ruby.yield(args[0], args[0], ruby.getRubyClass(), false).toRubyObject(); } finally { ruby.getBlock().setCurrent(oldBlock); } // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8db42974495981011f558bcce15e2dfc28681a76/RubyObject.java/buggy/org/jruby/RubyObject.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.