rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); | httpReq = actionReqImpl.getHttpServletRequest(); httpRes = actionResImpl.getHttpServletResponse(); | private void _invoke( PortletRequest req, PortletResponse res, boolean action) throws IOException, PortletException { if (_portletConfig.isWARFile()) { String path = StringPool.SLASH + _portletConfig.getPortletName() + "/invoke"; RequestDispatcher rd = _portletCtx.getServletContext().getRequestDispatcher(path); HttpServletRequest httpReq = null; HttpServletResponse httpRes = null; if (action) { ActionRequestImpl reqImpl = (ActionRequestImpl)req; ActionResponseImpl resImpl = (ActionResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } else { RenderRequestImpl reqImpl = (RenderRequestImpl)req; RenderResponseImpl resImpl = (RenderResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } httpReq.setAttribute(WebKeys.JAVAX_PORTLET_PORTLET, _portlet); try { rd.include(httpReq, httpRes); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof PortletException) { throw (PortletException)cause; } throw new PortletException(cause); } } else { if (action) { ActionRequest actionReq = (ActionRequest)req; ActionResponse actionRes = (ActionResponse)res; _portlet.processAction(actionReq, actionRes); } else { RenderRequest renderReq = (RenderRequest)req; RenderResponse renderRes = (RenderResponse)res; _portlet.render(renderReq, renderRes); } } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/42e50ccc98fbe9828f2c9204202bbbe54641cf09/CachePortlet.java/buggy/portal-ejb/src/com/liferay/portlet/CachePortlet.java |
RenderRequestImpl reqImpl = (RenderRequestImpl)req; RenderResponseImpl resImpl = (RenderResponseImpl)res; | renderReqImpl = (RenderRequestImpl)req; renderResImpl = (RenderResponseImpl)res; | private void _invoke( PortletRequest req, PortletResponse res, boolean action) throws IOException, PortletException { if (_portletConfig.isWARFile()) { String path = StringPool.SLASH + _portletConfig.getPortletName() + "/invoke"; RequestDispatcher rd = _portletCtx.getServletContext().getRequestDispatcher(path); HttpServletRequest httpReq = null; HttpServletResponse httpRes = null; if (action) { ActionRequestImpl reqImpl = (ActionRequestImpl)req; ActionResponseImpl resImpl = (ActionResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } else { RenderRequestImpl reqImpl = (RenderRequestImpl)req; RenderResponseImpl resImpl = (RenderResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } httpReq.setAttribute(WebKeys.JAVAX_PORTLET_PORTLET, _portlet); try { rd.include(httpReq, httpRes); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof PortletException) { throw (PortletException)cause; } throw new PortletException(cause); } } else { if (action) { ActionRequest actionReq = (ActionRequest)req; ActionResponse actionRes = (ActionResponse)res; _portlet.processAction(actionReq, actionRes); } else { RenderRequest renderReq = (RenderRequest)req; RenderResponse renderRes = (RenderResponse)res; _portlet.render(renderReq, renderRes); } } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/42e50ccc98fbe9828f2c9204202bbbe54641cf09/CachePortlet.java/buggy/portal-ejb/src/com/liferay/portlet/CachePortlet.java |
httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); | httpReq = renderReqImpl.getHttpServletRequest(); httpRes = renderResImpl.getHttpServletResponse(); | private void _invoke( PortletRequest req, PortletResponse res, boolean action) throws IOException, PortletException { if (_portletConfig.isWARFile()) { String path = StringPool.SLASH + _portletConfig.getPortletName() + "/invoke"; RequestDispatcher rd = _portletCtx.getServletContext().getRequestDispatcher(path); HttpServletRequest httpReq = null; HttpServletResponse httpRes = null; if (action) { ActionRequestImpl reqImpl = (ActionRequestImpl)req; ActionResponseImpl resImpl = (ActionResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } else { RenderRequestImpl reqImpl = (RenderRequestImpl)req; RenderResponseImpl resImpl = (RenderResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } httpReq.setAttribute(WebKeys.JAVAX_PORTLET_PORTLET, _portlet); try { rd.include(httpReq, httpRes); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof PortletException) { throw (PortletException)cause; } throw new PortletException(cause); } } else { if (action) { ActionRequest actionReq = (ActionRequest)req; ActionResponse actionRes = (ActionResponse)res; _portlet.processAction(actionReq, actionRes); } else { RenderRequest renderReq = (RenderRequest)req; RenderResponse renderRes = (RenderResponse)res; _portlet.render(renderReq, renderRes); } } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/42e50ccc98fbe9828f2c9204202bbbe54641cf09/CachePortlet.java/buggy/portal-ejb/src/com/liferay/portlet/CachePortlet.java |
ActionRequest actionReq = (ActionRequest)req; ActionResponse actionRes = (ActionResponse)res; | ActionRequestImpl actionReqImpl = (ActionRequestImpl)req; ActionResponseImpl actionResImpl = (ActionResponseImpl)res; | private void _invoke( PortletRequest req, PortletResponse res, boolean action) throws IOException, PortletException { if (_portletConfig.isWARFile()) { String path = StringPool.SLASH + _portletConfig.getPortletName() + "/invoke"; RequestDispatcher rd = _portletCtx.getServletContext().getRequestDispatcher(path); HttpServletRequest httpReq = null; HttpServletResponse httpRes = null; if (action) { ActionRequestImpl reqImpl = (ActionRequestImpl)req; ActionResponseImpl resImpl = (ActionResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } else { RenderRequestImpl reqImpl = (RenderRequestImpl)req; RenderResponseImpl resImpl = (RenderResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } httpReq.setAttribute(WebKeys.JAVAX_PORTLET_PORTLET, _portlet); try { rd.include(httpReq, httpRes); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof PortletException) { throw (PortletException)cause; } throw new PortletException(cause); } } else { if (action) { ActionRequest actionReq = (ActionRequest)req; ActionResponse actionRes = (ActionResponse)res; _portlet.processAction(actionReq, actionRes); } else { RenderRequest renderReq = (RenderRequest)req; RenderResponse renderRes = (RenderResponse)res; _portlet.render(renderReq, renderRes); } } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/42e50ccc98fbe9828f2c9204202bbbe54641cf09/CachePortlet.java/buggy/portal-ejb/src/com/liferay/portlet/CachePortlet.java |
_portlet.processAction(actionReq, actionRes); | _portlet.processAction(actionReqImpl, actionResImpl); properties = actionResImpl.getProperties(); | private void _invoke( PortletRequest req, PortletResponse res, boolean action) throws IOException, PortletException { if (_portletConfig.isWARFile()) { String path = StringPool.SLASH + _portletConfig.getPortletName() + "/invoke"; RequestDispatcher rd = _portletCtx.getServletContext().getRequestDispatcher(path); HttpServletRequest httpReq = null; HttpServletResponse httpRes = null; if (action) { ActionRequestImpl reqImpl = (ActionRequestImpl)req; ActionResponseImpl resImpl = (ActionResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } else { RenderRequestImpl reqImpl = (RenderRequestImpl)req; RenderResponseImpl resImpl = (RenderResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } httpReq.setAttribute(WebKeys.JAVAX_PORTLET_PORTLET, _portlet); try { rd.include(httpReq, httpRes); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof PortletException) { throw (PortletException)cause; } throw new PortletException(cause); } } else { if (action) { ActionRequest actionReq = (ActionRequest)req; ActionResponse actionRes = (ActionResponse)res; _portlet.processAction(actionReq, actionRes); } else { RenderRequest renderReq = (RenderRequest)req; RenderResponse renderRes = (RenderResponse)res; _portlet.render(renderReq, renderRes); } } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/42e50ccc98fbe9828f2c9204202bbbe54641cf09/CachePortlet.java/buggy/portal-ejb/src/com/liferay/portlet/CachePortlet.java |
RenderRequest renderReq = (RenderRequest)req; RenderResponse renderRes = (RenderResponse)res; | RenderRequestImpl renderReqImpl = (RenderRequestImpl)req; RenderResponseImpl renderResImpl = (RenderResponseImpl)res; | private void _invoke( PortletRequest req, PortletResponse res, boolean action) throws IOException, PortletException { if (_portletConfig.isWARFile()) { String path = StringPool.SLASH + _portletConfig.getPortletName() + "/invoke"; RequestDispatcher rd = _portletCtx.getServletContext().getRequestDispatcher(path); HttpServletRequest httpReq = null; HttpServletResponse httpRes = null; if (action) { ActionRequestImpl reqImpl = (ActionRequestImpl)req; ActionResponseImpl resImpl = (ActionResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } else { RenderRequestImpl reqImpl = (RenderRequestImpl)req; RenderResponseImpl resImpl = (RenderResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } httpReq.setAttribute(WebKeys.JAVAX_PORTLET_PORTLET, _portlet); try { rd.include(httpReq, httpRes); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof PortletException) { throw (PortletException)cause; } throw new PortletException(cause); } } else { if (action) { ActionRequest actionReq = (ActionRequest)req; ActionResponse actionRes = (ActionResponse)res; _portlet.processAction(actionReq, actionRes); } else { RenderRequest renderReq = (RenderRequest)req; RenderResponse renderRes = (RenderResponse)res; _portlet.render(renderReq, renderRes); } } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/42e50ccc98fbe9828f2c9204202bbbe54641cf09/CachePortlet.java/buggy/portal-ejb/src/com/liferay/portlet/CachePortlet.java |
_portlet.render(renderReq, renderRes); | _portlet.render(renderReqImpl, renderResImpl); properties = renderResImpl.getProperties(); } } if ((properties != null) && (properties.size() > 0)) { String expCache = (String)properties.get( RenderResponse.EXPIRATION_CACHE); if ((expCache != null) && (_expCache != null)) { _expCache = new Integer(GetterUtil.getInteger(expCache)); | private void _invoke( PortletRequest req, PortletResponse res, boolean action) throws IOException, PortletException { if (_portletConfig.isWARFile()) { String path = StringPool.SLASH + _portletConfig.getPortletName() + "/invoke"; RequestDispatcher rd = _portletCtx.getServletContext().getRequestDispatcher(path); HttpServletRequest httpReq = null; HttpServletResponse httpRes = null; if (action) { ActionRequestImpl reqImpl = (ActionRequestImpl)req; ActionResponseImpl resImpl = (ActionResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } else { RenderRequestImpl reqImpl = (RenderRequestImpl)req; RenderResponseImpl resImpl = (RenderResponseImpl)res; httpReq = reqImpl.getHttpServletRequest(); httpRes = resImpl.getHttpServletResponse(); } httpReq.setAttribute(WebKeys.JAVAX_PORTLET_PORTLET, _portlet); try { rd.include(httpReq, httpRes); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof PortletException) { throw (PortletException)cause; } throw new PortletException(cause); } } else { if (action) { ActionRequest actionReq = (ActionRequest)req; ActionResponse actionRes = (ActionResponse)res; _portlet.processAction(actionReq, actionRes); } else { RenderRequest renderReq = (RenderRequest)req; RenderResponse renderRes = (RenderResponse)res; _portlet.render(renderReq, renderRes); } } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/42e50ccc98fbe9828f2c9204202bbbe54641cf09/CachePortlet.java/buggy/portal-ejb/src/com/liferay/portlet/CachePortlet.java |
File deployDir = new File(OmniadminUtil.getAutoDeployDeployDir()); File destDir = new File(OmniadminUtil.getAutoDeployDestDir()); long interval = OmniadminUtil.getAutoDeployInterval(); | File deployDir = new File( PrefsPropsUtil.getString(PropsUtil.AUTO_DEPLOY_DEPLOY_DIR)); File destDir = new File( PrefsPropsUtil.getString(PropsUtil.AUTO_DEPLOY_DEST_DIR)); long interval = PrefsPropsUtil.getLong( PropsUtil.AUTO_DEPLOY_INTERVAL); | public void run(String[] ids) throws ActionException { // JCR try { if (GetterUtil.getBoolean(PropsUtil.get( PropsUtil.JCR_INITIALIZE_ON_STARTUP))) { JCRFactoryUtil.initialize(); } } catch (Exception e) { _log.error(e); } // Portal initable PortalInitableUtil.flushInitables(); // Hot deploy _log.debug("Registering hot deploy listeners"); HotDeployUtil.registerListener(new HotDeployLayoutTemplateListener()); HotDeployUtil.registerListener(new HotDeployPortletListener()); HotDeployUtil.registerListener(new HotDeployThemeListener()); HotDeployUtil.flushEvents(); // Auto deploy try { _log.debug("Registering auto deploy directories"); File deployDir = new File(OmniadminUtil.getAutoDeployDeployDir()); File destDir = new File(OmniadminUtil.getAutoDeployDestDir()); long interval = OmniadminUtil.getAutoDeployInterval(); List autoDeployListeners = new ArrayList(); autoDeployListeners.add(new AutoDeployLayoutTemplateListener()); autoDeployListeners.add(new AutoDeployPortletListener()); autoDeployListeners.add(new AutoDeployThemeListener()); AutoDeployDir autoDeployDir = new AutoDeployDir( "defaultAutoDeployDir", deployDir, destDir, interval, autoDeployListeners); AutoDeployUtil.registerDir(autoDeployDir); } catch (Exception e) { _log.error(e); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/58a5501f2dec858b085420e7613b08c0cdc7f24d/GlobalStartupAction.java/buggy/portal-ejb/src/com/liferay/portal/events/GlobalStartupAction.java |
public Style(CalculatedStyle calculatedStyle, float parentWidth, CssContext cssContext) { | public Style(CalculatedStyle calculatedStyle, float parentWidth) { | public Style(CalculatedStyle calculatedStyle, float parentWidth, CssContext cssContext) { this.calculatedStyle = calculatedStyle; this.parentWidth = parentWidth; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1a1faae1c515edaea28dc3a60efde193dc7545a6/Style.java/clean/src/java/org/xhtmlrenderer/render/Style.java |
RectPropertySet rect = calculatedStyle.getMarginRect(parentWidth, parentWidth, cssContext).copyOf(); | RectPropertySet rect = calculatedStyle.getMarginRect(parentWidth, parentWidth, cssContext).copyOf(); | public RectPropertySet getMarginWidth(CssContext cssContext) { RectPropertySet rect = calculatedStyle.getMarginRect(parentWidth, parentWidth, cssContext).copyOf(); // TODO: this is bad for cached rects... if (this.marginTopOverrideSet) { rect.setTop((int) this.marginTopOverride); } if (this.marginBottomOverrideSet) { rect.setBottom((int) this.marginBottomOverride); } return rect; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1a1faae1c515edaea28dc3a60efde193dc7545a6/Style.java/clean/src/java/org/xhtmlrenderer/render/Style.java |
Font font = FontUtil.getFont(c, style); | Font font = FontUtil.getFont(c); | private static void drawText(Context c, Box box, String type) { String text = ""; if (type.equals("decimal")) { text = box.list_count + "."; } if (type.equals("lower-latin")) { text = toLatin(box.list_count).toLowerCase() + "."; } if (type.equals("upper-latin")) { text = toLatin(box.list_count).toUpperCase() + "."; } if (type.equals("lower-roman")) { text = toRoman(box.list_count).toLowerCase() + "."; } if (type.equals("upper-roman")) { text = toRoman(box.list_count).toUpperCase() + "."; } CalculatedStyle style = c.getCurrentStyle(); Font font = FontUtil.getFont(c, style); LineMetrics lm = font.getLineMetrics(text, ((Graphics2D) c.getGraphics()).getFontRenderContext()); int w = FontUtil.len(c, text, font); int h = FontUtil.lineHeight(c, style); int x = box.x - w - 2; int y = box.y + h; y -= (int) lm.getDescent(); c.getGraphics().setFont(font); c.getGraphics().drawString(text, x, y); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/ListItemPainter.java/clean/src/java/org/xhtmlrenderer/render/ListItemPainter.java |
int h = FontUtil.lineHeight(c, style); | int h = FontUtil.lineHeight(c); | private static void drawText(Context c, Box box, String type) { String text = ""; if (type.equals("decimal")) { text = box.list_count + "."; } if (type.equals("lower-latin")) { text = toLatin(box.list_count).toLowerCase() + "."; } if (type.equals("upper-latin")) { text = toLatin(box.list_count).toUpperCase() + "."; } if (type.equals("lower-roman")) { text = toRoman(box.list_count).toLowerCase() + "."; } if (type.equals("upper-roman")) { text = toRoman(box.list_count).toUpperCase() + "."; } CalculatedStyle style = c.getCurrentStyle(); Font font = FontUtil.getFont(c, style); LineMetrics lm = font.getLineMetrics(text, ((Graphics2D) c.getGraphics()).getFontRenderContext()); int w = FontUtil.len(c, text, font); int h = FontUtil.lineHeight(c, style); int x = box.x - w - 2; int y = box.y + h; y -= (int) lm.getDescent(); c.getGraphics().setFont(font); c.getGraphics().drawString(text, x, y); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/ListItemPainter.java/clean/src/java/org/xhtmlrenderer/render/ListItemPainter.java |
int h = FontUtil.lineHeight(c, style); | int h = FontUtil.lineHeight(c); | public static void paint(Context c, Box box) { CalculatedStyle style = c.getCurrentStyle(); String type = style.getStringProperty("list-style-type"); if (type.equals("none")) { return; } if (type.equals("lower-greek")) { type = "decimal"; } if (type.equals("decimal-leading-zero")) { type = "decimal"; } String image = style.getStringProperty("list-style-image"); Image img = null; if (!image.equals("none")) { try { //Uu.p("loading: " + image); img = ImageUtil.loadImage(c, image); } catch (Exception ex) { Uu.p(ex); } //Uu.p("image = " + img); if (img != null) { int rad = 8; int baseline = box.height; c.getGraphics().drawImage(img, box.x - img.getWidth(null) - 2, box.y + baseline / 2 - img.getHeight(null) / 2 + 2, null); return; } } // prep the color //box.color = style.getColor(); c.getGraphics().setColor(style.getColor()); // save the old AntiAliasing setting, then force it on Object aa_key = c.getGraphics().getRenderingHint(RenderingHints.KEY_ANTIALIASING); c.getGraphics().setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // calculations for bullets int rad = 8;// change this to use the glyph height int h = FontUtil.lineHeight(c, style); rad = h / 3; int x = box.x - rad - rad / 2; int y = box.y + (h - rad / 2) / 2; if (type.equals("disc")) { c.getGraphics().fillOval(x, y, rad, rad); return; } if (type.equals("square")) { c.getGraphics().fillRect(x, y, rad, rad); return; } if (type.equals("circle")) { c.getGraphics().drawOval(x, y, rad, rad); return; } // restore the old AntiAliasing setting c.getGraphics().setRenderingHint(RenderingHints.KEY_ANTIALIASING, aa_key); // calculations for text if (type.equals("decimal")) { drawText(c, box, type); return; } if (type.equals("lower-latin")) { drawText(c, box, type); return; } if (type.equals("upper-latin")) { drawText(c, box, type); return; } if (type.equals("lower-roman")) { drawText(c, box, type); return; } if (type.equals("upper-roman")) { drawText(c, box, type); return; } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/ListItemPainter.java/clean/src/java/org/xhtmlrenderer/render/ListItemPainter.java |
public static Font getFont( Context c, Node e ) { //u.p("testing node: " + e); //Font f = c.getGraphics().getFont(); // if plain text then get the styling from the parent node if ( e.getNodeType() == e.TEXT_NODE ) { //u.p("it's a node"); Element el = (Element)e.getParentNode(); return getElementFont( c, el ); } if ( e.getNodeType() == e.ELEMENT_NODE ) { Element el = (Element)e; return getElementFont( c, el ); } u.p( "big error in getFont(). Got a node that is neither txt nor element" ); return null; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9889da97aac1420c14517c95bbd205fb64ef40d3/FontUtil.java/buggy/src/java/org/xhtmlrenderer/layout/FontUtil.java |
||
/* | public static Font getFont( Context c, Node e ) { //u.p("testing node: " + e); //Font f = c.getGraphics().getFont(); // if plain text then get the styling from the parent node if ( e.getNodeType() == e.TEXT_NODE ) { //u.p("it's a node"); Element el = (Element)e.getParentNode(); return getElementFont( c, el ); } if ( e.getNodeType() == e.ELEMENT_NODE ) { Element el = (Element)e; return getElementFont( c, el ); } u.p( "big error in getFont(). Got a node that is neither txt nor element" ); return null; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9889da97aac1420c14517c95bbd205fb64ef40d3/FontUtil.java/buggy/src/java/org/xhtmlrenderer/layout/FontUtil.java |
|
u.p( "big error in getFont(). Got a node that is neither txt nor element" ); return null; | */ u.p("here"); u.p("big error in getFont(). Got a node that is neither txt nor element" ); u.p("probably returning a bad font!"); Font f = c.getGraphics().getFont(); return f; | public static Font getFont( Context c, Node e ) { //u.p("testing node: " + e); //Font f = c.getGraphics().getFont(); // if plain text then get the styling from the parent node if ( e.getNodeType() == e.TEXT_NODE ) { //u.p("it's a node"); Element el = (Element)e.getParentNode(); return getElementFont( c, el ); } if ( e.getNodeType() == e.ELEMENT_NODE ) { Element el = (Element)e; return getElementFont( c, el ); } u.p( "big error in getFont(). Got a node that is neither txt nor element" ); return null; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9889da97aac1420c14517c95bbd205fb64ef40d3/FontUtil.java/buggy/src/java/org/xhtmlrenderer/layout/FontUtil.java |
int availableRows = Dialog.availableRows(parent); | int availableRows = DialogUtil.availableRows(parent); | public void createControl(Composite parent) { Font font = parent.getFont(); // create composite for page. Composite outerContainer = new Composite(parent, SWT.NONE); outerContainer.setLayout(new GridLayout()); outerContainer.setLayoutData(new GridData( GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); outerContainer.setFont(font); Label messageLabel = new Label(outerContainer,SWT.NONE); messageLabel.setText(message); messageLabel.setFont(font); //Create a table for the list Table table = new Table(outerContainer, SWT.BORDER); GridData data = new GridData(GridData.FILL_BOTH); int availableRows = Dialog.availableRows(parent); //Only give a height hint if the dialog is going to be too small if(availableRows > 50){ data.heightHint = SIZING_LISTS_HEIGHT; } else{ data.heightHint = availableRows * 3; } table.setLayoutData(data); table.setFont(font); // the list viewer wizardSelectionViewer = new TableViewer(table); wizardSelectionViewer.setContentProvider(new WorkbenchContentProvider()); wizardSelectionViewer.setLabelProvider(new WorkbenchLabelProvider()); wizardSelectionViewer.setSorter(new WorkbenchViewerSorter()); wizardSelectionViewer.addSelectionChangedListener(this); wizardSelectionViewer.addDoubleClickListener(this); wizardSelectionViewer.setInput(wizardElements); restoreWidgetValues(); setControl(outerContainer);} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/eeaa2fa6a21ae6578116de51390edb42d9cde51e/WorkbenchWizardListSelectionPage.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardListSelectionPage.java |
String subj0 = _stripPrefixes(me0.getSubject().trim().toLowerCase()); String subj1 = _stripPrefixes(me1.getSubject().trim().toLowerCase()); | String subj0 = _stripPrefixes( GetterUtil.getString(me0.getSubject()).trim().toLowerCase()); String subj1 = _stripPrefixes( GetterUtil.getString(me1.getSubject()).trim().toLowerCase()); | public int compare(Object arg0, Object arg1) { MailEnvelope me0 = (MailEnvelope)arg0; MailEnvelope me1 = (MailEnvelope)arg1; Long uid0 = new Long(me0.getMsgUID()); Long uid1 = new Long(me1.getMsgUID()); String subj0 = _stripPrefixes(me0.getSubject().trim().toLowerCase()); String subj1 = _stripPrefixes(me1.getSubject().trim().toLowerCase()); int comparison = 0; if (_asc) { comparison = subj0.compareTo(subj1); if (comparison == 0) { comparison = DateUtil.compareTo(me0.getDate(), me1.getDate()); if (comparison == 0) { comparison = uid0.compareTo(uid1); } } } else { comparison = subj1.compareTo(subj0); if (comparison == 0) { comparison = DateUtil.compareTo(me1.getDate(), me0.getDate()); if (comparison == 0) { comparison = uid1.compareTo(uid0); } } } return comparison; } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/d8d693773d0054a4274a1653a3502023da964dc6/SubjectComparator.java/buggy/portal-ejb/src/com/liferay/portlet/mail/util/comparator/SubjectComparator.java |
int current = this.x; | int calcX = 0; | public void align() { if (getFloatDistances() == null) { // Shouldn't happen (but currently can with nested tables) XRLog.layout(Level.WARNING, "Float distances not available. Cannot align."); return; } IdentValue align = getParent().getStyle().getCalculatedStyle().getIdent(CSSName.TEXT_ALIGN); // TODO implement text-align: justify int current = this.x; if (align == IdentValue.LEFT || align == IdentValue.JUSTIFY) { int floatDistance = getFloatDistances().getLeftFloatDistance(); this.x += floatDistance; } else if (align == IdentValue.CENTER) { int leftFloatDistance = getFloatDistances().getLeftFloatDistance(); int rightFloatDistance = getFloatDistances().getRightFloatDistance(); int midpoint = leftFloatDistance + (getParent().getContentWidth() - leftFloatDistance - rightFloatDistance) / 2; this.x += midpoint - getContentWidth() / 2; } else if (align == IdentValue.RIGHT) { int floatDistance = getFloatDistances().getRightFloatDistance(); this.x += getParent().getContentWidth() - floatDistance - getContentWidth(); } if (current != this.x) { calcCanvasLocation(); calcChildLocations(); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e900e61ce3c01edb12a8561b3a8ac20539d8450a/LineBox.java/clean/src/java/org/xhtmlrenderer/render/LineBox.java |
this.x += floatDistance; | calcX = getContentStart() + floatDistance; | public void align() { if (getFloatDistances() == null) { // Shouldn't happen (but currently can with nested tables) XRLog.layout(Level.WARNING, "Float distances not available. Cannot align."); return; } IdentValue align = getParent().getStyle().getCalculatedStyle().getIdent(CSSName.TEXT_ALIGN); // TODO implement text-align: justify int current = this.x; if (align == IdentValue.LEFT || align == IdentValue.JUSTIFY) { int floatDistance = getFloatDistances().getLeftFloatDistance(); this.x += floatDistance; } else if (align == IdentValue.CENTER) { int leftFloatDistance = getFloatDistances().getLeftFloatDistance(); int rightFloatDistance = getFloatDistances().getRightFloatDistance(); int midpoint = leftFloatDistance + (getParent().getContentWidth() - leftFloatDistance - rightFloatDistance) / 2; this.x += midpoint - getContentWidth() / 2; } else if (align == IdentValue.RIGHT) { int floatDistance = getFloatDistances().getRightFloatDistance(); this.x += getParent().getContentWidth() - floatDistance - getContentWidth(); } if (current != this.x) { calcCanvasLocation(); calcChildLocations(); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e900e61ce3c01edb12a8561b3a8ac20539d8450a/LineBox.java/clean/src/java/org/xhtmlrenderer/render/LineBox.java |
this.x += midpoint - getContentWidth() / 2; | calcX = midpoint - (getContentWidth() + getContentStart()) / 2; | public void align() { if (getFloatDistances() == null) { // Shouldn't happen (but currently can with nested tables) XRLog.layout(Level.WARNING, "Float distances not available. Cannot align."); return; } IdentValue align = getParent().getStyle().getCalculatedStyle().getIdent(CSSName.TEXT_ALIGN); // TODO implement text-align: justify int current = this.x; if (align == IdentValue.LEFT || align == IdentValue.JUSTIFY) { int floatDistance = getFloatDistances().getLeftFloatDistance(); this.x += floatDistance; } else if (align == IdentValue.CENTER) { int leftFloatDistance = getFloatDistances().getLeftFloatDistance(); int rightFloatDistance = getFloatDistances().getRightFloatDistance(); int midpoint = leftFloatDistance + (getParent().getContentWidth() - leftFloatDistance - rightFloatDistance) / 2; this.x += midpoint - getContentWidth() / 2; } else if (align == IdentValue.RIGHT) { int floatDistance = getFloatDistances().getRightFloatDistance(); this.x += getParent().getContentWidth() - floatDistance - getContentWidth(); } if (current != this.x) { calcCanvasLocation(); calcChildLocations(); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e900e61ce3c01edb12a8561b3a8ac20539d8450a/LineBox.java/clean/src/java/org/xhtmlrenderer/render/LineBox.java |
this.x += getParent().getContentWidth() - floatDistance - getContentWidth(); | calcX = getParent().getContentWidth() - floatDistance - getContentWidth(); | public void align() { if (getFloatDistances() == null) { // Shouldn't happen (but currently can with nested tables) XRLog.layout(Level.WARNING, "Float distances not available. Cannot align."); return; } IdentValue align = getParent().getStyle().getCalculatedStyle().getIdent(CSSName.TEXT_ALIGN); // TODO implement text-align: justify int current = this.x; if (align == IdentValue.LEFT || align == IdentValue.JUSTIFY) { int floatDistance = getFloatDistances().getLeftFloatDistance(); this.x += floatDistance; } else if (align == IdentValue.CENTER) { int leftFloatDistance = getFloatDistances().getLeftFloatDistance(); int rightFloatDistance = getFloatDistances().getRightFloatDistance(); int midpoint = leftFloatDistance + (getParent().getContentWidth() - leftFloatDistance - rightFloatDistance) / 2; this.x += midpoint - getContentWidth() / 2; } else if (align == IdentValue.RIGHT) { int floatDistance = getFloatDistances().getRightFloatDistance(); this.x += getParent().getContentWidth() - floatDistance - getContentWidth(); } if (current != this.x) { calcCanvasLocation(); calcChildLocations(); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e900e61ce3c01edb12a8561b3a8ac20539d8450a/LineBox.java/clean/src/java/org/xhtmlrenderer/render/LineBox.java |
if (current != this.x) { | if (calcX != this.x) { this.x = calcX; | public void align() { if (getFloatDistances() == null) { // Shouldn't happen (but currently can with nested tables) XRLog.layout(Level.WARNING, "Float distances not available. Cannot align."); return; } IdentValue align = getParent().getStyle().getCalculatedStyle().getIdent(CSSName.TEXT_ALIGN); // TODO implement text-align: justify int current = this.x; if (align == IdentValue.LEFT || align == IdentValue.JUSTIFY) { int floatDistance = getFloatDistances().getLeftFloatDistance(); this.x += floatDistance; } else if (align == IdentValue.CENTER) { int leftFloatDistance = getFloatDistances().getLeftFloatDistance(); int rightFloatDistance = getFloatDistances().getRightFloatDistance(); int midpoint = leftFloatDistance + (getParent().getContentWidth() - leftFloatDistance - rightFloatDistance) / 2; this.x += midpoint - getContentWidth() / 2; } else if (align == IdentValue.RIGHT) { int floatDistance = getFloatDistances().getRightFloatDistance(); this.x += getParent().getContentWidth() - floatDistance - getContentWidth(); } if (current != this.x) { calcCanvasLocation(); calcChildLocations(); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e900e61ce3c01edb12a8561b3a8ac20539d8450a/LineBox.java/clean/src/java/org/xhtmlrenderer/render/LineBox.java |
} if (isContainsPageCounter()) { lookForPageCounters(c); int totalLineWidth = InlineBoxing.positionHorizontally(c, this, 0); this.contentWidth = totalLineWidth; calcChildLocations(); align(); | public void paintInline(RenderingContext c) { if (! getParent().getStyle().isVisible()) { return; } if (textDecoration != null) { c.getOutputDevice().drawTextDecoration(c, this); } if (c.debugDrawLineBoxes()) { c.getOutputDevice().drawDebugOutline(c, this, Color.GREEN); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e900e61ce3c01edb12a8561b3a8ac20539d8450a/LineBox.java/clean/src/java/org/xhtmlrenderer/render/LineBox.java |
|
public Object get(Object key) { | final public Object get(Object key) { | public Object get(Object key) { int i = indexOf(key); if(i >= 0) return array[i + 1]; return null;} | 52334 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52334/ae623590ccb2fd017d67637b2f52e747b9b4ad73/PersistentArrayMap.java/buggy/src/jvm/clojure/lang/PersistentArrayMap.java |
int indexOf(Object key){ | private int indexOf(Object key){ | int indexOf(Object key){ for(int i=0;i<array.length;i+=2) { if(equalKey(array[i],key)) return i; } return -1;} | 52334 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52334/ae623590ccb2fd017d67637b2f52e747b9b4ad73/PersistentArrayMap.java/buggy/src/jvm/clojure/lang/PersistentArrayMap.java |
return new PersistentArrayMap(newArray); | return create(newArray); | public IPersistentMap put(Object key, Object val) { int i = indexOf(key); Object[] newArray; if(i >= 0) //already have key, same-sized replacement { if(array[i+1] == val) //no change, no op return this; newArray = array.clone(); newArray[i+1] = val; } else //didn't have key, grow { newArray = new Object[array.length + 2]; if(array.length > 0) System.arraycopy(array,0,newArray,2,array.length); newArray[0] = key; newArray[1] = val; } return new PersistentArrayMap(newArray);} | 52334 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52334/ae623590ccb2fd017d67637b2f52e747b9b4ad73/PersistentArrayMap.java/buggy/src/jvm/clojure/lang/PersistentArrayMap.java |
return new PersistentArrayMap(newArray); | return create(newArray); | public IPersistentMap remove(Object key) { int i = indexOf(key); if(i >= 0) //have key, will remove { int newlen = array.length - 2; if(newlen == 0) return empty(); Object[] newArray = new Object[newlen]; for(int s=0,d=0;s<array.length;s += 2) { if(!equalKey(array[s],key)) //skip removal key { newArray[d] = array[s]; newArray[d+1] = array[s+1]; d += 2; } } return new PersistentArrayMap(newArray); } //don't have key, no op return this;} | 52334 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52334/ae623590ccb2fd017d67637b2f52e747b9b4ad73/PersistentArrayMap.java/buggy/src/jvm/clojure/lang/PersistentArrayMap.java |
size.y = TrimUtil.TRIM_DEFAULT_HEIGHT; | if (isHorizontal(side)) size.y = TrimUtil.TRIM_DEFAULT_HEIGHT; else { size.x = TrimUtil.TRIM_DEFAULT_HEIGHT; } | public Point computeSize(int wHint, int hHint, boolean changed) { Point size = super.computeSize(wHint, hHint, changed); size.y = TrimUtil.TRIM_DEFAULT_HEIGHT; return size; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/b7807d461165c65db686560280fb481dfcad9f75/ProgressRegion.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressRegion.java |
int oldSide = side; side = dropSide; if (oldSide == dropSide || (isVertical(oldSide) && isVertical(dropSide)) || (isHorizontal(oldSide) && isHorizontal(dropSide))) return; recreate(); | public void dock(int dropSide) { // deliberately do nothing } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/b7807d461165c65db686560280fb481dfcad9f75/ProgressRegion.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressRegion.java |
|
return item; | return animationItem; | public AnimationItem getAnimationItem() { return item; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/b7807d461165c65db686560280fb481dfcad9f75/ProgressRegion.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressRegion.java |
return SWT.BOTTOM; | return SWT.BOTTOM | SWT.TOP | SWT.LEFT | SWT.RIGHT ; | public int getValidSides() { return SWT.BOTTOM; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/b7807d461165c65db686560280fb481dfcad9f75/ProgressRegion.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressRegion.java |
this.detachable = false; | final IPreferenceStore store = PlatformUI.getPreferenceStore(); this.detachable = store.getBoolean(IWorkbenchPreferenceConstants.ENABLE_DETACHED_VIEWS); | public PerspectiveHelper(WorkbenchPage workbenchPage, ViewSashContainer mainLayout, Perspective perspective) { this.page = workbenchPage; this.mainLayout = mainLayout; // Determine if reparenting is allowed by checking if some arbitrary // Composite supports reparenting. This is used to determine if // detached views should be enabled. this.detachable = false; Composite client = workbenchPage.getClientComposite(); if (client != null) { Composite testChild = new Composite(client, SWT.NONE); this.detachable = testChild.isReparentable(); testChild.dispose(); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e468470ba58ef954c40125efc2bcadb3b5be3520/PerspectiveHelper.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java |
Composite client = workbenchPage.getClientComposite(); if (client != null) { Composite testChild = new Composite(client, SWT.NONE); this.detachable = testChild.isReparentable(); testChild.dispose(); } | if (this.detachable) { Composite client = workbenchPage.getClientComposite(); if (client == null) { this.detachable = false; } else { Composite testChild = new Composite(client, SWT.NONE); this.detachable = testChild.isReparentable(); testChild.dispose(); } } | public PerspectiveHelper(WorkbenchPage workbenchPage, ViewSashContainer mainLayout, Perspective perspective) { this.page = workbenchPage; this.mainLayout = mainLayout; // Determine if reparenting is allowed by checking if some arbitrary // Composite supports reparenting. This is used to determine if // detached views should be enabled. this.detachable = false; Composite client = workbenchPage.getClientComposite(); if (client != null) { Composite testChild = new Composite(client, SWT.NONE); this.detachable = testChild.isReparentable(); testChild.dispose(); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e468470ba58ef954c40125efc2bcadb3b5be3520/PerspectiveHelper.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java |
stringClass.defineMethod("each_byte", CallbackFactory.getMethod(RubyString.class, "each_byte")); | public static RubyClass createStringClass(Ruby ruby) { RubyClass stringClass = ruby.defineClass("String", ruby.getClasses().getObjectClass()); stringClass.includeModule(ruby.getClasses().getComparableModule()); stringClass.includeModule(ruby.getClasses().getEnumerableModule()); stringClass.defineSingletonMethod("new", CallbackFactory.getOptSingletonMethod(RubyString.class, "newInstance")); stringClass.defineMethod("initialize", CallbackFactory.getMethod(RubyString.class, "replace", RubyObject.class)); stringClass.defineMethod("clone", CallbackFactory.getMethod(RubyString.class, "rbClone")); stringClass.defineMethod("dup", CallbackFactory.getMethod(RubyString.class, "dup")); stringClass.defineMethod("<=>", CallbackFactory.getMethod(RubyString.class, "op_cmp", RubyObject.class)); stringClass.defineMethod("==", CallbackFactory.getMethod(RubyString.class, "equal", RubyObject.class)); stringClass.defineMethod("===", CallbackFactory.getMethod(RubyString.class, "equal", RubyObject.class)); stringClass.defineMethod("eql?", CallbackFactory.getMethod(RubyString.class, "equal", RubyObject.class)); stringClass.defineMethod("hash", CallbackFactory.getMethod(RubyString.class, "hash")); stringClass.defineMethod("+", CallbackFactory.getMethod(RubyString.class, "op_plus", RubyObject.class)); stringClass.defineMethod("*", CallbackFactory.getMethod(RubyString.class, "op_mul", RubyInteger.class)); stringClass.defineMethod("%", CallbackFactory.getMethod(RubyString.class, "format", RubyObject.class)); stringClass.defineMethod("[]", CallbackFactory.getOptMethod(RubyString.class, "aref")); stringClass.defineMethod("[]=", CallbackFactory.getOptMethod(RubyString.class, "aset")); stringClass.defineMethod("length", CallbackFactory.getMethod(RubyString.class, "length")); stringClass.defineMethod("size", CallbackFactory.getMethod(RubyString.class, "length")); stringClass.defineMethod("empty?", CallbackFactory.getMethod(RubyString.class, "empty")); stringClass.defineMethod("=~", CallbackFactory.getMethod(RubyString.class, "match", RubyObject.class)); stringClass.defineMethod("~", CallbackFactory.getMethod(RubyString.class, "match2")); stringClass.defineMethod("succ", CallbackFactory.getMethod(RubyString.class, "succ")); stringClass.defineMethod("succ!", CallbackFactory.getMethod(RubyString.class, "succ_bang")); stringClass.defineMethod("next", CallbackFactory.getMethod(RubyString.class, "succ")); stringClass.defineMethod("next!", CallbackFactory.getMethod(RubyString.class, "succ_bang")); stringClass.defineMethod("upto", CallbackFactory.getMethod(RubyString.class, "upto", RubyObject.class)); stringClass.defineMethod("index", CallbackFactory.getOptMethod(RubyString.class, "index")); stringClass.defineMethod("rindex", CallbackFactory.getOptMethod(RubyString.class, "rindex")); stringClass.defineMethod("replace", CallbackFactory.getMethod(RubyString.class, "replace", RubyObject.class)); stringClass.defineMethod("to_i", CallbackFactory.getMethod(RubyString.class, "to_i")); stringClass.defineMethod("to_f", CallbackFactory.getMethod(RubyString.class, "to_f")); stringClass.defineMethod("to_s", CallbackFactory.getMethod(RubyString.class, "to_s")); stringClass.defineMethod("to_str", CallbackFactory.getMethod(RubyString.class, "to_s")); stringClass.defineMethod("inspect", CallbackFactory.getMethod(RubyString.class, "inspect")); stringClass.defineMethod("dump", CallbackFactory.getMethod(RubyString.class, "dump")); stringClass.defineMethod("upcase", CallbackFactory.getMethod(RubyString.class, "upcase")); stringClass.defineMethod("downcase", CallbackFactory.getMethod(RubyString.class, "downcase")); stringClass.defineMethod("capitalize", CallbackFactory.getMethod(RubyString.class, "capitalize")); stringClass.defineMethod("swapcase", CallbackFactory.getMethod(RubyString.class, "swapcase")); stringClass.defineMethod("upcase!", CallbackFactory.getMethod(RubyString.class, "upcase_bang")); stringClass.defineMethod("downcase!", CallbackFactory.getMethod(RubyString.class, "downcase_bang")); stringClass.defineMethod("capitalize!", CallbackFactory.getMethod(RubyString.class, "capitalize_bang")); stringClass.defineMethod("swapcase!", CallbackFactory.getMethod(RubyString.class, "swapcase_bang")); stringClass.defineMethod("hex", CallbackFactory.getMethod(RubyString.class, "hex")); stringClass.defineMethod("oct", CallbackFactory.getMethod(RubyString.class, "oct")); stringClass.defineMethod("split", CallbackFactory.getOptMethod(RubyString.class, "split")); stringClass.defineMethod("reverse", CallbackFactory.getMethod(RubyString.class, "reverse")); stringClass.defineMethod("reverse!", CallbackFactory.getMethod(RubyString.class, "reverse_bang")); stringClass.defineMethod("concat", CallbackFactory.getMethod(RubyString.class, "concat", RubyObject.class)); stringClass.defineMethod("<<", CallbackFactory.getMethod(RubyString.class, "concat", RubyObject.class)); // rb_define_method(rb_cString, "crypt", rb_str_crypt, 1); stringClass.defineMethod("intern", CallbackFactory.getMethod(RubyString.class, "intern")); stringClass.defineMethod("include?", CallbackFactory.getMethod(RubyString.class, "include", RubyObject.class)); stringClass.defineMethod("scan", CallbackFactory.getMethod(RubyString.class, "scan", RubyObject.class)); stringClass.defineMethod("ljust", CallbackFactory.getMethod(RubyString.class, "ljust", RubyObject.class)); stringClass.defineMethod("rjust", CallbackFactory.getMethod(RubyString.class, "rjust", RubyObject.class)); stringClass.defineMethod("center", CallbackFactory.getMethod(RubyString.class, "center", RubyObject.class)); stringClass.defineMethod("sub", CallbackFactory.getOptMethod(RubyString.class, "sub")); stringClass.defineMethod("gsub", CallbackFactory.getOptMethod(RubyString.class, "gsub")); stringClass.defineMethod("chop", CallbackFactory.getMethod(RubyString.class, "chop")); stringClass.defineMethod("chomp", CallbackFactory.getOptMethod(RubyString.class, "chomp")); stringClass.defineMethod("strip", CallbackFactory.getMethod(RubyString.class, "strip")); stringClass.defineMethod("sub!", CallbackFactory.getOptMethod(RubyString.class, "sub_bang")); stringClass.defineMethod("gsub!", CallbackFactory.getOptMethod(RubyString.class, "gsub_bang")); stringClass.defineMethod("chop!", CallbackFactory.getMethod(RubyString.class, "chop_bang")); stringClass.defineMethod("chomp!", CallbackFactory.getOptMethod(RubyString.class, "chomp_bang")); stringClass.defineMethod("strip!", CallbackFactory.getMethod(RubyString.class, "strip_bang")); stringClass.defineMethod("tr", CallbackFactory.getOptMethod(RubyString.class, "tr")); stringClass.defineMethod("tr_s", CallbackFactory.getOptMethod(RubyString.class, "tr_s")); stringClass.defineMethod("delete", CallbackFactory.getOptMethod(RubyString.class, "delete")); stringClass.defineMethod("squeeze", CallbackFactory.getOptMethod(RubyString.class, "squeeze")); stringClass.defineMethod("count", CallbackFactory.getOptMethod(RubyString.class, "count")); stringClass.defineMethod("tr!", CallbackFactory.getOptMethod(RubyString.class, "tr_bang")); stringClass.defineMethod("tr_s!", CallbackFactory.getOptMethod(RubyString.class, "tr_s_bang")); stringClass.defineMethod("delete!", CallbackFactory.getOptMethod(RubyString.class, "delete_bang")); stringClass.defineMethod("squeeze!", CallbackFactory.getOptMethod(RubyString.class, "squeeze_bang")); stringClass.defineMethod("each_line", CallbackFactory.getOptMethod(RubyString.class, "each_line")); stringClass.defineMethod("each", CallbackFactory.getOptMethod(RubyString.class, "each_line")); // rb_define_method(rb_cString, "each_byte", rb_str_each_byte, 0); // rb_define_method(rb_cString, "sum", rb_str_sum, -1); // rb_define_global_function("sub", rb_f_sub, -1); // rb_define_global_function("gsub", rb_f_gsub, -1); // rb_define_global_function("sub!", rb_f_sub_bang, -1); // rb_define_global_function("gsub!", rb_f_gsub_bang, -1); // rb_define_global_function("chop", rb_f_chop, 0); // rb_define_global_function("chop!", rb_f_chop_bang, 0); // rb_define_global_function("chomp", rb_f_chomp, -1); // rb_define_global_function("chomp!", rb_f_chomp_bang, -1); // rb_define_global_function("split", rb_f_split, -1); // rb_define_global_function("scan", rb_f_scan, 1); stringClass.defineMethod("slice", CallbackFactory.getOptMethod(RubyString.class, "aref")); stringClass.defineMethod("slice!", CallbackFactory.getOptMethod(RubyString.class, "slice_bang")); // id_to_s = rb_intern("to_s"); // rb_fs = Qnil; // rb_define_hooked_variable("$;", &rb_fs, 0, rb_str_setter); // rb_define_hooked_variable("$-F", &rb_fs, 0, rb_str_setter); return stringClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/3b95e6f239598e8fb886e0afdcc7358c9a96d8de/RubyString.java/clean/org/jruby/RubyString.java |
|
item.setParent(this); | protected void itemAdded(IContributionItem item) { markDirty(); if (item.isDynamic()) dynamicItems++; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6af15a0829b4f89228699e9027820ef204fe029a/ContributionManager.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ContributionManager.java |
|
item.setParent(null); | protected void itemRemoved(IContributionItem item) { markDirty(); if (item.isDynamic()) dynamicItems--; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6af15a0829b4f89228699e9027820ef204fe029a/ContributionManager.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ContributionManager.java |
|
super("Unable to open config file "+inFile); | super(MessageKey.CONFIG_FILE_OPEN.getLocalizedMessage(inFile)); | public ConfigFileLoadingException(String inFile) { super("Unable to open config file "+inFile); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/c1e9503d3032bc75965b7f7178f503c3094437f3/ConfigFileLoadingException.java/buggy/source/core/src/main/java/org/marketcetera/core/ConfigFileLoadingException.java |
Class javaClass = Class.forName(className); | Class javaClass = getJavaClass(); | private Method getMethod() { try { Class javaClass = Class.forName(className); Class[] args = new Class[2 + arity]; args[0] = Ruby.class; args[1] = IRubyObject.class; for (int i = 2; i < args.length; i++) { args[i] = IRubyObject.class; } return javaClass.getMethod(methodName, args); } catch (ClassNotFoundException e) { Asserts.notReached("class not found: " + className); return null; } catch (NoSuchMethodException e) { Asserts.notReached("method not found: " + methodName); return null; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/af1920a5c29079063127d9968487d5e5fbf75031/CompiledReflectionCallback.java/clean/src/org/jruby/runtime/CompiledReflectionCallback.java |
} catch (ClassNotFoundException e) { Asserts.notReached("class not found: " + className); return null; | private Method getMethod() { try { Class javaClass = Class.forName(className); Class[] args = new Class[2 + arity]; args[0] = Ruby.class; args[1] = IRubyObject.class; for (int i = 2; i < args.length; i++) { args[i] = IRubyObject.class; } return javaClass.getMethod(methodName, args); } catch (ClassNotFoundException e) { Asserts.notReached("class not found: " + className); return null; } catch (NoSuchMethodException e) { Asserts.notReached("method not found: " + methodName); return null; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/af1920a5c29079063127d9968487d5e5fbf75031/CompiledReflectionCallback.java/clean/src/org/jruby/runtime/CompiledReflectionCallback.java |
|
log().debug(getController().getMySelf().getNick() + " analyse connection: lan: " + onLAN); | log().debug("analyse connection: lan: " + onLAN); | public void analyseConnection() { if (getRemoteAddress() != null && getRemoteAddress().getAddress() != null) { setOnLAN(NetworkUtil.isOnLanOrLoopback(getRemoteAddress().getAddress())); // Check if the remote address is one of this machine's // interfaces. try { omitBandwidthLimit = NetworkUtil.getAllLocalNetworkAddresses() .containsKey(socket.getInetAddress()); } catch (SocketException e) { log().error("Omitting bandwidth", e); } } if (!onLAN && !getController().isSilentMode()) { // testConnection(); } if(logVerbose) { log().debug(getController().getMySelf().getNick() + " analyse connection: lan: " + onLAN); } } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/a539f22668bb6210ab44531afdfaedb6097fd3ae/ConnectionHandler.java/buggy/src/main/de/dal33t/powerfolder/net/ConnectionHandler.java |
decoratedField.setUseMaximumDecorationWidth(false); | protected Control createControl(Composite parent) { // BEGIN MOD decoratedField = new DecoratedField(parent, getStyle(), new TextControlCreator()); text = (Text) decoratedField.getControl(); decoratedField.getLayoutControl().setBackground(text.getBackground()); // END MOD text.addSelectionListener(new SelectionAdapter() { public void widgetDefaultSelected(SelectionEvent e) { handleDefaultSelection(e); } }); text.addKeyListener(new KeyAdapter() { // hook key pressed - see PR 14201 public void keyPressed(KeyEvent e) { keyReleaseOccured(e); // as a result of processing the above call, clients may have // disposed this cell editor if ((getControl() == null) || getControl().isDisposed()) return; checkSelection(); // see explaination below checkDeleteable(); checkSelectable(); } }); text.addTraverseListener(new TraverseListener() { public void keyTraversed(TraverseEvent e) { if (e.detail == SWT.TRAVERSE_ESCAPE || e.detail == SWT.TRAVERSE_RETURN) { e.doit = false; } } }); // We really want a selection listener but it is not supported so we // use a key listener and a mouse listener to know when selection // changes // may have occured text.addMouseListener(new MouseAdapter() { public void mouseUp(MouseEvent e) { checkSelection(); checkDeleteable(); checkSelectable(); } }); text.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent e) { DecoratedTextCellEditor.this.focusLost(); } }); text.setFont(parent.getFont()); text.setBackground(parent.getBackground()); text.setText("");//$NON-NLS-1$ text.addModifyListener(getModifyListener()); // BEGIN MOD return decoratedField.getLayoutControl(); // END MOD } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/4a358afc8d93c75badf1e31f688464be70e02b8d/DecoratedTextCellEditor.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/DecoratedTextCellEditor.java |
|
if(!PlatformUI.isWorkbenchRunning()) return; | public void done(IJobChangeEvent event) { statuses[0] = event.getResult(); pendingInfos.remove(info); refreshDialog(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/04515d9d58c4c5f95a233997534fadc66a378488/ProgressFeedbackManager.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressFeedbackManager.java |
|
messagesViewer.refresh(); fillsViewer.refresh(); averagePriceViewer.refresh(); | refresh(); | protected void asyncRefresh() { asyncExec(new Runnable() { public void run() { messagesViewer.refresh(); fillsViewer.refresh(); averagePriceViewer.refresh(); } }); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/b8c700cda905c4e84961a6d74c519385526853c4/OrderHistoryEditor.java/buggy/source/trunk/src/main/java/org/marketcetera/photon/editors/OrderHistoryEditor.java |
messagesViewer.refresh(); fillsViewer.refresh(); averagePriceViewer.refresh(); | try { averagePriceViewer.setInput(avgPxHistory); refresh(); } catch (Throwable ex){ ex.printStackTrace(); } | public void run() { messagesViewer.refresh(); fillsViewer.refresh(); averagePriceViewer.refresh(); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/b8c700cda905c4e84961a6d74c519385526853c4/OrderHistoryEditor.java/buggy/source/trunk/src/main/java/org/marketcetera/photon/editors/OrderHistoryEditor.java |
averagePriceViewer.setInput(input.getAveragePriceHistory()); asyncRefresh(); | final FIXMessageHistory avgPxHistory = input.getAveragePriceHistory(); asyncExec(new Runnable(){ public void run() { try { averagePriceViewer.setInput(avgPxHistory); refresh(); } catch (Throwable ex){ ex.printStackTrace(); } } }); | public void incomingMessage(Message message) { averagePriceViewer.setInput(input.getAveragePriceHistory()); asyncRefresh(); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/b8c700cda905c4e84961a6d74c519385526853c4/OrderHistoryEditor.java/buggy/source/trunk/src/main/java/org/marketcetera/photon/editors/OrderHistoryEditor.java |
IRubyObject[] args = ArgsUtil.setupArgs(runtime, this, exceptionNodes); ArgsUtil.endCallArgs(runtime, tmpBlock); | IRubyObject[] args = null; try { args = ArgsUtil.setupArgs(runtime, this, exceptionNodes); } finally { ArgsUtil.endCallArgs(runtime, tmpBlock); } | private boolean isRescueHandled(RubyException currentException, IListNode exceptionNodes) { if (exceptionNodes == null) { return currentException.isKindOf(runtime.getExceptions().getStandardError()); } Block tmpBlock = ArgsUtil.beginCallArgs(runtime); IRubyObject[] args = ArgsUtil.setupArgs(runtime, this, exceptionNodes); ArgsUtil.endCallArgs(runtime, tmpBlock); for (int i = 0; i < args.length; i++) { if (! args[i].isKindOf(runtime.getClasses().getModuleClass())) { throw new TypeError(runtime, "class or module required for rescue clause"); } if (currentException.isKindOf((RubyModule) args[i])) { return true; } } return false; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/aa3fe2195e86c2c426f4012089ef8c66a66e925c/EvaluateVisitor.java/buggy/org/jruby/evaluator/EvaluateVisitor.java |
eval(iVisited.getIterNode()); return; | threadContext.getIterStack().push(Iter.ITER_NOT); try { eval(iVisited.getIterNode()); return; } finally { threadContext.getIterStack().pop(); } | public void visitBlockPassNode(BlockPassNode iVisited) { IRubyObject block = eval(iVisited.getBodyNode()); if (block.isNil()) { eval(iVisited.getIterNode()); return; } else if (block instanceof RubyMethod) { block = ((RubyMethod)block).to_proc(); } else if (!(block instanceof RubyProc)) { throw new TypeError(runtime, "wrong argument type " + block.getInternalClass().toName() + " (expected Proc)"); } Block oldBlock = threadContext.getBlockStack().getCurrent(); threadContext.getBlockStack().push(((RubyProc) block).getBlock()); threadContext.getIterStack().push(Iter.ITER_PRE); threadContext.getCurrentFrame().setIter(Iter.ITER_PRE); try { eval(iVisited.getIterNode()); } finally { threadContext.getIterStack().pop(); threadContext.getBlockStack().setCurrent(oldBlock); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/aa3fe2195e86c2c426f4012089ef8c66a66e925c/EvaluateVisitor.java/buggy/org/jruby/evaluator/EvaluateVisitor.java |
IRubyObject receiver = eval(iVisited.getReceiverNode()); IRubyObject[] args = ArgsUtil.setupArgs(runtime, this, iVisited.getArgsNode()); ArgsUtil.endCallArgs(runtime, tmpBlock); | IRubyObject receiver = null; IRubyObject[] args = null; try { receiver = eval(iVisited.getReceiverNode()); args = ArgsUtil.setupArgs(runtime, this, iVisited.getArgsNode()); } finally { ArgsUtil.endCallArgs(runtime, tmpBlock); } | public void visitCallNode(CallNode iVisited) { Block tmpBlock = ArgsUtil.beginCallArgs(runtime); IRubyObject receiver = eval(iVisited.getReceiverNode()); IRubyObject[] args = ArgsUtil.setupArgs(runtime, this, iVisited.getArgsNode()); ArgsUtil.endCallArgs(runtime, tmpBlock); result = receiver.getInternalClass().call(receiver, iVisited.getName(), args, CallType.NORMAL); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/aa3fe2195e86c2c426f4012089ef8c66a66e925c/EvaluateVisitor.java/buggy/org/jruby/evaluator/EvaluateVisitor.java |
IRubyObject[] args = ArgsUtil.setupArgs(runtime, this, iVisited.getArgsNode()); ArgsUtil.endCallArgs(runtime, tmpBlock); | IRubyObject[] args = null; try { args = ArgsUtil.setupArgs(runtime, this, iVisited.getArgsNode()); } finally { ArgsUtil.endCallArgs(runtime, tmpBlock); } | public void visitFCallNode(FCallNode iVisited) { Block tmpBlock = ArgsUtil.beginCallArgs(runtime); IRubyObject[] args = ArgsUtil.setupArgs(runtime, this, iVisited.getArgsNode()); ArgsUtil.endCallArgs(runtime, tmpBlock); result = self.getInternalClass().call(self, iVisited.getName(), args, CallType.FUNCTIONAL); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/aa3fe2195e86c2c426f4012089ef8c66a66e925c/EvaluateVisitor.java/buggy/org/jruby/evaluator/EvaluateVisitor.java |
Block tmpBlock = ArgsUtil.beginCallArgs(runtime); IRubyObject recv = eval(iVisited.getIterNode()); ArgsUtil.endCallArgs(runtime, tmpBlock); threadContext.setPosition(position); | IRubyObject recv = null; try { recv = eval(iVisited.getIterNode()); } finally { threadContext.setPosition(position); ArgsUtil.endCallArgs(runtime, tmpBlock); } | public void visitForNode(ForNode iVisited) { runtime.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self); runtime.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { ISourcePosition position = threadContext.getPosition(); Block tmpBlock = ArgsUtil.beginCallArgs(runtime); IRubyObject recv = eval(iVisited.getIterNode()); ArgsUtil.endCallArgs(runtime, tmpBlock); threadContext.setPosition(position); result = recv.getInternalClass().call(recv, "each", null, CallType.NORMAL); return; } catch (RetryJump rExcptn) { } } } catch (ReturnJump rExcptn) { result = rExcptn.getReturnValue(); } catch (BreakJump bExcptn) { result = runtime.getNil(); } finally { runtime.getIterStack().pop(); runtime.getBlockStack().pop(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/aa3fe2195e86c2c426f4012089ef8c66a66e925c/EvaluateVisitor.java/buggy/org/jruby/evaluator/EvaluateVisitor.java |
IRubyObject[] args = ArgsUtil.setupArgs(runtime, this, iVisited.getArgsNode()); ArgsUtil.endCallArgs(runtime, tmpBlock); | IRubyObject[] args = null; try { args = ArgsUtil.setupArgs(runtime, this, iVisited.getArgsNode()); } finally { ArgsUtil.endCallArgs(runtime, tmpBlock); } | public void visitSuperNode(SuperNode iVisited) { if (runtime.getCurrentFrame().getLastClass() == null) { throw new NameError(runtime, "Superclass method '" + runtime.getCurrentFrame().getLastFunc() + "' disabled."); } Block tmpBlock = ArgsUtil.beginCallArgs(runtime); IRubyObject[] args = ArgsUtil.setupArgs(runtime, this, iVisited.getArgsNode()); ArgsUtil.endCallArgs(runtime, tmpBlock); runtime.getIterStack().push(runtime.getCurrentIter().isNot() ? Iter.ITER_NOT : Iter.ITER_PRE); try { result = runtime.getCurrentFrame().getLastClass().getSuperClass().call(runtime.getCurrentFrame().getSelf(), runtime.getCurrentFrame().getLastFunc(), args, CallType.SUPER); } finally { runtime.getIterStack().pop(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/aa3fe2195e86c2c426f4012089ef8c66a66e925c/EvaluateVisitor.java/buggy/org/jruby/evaluator/EvaluateVisitor.java |
result = runtime.yield(result, null, null, false); | result = threadContext.yield(result, null, null, false); | public void visitYieldNode(YieldNode iVisited) { eval(iVisited.getArgsNode()); if (iVisited.getArgsNode() instanceof ExpandArrayNode && ((RubyArray) result).getLength() == 1) { result = ((RubyArray) result).entry(0); } result = runtime.yield(result, null, null, false); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/aa3fe2195e86c2c426f4012089ef8c66a66e925c/EvaluateVisitor.java/buggy/org/jruby/evaluator/EvaluateVisitor.java |
setModified(true); | public void setActionId(String actionId) { if (((actionId == null) && (_actionId != null)) || ((actionId != null) && (_actionId == null)) || ((actionId != null) && (_actionId != null) && !actionId.equals(_actionId))) { if (!XSS_ALLOW_ACTIONID) { actionId = XSSUtil.strip(actionId); } _actionId = actionId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/PermissionModel.java/buggy/portal-ejb/src/com/liferay/portal/model/PermissionModel.java |
|
setModified(true); | public void setCompanyId(String companyId) { if (((companyId == null) && (_companyId != null)) || ((companyId != null) && (_companyId == null)) || ((companyId != null) && (_companyId != null) && !companyId.equals(_companyId))) { if (!XSS_ALLOW_COMPANYID) { companyId = XSSUtil.strip(companyId); } _companyId = companyId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/PermissionModel.java/buggy/portal-ejb/src/com/liferay/portal/model/PermissionModel.java |
|
setModified(true); | public void setPermissionId(String permissionId) { if (((permissionId == null) && (_permissionId != null)) || ((permissionId != null) && (_permissionId == null)) || ((permissionId != null) && (_permissionId != null) && !permissionId.equals(_permissionId))) { if (!XSS_ALLOW_PERMISSIONID) { permissionId = XSSUtil.strip(permissionId); } _permissionId = permissionId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/PermissionModel.java/buggy/portal-ejb/src/com/liferay/portal/model/PermissionModel.java |
|
setModified(true); | public void setResourceId(String resourceId) { if (((resourceId == null) && (_resourceId != null)) || ((resourceId != null) && (_resourceId == null)) || ((resourceId != null) && (_resourceId != null) && !resourceId.equals(_resourceId))) { if (!XSS_ALLOW_RESOURCEID) { resourceId = XSSUtil.strip(resourceId); } _resourceId = resourceId; setModified(true); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f4d6afc6707f57fd84bf6b624f0c119657b0a766/PermissionModel.java/buggy/portal-ejb/src/com/liferay/portal/model/PermissionModel.java |
|
Reader r = _userAgent.getReader(info.getUri()); if (r != null) { | InputStream is = _userAgent.getInputStream(info.getUri()); if (is != null) { | private void debugBadStyleSheet(StylesheetInfo info) { Reader r = _userAgent.getReader(info.getUri()); if (r != null) { try { LineNumberReader lnr = new LineNumberReader(new BufferedReader(r)); StringBuffer sb = new StringBuffer(); String line = null; while ((line = lnr.readLine()) != null) { sb.append(line + "\n"); } XRLog.cssParse(sb.toString()); } catch (Exception ex) { XRLog.cssParse("Failed to read CSS sheet at " + info.getUri() + " for debugging."); } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9914a9774412cb33b91d4136ee4bc7038267d52b/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
Reader r = new InputStreamReader(is); | private void debugBadStyleSheet(StylesheetInfo info) { Reader r = _userAgent.getReader(info.getUri()); if (r != null) { try { LineNumberReader lnr = new LineNumberReader(new BufferedReader(r)); StringBuffer sb = new StringBuffer(); String line = null; while ((line = lnr.readLine()) != null) { sb.append(line + "\n"); } XRLog.cssParse(sb.toString()); } catch (Exception ex) { XRLog.cssParse("Failed to read CSS sheet at " + info.getUri() + " for debugging."); } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9914a9774412cb33b91d4136ee4bc7038267d52b/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
|
public Stylesheet parse(java.io.Reader reader, StylesheetInfo info) { InputSource is = new InputSource(reader); | public Stylesheet parse(InputStream stream, StylesheetInfo info) { Reader r = new InputStreamReader(stream); InputSource is = new InputSource(r); | public Stylesheet parse(java.io.Reader reader, StylesheetInfo info) { InputSource is = new InputSource(reader); CSSStyleSheet style = null; try { style = parser.parseStyleSheet(is); } catch (java.io.IOException e) { throw new XRRuntimeException("IOException on parsing style seet from a Reader; don't know the URI.", e); } Stylesheet sheet = new Stylesheet(info.getUri(), info.getOrigin()); CSSRuleList rl = style.getCssRules(); pullRulesets(rl, sheet, info); return sheet; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9914a9774412cb33b91d4136ee4bc7038267d52b/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
Reader reader = new StringReader(isis[i].getStyle()); StylesheetInfo info = isis[i].getInfo(); info.setUri(main.getUri()); Stylesheet is = parse(reader, info); info.setStylesheet(is); sheet.addStylesheet(info); | try { InputStream stream = new ByteArrayInputStream(isis[i].getStyle().getBytes("UTF-8")); StylesheetInfo info = isis[i].getInfo(); info.setUri(main.getUri()); Stylesheet is = parse(stream, info); info.setStylesheet(is); sheet.addStylesheet(info); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } | public Stylesheet parseInlines(InlineStyleInfo[] isis, StylesheetInfo main) { Stylesheet sheet = new Stylesheet(main.getUri(), main.getOrigin()); if (isis != null) { for (int i = 0; i < isis.length; i++) { Reader reader = new StringReader(isis[i].getStyle()); StylesheetInfo info = isis[i].getInfo(); info.setUri(main.getUri()); Stylesheet is = parse(reader, info); info.setStylesheet(is); sheet.addStylesheet(info); } } return sheet; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9914a9774412cb33b91d4136ee4bc7038267d52b/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
return null; | return PreferenceConverter.getDefaultFontDataArray(getPreferenceStore(), definition.getId()); | private FontData[] getFontAncestorValue(FontDefinition definition) { FontDefinition ancestor = getFontAncestor(definition); if (ancestor == null) return null; return getFontValue(ancestor); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/114554a929da031b01ed8147db0db98d89920a6c/ColorsAndFontsPreferencePage.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentation/ColorsAndFontsPreferencePage.java |
if(val.getCssValueType() == val.CSS_PRIMITIVE_VALUE) { | else if(val.getCssValueType() == val.CSS_PRIMITIVE_VALUE) { | private void expandBackgroundPosition(CSSStyleRule rule) { CSSStyleDeclaration dec = rule.getStyle(); CSSValue val = dec.getPropertyCSSValue("background-position"); String prio = dec.getPropertyPriority("background-position"); if(val.getCssValueType() == val.CSS_VALUE_LIST) { //u.p("val = " + val); return; } if(val.getCssValueType() == val.CSS_PRIMITIVE_VALUE) { //u.p("val = " + val); String str = val.getCssText(); if(str.startsWith("top")) { dec.setProperty("background-position","50% 0%",prio); } if(str.startsWith("bottom")) { dec.setProperty("background-position","50% 100%",prio); } if(str.startsWith("left")) { dec.setProperty("background-position","0% 50%",prio); } if(str.startsWith("right")) { dec.setProperty("background-position","100% 50%",prio); } return; } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
else System.err.println("unhandled value-type in RuleNormalizer.expandBackgroundPosition"); | private void expandBackgroundPosition(CSSStyleRule rule) { CSSStyleDeclaration dec = rule.getStyle(); CSSValue val = dec.getPropertyCSSValue("background-position"); String prio = dec.getPropertyPriority("background-position"); if(val.getCssValueType() == val.CSS_VALUE_LIST) { //u.p("val = " + val); return; } if(val.getCssValueType() == val.CSS_PRIMITIVE_VALUE) { //u.p("val = " + val); String str = val.getCssText(); if(str.startsWith("top")) { dec.setProperty("background-position","50% 0%",prio); } if(str.startsWith("bottom")) { dec.setProperty("background-position","50% 100%",prio); } if(str.startsWith("left")) { dec.setProperty("background-position","0% 50%",prio); } if(str.startsWith("right")) { dec.setProperty("background-position","100% 50%",prio); } return; } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
|
if(isColor(v.getCssText())) { | else if(isColor(v.getCssText())) { | private void expandBorder(CSSStyleRule rule) { CSSStyleDeclaration dec = rule.getStyle(); CSSValue val = dec.getPropertyCSSValue("border"); String prio = dec.getPropertyPriority("border"); CSSValueList list = (CSSValueList)val; CSSValue a, b, c; if(val.getCssValueType() == val.CSS_VALUE_LIST) { for(int i=0; i<list.getLength(); i++) { CSSValue v = list.item(i); if(isDimension(v.getCssText())) { dec.setProperty("border-width",v.getCssText(),prio); expandProperty("border-width",rule); } if(isColor(v.getCssText())) { dec.setProperty("border-color",v.getCssText(),prio); expandProperty("border-color",rule); } if(isBorderStyle(v.getCssText())) { dec.setProperty("border-style",v.getCssText(),prio); expandProperty("border-style",rule); } } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
if(isBorderStyle(v.getCssText())) { | else if(isBorderStyle(v.getCssText())) { | private void expandBorder(CSSStyleRule rule) { CSSStyleDeclaration dec = rule.getStyle(); CSSValue val = dec.getPropertyCSSValue("border"); String prio = dec.getPropertyPriority("border"); CSSValueList list = (CSSValueList)val; CSSValue a, b, c; if(val.getCssValueType() == val.CSS_VALUE_LIST) { for(int i=0; i<list.getLength(); i++) { CSSValue v = list.item(i); if(isDimension(v.getCssText())) { dec.setProperty("border-width",v.getCssText(),prio); expandProperty("border-width",rule); } if(isColor(v.getCssText())) { dec.setProperty("border-color",v.getCssText(),prio); expandProperty("border-color",rule); } if(isBorderStyle(v.getCssText())) { dec.setProperty("border-style",v.getCssText(),prio); expandProperty("border-style",rule); } } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
} else { System.err.println("unhandled value type in RuleNormalizer.expandBorder"); | private void expandBorder(CSSStyleRule rule) { CSSStyleDeclaration dec = rule.getStyle(); CSSValue val = dec.getPropertyCSSValue("border"); String prio = dec.getPropertyPriority("border"); CSSValueList list = (CSSValueList)val; CSSValue a, b, c; if(val.getCssValueType() == val.CSS_VALUE_LIST) { for(int i=0; i<list.getLength(); i++) { CSSValue v = list.item(i); if(isDimension(v.getCssText())) { dec.setProperty("border-width",v.getCssText(),prio); expandProperty("border-width",rule); } if(isColor(v.getCssText())) { dec.setProperty("border-color",v.getCssText(),prio); expandProperty("border-color",rule); } if(isBorderStyle(v.getCssText())) { dec.setProperty("border-style",v.getCssText(),prio); expandProperty("border-style",rule); } } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
|
if(prop.equals("padding")) { | else if(prop.equals("padding")) { | private void expandProperty(String prop, CSSStyleRule rule) { if( prop.equals("color") || prop.equals("background-color") || prop.equals("border-color")) { String value = rule.getStyle().getPropertyValue(prop); rule.getStyle().setProperty(prop,getColorHex(value),rule.getStyle().getPropertyPriority(prop)); return; } if(prop.equals("padding")) { expand(prop,rule); } if(prop.equals("margin")) { expand(prop,rule); } if(prop.equals("border-width")) { expand("border-width",rule,"border","-width"); } if(prop.equals("background-position")) { expandBackgroundPosition(rule); } if(prop.equals("border")) { //u.p("normalizing: " + prop); expandBorder(rule); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
if(prop.equals("margin")) { | else if(prop.equals("margin")) { | private void expandProperty(String prop, CSSStyleRule rule) { if( prop.equals("color") || prop.equals("background-color") || prop.equals("border-color")) { String value = rule.getStyle().getPropertyValue(prop); rule.getStyle().setProperty(prop,getColorHex(value),rule.getStyle().getPropertyPriority(prop)); return; } if(prop.equals("padding")) { expand(prop,rule); } if(prop.equals("margin")) { expand(prop,rule); } if(prop.equals("border-width")) { expand("border-width",rule,"border","-width"); } if(prop.equals("background-position")) { expandBackgroundPosition(rule); } if(prop.equals("border")) { //u.p("normalizing: " + prop); expandBorder(rule); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
if(prop.equals("border-width")) { | else if(prop.equals("border-width")) { | private void expandProperty(String prop, CSSStyleRule rule) { if( prop.equals("color") || prop.equals("background-color") || prop.equals("border-color")) { String value = rule.getStyle().getPropertyValue(prop); rule.getStyle().setProperty(prop,getColorHex(value),rule.getStyle().getPropertyPriority(prop)); return; } if(prop.equals("padding")) { expand(prop,rule); } if(prop.equals("margin")) { expand(prop,rule); } if(prop.equals("border-width")) { expand("border-width",rule,"border","-width"); } if(prop.equals("background-position")) { expandBackgroundPosition(rule); } if(prop.equals("border")) { //u.p("normalizing: " + prop); expandBorder(rule); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
if(prop.equals("background-position")) { | else if(prop.equals("background-position")) { | private void expandProperty(String prop, CSSStyleRule rule) { if( prop.equals("color") || prop.equals("background-color") || prop.equals("border-color")) { String value = rule.getStyle().getPropertyValue(prop); rule.getStyle().setProperty(prop,getColorHex(value),rule.getStyle().getPropertyPriority(prop)); return; } if(prop.equals("padding")) { expand(prop,rule); } if(prop.equals("margin")) { expand(prop,rule); } if(prop.equals("border-width")) { expand("border-width",rule,"border","-width"); } if(prop.equals("background-position")) { expandBackgroundPosition(rule); } if(prop.equals("border")) { //u.p("normalizing: " + prop); expandBorder(rule); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
if(prop.equals("border")) { | else if(prop.equals("border")) { | private void expandProperty(String prop, CSSStyleRule rule) { if( prop.equals("color") || prop.equals("background-color") || prop.equals("border-color")) { String value = rule.getStyle().getPropertyValue(prop); rule.getStyle().setProperty(prop,getColorHex(value),rule.getStyle().getPropertyPriority(prop)); return; } if(prop.equals("padding")) { expand(prop,rule); } if(prop.equals("margin")) { expand(prop,rule); } if(prop.equals("border-width")) { expand("border-width",rule,"border","-width"); } if(prop.equals("background-position")) { expandBackgroundPosition(rule); } if(prop.equals("border")) { //u.p("normalizing: " + prop); expandBorder(rule); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
else { rule.getStyle().setProperty(prop,rule.getStyle().getPropertyValue(prop),rule.getStyle().getPropertyPriority(prop)); } | private void expandProperty(String prop, CSSStyleRule rule) { if( prop.equals("color") || prop.equals("background-color") || prop.equals("border-color")) { String value = rule.getStyle().getPropertyValue(prop); rule.getStyle().setProperty(prop,getColorHex(value),rule.getStyle().getPropertyPriority(prop)); return; } if(prop.equals("padding")) { expand(prop,rule); } if(prop.equals("margin")) { expand(prop,rule); } if(prop.equals("border-width")) { expand("border-width",rule,"border","-width"); } if(prop.equals("background-position")) { expandBackgroundPosition(rule); } if(prop.equals("border")) { //u.p("normalizing: " + prop); expandBorder(rule); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
|
for(int i=0; i<rule.getStyle().getLength(); i++) { | int length = rule.getStyle().getLength(); for(int i=0; i<length; i++) { | public CSSStyleRule normalize(CSSStyleRule rule) { for(int i=0; i<rule.getStyle().getLength(); i++) { String prop = rule.getStyle().item(i); expandProperty(prop,rule); } return rule; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/f81fa730fe7c90e9ffcfc7979f1ecfa690950d26/RuleNormalizer.java/buggy/src/java/org/joshy/html/css/RuleNormalizer.java |
Iterator i = commandIdToBinding.entrySet().iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry) i.next(); String commandId = (String) entry.getKey(); Binding binding = (Binding) entry.getValue(); commandService.getCommand(commandId).removeCommandListener(actionSetListener); if (binding!=null && actionSetActiveBindings.contains(binding)) { bindingService.removeBinding(binding); } } commandIdToBinding.clear(); actionSetActiveBindings.clear(); | private final void clearBindings() { // TODO Implement } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/99903f71f731881354e6ee730d7b0008957bea96/LegacyActionPersistence.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java |
|
bindingService.addBinding(binding); | commandIdToBinding.put(command.getCommand().getId(), binding); if (command.getCommand().isEnabled()) { bindingService.addBinding(binding); actionSetActiveBindings.add(binding); } command.getCommand().addCommandListener(actionSetListener); | private final void convertActionToBinding( final IConfigurationElement element, final ParameterizedCommand command) { // Figure out which accelerator text to use. String acceleratorText = readOptional(element, ATT_ACCELERATOR); if (acceleratorText == null) { final String label = readOptional(element, ATT_LABEL); if (label != null) { acceleratorText = LegacyActionTools .extractAcceleratorText(label); } } // If there is some accelerator text, generate a key sequence from it. if (acceleratorText != null) { final IKeyLookup lookup = KeyLookupFactory.getSWTKeyLookup(); final int acceleratorInt = LegacyActionTools .convertAccelerator(acceleratorText); final int modifierMask = lookup.getAlt() | lookup.getCommand() | lookup.getCtrl() | lookup.getShift(); final int modifierKeys = acceleratorInt & modifierMask; final int naturalKey = acceleratorInt & ~modifierMask; final KeyStroke keyStroke = KeyStroke.getInstance(modifierKeys, naturalKey); final KeySequence keySequence = KeySequence.getInstance(keyStroke); final Scheme activeScheme = bindingService.getActiveScheme(); final Binding binding = new KeyBinding(keySequence, command, activeScheme.getId(), IContextIds.CONTEXT_ID_WINDOW, null, null, null, Binding.SYSTEM); bindingService.addBinding(binding); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/99903f71f731881354e6ee730d7b0008957bea96/LegacyActionPersistence.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java |
clearBindings(); | public final void dispose() { super.dispose(); clearActivations(); clearBindings(); clearImages(); clearMenus(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/99903f71f731881354e6ee730d7b0008957bea96/LegacyActionPersistence.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java |
|
private void doTestAdd(final int increment, int total, boolean preSort) { | private void doTestAdd(final int increment, final int total,final boolean preSort) throws CoreException { | private void doTestAdd(final int increment, int total, boolean preSort) { openBrowser(); int iterations = ITERATIONS; if (total > 100)// Cut it down for large data sets iterations = ITERATIONS / 5; for (int i = 0; i < iterations; i++) { TestTreeElement input = new TestTreeElement(0, null); viewer.setInput(input); input.createChildren(total); if (preSort) viewer.getSorter().sort(viewer, input.children); Collection batches = new ArrayList(); int blocks = input.children.length / increment; for (int j = 0; j < blocks; j = j + increment) { Object[] batch = new Object[increment]; System.arraycopy(input.children, j * increment, batch, 0, increment); batches.add(batch); } processEvents(); Object[] batchArray = batches.toArray(); startMeasuring(); // Measure more than one for the fast cases for (int k = 0; k < batchArray.length; k++) { viewer.add(input, (Object[]) batchArray[k]); processEvents(); } stopMeasuring(); } commitMeasurements(); assertPerformance(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2d68822a79e6e20d403c2debfba4b04bdf2e5057/TreeTest.java/buggy/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/performance/TreeTest.java |
if (total > 100) | int minIterations = JFacePerformanceSuite.MIN_ITERATIONS; if (total > 100) { | private void doTestAdd(final int increment, int total, boolean preSort) { openBrowser(); int iterations = ITERATIONS; if (total > 100)// Cut it down for large data sets iterations = ITERATIONS / 5; for (int i = 0; i < iterations; i++) { TestTreeElement input = new TestTreeElement(0, null); viewer.setInput(input); input.createChildren(total); if (preSort) viewer.getSorter().sort(viewer, input.children); Collection batches = new ArrayList(); int blocks = input.children.length / increment; for (int j = 0; j < blocks; j = j + increment) { Object[] batch = new Object[increment]; System.arraycopy(input.children, j * increment, batch, 0, increment); batches.add(batch); } processEvents(); Object[] batchArray = batches.toArray(); startMeasuring(); // Measure more than one for the fast cases for (int k = 0; k < batchArray.length; k++) { viewer.add(input, (Object[]) batchArray[k]); processEvents(); } stopMeasuring(); } commitMeasurements(); assertPerformance(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2d68822a79e6e20d403c2debfba4b04bdf2e5057/TreeTest.java/buggy/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/performance/TreeTest.java |
for (int i = 0; i < iterations; i++) { TestTreeElement input = new TestTreeElement(0, null); viewer.setInput(input); input.createChildren(total); if (preSort) viewer.getSorter().sort(viewer, input.children); Collection batches = new ArrayList(); int blocks = input.children.length / increment; for (int j = 0; j < blocks; j = j + increment) { Object[] batch = new Object[increment]; System.arraycopy(input.children, j * increment, batch, 0, increment); batches.add(batch); | exercise(new TestRunnable() { public void run() { TestTreeElement input = new TestTreeElement(0, null); viewer.setInput(input); input.createChildren(total); if (preSort) viewer.getSorter().sort(viewer, input.children); Collection batches = new ArrayList(); int blocks = input.children.length / increment; for (int j = 0; j < blocks; j = j + increment) { Object[] batch = new Object[increment]; System.arraycopy(input.children, j * increment, batch, 0, increment); batches.add(batch); } processEvents(); Object[] batchArray = batches.toArray(); startMeasuring(); for (int k = 0; k < batchArray.length; k++) { viewer.add(input, (Object[]) batchArray[k]); processEvents(); } stopMeasuring(); | private void doTestAdd(final int increment, int total, boolean preSort) { openBrowser(); int iterations = ITERATIONS; if (total > 100)// Cut it down for large data sets iterations = ITERATIONS / 5; for (int i = 0; i < iterations; i++) { TestTreeElement input = new TestTreeElement(0, null); viewer.setInput(input); input.createChildren(total); if (preSort) viewer.getSorter().sort(viewer, input.children); Collection batches = new ArrayList(); int blocks = input.children.length / increment; for (int j = 0; j < blocks; j = j + increment) { Object[] batch = new Object[increment]; System.arraycopy(input.children, j * increment, batch, 0, increment); batches.add(batch); } processEvents(); Object[] batchArray = batches.toArray(); startMeasuring(); // Measure more than one for the fast cases for (int k = 0; k < batchArray.length; k++) { viewer.add(input, (Object[]) batchArray[k]); processEvents(); } stopMeasuring(); } commitMeasurements(); assertPerformance(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2d68822a79e6e20d403c2debfba4b04bdf2e5057/TreeTest.java/buggy/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/performance/TreeTest.java |
processEvents(); Object[] batchArray = batches.toArray(); startMeasuring(); | }, minIterations, iterations, JFacePerformanceSuite.MAX_TIME); | private void doTestAdd(final int increment, int total, boolean preSort) { openBrowser(); int iterations = ITERATIONS; if (total > 100)// Cut it down for large data sets iterations = ITERATIONS / 5; for (int i = 0; i < iterations; i++) { TestTreeElement input = new TestTreeElement(0, null); viewer.setInput(input); input.createChildren(total); if (preSort) viewer.getSorter().sort(viewer, input.children); Collection batches = new ArrayList(); int blocks = input.children.length / increment; for (int j = 0; j < blocks; j = j + increment) { Object[] batch = new Object[increment]; System.arraycopy(input.children, j * increment, batch, 0, increment); batches.add(batch); } processEvents(); Object[] batchArray = batches.toArray(); startMeasuring(); // Measure more than one for the fast cases for (int k = 0; k < batchArray.length; k++) { viewer.add(input, (Object[]) batchArray[k]); processEvents(); } stopMeasuring(); } commitMeasurements(); assertPerformance(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2d68822a79e6e20d403c2debfba4b04bdf2e5057/TreeTest.java/buggy/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/performance/TreeTest.java |
for (int k = 0; k < batchArray.length; k++) { viewer.add(input, (Object[]) batchArray[k]); processEvents(); } stopMeasuring(); } | private void doTestAdd(final int increment, int total, boolean preSort) { openBrowser(); int iterations = ITERATIONS; if (total > 100)// Cut it down for large data sets iterations = ITERATIONS / 5; for (int i = 0; i < iterations; i++) { TestTreeElement input = new TestTreeElement(0, null); viewer.setInput(input); input.createChildren(total); if (preSort) viewer.getSorter().sort(viewer, input.children); Collection batches = new ArrayList(); int blocks = input.children.length / increment; for (int j = 0; j < blocks; j = j + increment) { Object[] batch = new Object[increment]; System.arraycopy(input.children, j * increment, batch, 0, increment); batches.add(batch); } processEvents(); Object[] batchArray = batches.toArray(); startMeasuring(); // Measure more than one for the fast cases for (int k = 0; k < batchArray.length; k++) { viewer.add(input, (Object[]) batchArray[k]); processEvents(); } stopMeasuring(); } commitMeasurements(); assertPerformance(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2d68822a79e6e20d403c2debfba4b04bdf2e5057/TreeTest.java/buggy/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/performance/TreeTest.java |
|
tagIfNecessary("JFace - Add 1000 items in 10 blocks to TreeViewer", Dimension.ELAPSED_PROCESS); | tagIfNecessary("JFace - Add 1000 items in 10 blocks to TreeViewer", Dimension.ELAPSED_PROCESS); | public void testAddHundred() throws CoreException { tagIfNecessary("JFace - Add 1000 items in 10 blocks to TreeViewer", Dimension.ELAPSED_PROCESS); doTestAdd(100, TEST_COUNT, false); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2d68822a79e6e20d403c2debfba4b04bdf2e5057/TreeTest.java/buggy/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/performance/TreeTest.java |
public void testAddHundredPreSort() throws CoreException { doTestAdd(100, 1000, true); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2d68822a79e6e20d403c2debfba4b04bdf2e5057/TreeTest.java/buggy/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/performance/TreeTest.java |
||
public void testAddThousand() { | public void testAddThousand() throws CoreException { | public void testAddThousand() { doTestAdd(1000, 2000, false); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2d68822a79e6e20d403c2debfba4b04bdf2e5057/TreeTest.java/buggy/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/performance/TreeTest.java |
if (block.repeat.equals("repeat-Xx")) { | if (block.repeat == IdentValue.REPEAT_X) { | public static void paint(Context c, Box block) { // don't draw if the backgrounds are turned off if (!Configuration.isTrue("xr.renderer.draw.backgrounds", true)) { return; } int width = block.getWidth(); int height = block.getHeight(); Border border = c.getCurrentStyle().getBorderWidth(width, height, c.getCtx()); if (border == null) { return; } Border margin = c.getCurrentStyle().getMarginWidth(width, height, c.getCtx()); Rectangle box = new Rectangle(block.x + margin.left + border.left, block.y + margin.top + border.top, block.width - margin.left - margin.right - border.left - border.right, block.height - margin.top - border.top - border.bottom - margin.bottom); // paint the background Color background_color = BoxRendering.getBackgroundColor(c); if (background_color != null) { // skip transparent background if (!background_color.equals(transparent)) { //TODO. make conf controlled Uu.p("filling a background"); c.getGraphics().setColor(background_color); c.getGraphics().fillRect(box.x, box.y, box.width, box.height); } } int xoff = 0; int yoff = 0; if (block.attachment == IdentValue.FIXED) { yoff = c.getCanvas().getLocation().y; //TODO. make conf controlled Uu.p("setting the clip rect for fixed background"); c.getGraphics().setClip(c.getCanvas().getVisibleRect()); } if (block.background_image != null) { int left_insets = box.x; int top_insets = box.y; int back_width = box.width; int back_height = box.height; Rectangle2D oldclip = (Rectangle2D) c.getGraphics().getClip(); Rectangle new_clip = new Rectangle(left_insets, top_insets, back_width, back_height); c.getGraphics().setClip(oldclip.createIntersection(new_clip)); xoff += block.background_position_horizontal; yoff -= block.background_position_vertical; // tile the image as appropriate // do fixed tile image boolean horiz = false; boolean vert = false; if (block.repeat.equals("repeat-Xx")) { horiz = true; vert = false; } if (block.repeat.equals("repeat-y")) { horiz = false; vert = true; } if (block.repeat.equals("repeat")) { horiz = true; vert = true; } //TODO. make conf controlled Uu.p("filling background with an image"); // fixed tiled image if (block.attachment != null && block.attachment.equals("fixed")) { tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); } else { // do normal tile image tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); } //TODO. make conf controlled Uu.p("setting the clip rect"); c.getGraphics().setClip(oldclip); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/4f8dc5e7235e4a07429eabed1405b8f7e77d1c74/BackgroundPainter.java/clean/src/java/org/xhtmlrenderer/render/BackgroundPainter.java |
if (block.repeat.equals("repeat-y")) { | if (block.repeat == IdentValue.REPEAT_Y) { | public static void paint(Context c, Box block) { // don't draw if the backgrounds are turned off if (!Configuration.isTrue("xr.renderer.draw.backgrounds", true)) { return; } int width = block.getWidth(); int height = block.getHeight(); Border border = c.getCurrentStyle().getBorderWidth(width, height, c.getCtx()); if (border == null) { return; } Border margin = c.getCurrentStyle().getMarginWidth(width, height, c.getCtx()); Rectangle box = new Rectangle(block.x + margin.left + border.left, block.y + margin.top + border.top, block.width - margin.left - margin.right - border.left - border.right, block.height - margin.top - border.top - border.bottom - margin.bottom); // paint the background Color background_color = BoxRendering.getBackgroundColor(c); if (background_color != null) { // skip transparent background if (!background_color.equals(transparent)) { //TODO. make conf controlled Uu.p("filling a background"); c.getGraphics().setColor(background_color); c.getGraphics().fillRect(box.x, box.y, box.width, box.height); } } int xoff = 0; int yoff = 0; if (block.attachment == IdentValue.FIXED) { yoff = c.getCanvas().getLocation().y; //TODO. make conf controlled Uu.p("setting the clip rect for fixed background"); c.getGraphics().setClip(c.getCanvas().getVisibleRect()); } if (block.background_image != null) { int left_insets = box.x; int top_insets = box.y; int back_width = box.width; int back_height = box.height; Rectangle2D oldclip = (Rectangle2D) c.getGraphics().getClip(); Rectangle new_clip = new Rectangle(left_insets, top_insets, back_width, back_height); c.getGraphics().setClip(oldclip.createIntersection(new_clip)); xoff += block.background_position_horizontal; yoff -= block.background_position_vertical; // tile the image as appropriate // do fixed tile image boolean horiz = false; boolean vert = false; if (block.repeat.equals("repeat-Xx")) { horiz = true; vert = false; } if (block.repeat.equals("repeat-y")) { horiz = false; vert = true; } if (block.repeat.equals("repeat")) { horiz = true; vert = true; } //TODO. make conf controlled Uu.p("filling background with an image"); // fixed tiled image if (block.attachment != null && block.attachment.equals("fixed")) { tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); } else { // do normal tile image tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); } //TODO. make conf controlled Uu.p("setting the clip rect"); c.getGraphics().setClip(oldclip); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/4f8dc5e7235e4a07429eabed1405b8f7e77d1c74/BackgroundPainter.java/clean/src/java/org/xhtmlrenderer/render/BackgroundPainter.java |
if (block.repeat.equals("repeat")) { | if (block.repeat == IdentValue.REPEAT) { | public static void paint(Context c, Box block) { // don't draw if the backgrounds are turned off if (!Configuration.isTrue("xr.renderer.draw.backgrounds", true)) { return; } int width = block.getWidth(); int height = block.getHeight(); Border border = c.getCurrentStyle().getBorderWidth(width, height, c.getCtx()); if (border == null) { return; } Border margin = c.getCurrentStyle().getMarginWidth(width, height, c.getCtx()); Rectangle box = new Rectangle(block.x + margin.left + border.left, block.y + margin.top + border.top, block.width - margin.left - margin.right - border.left - border.right, block.height - margin.top - border.top - border.bottom - margin.bottom); // paint the background Color background_color = BoxRendering.getBackgroundColor(c); if (background_color != null) { // skip transparent background if (!background_color.equals(transparent)) { //TODO. make conf controlled Uu.p("filling a background"); c.getGraphics().setColor(background_color); c.getGraphics().fillRect(box.x, box.y, box.width, box.height); } } int xoff = 0; int yoff = 0; if (block.attachment == IdentValue.FIXED) { yoff = c.getCanvas().getLocation().y; //TODO. make conf controlled Uu.p("setting the clip rect for fixed background"); c.getGraphics().setClip(c.getCanvas().getVisibleRect()); } if (block.background_image != null) { int left_insets = box.x; int top_insets = box.y; int back_width = box.width; int back_height = box.height; Rectangle2D oldclip = (Rectangle2D) c.getGraphics().getClip(); Rectangle new_clip = new Rectangle(left_insets, top_insets, back_width, back_height); c.getGraphics().setClip(oldclip.createIntersection(new_clip)); xoff += block.background_position_horizontal; yoff -= block.background_position_vertical; // tile the image as appropriate // do fixed tile image boolean horiz = false; boolean vert = false; if (block.repeat.equals("repeat-Xx")) { horiz = true; vert = false; } if (block.repeat.equals("repeat-y")) { horiz = false; vert = true; } if (block.repeat.equals("repeat")) { horiz = true; vert = true; } //TODO. make conf controlled Uu.p("filling background with an image"); // fixed tiled image if (block.attachment != null && block.attachment.equals("fixed")) { tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); } else { // do normal tile image tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); } //TODO. make conf controlled Uu.p("setting the clip rect"); c.getGraphics().setClip(oldclip); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/4f8dc5e7235e4a07429eabed1405b8f7e77d1c74/BackgroundPainter.java/clean/src/java/org/xhtmlrenderer/render/BackgroundPainter.java |
actionService.dispose(); | actionService.dispose(); | protected void dispose() { commonNavigator.getCommonViewer().removeSelectionChangedListener(this); // commonNavigator.getCommonViewer().removeOpenListener(commonOpenService); // commonOpenService.dispose(); actionService.dispose(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
if (selection instanceof IStructuredSelection) actionService.fillContextMenu(aMenuManager, (IStructuredSelection) selection); else actionService.fillContextMenu(aMenuManager, StructuredSelection.EMPTY); | actionService.setContext(new ActionContext(selection)); actionService.fillContextMenu(aMenuManager); | protected void fillContextMenu(IMenuManager aMenuManager) { ISelection selection = commonNavigator.getCommonViewer().getSelection(); if (selection instanceof IStructuredSelection) actionService.fillContextMenu(aMenuManager, (IStructuredSelection) selection); else actionService.fillContextMenu(aMenuManager, StructuredSelection.EMPTY); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
public INavigatorActionService getNavigatorActionService() { | public NavigatorActionService getNavigatorActionService() { | public INavigatorActionService getNavigatorActionService() { return actionService; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
private void init() { commonNavigator.getCommonViewer().addSelectionChangedListener(this); updateStatusBar(commonNavigator.getCommonViewer().getSelection()); actionService = new NavigatorActionService(commonNavigator, commonNavigator.getCommonViewer(), contentService); // commonNavigator.getCommonViewer().addOpenListener(commonOpenService); initContextMenu(); initViewMenu(); final RetargetAction openAction = new RetargetAction(ICommonActionConstants.OPEN, CommonNavigatorMessages.Open_action_label); commonNavigator.getViewSite().getPage().addPartListener(openAction); openAction.setActionDefinitionId(ICommonActionConstants.OPEN); commonNavigator.getCommonViewer().addOpenListener(new IOpenListener() { public void open(OpenEvent event) { openAction.run(); } }); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
||
final RetargetAction openAction = new RetargetAction(ICommonActionConstants.OPEN, CommonNavigatorMessages.Open_action_label); | final RetargetAction openAction = new RetargetAction( ICommonActionConstants.OPEN, CommonNavigatorMessages.Open_action_label); | private void init() { commonNavigator.getCommonViewer().addSelectionChangedListener(this); updateStatusBar(commonNavigator.getCommonViewer().getSelection()); actionService = new NavigatorActionService(commonNavigator, commonNavigator.getCommonViewer(), contentService); // commonNavigator.getCommonViewer().addOpenListener(commonOpenService); initContextMenu(); initViewMenu(); final RetargetAction openAction = new RetargetAction(ICommonActionConstants.OPEN, CommonNavigatorMessages.Open_action_label); commonNavigator.getViewSite().getPage().addPartListener(openAction); openAction.setActionDefinitionId(ICommonActionConstants.OPEN); commonNavigator.getCommonViewer().addOpenListener(new IOpenListener() { public void open(OpenEvent event) { openAction.run(); } }); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
private void init() { commonNavigator.getCommonViewer().addSelectionChangedListener(this); updateStatusBar(commonNavigator.getCommonViewer().getSelection()); actionService = new NavigatorActionService(commonNavigator, commonNavigator.getCommonViewer(), contentService); // commonNavigator.getCommonViewer().addOpenListener(commonOpenService); initContextMenu(); initViewMenu(); final RetargetAction openAction = new RetargetAction(ICommonActionConstants.OPEN, CommonNavigatorMessages.Open_action_label); commonNavigator.getViewSite().getPage().addPartListener(openAction); openAction.setActionDefinitionId(ICommonActionConstants.OPEN); commonNavigator.getCommonViewer().addOpenListener(new IOpenListener() { public void open(OpenEvent event) { openAction.run(); } }); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
||
public void open(OpenEvent event) { openAction.run(); | public void open(OpenEvent event) { openAction.run(); | private void init() { commonNavigator.getCommonViewer().addSelectionChangedListener(this); updateStatusBar(commonNavigator.getCommonViewer().getSelection()); actionService = new NavigatorActionService(commonNavigator, commonNavigator.getCommonViewer(), contentService); // commonNavigator.getCommonViewer().addOpenListener(commonOpenService); initContextMenu(); initViewMenu(); final RetargetAction openAction = new RetargetAction(ICommonActionConstants.OPEN, CommonNavigatorMessages.Open_action_label); commonNavigator.getViewSite().getPage().addPartListener(openAction); openAction.setActionDefinitionId(ICommonActionConstants.OPEN); commonNavigator.getCommonViewer().addOpenListener(new IOpenListener() { public void open(OpenEvent event) { openAction.run(); } }); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
public void open(OpenEvent event) { openAction.run(); | public void open(OpenEvent event) { openAction.run(); | public void open(OpenEvent event) { openAction.run(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
commonViewer.getTree().setMenu(menu); actionService.setUpdateMenu(menuMgr); | commonViewer.getTree().setMenu(menu); actionService.prepareMenuForPlatformContributions(menuMgr, commonViewer, false); | protected void initContextMenu() { MenuManager menuMgr = new MenuManager(contentService .getViewerDescriptor().getPopupMenuId()); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager manager) { fillContextMenu(manager); } }); TreeViewer commonViewer = commonNavigator.getCommonViewer(); Menu menu = menuMgr.createContextMenu(commonViewer.getTree()); commonViewer.getTree().setMenu(menu); actionService.setUpdateMenu(menuMgr); /* * Hooks into the Eclipse framework for Object contributions, and View * contributions. */ commonNavigator.getSite().registerContextMenu( contentService.getViewerDescriptor().getPopupMenuId(), menuMgr, commonViewer); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
/* * Hooks into the Eclipse framework for Object contributions, and View * contributions. */ commonNavigator.getSite().registerContextMenu( contentService.getViewerDescriptor().getPopupMenuId(), menuMgr, commonViewer); | protected void initContextMenu() { MenuManager menuMgr = new MenuManager(contentService .getViewerDescriptor().getPopupMenuId()); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager manager) { fillContextMenu(manager); } }); TreeViewer commonViewer = commonNavigator.getCommonViewer(); Menu menu = menuMgr.createContextMenu(commonViewer.getTree()); commonViewer.getTree().setMenu(menu); actionService.setUpdateMenu(menuMgr); /* * Hooks into the Eclipse framework for Object contributions, and View * contributions. */ commonNavigator.getSite().registerContextMenu( contentService.getViewerDescriptor().getPopupMenuId(), menuMgr, commonViewer); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
|
.getActionBars(), structuredSelection); | .getActionBars()); | public void selectionChanged(SelectionChangedEvent anEvent) { updateStatusBar(anEvent.getSelection()); if (anEvent.getSelection() instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) anEvent .getSelection(); actionService.fillActionBars(commonNavigator.getViewSite() .getActionBars(), structuredSelection); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6915e85b60af35942d3186f62ce0acdf65c91e7f/CommonNavigatorManager.java/clean/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java |
page.paintBorder(c, 0); | page.paintBorder(c, 0, Layer.PAGED_MODE_PRINT); | public void paintPage(Graphics2D g, int pageNo) { Layer root = getRootLayer(); if (root == null) { throw new RuntimeException("Document needs layout"); } if (pageNo < 0 || pageNo >= root.getPages().size()) { throw new IllegalArgumentException("Page " + pageNo + " is not between 0 " + "and " + root.getPages().size()); } RenderingContext c = newRenderingContext(g); PageBox page = (PageBox)root.getPages().get(pageNo); Shape working = g.getClip(); Rectangle content = page.getPrintingClippingBounds(c); g.clip(content); int top = -page.getPaintingTop() + page.getStyle().getMarginBorderPadding(c, CalculatedStyle.TOP); int left = page.getStyle().getMarginBorderPadding(c, CalculatedStyle.LEFT); g.translate(left, top); root.paint(c, 0, 0); g.translate(-left, -top); g.setClip(working); page.paintAlternateFlows(c, root, Layer.PAGED_MODE_PRINT, 0); page.paintBorder(c, 0); g.setClip(working); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e887a17fc3203362d3f56c4a2b337639be435104/BasicPanel.java/clean/src/java/org/xhtmlrenderer/swing/BasicPanel.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.