rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
if (currentSide == TOP) thickness = (int)border.top(); if (currentSide == BOTTOM) thickness = (int)border.bottom(); if (currentSide == RIGHT) thickness = (int)border.right(); if (currentSide == LEFT) thickness = (int)border.left();
if (currentSide == TOP) thickness = (int) border.top(); if (currentSide == BOTTOM) thickness = (int) border.bottom(); if (currentSide == RIGHT) thickness = (int) border.right(); if (currentSide == LEFT) thickness = (int) border.left();
private static void paintBorderSide(final BorderPropertySet border, final Graphics g, final Rectangle bounds, final int sides, int currentSide, final IdentValue borderSideStyle, int xOffset) { Graphics2D g2 = (Graphics2D) g; if (borderSideStyle == IdentValue.RIDGE || borderSideStyle == IdentValue.GROOVE) { BorderPropertySet bd2 = new BorderPropertySet( (int)(border.top() / 2), (int)(border.right() / 2), (int)(border.bottom() / 2), (int)(border.left() / 2)); if (borderSideStyle == IdentValue.RIDGE) { paintGoodBevel(g2, bounds, border, border.darker(borderSideStyle), border.brighter(borderSideStyle), sides, currentSide); paintGoodBevel(g2, bounds, bd2, border.brighter(borderSideStyle), border.darker(borderSideStyle), sides, currentSide); } else { paintGoodBevel(g2, bounds, border, border.brighter(borderSideStyle), border.darker(borderSideStyle), sides, currentSide); paintGoodBevel(g2, bounds, bd2, border.darker(borderSideStyle), border.brighter(borderSideStyle), sides, currentSide); } return; } if (borderSideStyle == IdentValue.OUTSET) { paintGoodBevel(g2, bounds, border, border.brighter(borderSideStyle), border.darker(borderSideStyle), sides, currentSide); return; } if (borderSideStyle == IdentValue.INSET) { paintGoodBevel(g2, bounds, border, border.darker(borderSideStyle), border.brighter(borderSideStyle), sides, currentSide); return; } if (borderSideStyle == IdentValue.SOLID) { paintSolid(g2, bounds, border, border, sides, currentSide); return; } if (borderSideStyle == IdentValue.DOUBLE) { // this may need to be modified to account for rounding errors // create a new border only 1/3 the thickness BorderPropertySet outer = new BorderPropertySet( (int)(border.top() / 3), (int)(border.bottom() / 3), (int)(border.left() / 3), (int)(border.right() / 3)); BorderPropertySet center = new BorderPropertySet(outer); BorderPropertySet inner = new BorderPropertySet(outer); if ((int)border.top() == 1) { outer.setTop(1f); center.setTop(0f); } if ((int)border.bottom() == 1) { outer.setBottom(1f); center.setBottom(0f); } if ((int)border.left() == 1) { outer.setLeft(1f); center.setLeft(0f); } if ((int)border.right() == 1) { outer.setRight(1f); center.setRight(0f); } if ((int)border.top() == 2) { outer.setTop(1f); center.setTop(0f); inner.setTop(1f); } if ((int)border.bottom() == 2) { outer.setBottom(1f); center.setBottom(0f); inner.setBottom(1f); } if ((int)border.left() == 2) { outer.setLeft(1f); center.setLeft(0f); inner.setLeft(1f); } if ((int)border.right() == 2) { outer.setRight(1f); center.setRight(0f); inner.setRight(1f); } Rectangle b2 = shrinkRect(bounds, outer, sides); b2 = shrinkRect(b2, center, sides); // draw outer border paintSolid((Graphics2D) g, bounds, outer, border, sides, currentSide); // draw inner border paintSolid((Graphics2D) g, b2, inner, border, sides, currentSide); return; } int thickness = 0; if (currentSide == TOP) thickness = (int)border.top(); if (currentSide == BOTTOM) thickness = (int)border.bottom(); if (currentSide == RIGHT) thickness = (int)border.right(); if (currentSide == LEFT) thickness = (int)border.left(); if (borderSideStyle == IdentValue.DASHED) { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); paintPatternedRect(g2, bounds, border, border, new float[]{8.0f + thickness * 2, 4.0f + thickness}, sides, currentSide, xOffset); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); } if (borderSideStyle == IdentValue.DOTTED) { // turn off anti-aliasing or the dots will be all blurry g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); paintPatternedRect(g2, bounds, border, border, new float[]{thickness, thickness}, sides, currentSide, xOffset); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
g2.setStroke(new BasicStroke((int)border.top(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + (int)(border.top() / 2), x + w - 1, y + (int)(border.top() / 2));
g2.setStroke(new BasicStroke((int) border.top(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + (int) (border.top() / 2), x + w - 1, y + (int) (border.top() / 2));
private static void paintPatternedRect(final Graphics2D g2, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet color, final float[] pattern, final int sides, final int currentSide, int xOffset) { Polygon clip = getBevelledPolygon(bounds, border, sides, currentSide, true); Shape old_clip = g2.getClip(); if (clip != null) g2.clip(clip); Stroke old_stroke = g2.getStroke(); int x = bounds.x; int y = bounds.y; int w = bounds.width; int h = bounds.height; if (currentSide == TOP) { g2.setColor(color.topColor()); g2.setStroke(new BasicStroke((int)border.top(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + (int)(border.top() / 2), x + w - 1, y + (int)(border.top() / 2)); } else if (currentSide == LEFT) { g2.setColor(color.leftColor()); g2.setStroke(new BasicStroke((int)border.left(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + (int)(border.left() / 2), y, x + (int)(border.left() / 2), y + h - 1); } else if (currentSide == RIGHT) { g2.setColor(color.rightColor()); g2.setStroke(new BasicStroke((int)border.right(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + w - (int)(border.right() / 2), y, x + w - (int)(border.right() / 2), y + h); } else if (currentSide == BOTTOM) { g2.setColor(color.bottomColor()); g2.setStroke(new BasicStroke((int)border.bottom(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + h - (int)(border.bottom() / 2), x + w, y + h - (int)(border.bottom() / 2)); } g2.setStroke(old_stroke); g2.setClip(old_clip); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
g2.setStroke(new BasicStroke((int)border.left(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + (int)(border.left() / 2), y, x + (int)(border.left() / 2), y + h - 1);
g2.setStroke(new BasicStroke((int) border.left(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + (int) (border.left() / 2), y, x + (int) (border.left() / 2), y + h - 1);
private static void paintPatternedRect(final Graphics2D g2, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet color, final float[] pattern, final int sides, final int currentSide, int xOffset) { Polygon clip = getBevelledPolygon(bounds, border, sides, currentSide, true); Shape old_clip = g2.getClip(); if (clip != null) g2.clip(clip); Stroke old_stroke = g2.getStroke(); int x = bounds.x; int y = bounds.y; int w = bounds.width; int h = bounds.height; if (currentSide == TOP) { g2.setColor(color.topColor()); g2.setStroke(new BasicStroke((int)border.top(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + (int)(border.top() / 2), x + w - 1, y + (int)(border.top() / 2)); } else if (currentSide == LEFT) { g2.setColor(color.leftColor()); g2.setStroke(new BasicStroke((int)border.left(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + (int)(border.left() / 2), y, x + (int)(border.left() / 2), y + h - 1); } else if (currentSide == RIGHT) { g2.setColor(color.rightColor()); g2.setStroke(new BasicStroke((int)border.right(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + w - (int)(border.right() / 2), y, x + w - (int)(border.right() / 2), y + h); } else if (currentSide == BOTTOM) { g2.setColor(color.bottomColor()); g2.setStroke(new BasicStroke((int)border.bottom(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + h - (int)(border.bottom() / 2), x + w, y + h - (int)(border.bottom() / 2)); } g2.setStroke(old_stroke); g2.setClip(old_clip); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
g2.setStroke(new BasicStroke((int)border.right(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + w - (int)(border.right() / 2), y, x + w - (int)(border.right() / 2), y + h);
g2.setStroke(new BasicStroke((int) border.right(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + w - (int) (border.right() / 2), y, x + w - (int) (border.right() / 2), y + h);
private static void paintPatternedRect(final Graphics2D g2, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet color, final float[] pattern, final int sides, final int currentSide, int xOffset) { Polygon clip = getBevelledPolygon(bounds, border, sides, currentSide, true); Shape old_clip = g2.getClip(); if (clip != null) g2.clip(clip); Stroke old_stroke = g2.getStroke(); int x = bounds.x; int y = bounds.y; int w = bounds.width; int h = bounds.height; if (currentSide == TOP) { g2.setColor(color.topColor()); g2.setStroke(new BasicStroke((int)border.top(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + (int)(border.top() / 2), x + w - 1, y + (int)(border.top() / 2)); } else if (currentSide == LEFT) { g2.setColor(color.leftColor()); g2.setStroke(new BasicStroke((int)border.left(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + (int)(border.left() / 2), y, x + (int)(border.left() / 2), y + h - 1); } else if (currentSide == RIGHT) { g2.setColor(color.rightColor()); g2.setStroke(new BasicStroke((int)border.right(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + w - (int)(border.right() / 2), y, x + w - (int)(border.right() / 2), y + h); } else if (currentSide == BOTTOM) { g2.setColor(color.bottomColor()); g2.setStroke(new BasicStroke((int)border.bottom(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + h - (int)(border.bottom() / 2), x + w, y + h - (int)(border.bottom() / 2)); } g2.setStroke(old_stroke); g2.setClip(old_clip); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
g2.setStroke(new BasicStroke((int)border.bottom(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + h - (int)(border.bottom() / 2), x + w, y + h - (int)(border.bottom() / 2));
g2.setStroke(new BasicStroke((int) border.bottom(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + h - (int) (border.bottom() / 2), x + w, y + h - (int) (border.bottom() / 2));
private static void paintPatternedRect(final Graphics2D g2, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet color, final float[] pattern, final int sides, final int currentSide, int xOffset) { Polygon clip = getBevelledPolygon(bounds, border, sides, currentSide, true); Shape old_clip = g2.getClip(); if (clip != null) g2.clip(clip); Stroke old_stroke = g2.getStroke(); int x = bounds.x; int y = bounds.y; int w = bounds.width; int h = bounds.height; if (currentSide == TOP) { g2.setColor(color.topColor()); g2.setStroke(new BasicStroke((int)border.top(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + (int)(border.top() / 2), x + w - 1, y + (int)(border.top() / 2)); } else if (currentSide == LEFT) { g2.setColor(color.leftColor()); g2.setStroke(new BasicStroke((int)border.left(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + (int)(border.left() / 2), y, x + (int)(border.left() / 2), y + h - 1); } else if (currentSide == RIGHT) { g2.setColor(color.rightColor()); g2.setStroke(new BasicStroke((int)border.right(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0)); g2.drawLine(x + w - (int)(border.right() / 2), y, x + w - (int)(border.right() / 2), y + h); } else if (currentSide == BOTTOM) { g2.setColor(color.bottomColor()); g2.setStroke(new BasicStroke((int)border.bottom(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset)); g2.drawLine(x, y + h - (int)(border.bottom() / 2), x + w, y + h - (int)(border.bottom() / 2)); } g2.setStroke(old_stroke); g2.setClip(old_clip); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
if ((int)border.top() == 1) {
if ((int) border.top() == 1) {
private static void paintSolid(final Graphics2D g2, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet bcolor, final int sides, int currentSide) { //Bug in polygon painting paints an extra pixel to the right and bottom //But clipping works fine! Polygon poly = getBevelledPolygon(bounds, border, sides, currentSide, false); //Shape old_clip = g2.getClip(); //if (poly != null) g2.clip(poly); if (currentSide == TOP) { g2.setColor(bcolor.topColor()); // draw a 1px border with a line instead of a polygon if ((int)border.top() == 1) { g2.drawLine(bounds.x, bounds.y, bounds.x + bounds.width - 1, bounds.y); } else { // use polygons for borders over 1px wide g2.fillPolygon(poly); } } else if (currentSide == BOTTOM) { g2.setColor(bcolor.bottomColor()); if ((int)border.bottom() == 1) { g2.drawLine(bounds.x, bounds.y + bounds.height - 1, bounds.x + bounds.width - 1, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } else if (currentSide == RIGHT) { g2.setColor(bcolor.rightColor()); if ((int)border.right() == 1) { g2.drawLine(bounds.x + bounds.width - 1, bounds.y, bounds.x + bounds.width - 1, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } else if (currentSide == LEFT) { g2.setColor(bcolor.leftColor()); if ((int)border.left() == 1) { g2.drawLine(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
if ((int)border.bottom() == 1) {
if ((int) border.bottom() == 1) {
private static void paintSolid(final Graphics2D g2, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet bcolor, final int sides, int currentSide) { //Bug in polygon painting paints an extra pixel to the right and bottom //But clipping works fine! Polygon poly = getBevelledPolygon(bounds, border, sides, currentSide, false); //Shape old_clip = g2.getClip(); //if (poly != null) g2.clip(poly); if (currentSide == TOP) { g2.setColor(bcolor.topColor()); // draw a 1px border with a line instead of a polygon if ((int)border.top() == 1) { g2.drawLine(bounds.x, bounds.y, bounds.x + bounds.width - 1, bounds.y); } else { // use polygons for borders over 1px wide g2.fillPolygon(poly); } } else if (currentSide == BOTTOM) { g2.setColor(bcolor.bottomColor()); if ((int)border.bottom() == 1) { g2.drawLine(bounds.x, bounds.y + bounds.height - 1, bounds.x + bounds.width - 1, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } else if (currentSide == RIGHT) { g2.setColor(bcolor.rightColor()); if ((int)border.right() == 1) { g2.drawLine(bounds.x + bounds.width - 1, bounds.y, bounds.x + bounds.width - 1, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } else if (currentSide == LEFT) { g2.setColor(bcolor.leftColor()); if ((int)border.left() == 1) { g2.drawLine(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
if ((int)border.right() == 1) {
if ((int) border.right() == 1) {
private static void paintSolid(final Graphics2D g2, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet bcolor, final int sides, int currentSide) { //Bug in polygon painting paints an extra pixel to the right and bottom //But clipping works fine! Polygon poly = getBevelledPolygon(bounds, border, sides, currentSide, false); //Shape old_clip = g2.getClip(); //if (poly != null) g2.clip(poly); if (currentSide == TOP) { g2.setColor(bcolor.topColor()); // draw a 1px border with a line instead of a polygon if ((int)border.top() == 1) { g2.drawLine(bounds.x, bounds.y, bounds.x + bounds.width - 1, bounds.y); } else { // use polygons for borders over 1px wide g2.fillPolygon(poly); } } else if (currentSide == BOTTOM) { g2.setColor(bcolor.bottomColor()); if ((int)border.bottom() == 1) { g2.drawLine(bounds.x, bounds.y + bounds.height - 1, bounds.x + bounds.width - 1, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } else if (currentSide == RIGHT) { g2.setColor(bcolor.rightColor()); if ((int)border.right() == 1) { g2.drawLine(bounds.x + bounds.width - 1, bounds.y, bounds.x + bounds.width - 1, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } else if (currentSide == LEFT) { g2.setColor(bcolor.leftColor()); if ((int)border.left() == 1) { g2.drawLine(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
if ((int)border.left() == 1) {
if ((int) border.left() == 1) {
private static void paintSolid(final Graphics2D g2, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet bcolor, final int sides, int currentSide) { //Bug in polygon painting paints an extra pixel to the right and bottom //But clipping works fine! Polygon poly = getBevelledPolygon(bounds, border, sides, currentSide, false); //Shape old_clip = g2.getClip(); //if (poly != null) g2.clip(poly); if (currentSide == TOP) { g2.setColor(bcolor.topColor()); // draw a 1px border with a line instead of a polygon if ((int)border.top() == 1) { g2.drawLine(bounds.x, bounds.y, bounds.x + bounds.width - 1, bounds.y); } else { // use polygons for borders over 1px wide g2.fillPolygon(poly); } } else if (currentSide == BOTTOM) { g2.setColor(bcolor.bottomColor()); if ((int)border.bottom() == 1) { g2.drawLine(bounds.x, bounds.y + bounds.height - 1, bounds.x + bounds.width - 1, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } else if (currentSide == RIGHT) { g2.setColor(bcolor.rightColor()); if ((int)border.right() == 1) { g2.drawLine(bounds.x + bounds.width - 1, bounds.y, bounds.x + bounds.width - 1, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } else if (currentSide == LEFT) { g2.setColor(bcolor.leftColor()); if ((int)border.left() == 1) { g2.drawLine(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height - 1); } else { g2.fillPolygon(poly); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
r2.x = rect.x + ((sides & LEFT) == 0 ? 0 : (int)border.left()); r2.width = rect.width - ((sides & LEFT) == 0 ? 0 : (int)border.left()) - ((sides & RIGHT) == 0 ? 0 : (int)border.right()); r2.y = rect.y + ((sides & TOP) == 0 ? 0 : (int)border.top()); r2.height = rect.height - ((sides & TOP) == 0 ? 0 : (int)border.top()) - ((sides & BOTTOM) == 0 ? 0 : (int)border.bottom());
r2.x = rect.x + ((sides & LEFT) == 0 ? 0 : (int) border.left()); r2.width = rect.width - ((sides & LEFT) == 0 ? 0 : (int) border.left()) - ((sides & RIGHT) == 0 ? 0 : (int) border.right()); r2.y = rect.y + ((sides & TOP) == 0 ? 0 : (int) border.top()); r2.height = rect.height - ((sides & TOP) == 0 ? 0 : (int) border.top()) - ((sides & BOTTOM) == 0 ? 0 : (int) border.bottom());
public static Rectangle shrinkRect(final Rectangle rect, final BorderPropertySet border, int sides) { Rectangle r2 = new Rectangle(); r2.x = rect.x + ((sides & LEFT) == 0 ? 0 : (int)border.left()); r2.width = rect.width - ((sides & LEFT) == 0 ? 0 : (int)border.left()) - ((sides & RIGHT) == 0 ? 0 : (int)border.right()); r2.y = rect.y + ((sides & TOP) == 0 ? 0 : (int)border.top()); r2.height = rect.height - ((sides & TOP) == 0 ? 0 : (int)border.top()) - ((sides & BOTTOM) == 0 ? 0 : (int)border.bottom()); return r2; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1ca686f10a0033c5e79968a5d664589db0fef2ec/BorderPainter.java/buggy/src/java/org/xhtmlrenderer/render/BorderPainter.java
doc.add(LuceneFields.getKeyword( LuceneFields.COMPANY_ID, companyId)); doc.add(LuceneFields.getKeyword( LuceneFields.PORTLET_ID, PORTLET_ID));
doc.add( LuceneFields.getKeyword(LuceneFields.COMPANY_ID, companyId)); doc.add( LuceneFields.getKeyword(LuceneFields.PORTLET_ID, PORTLET_ID));
public static void addMessage( String companyId, String groupId, String categoryId, String topicId, String threadId, String messageId, String title, String content) throws IOException { synchronized (IndexWriter.class) { content = Html.stripHtml(content); IndexWriter writer = LuceneUtil.getWriter(companyId); Document doc = new Document(); doc.add( LuceneFields.getKeyword( LuceneFields.UID, LuceneFields.getUID(PORTLET_ID, topicId, messageId))); doc.add(LuceneFields.getKeyword( LuceneFields.COMPANY_ID, companyId)); doc.add(LuceneFields.getKeyword( LuceneFields.PORTLET_ID, PORTLET_ID)); doc.add(LuceneFields.getKeyword(LuceneFields.GROUP_ID, groupId)); doc.add(new Field(LuceneFields.TITLE, title, Field.Store.YES, Field.Index.TOKENIZED)); doc.add(new Field(LuceneFields.CONTENT, content, Field.Store.YES, Field.Index.TOKENIZED)); doc.add(LuceneFields.getDate(LuceneFields.MODIFIED)); doc.add(LuceneFields.getKeyword("categoryId", categoryId)); doc.add(LuceneFields.getKeyword("topicId", topicId)); doc.add(LuceneFields.getKeyword("threadId", threadId)); doc.add(LuceneFields.getKeyword("messageId", messageId)); writer.addDocument(doc); LuceneUtil.write(writer); } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/fa825e278fff56c5878f6bf4ebfe8e8c47fa5e6f/Indexer.java/buggy/portal-ejb/src/com/liferay/portlet/messageboards/util/Indexer.java
doc.add(new Field(LuceneFields.TITLE, title, Field.Store.YES, Field.Index.TOKENIZED)); doc.add(new Field(LuceneFields.CONTENT, content, Field.Store.YES, Field.Index.TOKENIZED));
doc.add(LuceneFields.getText(LuceneFields.TITLE, title)); doc.add(LuceneFields.getText(LuceneFields.CONTENT, content));
public static void addMessage( String companyId, String groupId, String categoryId, String topicId, String threadId, String messageId, String title, String content) throws IOException { synchronized (IndexWriter.class) { content = Html.stripHtml(content); IndexWriter writer = LuceneUtil.getWriter(companyId); Document doc = new Document(); doc.add( LuceneFields.getKeyword( LuceneFields.UID, LuceneFields.getUID(PORTLET_ID, topicId, messageId))); doc.add(LuceneFields.getKeyword( LuceneFields.COMPANY_ID, companyId)); doc.add(LuceneFields.getKeyword( LuceneFields.PORTLET_ID, PORTLET_ID)); doc.add(LuceneFields.getKeyword(LuceneFields.GROUP_ID, groupId)); doc.add(new Field(LuceneFields.TITLE, title, Field.Store.YES, Field.Index.TOKENIZED)); doc.add(new Field(LuceneFields.CONTENT, content, Field.Store.YES, Field.Index.TOKENIZED)); doc.add(LuceneFields.getDate(LuceneFields.MODIFIED)); doc.add(LuceneFields.getKeyword("categoryId", categoryId)); doc.add(LuceneFields.getKeyword("topicId", topicId)); doc.add(LuceneFields.getKeyword("threadId", threadId)); doc.add(LuceneFields.getKeyword("messageId", messageId)); writer.addDocument(doc); LuceneUtil.write(writer); } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/fa825e278fff56c5878f6bf4ebfe8e8c47fa5e6f/Indexer.java/buggy/portal-ejb/src/com/liferay/portlet/messageboards/util/Indexer.java
QueryParser queryParser = new QueryParser(LuceneFields.CONTENT, LuceneUtil.getAnalyzer()); Query query = queryParser.parse(booleanQuery.toString()); Hits hits = searcher.search(query);
Hits hits = searcher.search(booleanQuery);
public static void deleteMessages( String companyId, String topicId) throws IOException, ParseException { synchronized (IndexWriter.class) { BooleanQuery booleanQuery = new BooleanQuery(); LuceneUtil.addRequiredTerm( booleanQuery, LuceneFields.PORTLET_ID, PORTLET_ID); LuceneUtil.addRequiredTerm(booleanQuery, "topicId", topicId); Searcher searcher = LuceneUtil.getSearcher(companyId); QueryParser queryParser = new QueryParser(LuceneFields.CONTENT, LuceneUtil.getAnalyzer()); Query query = queryParser.parse(booleanQuery.toString()); Hits hits = searcher.search(query); if (hits.length() > 0) { IndexReader reader = LuceneUtil.getReader(companyId); for (int i = 0; i < hits.length(); i++) { Document doc = hits.doc(i); Field field = doc.getField(LuceneFields.UID); reader.deleteDocuments( new Term(LuceneFields.UID, field.stringValue())); } reader.close(); } } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/fa825e278fff56c5878f6bf4ebfe8e8c47fa5e6f/Indexer.java/buggy/portal-ejb/src/com/liferay/portlet/messageboards/util/Indexer.java
public DocumentSummary getDocumentSummary( Document doc, PortletURL portletURL) { // Title String title = doc.get(LuceneFields.TITLE); // Content String content = doc.get(LuceneFields.CONTENT); content = StringUtil.shorten(content, 200); // URL String messageId = doc.get("messageId"); String topicId = doc.get("topicId"); portletURL.setParameter("struts_action", "/message_boards/view_message"); portletURL.setParameter("messageId", messageId); portletURL.setParameter("topicId", topicId); return new DocumentSummary(title, content, portletURL); }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/fa825e278fff56c5878f6bf4ebfe8e8c47fa5e6f/Indexer.java/buggy/portal-ejb/src/com/liferay/portlet/messageboards/util/Indexer.java
Dimension minDimension = backButton.getPreferredSize(); minDimension.width = Sizes.dialogUnitXAsPixel(12, backButton); backButton.setPreferredSize(minDimension); forwardButton.setPreferredSize(minDimension); upButton.setPreferredSize(minDimension);
backButton.setBorder(new EmptyBorder(2,2,2,2)); forwardButton.setBorder(new EmptyBorder(2,2,2,2)); upButton.setBorder(new EmptyBorder(2,2,2,2));
private void initComponents() { backButton = new JButton(Icons.ARROW_LEFT); backButton.setDisabledIcon(Icons.ARROW_LEFT_GRAY); forwardButton = new JButton(Icons.ARROW_RIGHT); forwardButton.setDisabledIcon(Icons.ARROW_RIGHT_GRAY); upButton = new JButton(Icons.ARROW_UP); upButton.setDisabledIcon(Icons.ARROW_UP_GRAY); backButton.setEnabled(false); forwardButton.setEnabled(false); upButton.setEnabled(false); // no fancy background in this button backButton.setOpaque(false); forwardButton.setOpaque(false); upButton.setOpaque(false); // Set minimum size at at least one button Dimension minDimension = backButton.getPreferredSize(); minDimension.width = Sizes.dialogUnitXAsPixel(12, backButton); backButton.setPreferredSize(minDimension); forwardButton.setPreferredSize(minDimension); upButton.setPreferredSize(minDimension); // listen for button clicks ButtonListener buttonListener = new ButtonListener(); backButton.addActionListener(buttonListener); forwardButton.addActionListener(buttonListener); upButton.addActionListener(buttonListener); // to draw the raised border MouseListener mouseListener = new ButtonMouseListener(); backButton.addMouseListener(mouseListener); forwardButton.addMouseListener(mouseListener); upButton.addMouseListener(mouseListener); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/3a0d91d46c92a08762036c1906878098b57d63ae/NavigationToolBar.java/clean/src/main/de/dal33t/powerfolder/ui/navigation/NavigationToolBar.java
button.setBorder(null);
button.setBorder(new EmptyBorder(2,2,2,2));
private void lowerButton(JButton button) { button.setBorder(null); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/3a0d91d46c92a08762036c1906878098b57d63ae/NavigationToolBar.java/clean/src/main/de/dal33t/powerfolder/ui/navigation/NavigationToolBar.java
openLink(filename);
openLink("file:
private void openErrorLogBrowser() { String filename = Platform.getLogFileLocation().toOSString(); File log = new File(filename); if (log.exists()) { openLink(filename); return; } MessageDialog.openInformation(getShell(), WorkbenchMessages.AboutSystemDialog_noLogTitle, NLS.bind(WorkbenchMessages.AboutSystemDialog_noLogMessage, filename )); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/448e052e2c67e7750ae9434c2747fc50268900fe/AboutSystemDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutSystemDialog.java
return RubyFixnum.newFixnum(recv.getRuntime(), 0);
return recv.getRuntime().newFixnum(0);
public static IRubyObject chdir(IRubyObject recv, RubyString path) { File dir = getDir(recv.getRuntime(), path.toString()); String realPath = null; // We get canonical path to try and flatten the path out. // a dir '/subdir/..' should return as '/' try { realPath = dir.getCanonicalPath(); } catch (IOException e) { realPath = dir.getAbsolutePath(); } System.setProperty("user.dir", realPath); return RubyFixnum.newFixnum(recv.getRuntime(), 0); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
getRuntime().yield(RubyString.newString(getRuntime(), contents[i]));
getRuntime().yield(getRuntime().newString(contents[i]));
public IRubyObject each() { String[] contents = snapshot; for (int i=0; i<contents.length; i++) { getRuntime().yield(RubyString.newString(getRuntime(), contents[i])); } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
return RubyArray.newArray(getRuntime(), JavaUtil.convertJavaArrayToRuby(getRuntime(), snapshot));
return getRuntime().newArray(JavaUtil.convertJavaArrayToRuby(getRuntime(), snapshot));
public RubyArray entries() { return RubyArray.newArray(getRuntime(), JavaUtil.convertJavaArrayToRuby(getRuntime(), snapshot)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
return new RubyString(recv.getRuntime(), System.getProperty("user.dir"));
return recv.getRuntime().newString(System.getProperty("user.dir"));
public static RubyString getwd(IRubyObject recv) { return new RubyString(recv.getRuntime(), System.getProperty("user.dir")); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
return RubyArray.newArray(recv.getRuntime(), JavaUtil.convertJavaArrayToRuby(recv.getRuntime(), files));
return recv.getRuntime().newArray(JavaUtil.convertJavaArrayToRuby(recv.getRuntime(), files));
public static RubyArray glob(IRubyObject recv, RubyString pat) { String pattern = pat.toString(); String[] files = new Glob(pattern).getNames(); return RubyArray.newArray(recv.getRuntime(), JavaUtil.convertJavaArrayToRuby(recv.getRuntime(), files)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
throw new ArgumentError(recv.getRuntime(), args.length, 1);
throw recv.getRuntime().newArgumentError(args.length, 1);
public static IRubyObject mkdir(IRubyObject recv, IRubyObject[] args) { if (args.length < 1) { throw new ArgumentError(recv.getRuntime(), args.length, 1); } if (args.length > 2) { throw new ArgumentError(recv.getRuntime(), args.length, 2); } args[0].checkSafeString(); String path = args[0].toString(); File newDir = new File(path); if (newDir.exists()) { throw new IOError(recv.getRuntime(), path + " already exists"); } return newDir.mkdir() ? RubyFixnum.zero(recv.getRuntime()) : RubyFixnum.one(recv.getRuntime()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
throw new ArgumentError(recv.getRuntime(), args.length, 2);
throw recv.getRuntime().newArgumentError(args.length, 2);
public static IRubyObject mkdir(IRubyObject recv, IRubyObject[] args) { if (args.length < 1) { throw new ArgumentError(recv.getRuntime(), args.length, 1); } if (args.length > 2) { throw new ArgumentError(recv.getRuntime(), args.length, 2); } args[0].checkSafeString(); String path = args[0].toString(); File newDir = new File(path); if (newDir.exists()) { throw new IOError(recv.getRuntime(), path + " already exists"); } return newDir.mkdir() ? RubyFixnum.zero(recv.getRuntime()) : RubyFixnum.one(recv.getRuntime()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
return RubyString.nilString(runtime);
return RubyString.nilString(getRuntime());
public RubyString read() { if (!isOpen) { throw new IOError(getRuntime(), "Directory already closed"); } if (pos >= snapshot.length) { return RubyString.nilString(runtime); } RubyString result = new RubyString(getRuntime(), snapshot[pos]); pos++; return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
return RubyFixnum.newFixnum(getRuntime(), pos);
return getRuntime().newFixnum(pos);
public IRubyObject rewind() { pos = 0; return RubyFixnum.newFixnum(getRuntime(), pos); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
return RubyFixnum.newFixnum(recv.getRuntime(), 0);
return recv.getRuntime().newFixnum(0);
public static IRubyObject rmdir(IRubyObject recv, RubyString path) { File directory = new File(path.toString()); if (!directory.delete()) { throw new SystemCallError(recv.getRuntime(), "No such directory"); } return RubyFixnum.newFixnum(recv.getRuntime(), 0); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
return RubyFixnum.newFixnum(getRuntime(), pos);
return getRuntime().newFixnum(pos);
public RubyInteger tell() { return RubyFixnum.newFixnum(getRuntime(), pos); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyDir.java/buggy/src/org/jruby/RubyDir.java
box.absolute = true;
box.setAbsolute(true);
public static void setupAbsolute( Context c, Box box ) { String position = getPosition( c, box ); if ( position.equals( "absolute" ) ) { if ( c.css.hasProperty( box.node, "right", false ) ) { //u.p("prop = " + c.css.getProperty(box.getRealElement(),"right",false)); if(hasIdent(c,box.getRealElement(),"right",false)) { if(c.css.getStringProperty(box.node,"right",false).equals("auto")) { box.right_set = false; //u.p("right set to auto"); } } else { box.right = (int)c.css.getFloatProperty( box.node, "right", 0, false ); box.right_set = true; //u.p("right set to : " + box.right); } } if ( c.css.hasProperty( box.node, "left", false ) ) { //u.p("prop = " + c.css.getProperty(box.getRealElement(),"left",false)); if(hasIdent(c,box.getRealElement(),"left",false)) { if(c.css.getStringProperty(box.node,"left",false).equals("auto")) { box.left_set = false; //u.p("left set to auto"); } } else { box.left = (int)c.css.getFloatProperty( box.node, "left", 0, false ); box.left_set = true; //u.p("left set to : " + box.left); } } /* if ( c.css.hasProperty( box.node, "left", false ) ) { box.left = (int)c.css.getFloatProperty( box.node, "left", 0, false ); box.left_set = true; } */ if ( c.css.hasProperty( box.node, "bottom", false ) ) { box.top = -(int)c.css.getFloatProperty( box.node, "bottom", 0, false ); } if ( c.css.hasProperty( box.node, "top", false ) ) { box.top = (int)c.css.getFloatProperty( box.node, "top", 0, false ); } box.absolute = true; // if right and left are set calculate width if(box.right_set && box.left_set) { box.width = box.width - box.right - box.left; } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/ed51047386cdc7bfa8a77f3a7af2efcb2f70f4bc/BoxLayout.java/buggy/src/java/org/xhtmlrenderer/layout/BoxLayout.java
return false;
return false;
public boolean equals(Object obj) { if (!(obj instanceof ImageDataImageDescriptor)) return false; ImageDataImageDescriptor imgWrap = (ImageDataImageDescriptor) obj; return data.equals(imgWrap.data) && (imgWrap.originalImage == originalImage); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/5f873f39017e13c8ffec0fdc534a9976dfe4c220/ImageDataImageDescriptor.java/buggy/bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ImageDataImageDescriptor.java
return data.equals(imgWrap.data) && (imgWrap.originalImage == originalImage);
if (originalImage != null) { return imgWrap.originalImage == originalImage; } return (imgWrap.originalImage == null && data.equals(imgWrap.data));
public boolean equals(Object obj) { if (!(obj instanceof ImageDataImageDescriptor)) return false; ImageDataImageDescriptor imgWrap = (ImageDataImageDescriptor) obj; return data.equals(imgWrap.data) && (imgWrap.originalImage == originalImage); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/5f873f39017e13c8ffec0fdc534a9976dfe4c220/ImageDataImageDescriptor.java/buggy/bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ImageDataImageDescriptor.java
log().verbose("Acceptor finished to " + socket + ", took " + took + "ms");
log().verbose( "Acceptor finished to " + socket + ", took " + took + "ms");
public void run() { try { startTime = new Date(); log().debug( "Accepting connection from: " + socket.getInetAddress() + ":" + socket.getPort()); acceptNode(socket); } catch (ConnectionException e) { log().verbose("Unable to connect to " + socket, e); shutdown(); } finally { // Remove from acceptors list acceptors.remove(this); } long took = System.currentTimeMillis() - startTime.getTime(); if (logVerbose) { log().verbose("Acceptor finished to " + socket + ", took " + took + "ms"); } }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/811a5ad28ec2bb10feb25d6330b500d438c08423/NodeManager.java/clean/src/main/de/dal33t/powerfolder/net/NodeManager.java
|| node.isUnableToConnect() || node.getReconnectAddress() == null)
|| node.isUnableToConnect() || node.getReconnectAddress() == null || node.getReconnectAddress().getAddress() == null)
public boolean markNodeForImmediateReconnection(Member node) { if (node.isConnected() || node.isReconnecting() || node.isMySelf() || node.isUnableToConnect() || node.getReconnectAddress() == null) { // Not reconnect nesseary return false; } if (getController().isLanOnly() && !NetworkUtil.isOnLanOrLoopback(node.getReconnectAddress() .getAddress())) { // no strangers in lan only mode return false; } // TODO: This code is also in buildReconnectionQueue // Offline limit time, all nodes before this time are not getting // reconnected Date offlineLimitTime = new Date(System.currentTimeMillis() - Constants.MAX_NODE_OFFLINE_TIME); // Check if node was offline too long Date lastConnectTime = node.getLastNetworkConnectTime(); boolean offlineTooLong = true; offlineTooLong = lastConnectTime != null ? lastConnectTime .before(offlineLimitTime) : true; if (offlineTooLong) { return false; } if (logVerbose) { log().verbose("Marking node for immediate reconnect: " + node); } synchronized (reconnectionQueue) { // Remove node reconnectionQueue.remove(node); // Add at start reconnectionQueue.add(0, node); } return true; }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/811a5ad28ec2bb10feb25d6330b500d438c08423/NodeManager.java/clean/src/main/de/dal33t/powerfolder/net/NodeManager.java
BoxRendering.paint(c, inline);
BoxRendering.paint(c, inline, false);
static void paintAbsolute(Context c, Box inline) { // Uu.p("paint absolute: " + inline); //c.translate(line.x, line.y + (line.baseline - inline.height)); /*Renderer rend = c.getRenderer(inline.content.getElement()); rend.paint(c, inline);*/ BoxRendering.paint(c, inline); //c.translate(-line.x, -(line.y + (line.baseline - inline.height))); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
BoxRendering.paint(c, inline);
BoxRendering.paint(c, inline, false);
static void paintFloat(Context c, InlineBox inline) { // Uu.p("painting a float: " + inline); Rectangle oe = c.getExtents(); c.setExtents(new Rectangle(oe.x, 0, oe.width, oe.height)); //int xoff = line.Xx + inline.Xx; int xoff = 0; int yoff = 0;//line.y + ( line.baseline - inline.height );// + inline.y; // Uu.p("translating by: " + xoff + " " + yoff); c.translate(xoff, yoff); /*Renderer rend = c.getRenderer(inline.content.getElement()); rend.paint(c, inline);//.sub_block ); */ BoxRendering.paint(c, inline); c.translate(-xoff, -yoff); c.setExtents(oe); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line) {
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics) {
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line) { if (ib.floated) { paintFloat(c, ib); debugInlines(c, ib, lx, ly); return; } // Uu.p("paintInline: " + inline); if (ib instanceof InlineBlockBox) { paintReplaced(c, ib, line); debugInlines(c, ib, lx, ly); return; } InlineTextBox inline = (InlineTextBox) ib; if (inline.pushstyles != null) { for (Iterator i = inline.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement())); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.pushStyle(hs); }*/ //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, inline); } } c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly + inline.y; int ix = lx + inline.x; // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); //ix += inline.totalLeftPadding(c.getCurrentStyle()); paintSelection(c, inline, lx, ly); paintText(c, lx, ly, ix, iy, inline); debugInlines(c, inline, lx, ly); if (inline.popstyles != null) { for (Iterator i = inline.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.popStyle(); } */ c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
if (ib.floated) { paintFloat(c, ib); debugInlines(c, ib, lx, ly); return; } if (ib instanceof InlineBlockBox) { paintReplaced(c, ib, line); debugInlines(c, ib, lx, ly); return; } InlineTextBox inline = (InlineTextBox) ib; if (inline.pushstyles != null) { for (Iterator i = inline.pushstyles.iterator(); i.hasNext();) {
if (ib.pushstyles != null) { for (Iterator i = ib.pushstyles.iterator(); i.hasNext();) {
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line) { if (ib.floated) { paintFloat(c, ib); debugInlines(c, ib, lx, ly); return; } // Uu.p("paintInline: " + inline); if (ib instanceof InlineBlockBox) { paintReplaced(c, ib, line); debugInlines(c, ib, lx, ly); return; } InlineTextBox inline = (InlineTextBox) ib; if (inline.pushstyles != null) { for (Iterator i = inline.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement())); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.pushStyle(hs); }*/ //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, inline); } } c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly + inline.y; int ix = lx + inline.x; // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); //ix += inline.totalLeftPadding(c.getCurrentStyle()); paintSelection(c, inline, lx, ly); paintText(c, lx, ly, ix, iy, inline); debugInlines(c, inline, lx, ly); if (inline.popstyles != null) { for (Iterator i = inline.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.popStyle(); } */ c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
paintPadding(c, line, inline);
paintPadding(c, line, ib);
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line) { if (ib.floated) { paintFloat(c, ib); debugInlines(c, ib, lx, ly); return; } // Uu.p("paintInline: " + inline); if (ib instanceof InlineBlockBox) { paintReplaced(c, ib, line); debugInlines(c, ib, lx, ly); return; } InlineTextBox inline = (InlineTextBox) ib; if (inline.pushstyles != null) { for (Iterator i = inline.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement())); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.pushStyle(hs); }*/ //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, inline); } } c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly + inline.y; int ix = lx + inline.x; // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); //ix += inline.totalLeftPadding(c.getCurrentStyle()); paintSelection(c, inline, lx, ly); paintText(c, lx, ly, ix, iy, inline); debugInlines(c, inline, lx, ly); if (inline.popstyles != null) { for (Iterator i = inline.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.popStyle(); } */ c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
c.updateSelection(inline); int iy = ly + inline.y; int ix = lx + inline.x;
if (ib.floated) { paintFloat(c, ib); debugInlines(c, ib, lx, ly); } else if (ib instanceof InlineBlockBox) { c.pushStyle(c.getCss().getCascadedStyle(ib.element)); c.translate(line.x, line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height)); BoxRendering.paint(c, ib, true); c.translate(-line.x, -(line.y + (line.getBaseline() - VerticalAlign.getBaselineOffset(c, line, ib, blockLineHeight, blockLineMetrics) - ib.height))); debugInlines(c, ib, lx, ly); c.popStyle(); } else {
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line) { if (ib.floated) { paintFloat(c, ib); debugInlines(c, ib, lx, ly); return; } // Uu.p("paintInline: " + inline); if (ib instanceof InlineBlockBox) { paintReplaced(c, ib, line); debugInlines(c, ib, lx, ly); return; } InlineTextBox inline = (InlineTextBox) ib; if (inline.pushstyles != null) { for (Iterator i = inline.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement())); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.pushStyle(hs); }*/ //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, inline); } } c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly + inline.y; int ix = lx + inline.x; // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); //ix += inline.totalLeftPadding(c.getCurrentStyle()); paintSelection(c, inline, lx, ly); paintText(c, lx, ly, ix, iy, inline); debugInlines(c, inline, lx, ly); if (inline.popstyles != null) { for (Iterator i = inline.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.popStyle(); } */ c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
paintSelection(c, inline, lx, ly); paintText(c, lx, ly, ix, iy, inline); debugInlines(c, inline, lx, ly);
InlineTextBox inline = (InlineTextBox) ib;
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line) { if (ib.floated) { paintFloat(c, ib); debugInlines(c, ib, lx, ly); return; } // Uu.p("paintInline: " + inline); if (ib instanceof InlineBlockBox) { paintReplaced(c, ib, line); debugInlines(c, ib, lx, ly); return; } InlineTextBox inline = (InlineTextBox) ib; if (inline.pushstyles != null) { for (Iterator i = inline.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement())); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.pushStyle(hs); }*/ //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, inline); } } c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly + inline.y; int ix = lx + inline.x; // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); //ix += inline.totalLeftPadding(c.getCurrentStyle()); paintSelection(c, inline, lx, ly); paintText(c, lx, ly, ix, iy, inline); debugInlines(c, inline, lx, ly); if (inline.popstyles != null) { for (Iterator i = inline.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.popStyle(); } */ c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
if (inline.popstyles != null) { for (Iterator i = inline.popstyles.iterator(); i.hasNext();) {
c.updateSelection(inline); int iy = ly - VerticalAlign.getBaselineOffset(c, line, inline, blockLineHeight, blockLineMetrics); int ix = lx + inline.x; paintSelection(c, inline, lx, ly); paintText(c, lx, ly, ix, iy, inline); debugInlines(c, inline, lx, ly); } if (ib.popstyles != null) { for (Iterator i = ib.popstyles.iterator(); i.hasNext();) {
static void paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line) { if (ib.floated) { paintFloat(c, ib); debugInlines(c, ib, lx, ly); return; } // Uu.p("paintInline: " + inline); if (ib instanceof InlineBlockBox) { paintReplaced(c, ib, line); debugInlines(c, ib, lx, ly); return; } InlineTextBox inline = (InlineTextBox) ib; if (inline.pushstyles != null) { for (Iterator i = inline.pushstyles.iterator(); i.hasNext();) { StylePush sp = (StylePush) i.next(); c.pushStyle(c.getCss().getCascadedStyle(sp.getElement())); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.pushStyle(hs); }*/ //Now we know that an inline element started here, handle borders and such? Relative.translateRelative(c); //TODO: push to current border-list (and paint left edge) //HACK: this might do for now - tobe 2004-12-27 paintPadding(c, line, inline); } } c.updateSelection(inline); // calculate the Xx and y relative to the baseline of the line (ly) and the // left edge of the line (lx) int iy = ly + inline.y; int ix = lx + inline.x; // account for padding // Uu.p("adjusted inline by: " + inline.totalLeftPadding()); // Uu.p("inline = " + inline); // Uu.p("padding = " + inline.padding); //ix += inline.totalLeftPadding(c.getCurrentStyle()); paintSelection(c, inline, lx, ly); paintText(c, lx, ly, ix, iy, inline); debugInlines(c, inline, lx, ly); if (inline.popstyles != null) { for (Iterator i = inline.popstyles.iterator(); i.hasNext();) { StylePop sp = (StylePop) i.next(); //TODO: paint right edge and pop current border-list Relative.untranslateRelative(c); /*if (inline.hover) { CascadedStyle hs = c.getCss().getPseudoElementStyle(sp.getElement(), "hover"); if (hs != null) c.popStyle(); } */ c.popStyle(); } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
if (box instanceof BlockBox) {
if (box instanceof BlockBox) {
static void paintInlineContext(Context c, Box box) { //BlockBox block = (BlockBox)box; // translate into local coords // account for the origin of the containing box c.translate(box.x, box.y); // for each line box BlockBox block = null; if (box instanceof BlockBox) {//Why isn't it always a BlockBox? block = (BlockBox) box; } for (int i = 0; i < box.getChildCount(); i++) { if (i == 0 && block != null && block.firstLineStyle != null) c.pushStyle(block.firstLineStyle); // get the line box paintLine(c, (LineBox) box.getChild(i)); if (i == 0 && block != null && block.firstLineStyle != null) c.popStyle(); } // translate back to parent coords c.translate(-box.x, -box.y); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
paintLine(c, (LineBox) box.getChild(i));
paintLine(c, (LineBox) box.getChild(i), blockLineHeight, blockLineMetrics);
static void paintInlineContext(Context c, Box box) { //BlockBox block = (BlockBox)box; // translate into local coords // account for the origin of the containing box c.translate(box.x, box.y); // for each line box BlockBox block = null; if (box instanceof BlockBox) {//Why isn't it always a BlockBox? block = (BlockBox) box; } for (int i = 0; i < box.getChildCount(); i++) { if (i == 0 && block != null && block.firstLineStyle != null) c.pushStyle(block.firstLineStyle); // get the line box paintLine(c, (LineBox) box.getChild(i)); if (i == 0 && block != null && block.firstLineStyle != null) c.popStyle(); } // translate back to parent coords c.translate(-box.x, -box.y); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
static void paintLine(Context c, LineBox line) {
static void paintLine(Context c, LineBox line, int blockLineHeight, LineMetrics blockLineMetrics) {
static void paintLine(Context c, LineBox line) { // get Xx and y int lx = line.x; int ly = line.y + line.baseline; // for each inline box for (int j = 0; j < line.getChildCount(); j++) { Box child = line.getChild(j); if (child.absolute) { paintAbsolute(c, child); //debugInlines(c, child, lx, ly); continue; } InlineBox box = (InlineBox) child; paintInline(c, box, lx, ly, line); } if (c.debugDrawLineBoxes()) { GraphicsUtil.drawBox(c.getGraphics(), line, Color.blue); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
int ly = line.y + line.baseline;
int ly = line.y + line.getBaseline();
static void paintLine(Context c, LineBox line) { // get Xx and y int lx = line.x; int ly = line.y + line.baseline; // for each inline box for (int j = 0; j < line.getChildCount(); j++) { Box child = line.getChild(j); if (child.absolute) { paintAbsolute(c, child); //debugInlines(c, child, lx, ly); continue; } InlineBox box = (InlineBox) child; paintInline(c, box, lx, ly, line); } if (c.debugDrawLineBoxes()) { GraphicsUtil.drawBox(c.getGraphics(), line, Color.blue); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
paintInline(c, box, lx, ly, line);
paintInline(c, box, lx, ly, line, blockLineHeight, blockLineMetrics);
static void paintLine(Context c, LineBox line) { // get Xx and y int lx = line.x; int ly = line.y + line.baseline; // for each inline box for (int j = 0; j < line.getChildCount(); j++) { Box child = line.getChild(j); if (child.absolute) { paintAbsolute(c, child); //debugInlines(c, child, lx, ly); continue; } InlineBox box = (InlineBox) child; paintInline(c, box, lx, ly, line); } if (c.debugDrawLineBoxes()) { GraphicsUtil.drawBox(c.getGraphics(), line, Color.blue); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
int ty = line.baseline - inline.y - inline.height - padding_yoff + line.y;
int ty = line.getBaseline() - inline.y - inline.height - padding_yoff + line.y;
public static void paintPadding(Context c, LineBox line, InlineBox inline) { //Uu.p("painting border: " + inline.border); // paint the background int padding_xoff = 0; int padding_yoff = inline.totalTopPadding(c.getCurrentStyle()); int ty = line.baseline - inline.y - inline.height - padding_yoff + line.y; LineMetrics lm = FontUtil.getLineMetrics(c, inline); ty += (int) lm.getDescent(); c.translate(-padding_xoff, ty); int old_width = inline.width; int old_height = inline.height; inline.height += inline.totalVerticalPadding(c.getCurrentStyle()); BoxRendering.paintBackground(c, inline); Border margin = c.getCurrentStyle().getMarginWidth(); Rectangle bounds = new Rectangle(inline.x + margin.left, inline.y + margin.top, inline.width - margin.left - margin.right, inline.height - margin.top - margin.bottom); BorderPainter.paint(c, bounds, BorderPainter.ALL); inline.width = old_width; inline.height = old_height; c.translate(+padding_xoff, -ty); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
iy -= (int) lm.getDescent();
public static void paintText(Context c, int lx, int ly, int ix, int iy, InlineTextBox inline) { String text = inline.getSubstring(); Graphics g = c.getGraphics(); //adjust font for current settings Font oldfont = c.getGraphics().getFont(); c.getGraphics().setFont(FontUtil.getFont(c)); Color oldcolor = c.getGraphics().getColor(); c.getGraphics().setColor(c.getCurrentStyle().getColor()); Font cur_font = c.getGraphics().getFont(); LineMetrics lm = c.getTextRenderer().getLineMetrics(c.getGraphics(), cur_font, text); iy -= (int) lm.getDescent(); //draw the line if (text != null && text.length() > 0) { c.getTextRenderer().drawString(c.getGraphics(), text, ix, iy); } //draw any text decoration int stringWidth = (int) Math.ceil(c.getTextRenderer(). getLogicalBounds(c.getGraphics(), c.getGraphics().getFont(), text).getWidth()); // override based on settings String text_decoration = c.getCurrentStyle().getStringProperty(CSSName.TEXT_DECORATION); if (text_decoration != null && text_decoration.equals("underline")) { float down = lm.getUnderlineOffset(); float thick = lm.getUnderlineThickness(); g.fillRect(ix, iy - (int) down, stringWidth, (int) thick); } else if (text_decoration != null && text_decoration.equals("line-through")) { float down = lm.getStrikethroughOffset(); float thick = lm.getStrikethroughThickness(); g.fillRect(ix, iy + (int) down, stringWidth, (int) thick); } else if (text_decoration != null && text_decoration.equals("overline")) { float down = lm.getAscent(); float thick = lm.getUnderlineThickness(); g.fillRect(ix, iy - (int) down, stringWidth, (int) thick); } c.getGraphics().setColor(oldcolor); if (c.debugDrawFontMetrics()) { g.setColor(Color.red); g.drawLine(ix, iy, ix + inline.width, iy); iy += (int) Math.ceil(lm.getDescent()); g.drawLine(ix, iy, ix + inline.width, iy); iy -= (int) Math.ceil(lm.getDescent()); iy -= (int) Math.ceil(lm.getAscent()); g.drawLine(ix, iy, ix + inline.width, iy); } // restore the old font c.getGraphics().setFont(oldfont); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/InlineRendering.java/buggy/src/java/org/xhtmlrenderer/render/InlineRendering.java
self.eval(beginNode), self.eval(endNode), exclusive);
self.eval(getBeginNode()), self.eval(getEndNode()), exclusive);
public RubyObject eval(Ruby ruby, RubyObject self) { if (cachedValue != null) { return cachedValue; } RubyObject result = RubyRange.m_newRange(ruby, self.eval(beginNode), self.eval(endNode), exclusive); if (cannotCached) { return result; } else if (getBeginNode() instanceof LitNode && getEndNode() instanceof LitNode && getBeginNode().getLiteral() instanceof RubyFixnum && getEndNode().getLiteral() instanceof RubyFixnum) { cachedValue = result; } else { cannotCached = true; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/12748a4b8db7fd4836cd04c81e3cf2343735bfb6/DotNode.java/clean/org/jruby/nodes/DotNode.java
box.setChildrenExceedBounds(true);
public static Box generateAbsoluteBox(Context c, Content content) { //Uu.p("generate absolute block inline box: avail = " + content); Rectangle oe = c.getExtents();// copy the extents for safety c.setExtents(new Rectangle(oe)); Box box = Boxing.layout(c, content); //Uu.p("got a block box from the sub layout: " + box); c.setExtents(oe); box.setChildrenExceedBounds(true); box.absolute = true; return box; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/2486e0a7d32e8bf7a5ba0aa3c3626b52ad12da3c/Absolute.java/buggy/src/java/org/xhtmlrenderer/layout/block/Absolute.java
table.setData(MenuManager.class.toString(), menuMgr);
private void createContextMenu(String name, final Table table) { Menu menu; Menu existingMenu = table.getMenu(); MenuManager menuMgr = new MenuManager(name); if (existingMenu != null){ menu = existingMenu; } else { menu = menuMgr.createContextMenu(table); menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); } table.setMenu(menu); site.registerContextMenu(menuMgr, selectionProvider); }
52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/b0b843e1a52e7dda43315bce7121cdaa79a36d86/MessageListTableFormat.java/clean/source/trunk/plugins/org.marketcetera.photon/src/main/java/org/marketcetera/photon/ui/MessageListTableFormat.java
else { _log.debug("Processing path " + path); }
protected String processPath( HttpServletRequest req, HttpServletResponse res) throws IOException { String path = req.getParameter("struts_action"); if (Validator.isNull(path)) { path = (String)req.getAttribute(WebKeys.PORTLET_STRUTS_ACTION); } if (path == null) { PortletConfigImpl portletConfig = (PortletConfigImpl)req.getAttribute( WebKeys.JAVAX_PORTLET_CONFIG); _log.error( portletConfig.getPortletName() + " does not have any paths specified"); } return path; }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/e8a65fd03e91994ffdc7bdbe7486f6debf2cfc47/PortletRequestProcessor.java/buggy/portal-ejb/src/com/liferay/portal/struts/PortletRequestProcessor.java
folder.addPropertyChangeListener("syncProfile", folderSyncProfileChangeListener);
folder .removePropertyChangeListener(folderSyncProfileChangeListener);
public void selectionChanged(SelectionChangeEvent selectionChangeEvent) { Object selection = selectionChangeEvent.getSelection(); Object oldSelection = selectionModel.getOldSelection(); if (oldSelection instanceof Folder) { // Remove listener from old folder Folder folder = (Folder) oldSelection; folder.addPropertyChangeListener("syncProfile", folderSyncProfileChangeListener); } if (selection instanceof Folder) { // Add listener to new folder Folder folder = (Folder) selection; folder.addPropertyChangeListener("syncProfile", folderSyncProfileChangeListener); markAsSelected(folder.getSyncProfile().equals(syncProfile)); } }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/ce15653724fceecbba61f4a08a64f72d29e46197/ChangeSyncProfileAction.java/buggy/src/main/de/dal33t/powerfolder/ui/action/ChangeSyncProfileAction.java
folder.addPropertyChangeListener("syncProfile",
folder.addPropertyChangeListener(Folder.PROPERTY_SYNC_PROFILE,
public void selectionChanged(SelectionChangeEvent selectionChangeEvent) { Object selection = selectionChangeEvent.getSelection(); Object oldSelection = selectionModel.getOldSelection(); if (oldSelection instanceof Folder) { // Remove listener from old folder Folder folder = (Folder) oldSelection; folder.addPropertyChangeListener("syncProfile", folderSyncProfileChangeListener); } if (selection instanceof Folder) { // Add listener to new folder Folder folder = (Folder) selection; folder.addPropertyChangeListener("syncProfile", folderSyncProfileChangeListener); markAsSelected(folder.getSyncProfile().equals(syncProfile)); } }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/ce15653724fceecbba61f4a08a64f72d29e46197/ChangeSyncProfileAction.java/buggy/src/main/de/dal33t/powerfolder/ui/action/ChangeSyncProfileAction.java
public void handleSetChange(IObservableSet source, SetDiff diff) { Set addedKeys = new HashSet(diff.getAdditions()); Set removedKeys = new HashSet(diff.getRemovals());
public void handleSetChange(SetChangeEvent event) { Set addedKeys = new HashSet(event.diff.getAdditions()); Set removedKeys = new HashSet(event.diff.getRemovals());
public void handleSetChange(IObservableSet source, SetDiff diff) { Set addedKeys = new HashSet(diff.getAdditions()); Set removedKeys = new HashSet(diff.getRemovals()); Map oldValues = new HashMap(); Map newValues = new HashMap(); for (Iterator it = removedKeys.iterator(); it.hasNext();) { Object removedKey = it.next(); Object oldValue = doGet(removedKey); unhookListener(removedKey); if (oldValue != null) { oldValues.put(removedKey, oldValue); } } for (Iterator it = addedKeys.iterator(); it.hasNext();) { Object addedKey = it.next(); hookListener(addedKey); Object newValue = doGet(addedKey); newValues.put(addedKey, newValue); } fireMapChange(Diffs.createMapDiff(addedKeys, removedKeys, Collections.EMPTY_SET, oldValues, newValues)); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/ComputedObservableMap.java/buggy/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.java
if (box.isInlineElement() || !(box.content instanceof TextContent)) {
if (isBlockOrInlineElementBox(box)) {
public static Border getBorder(Context c, Box box) { //TODO: can I skip this? if (isBlockOrInlineElementBox(c, box)) { if (box.isInlineElement() || !(box.content instanceof TextContent)) { // Uu.p("setting border for: " + box); if (box.border == null) { box.border = c.getCurrentStyle().getBorderWidth(); } //} else { // Uu.p("skipping border for: " + box); } return box.border; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/7e8f8975a39606e0ad272f1e0bed6839ad1d9fc8/LayoutUtil.java/buggy/src/java/org/xhtmlrenderer/layout/LayoutUtil.java
public CellBox layoutCell(Context c, Node cell, CellBox prev_cell, RowBox rowbox, TableBox table, int cellwidth) { CellBox cellbox = new CellBox(0, 0, cellwidth, 0); // attach the node cellbox.setNode(cell); getBorder(c, cellbox); getMargin(c, cellbox); getPadding(c, cellbox); //layout cell w/ modified inline cellbox.x = prev_cell.x + prev_cell.width + table.spacing.x + fudge; // y is 0 relative to the parent row cellbox.y = 0; // set height to 50 until it's set by the cell contents cellbox.height = 50; Rectangle oe = c.getExtents(); // new extents = old extents but smaller. same origin tho c.setExtents(new Rectangle(c.getExtents().x, c.getExtents().y, cellbox.width, 100)); // lay out the cell's contents Layout layout = c.getLayout(cell); Box cell_contents = layout.layout(c, new BlockContent((Element) cellbox.getNode(), c.css.getStyle(cellbox.getNode()))); cellbox.sub_box = cell_contents; // restore old extents c.setExtents(oe); // height of the cell will be based on the height of it's // contents cellbox.height = cell_contents.height; //save cellbox // height of row is max height of cells rowbox.height = Math.max(cellbox.height, rowbox.height); rowbox.cells.add(cellbox); return cellbox; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/bbe26e114cd1f823901a5ca3d63b5fccfdfedf81/TableLayout.java/clean/src/java/org/xhtmlrenderer/table/TableLayout.java
defineSingletonMethod("new", Arity.noArguments(), "newInstance");
public void initializeClass() { defineMethod("===", Arity.singleArgument(), "op_eqq"); defineMethod("<=>", Arity.singleArgument(), "op_cmp"); defineMethod("<", Arity.singleArgument(), "op_lt"); defineMethod("<=", Arity.singleArgument(), "op_le"); defineMethod(">", Arity.singleArgument(), "op_gt"); defineMethod(">=", Arity.singleArgument(), "op_ge"); defineMethod("ancestors", Arity.noArguments()); defineMethod("class_variables", Arity.noArguments()); defineMethod("clone", Arity.noArguments(), "rbClone"); defineMethod("const_defined?", Arity.singleArgument(), "const_defined"); defineMethod("const_get", Arity.singleArgument(), "const_get"); defineMethod("const_missing", Arity.singleArgument()); defineMethod("const_set", Arity.twoArguments()); defineMethod("constants", Arity.noArguments()); defineMethod("dup", Arity.noArguments()); defineMethod("extended", Arity.singleArgument()); defineMethod("included", Arity.singleArgument()); defineMethod("included_modules", Arity.noArguments()); defineMethod("initialize", Arity.optional()); defineMethod("instance_method", Arity.singleArgument()); defineMethod("instance_methods", Arity.optional()); defineMethod("method_defined?", Arity.singleArgument(), "method_defined"); defineMethod("module_eval", Arity.optional()); defineMethod("name", Arity.noArguments()); defineMethod("private_class_method", Arity.optional()); defineMethod("private_instance_methods", Arity.optional()); defineMethod("protected_instance_methods", Arity.optional()); defineMethod("public_class_method", Arity.optional()); defineMethod("public_instance_methods", Arity.optional()); defineMethod("to_s", Arity.noArguments()); defineAlias("class_eval", "module_eval"); definePrivateMethod("alias_method", Arity.twoArguments()); definePrivateMethod("append_features", Arity.singleArgument()); definePrivateMethod("attr", Arity.optional()); definePrivateMethod("attr_reader", Arity.optional()); definePrivateMethod("attr_writer", Arity.optional()); definePrivateMethod("attr_accessor", Arity.optional()); definePrivateMethod("define_method", Arity.optional()); definePrivateMethod("extend_object", Arity.singleArgument()); definePrivateMethod("include", Arity.optional()); definePrivateMethod("method_added", Arity.singleArgument()); definePrivateMethod("module_function", Arity.optional()); definePrivateMethod("public", Arity.optional(), "rbPublic"); definePrivateMethod("protected", Arity.optional(), "rbProtected"); definePrivateMethod("private", Arity.optional(), "rbPrivate"); definePrivateMethod("remove_class_variable", Arity.singleArgument()); definePrivateMethod("remove_const", Arity.singleArgument()); definePrivateMethod("remove_method", Arity.singleArgument()); definePrivateMethod("undef_method", Arity.singleArgument()); defineSingletonMethod("new", Arity.noArguments(), "newInstance"); defineSingletonMethod("nesting", Arity.noArguments()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d166adca82dbf831b1e455c4d157b0033e10a6f1/ModuleMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/ModuleMetaClass.java
return Util.equals(this.targetId, that.targetId) && Util.equals(this.expression, that.expression) && Util.equals(this.getWindow(), that.getWindow());
return equals(this.targetId, that.targetId) && equals(this.expression, that.expression) && equals(this.getWindow(), that.getWindow());
public final boolean equals(final Object object) { if (object instanceof LegacyViewerContributionExpression) { final LegacyViewerContributionExpression that = (LegacyViewerContributionExpression) object; return Util.equals(this.targetId, that.targetId) && Util.equals(this.expression, that.expression) && Util.equals(this.getWindow(), that.getWindow()); } return false; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/ba8772da3d063410cc9112f7f53da28a447f2704/LegacyViewerContributionExpression.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/LegacyViewerContributionExpression.java
Rectangle contentBounds = replaced.getContentAreaEdge( replaced.getAbsX(), replaced.getAbsY(), c); Point loc = replaced.getReplacedElement().getLocation(); if (contentBounds.x != loc.x || contentBounds.y != loc.y) { replaced.getReplacedElement().setLocation(contentBounds.x, contentBounds.y); }
private void paintReplacedElement(RenderingContext c, BlockBox replaced) { if (! c.isInteractive()) { c.getOutputDevice().paintReplacedElement(c, replaced); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/2d0418135baea38113aec4c619576083cc381df4/Layer.java/clean/src/java/org/xhtmlrenderer/layout/Layer.java
if ((downloadCounter == null || downloadCounter.getBytesExpected() != totalSize) && member.isMySelf()) { downloadCounter = new TransferCounter(memberSize, totalSize);
if (member.isMySelf()) { long downloadSize; if (folder.getSyncProfile().isAutodownload()) { downloadSize = totalSize; } else { downloadSize = memberSize; for (FileInfo fi: allFiles) { if (getController().getTransferManager().isDownloadingActive(fi) || getController().getTransferManager().isDownloadingPending(fi)) { downloadSize += fi.getSize(); } } if (logVerbose) { log().verbose("memberSize: " + memberSize + ", downloadSize: " + downloadSize); } } if (downloadCounter == null || downloadCounter.getBytesExpected() != downloadSize) { assert(downloadSize >= memberSize); downloadCounter = new TransferCounter(memberSize, downloadSize); }
synchronized void calculate0() { if (logVerbose) { log().verbose( "calc stats " + folder.getName() + " stats@: " + (System.currentTimeMillis() - startTime)); } isCalculating = true; // log().verbose("Recalculation statisitcs on " + folder); // clear statistics before syncPercentages.clear(); filesCount.clear(); sizes.clear(); // Get ALL files, also offline users FileInfo[] allFiles = folder.getAllFiles(true); totalNormalFilesCount = 0; totalExpectedFilesCount = 0; totalDeletedFilesCount = 0; // Containing all deleted files Set<FileInfo> deletedFiles = new HashSet<FileInfo>(); for (int i = 0; i < allFiles.length; i++) { FileInfo fInfo = allFiles[i]; if (fInfo.isDeleted()) { totalDeletedFilesCount++; deletedFiles.add(fInfo); } else if (fInfo.isExpected(folder.getController() .getFolderRepository())) { totalExpectedFilesCount++; } else { totalNormalFilesCount++; } } if (logVerbose) { log() .verbose( "Got " + deletedFiles.size() + " total deleted files on folder"); } // calculate total sizes totalSize = calculateSize(allFiles, true); totalFilesCount = allFiles.length; int nCalculatedMembers = 0; double totalSyncTemp = 0; Member[] members = folder.getMembers(); for (int i = 0; i < members.length; i++) { Member member = members[i]; FileInfo[] memberFileList = folder.getFiles(member); if (memberFileList == null) { continue; } long memberSize = calculateSize(memberFileList, true); int memberFileCount = memberFileList.length; Set<FileInfo> memberFiles = new HashSet<FileInfo>(Arrays .asList(memberFileList)); for (Iterator it = deletedFiles.iterator(); it.hasNext();) { FileInfo deletedOne = (FileInfo) it.next(); if (!memberFiles.contains(deletedOne)) { // Add to my size memberSize += deletedOne.getSize(); memberFileCount++; } } if ((downloadCounter == null || downloadCounter.getBytesExpected() != totalSize) && member.isMySelf()) { // Initialize downloadCounter with appropriate values downloadCounter = new TransferCounter(memberSize, totalSize); } double syncPercentage = (((double) memberSize) / totalSize) * 100; if (totalSize == 0) { syncPercentage = 100; } nCalculatedMembers++; totalSyncTemp += syncPercentage; syncPercentages.put(member, new Double(syncPercentage)); filesCount.put(member, new Integer(memberFileCount)); sizes.put(member, new Long(memberSize)); } // Calculate total sync totalSyncPercentage = totalSyncTemp / nCalculatedMembers; if (logVerbose) { log().verbose( "Recalculated: " + totalNormalFilesCount + " normal, " + totalExpectedFilesCount + " expected, " + totalDeletedFilesCount + " deleted"); } // Fire event folder.fireStatisticsCalculated(); lastCalc = System.currentTimeMillis(); isCalculating = false; if (logVerbose) { log().verbose( "calc stats " + folder.getName() + " done @: " + (System.currentTimeMillis() - startTime)); } }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/0ce290c97cc057f44014d79172ecb0bb04bbc1ec/FolderStatistic.java/buggy/src/main/de/dal33t/powerfolder/disk/FolderStatistic.java
return (RubyString) convertToType("String", "to_s", true);
return convertToType("String", "to_str", true);
public IRubyObject convertToString() { return (RubyString) convertToType("String", "to_s", true); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ae3178fbb3656e01c3d379a6255e1af956725271/RubyObject.java/buggy/src/org/jruby/RubyObject.java
if (child_box.clear_left || child_box.clear_right) {
if (child_box.getStyle().isCleared()) {
public static void layoutContent(Context c, Box box, List contentList, Box block) { // prepare for the list items int old_counter = c.getListCounter(); c.setListCounter(0); Iterator contentIterator = contentList.iterator(); while (contentIterator.hasNext()) { Object o = contentIterator.next(); if (o instanceof FirstLineStyle) {//can actually only be the first object in list block.firstLineStyle = ((FirstLineStyle) o).getStyle(); //put it into the Context so it gets used on the first line c.addFirstLineStyle(block.firstLineStyle); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list block.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } Content currentContent = (Content) o; Box child_box = null; //TODO:handle run-ins. For now, treat them as blocks // update the counter for printing OL list items //TODO:handle counters correctly c.setListCounter(c.getListCounter() + 1); // execute the layout and get the return bounds //c.parent_box = box; //c.placement_point = new Point(0, box.height); c.translate(0, box.height); //child_box = Boxing.layout(c, currentContent); child_box = Boxing.preLayout(c, currentContent); //Uu.p("did pre layout on : " + child_box); //Uu.p("adding the child: " + child_box); child_box.list_count = c.getListCounter(); // set the child_box location child_box.x = 0; double initialY = box.height; child_box.y = (int) initialY; //Uu.p("set child box y to: " + child_box); box.addChild(child_box); Boxing.realLayout(c, child_box, currentContent); box.propagateChildProperties(child_box); c.translate(0, -box.height); //JMM. new code to handle the 'clear' property // if clear set if (child_box.clear_left || child_box.clear_right) {//Uu.p("doing a clear on: " + child_box); // get the distance we have to move it down int down = 0; //Uu.p("down = " + down); if (child_box.clear_left) { //Uu.p("left clear"); //Uu.p("left down = " + c.getPersistentBFC().getLeftDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getLeftDownDistance(child_box)); } //Uu.p("down = " + down); if (child_box.clear_right) { //Uu.p("right clear"); //Uu.p("right down = " + c.getPersistentBFC().getRightDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getRightDownDistance(child_box)); } //Uu.p("down = " + down); int diff = down - child_box.y; //Uu.p("child box.y = " + child_box.y); //Uu.p("diff = " + diff); if (diff > 0) { // move child box down child_box.y = down; // adjust parent box box.height += diff; } } //joshy fix the 'fixed' stuff later // if fixed or abs then don't modify the final layout bounds // because fixed elements are removed from normal flow if (child_box.fixed) { // put fixed positioning in later Fixed.positionFixedChild(c, child_box); } if (child_box.absolute) { Absolute.positionAbsoluteChild(c, child_box); } // skip adjusting the parent box if the child // doesn't affect flow layout if (LayoutUtil.isOutsideNormalFlow(child_box)) { continue; } // increase the final layout width if the child was greater box.adjustWidthForChild(child_box.getWidth()); c.addMaxWidth(box.getWidth()); // increase the final layout height by the height of the child box.height += (child_box.y - initialY) + child_box.height; c.addMaxHeight(box.height + box.y + (int) c.getOriginOffset().getY()); if (c.shouldStop()) { System.out.println("doing a quick stop"); break; } //Uu.p("alerting that there is a box available"); Dimension max_size = new Dimension(c.getMaxWidth(), c.getMaxHeight()); if (c.isInteractive() && !c.isPrint()) { if (Configuration.isTrue("xr.incremental.enabled", false) && c.isRenderQueueAvailable()) { c.getRenderQueue().dispatchRepaintEvent(new ReflowEvent(ReflowEvent.MORE_BOXES_AVAILABLE, box, max_size)); } int delay = Configuration.valueAsInt("xr.incremental.debug.layoutdelay", 0); if (delay > 0) { //Uu.p("sleeping for: " + delay); try { Uu.sleep(delay); } catch (Exception ex) { Uu.p("sleep was interrupted in BlockBoxing.layoutContent()!"); } } } } c.addMaxWidth(box.getWidth()); c.setListCounter(old_counter); if (block.firstLineStyle != null) { //pop it in case it wasn't used c.popFirstLineStyle(); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/d78edbe00854320b48eb4ef97095b253df533dd8/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java
if (child_box.clear_left) {
if (child_box.getStyle().isClearLeft()) {
public static void layoutContent(Context c, Box box, List contentList, Box block) { // prepare for the list items int old_counter = c.getListCounter(); c.setListCounter(0); Iterator contentIterator = contentList.iterator(); while (contentIterator.hasNext()) { Object o = contentIterator.next(); if (o instanceof FirstLineStyle) {//can actually only be the first object in list block.firstLineStyle = ((FirstLineStyle) o).getStyle(); //put it into the Context so it gets used on the first line c.addFirstLineStyle(block.firstLineStyle); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list block.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } Content currentContent = (Content) o; Box child_box = null; //TODO:handle run-ins. For now, treat them as blocks // update the counter for printing OL list items //TODO:handle counters correctly c.setListCounter(c.getListCounter() + 1); // execute the layout and get the return bounds //c.parent_box = box; //c.placement_point = new Point(0, box.height); c.translate(0, box.height); //child_box = Boxing.layout(c, currentContent); child_box = Boxing.preLayout(c, currentContent); //Uu.p("did pre layout on : " + child_box); //Uu.p("adding the child: " + child_box); child_box.list_count = c.getListCounter(); // set the child_box location child_box.x = 0; double initialY = box.height; child_box.y = (int) initialY; //Uu.p("set child box y to: " + child_box); box.addChild(child_box); Boxing.realLayout(c, child_box, currentContent); box.propagateChildProperties(child_box); c.translate(0, -box.height); //JMM. new code to handle the 'clear' property // if clear set if (child_box.clear_left || child_box.clear_right) {//Uu.p("doing a clear on: " + child_box); // get the distance we have to move it down int down = 0; //Uu.p("down = " + down); if (child_box.clear_left) { //Uu.p("left clear"); //Uu.p("left down = " + c.getPersistentBFC().getLeftDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getLeftDownDistance(child_box)); } //Uu.p("down = " + down); if (child_box.clear_right) { //Uu.p("right clear"); //Uu.p("right down = " + c.getPersistentBFC().getRightDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getRightDownDistance(child_box)); } //Uu.p("down = " + down); int diff = down - child_box.y; //Uu.p("child box.y = " + child_box.y); //Uu.p("diff = " + diff); if (diff > 0) { // move child box down child_box.y = down; // adjust parent box box.height += diff; } } //joshy fix the 'fixed' stuff later // if fixed or abs then don't modify the final layout bounds // because fixed elements are removed from normal flow if (child_box.fixed) { // put fixed positioning in later Fixed.positionFixedChild(c, child_box); } if (child_box.absolute) { Absolute.positionAbsoluteChild(c, child_box); } // skip adjusting the parent box if the child // doesn't affect flow layout if (LayoutUtil.isOutsideNormalFlow(child_box)) { continue; } // increase the final layout width if the child was greater box.adjustWidthForChild(child_box.getWidth()); c.addMaxWidth(box.getWidth()); // increase the final layout height by the height of the child box.height += (child_box.y - initialY) + child_box.height; c.addMaxHeight(box.height + box.y + (int) c.getOriginOffset().getY()); if (c.shouldStop()) { System.out.println("doing a quick stop"); break; } //Uu.p("alerting that there is a box available"); Dimension max_size = new Dimension(c.getMaxWidth(), c.getMaxHeight()); if (c.isInteractive() && !c.isPrint()) { if (Configuration.isTrue("xr.incremental.enabled", false) && c.isRenderQueueAvailable()) { c.getRenderQueue().dispatchRepaintEvent(new ReflowEvent(ReflowEvent.MORE_BOXES_AVAILABLE, box, max_size)); } int delay = Configuration.valueAsInt("xr.incremental.debug.layoutdelay", 0); if (delay > 0) { //Uu.p("sleeping for: " + delay); try { Uu.sleep(delay); } catch (Exception ex) { Uu.p("sleep was interrupted in BlockBoxing.layoutContent()!"); } } } } c.addMaxWidth(box.getWidth()); c.setListCounter(old_counter); if (block.firstLineStyle != null) { //pop it in case it wasn't used c.popFirstLineStyle(); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/d78edbe00854320b48eb4ef97095b253df533dd8/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java
if (child_box.clear_right) {
if (child_box.getStyle().isClearRight()) {
public static void layoutContent(Context c, Box box, List contentList, Box block) { // prepare for the list items int old_counter = c.getListCounter(); c.setListCounter(0); Iterator contentIterator = contentList.iterator(); while (contentIterator.hasNext()) { Object o = contentIterator.next(); if (o instanceof FirstLineStyle) {//can actually only be the first object in list block.firstLineStyle = ((FirstLineStyle) o).getStyle(); //put it into the Context so it gets used on the first line c.addFirstLineStyle(block.firstLineStyle); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list block.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } Content currentContent = (Content) o; Box child_box = null; //TODO:handle run-ins. For now, treat them as blocks // update the counter for printing OL list items //TODO:handle counters correctly c.setListCounter(c.getListCounter() + 1); // execute the layout and get the return bounds //c.parent_box = box; //c.placement_point = new Point(0, box.height); c.translate(0, box.height); //child_box = Boxing.layout(c, currentContent); child_box = Boxing.preLayout(c, currentContent); //Uu.p("did pre layout on : " + child_box); //Uu.p("adding the child: " + child_box); child_box.list_count = c.getListCounter(); // set the child_box location child_box.x = 0; double initialY = box.height; child_box.y = (int) initialY; //Uu.p("set child box y to: " + child_box); box.addChild(child_box); Boxing.realLayout(c, child_box, currentContent); box.propagateChildProperties(child_box); c.translate(0, -box.height); //JMM. new code to handle the 'clear' property // if clear set if (child_box.clear_left || child_box.clear_right) {//Uu.p("doing a clear on: " + child_box); // get the distance we have to move it down int down = 0; //Uu.p("down = " + down); if (child_box.clear_left) { //Uu.p("left clear"); //Uu.p("left down = " + c.getPersistentBFC().getLeftDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getLeftDownDistance(child_box)); } //Uu.p("down = " + down); if (child_box.clear_right) { //Uu.p("right clear"); //Uu.p("right down = " + c.getPersistentBFC().getRightDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getRightDownDistance(child_box)); } //Uu.p("down = " + down); int diff = down - child_box.y; //Uu.p("child box.y = " + child_box.y); //Uu.p("diff = " + diff); if (diff > 0) { // move child box down child_box.y = down; // adjust parent box box.height += diff; } } //joshy fix the 'fixed' stuff later // if fixed or abs then don't modify the final layout bounds // because fixed elements are removed from normal flow if (child_box.fixed) { // put fixed positioning in later Fixed.positionFixedChild(c, child_box); } if (child_box.absolute) { Absolute.positionAbsoluteChild(c, child_box); } // skip adjusting the parent box if the child // doesn't affect flow layout if (LayoutUtil.isOutsideNormalFlow(child_box)) { continue; } // increase the final layout width if the child was greater box.adjustWidthForChild(child_box.getWidth()); c.addMaxWidth(box.getWidth()); // increase the final layout height by the height of the child box.height += (child_box.y - initialY) + child_box.height; c.addMaxHeight(box.height + box.y + (int) c.getOriginOffset().getY()); if (c.shouldStop()) { System.out.println("doing a quick stop"); break; } //Uu.p("alerting that there is a box available"); Dimension max_size = new Dimension(c.getMaxWidth(), c.getMaxHeight()); if (c.isInteractive() && !c.isPrint()) { if (Configuration.isTrue("xr.incremental.enabled", false) && c.isRenderQueueAvailable()) { c.getRenderQueue().dispatchRepaintEvent(new ReflowEvent(ReflowEvent.MORE_BOXES_AVAILABLE, box, max_size)); } int delay = Configuration.valueAsInt("xr.incremental.debug.layoutdelay", 0); if (delay > 0) { //Uu.p("sleeping for: " + delay); try { Uu.sleep(delay); } catch (Exception ex) { Uu.p("sleep was interrupted in BlockBoxing.layoutContent()!"); } } } } c.addMaxWidth(box.getWidth()); c.setListCounter(old_counter); if (block.firstLineStyle != null) { //pop it in case it wasn't used c.popFirstLineStyle(); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/d78edbe00854320b48eb4ef97095b253df533dd8/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java
if (child_box.fixed) {
if (child_box.getStyle().isFixed()) {
public static void layoutContent(Context c, Box box, List contentList, Box block) { // prepare for the list items int old_counter = c.getListCounter(); c.setListCounter(0); Iterator contentIterator = contentList.iterator(); while (contentIterator.hasNext()) { Object o = contentIterator.next(); if (o instanceof FirstLineStyle) {//can actually only be the first object in list block.firstLineStyle = ((FirstLineStyle) o).getStyle(); //put it into the Context so it gets used on the first line c.addFirstLineStyle(block.firstLineStyle); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list block.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } Content currentContent = (Content) o; Box child_box = null; //TODO:handle run-ins. For now, treat them as blocks // update the counter for printing OL list items //TODO:handle counters correctly c.setListCounter(c.getListCounter() + 1); // execute the layout and get the return bounds //c.parent_box = box; //c.placement_point = new Point(0, box.height); c.translate(0, box.height); //child_box = Boxing.layout(c, currentContent); child_box = Boxing.preLayout(c, currentContent); //Uu.p("did pre layout on : " + child_box); //Uu.p("adding the child: " + child_box); child_box.list_count = c.getListCounter(); // set the child_box location child_box.x = 0; double initialY = box.height; child_box.y = (int) initialY; //Uu.p("set child box y to: " + child_box); box.addChild(child_box); Boxing.realLayout(c, child_box, currentContent); box.propagateChildProperties(child_box); c.translate(0, -box.height); //JMM. new code to handle the 'clear' property // if clear set if (child_box.clear_left || child_box.clear_right) {//Uu.p("doing a clear on: " + child_box); // get the distance we have to move it down int down = 0; //Uu.p("down = " + down); if (child_box.clear_left) { //Uu.p("left clear"); //Uu.p("left down = " + c.getPersistentBFC().getLeftDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getLeftDownDistance(child_box)); } //Uu.p("down = " + down); if (child_box.clear_right) { //Uu.p("right clear"); //Uu.p("right down = " + c.getPersistentBFC().getRightDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getRightDownDistance(child_box)); } //Uu.p("down = " + down); int diff = down - child_box.y; //Uu.p("child box.y = " + child_box.y); //Uu.p("diff = " + diff); if (diff > 0) { // move child box down child_box.y = down; // adjust parent box box.height += diff; } } //joshy fix the 'fixed' stuff later // if fixed or abs then don't modify the final layout bounds // because fixed elements are removed from normal flow if (child_box.fixed) { // put fixed positioning in later Fixed.positionFixedChild(c, child_box); } if (child_box.absolute) { Absolute.positionAbsoluteChild(c, child_box); } // skip adjusting the parent box if the child // doesn't affect flow layout if (LayoutUtil.isOutsideNormalFlow(child_box)) { continue; } // increase the final layout width if the child was greater box.adjustWidthForChild(child_box.getWidth()); c.addMaxWidth(box.getWidth()); // increase the final layout height by the height of the child box.height += (child_box.y - initialY) + child_box.height; c.addMaxHeight(box.height + box.y + (int) c.getOriginOffset().getY()); if (c.shouldStop()) { System.out.println("doing a quick stop"); break; } //Uu.p("alerting that there is a box available"); Dimension max_size = new Dimension(c.getMaxWidth(), c.getMaxHeight()); if (c.isInteractive() && !c.isPrint()) { if (Configuration.isTrue("xr.incremental.enabled", false) && c.isRenderQueueAvailable()) { c.getRenderQueue().dispatchRepaintEvent(new ReflowEvent(ReflowEvent.MORE_BOXES_AVAILABLE, box, max_size)); } int delay = Configuration.valueAsInt("xr.incremental.debug.layoutdelay", 0); if (delay > 0) { //Uu.p("sleeping for: " + delay); try { Uu.sleep(delay); } catch (Exception ex) { Uu.p("sleep was interrupted in BlockBoxing.layoutContent()!"); } } } } c.addMaxWidth(box.getWidth()); c.setListCounter(old_counter); if (block.firstLineStyle != null) { //pop it in case it wasn't used c.popFirstLineStyle(); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/d78edbe00854320b48eb4ef97095b253df533dd8/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java
if (child_box.absolute) {
if (child_box.getStyle().isAbsolute()) {
public static void layoutContent(Context c, Box box, List contentList, Box block) { // prepare for the list items int old_counter = c.getListCounter(); c.setListCounter(0); Iterator contentIterator = contentList.iterator(); while (contentIterator.hasNext()) { Object o = contentIterator.next(); if (o instanceof FirstLineStyle) {//can actually only be the first object in list block.firstLineStyle = ((FirstLineStyle) o).getStyle(); //put it into the Context so it gets used on the first line c.addFirstLineStyle(block.firstLineStyle); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list block.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } Content currentContent = (Content) o; Box child_box = null; //TODO:handle run-ins. For now, treat them as blocks // update the counter for printing OL list items //TODO:handle counters correctly c.setListCounter(c.getListCounter() + 1); // execute the layout and get the return bounds //c.parent_box = box; //c.placement_point = new Point(0, box.height); c.translate(0, box.height); //child_box = Boxing.layout(c, currentContent); child_box = Boxing.preLayout(c, currentContent); //Uu.p("did pre layout on : " + child_box); //Uu.p("adding the child: " + child_box); child_box.list_count = c.getListCounter(); // set the child_box location child_box.x = 0; double initialY = box.height; child_box.y = (int) initialY; //Uu.p("set child box y to: " + child_box); box.addChild(child_box); Boxing.realLayout(c, child_box, currentContent); box.propagateChildProperties(child_box); c.translate(0, -box.height); //JMM. new code to handle the 'clear' property // if clear set if (child_box.clear_left || child_box.clear_right) {//Uu.p("doing a clear on: " + child_box); // get the distance we have to move it down int down = 0; //Uu.p("down = " + down); if (child_box.clear_left) { //Uu.p("left clear"); //Uu.p("left down = " + c.getPersistentBFC().getLeftDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getLeftDownDistance(child_box)); } //Uu.p("down = " + down); if (child_box.clear_right) { //Uu.p("right clear"); //Uu.p("right down = " + c.getPersistentBFC().getRightDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getRightDownDistance(child_box)); } //Uu.p("down = " + down); int diff = down - child_box.y; //Uu.p("child box.y = " + child_box.y); //Uu.p("diff = " + diff); if (diff > 0) { // move child box down child_box.y = down; // adjust parent box box.height += diff; } } //joshy fix the 'fixed' stuff later // if fixed or abs then don't modify the final layout bounds // because fixed elements are removed from normal flow if (child_box.fixed) { // put fixed positioning in later Fixed.positionFixedChild(c, child_box); } if (child_box.absolute) { Absolute.positionAbsoluteChild(c, child_box); } // skip adjusting the parent box if the child // doesn't affect flow layout if (LayoutUtil.isOutsideNormalFlow(child_box)) { continue; } // increase the final layout width if the child was greater box.adjustWidthForChild(child_box.getWidth()); c.addMaxWidth(box.getWidth()); // increase the final layout height by the height of the child box.height += (child_box.y - initialY) + child_box.height; c.addMaxHeight(box.height + box.y + (int) c.getOriginOffset().getY()); if (c.shouldStop()) { System.out.println("doing a quick stop"); break; } //Uu.p("alerting that there is a box available"); Dimension max_size = new Dimension(c.getMaxWidth(), c.getMaxHeight()); if (c.isInteractive() && !c.isPrint()) { if (Configuration.isTrue("xr.incremental.enabled", false) && c.isRenderQueueAvailable()) { c.getRenderQueue().dispatchRepaintEvent(new ReflowEvent(ReflowEvent.MORE_BOXES_AVAILABLE, box, max_size)); } int delay = Configuration.valueAsInt("xr.incremental.debug.layoutdelay", 0); if (delay > 0) { //Uu.p("sleeping for: " + delay); try { Uu.sleep(delay); } catch (Exception ex) { Uu.p("sleep was interrupted in BlockBoxing.layoutContent()!"); } } } } c.addMaxWidth(box.getWidth()); c.setListCounter(old_counter); if (block.firstLineStyle != null) { //pop it in case it wasn't used c.popFirstLineStyle(); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/d78edbe00854320b48eb4ef97095b253df533dd8/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java
if (LayoutUtil.isOutsideNormalFlow(child_box)) {
if (child_box.getStyle().isOutsideNormalFlow()) {
public static void layoutContent(Context c, Box box, List contentList, Box block) { // prepare for the list items int old_counter = c.getListCounter(); c.setListCounter(0); Iterator contentIterator = contentList.iterator(); while (contentIterator.hasNext()) { Object o = contentIterator.next(); if (o instanceof FirstLineStyle) {//can actually only be the first object in list block.firstLineStyle = ((FirstLineStyle) o).getStyle(); //put it into the Context so it gets used on the first line c.addFirstLineStyle(block.firstLineStyle); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list block.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } Content currentContent = (Content) o; Box child_box = null; //TODO:handle run-ins. For now, treat them as blocks // update the counter for printing OL list items //TODO:handle counters correctly c.setListCounter(c.getListCounter() + 1); // execute the layout and get the return bounds //c.parent_box = box; //c.placement_point = new Point(0, box.height); c.translate(0, box.height); //child_box = Boxing.layout(c, currentContent); child_box = Boxing.preLayout(c, currentContent); //Uu.p("did pre layout on : " + child_box); //Uu.p("adding the child: " + child_box); child_box.list_count = c.getListCounter(); // set the child_box location child_box.x = 0; double initialY = box.height; child_box.y = (int) initialY; //Uu.p("set child box y to: " + child_box); box.addChild(child_box); Boxing.realLayout(c, child_box, currentContent); box.propagateChildProperties(child_box); c.translate(0, -box.height); //JMM. new code to handle the 'clear' property // if clear set if (child_box.clear_left || child_box.clear_right) {//Uu.p("doing a clear on: " + child_box); // get the distance we have to move it down int down = 0; //Uu.p("down = " + down); if (child_box.clear_left) { //Uu.p("left clear"); //Uu.p("left down = " + c.getPersistentBFC().getLeftDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getLeftDownDistance(child_box)); } //Uu.p("down = " + down); if (child_box.clear_right) { //Uu.p("right clear"); //Uu.p("right down = " + c.getPersistentBFC().getRightDownDistance(child_box)); down = Math.max(down, c.getBlockFormattingContext().getRightDownDistance(child_box)); } //Uu.p("down = " + down); int diff = down - child_box.y; //Uu.p("child box.y = " + child_box.y); //Uu.p("diff = " + diff); if (diff > 0) { // move child box down child_box.y = down; // adjust parent box box.height += diff; } } //joshy fix the 'fixed' stuff later // if fixed or abs then don't modify the final layout bounds // because fixed elements are removed from normal flow if (child_box.fixed) { // put fixed positioning in later Fixed.positionFixedChild(c, child_box); } if (child_box.absolute) { Absolute.positionAbsoluteChild(c, child_box); } // skip adjusting the parent box if the child // doesn't affect flow layout if (LayoutUtil.isOutsideNormalFlow(child_box)) { continue; } // increase the final layout width if the child was greater box.adjustWidthForChild(child_box.getWidth()); c.addMaxWidth(box.getWidth()); // increase the final layout height by the height of the child box.height += (child_box.y - initialY) + child_box.height; c.addMaxHeight(box.height + box.y + (int) c.getOriginOffset().getY()); if (c.shouldStop()) { System.out.println("doing a quick stop"); break; } //Uu.p("alerting that there is a box available"); Dimension max_size = new Dimension(c.getMaxWidth(), c.getMaxHeight()); if (c.isInteractive() && !c.isPrint()) { if (Configuration.isTrue("xr.incremental.enabled", false) && c.isRenderQueueAvailable()) { c.getRenderQueue().dispatchRepaintEvent(new ReflowEvent(ReflowEvent.MORE_BOXES_AVAILABLE, box, max_size)); } int delay = Configuration.valueAsInt("xr.incremental.debug.layoutdelay", 0); if (delay > 0) { //Uu.p("sleeping for: " + delay); try { Uu.sleep(delay); } catch (Exception ex) { Uu.p("sleep was interrupted in BlockBoxing.layoutContent()!"); } } } } c.addMaxWidth(box.getWidth()); c.setListCounter(old_counter); if (block.firstLineStyle != null) { //pop it in case it wasn't used c.popFirstLineStyle(); } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/d78edbe00854320b48eb4ef97095b253df533dd8/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java
block.attachment = c.css.getStringProperty(block.getElement(), "background-attachment");
block.attachment = c.css.getStringProperty(block.getElement(), "background-attachment",false);
public void paintBackground(Context c, Box box) { Box block = box; // cache the background color getBackgroundColor(c, block); // get the css properties String back_image = c.css.getStringProperty(block.getElement(), "background-image", false); block.repeat = c.css.getStringProperty(block.getElement(), "background-repeat"); block.attachment = c.css.getStringProperty(block.getElement(), "background-attachment"); // handle image positioning issues // need to update this to support vert and horz, not just vert if(c.css.hasProperty(block.getElement(),"background-position",false)) { Point pt = c.css.getFloatPairProperty(block.getElement(),"background-position",false); block.background_position_horizontal = (int)pt.getX(); block.background_position_vertical = (int)pt.getY(); } // load the background image block.background_image = null; if (back_image != null) { try { block.background_image = ImageUtil.loadImage(c,back_image); } catch (Exception ex) { u.p(ex); } /* ImageIcon icon = new ImageIcon(back_image); if(icon.getImageLoadStatus() == MediaTracker.COMPLETE) { block.background_image = icon.getImage(); } */ } // actually paint the background BackgroundPainter.paint(c, block); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/4a91c538e40c079cd5502443a87ab4894469da24/BoxLayout.java/clean/src/java/org/joshy/html/BoxLayout.java
public void setupFixed(Context c, Box box) { if (isFixed(c, box)) { box.fixed = true; if (c.css.hasProperty(box.node, "right", false)) { box.right = (int) c.css.getFloatProperty(box.node, "right", 0, false); box.right_set = true; } if (c.css.hasProperty(box.node, "bottom", false)) { box.bottom = (int) c.css.getFloatProperty(box.node, "bottom", 0, false); box.bottom_set = true; } } }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/4a91c538e40c079cd5502443a87ab4894469da24/BoxLayout.java/clean/src/java/org/joshy/html/BoxLayout.java
public boolean hasProperty( String propName ) { if(propName.equals("width")) return true; if(propName.equals("height")) return true; if(propName.equals("top")) return true; if(propName.equals("left")) return true; if(propName.equals("bottom")) return true; if(propName.equals("right")) return true;
public boolean hasProperty(String propName) { if (propName.equals("width")) return true; if (propName.equals("height")) return true; if (propName.equals("top")) return true; if (propName.equals("left")) return true; if (propName.equals("bottom")) return true; if (propName.equals("right")) return true;
public boolean hasProperty( String propName ) { if(propName.equals("width")) return true; if(propName.equals("height")) return true; if(propName.equals("top")) return true; if(propName.equals("left")) return true; if(propName.equals("bottom")) return true; if(propName.equals("right")) return true; return false; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/93d814d7886e593bc9bd7f476b2a18571a009aa6/CurrentBoxStyle.java/buggy/src/java/org/xhtmlrenderer/css/style/CurrentBoxStyle.java
public DerivedProperty propertyByName( String propName ) {
public DerivedProperty propertyByName(String propName) {
public DerivedProperty propertyByName( String propName ) { //TODO: return these values when DerivedProperty and DerivedValue are disconnected from CSS return null; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/93d814d7886e593bc9bd7f476b2a18571a009aa6/CurrentBoxStyle.java/buggy/src/java/org/xhtmlrenderer/css/style/CurrentBoxStyle.java
int value = message1.getCreateDate().compareTo( message2.getCreateDate());
int value = DateUtil.compareTo( message1.getCreateDate(), message2.getCreateDate());
public int compare(Object obj1, Object obj2) { MBMessage message1 = (MBMessage)obj1; MBMessage message2 = (MBMessage)obj2; int value = message1.getCreateDate().compareTo( message2.getCreateDate()); if (_asc) { return value; } else { return -value; } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/0f4675cccf5487b482133977e732e847e320f104/MessageCreateDateComparator.java/clean/portal-ejb/src/com/liferay/portlet/messageboards/util/comparator/MessageCreateDateComparator.java
decorationJob.setSystem(true);
private void createDecorationJob() { decorationJob = new Job(WorkbenchMessages.getString("DecorationScheduler.CalculationJobName")) {//$NON-NLS-1$ /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ public IStatus run(IProgressMonitor monitor) { monitor.beginTask(WorkbenchMessages.getString("DecorationScheduler.CalculatingTask"), 100); //$NON-NLS-1$ //will block if there are no resources to be decorated DecorationReference reference; monitor.worked(5); int workCount = 5; while ((reference = nextElement()) != null) { //Count up to 90 to give the appearance of updating if(workCount < 90){ monitor.worked(1); workCount++; } DecorationBuilder cacheResult = new DecorationBuilder(); monitor.subTask(reference.getSubTask()); //$NON-NLS-1$ //Don't decorate if there is already a pending result Object element = reference.getElement(); Object adapted = reference.getAdaptedElement(); boolean elementIsCached = true; DecorationResult adaptedResult = null; //Synchronize on the result lock as we want to //be sure that we do not try and decorate during //label update servicing. synchronized (resultLock) { elementIsCached = resultCache.containsKey(element); if (elementIsCached) { pendingUpdate.add(element); } if (adapted != null) { adaptedResult = (DecorationResult) resultCache.get(adapted); } } if (!elementIsCached) { //Just build for the resource first if (adapted != null) { if (adaptedResult == null) { decoratorManager .getLightweightManager() .getDecorations( adapted, cacheResult, true); if (cacheResult.hasValue()) { adaptedResult = cacheResult.createResult(); } } else { // If we already calculated the decoration // for the adapted element, reuse the result. cacheResult.applyResult(adaptedResult); // Set adaptedResult to null to indicate that // we do not need to cache the result again. adaptedResult = null; } } //Now add in the results for the main object decoratorManager .getLightweightManager() .getDecorations( element, cacheResult, false); //If we should update regardless then put a result anyways if (cacheResult.hasValue() || reference.shouldForceUpdate()) { //Synchronize on the result lock as we want to //be sure that we do not try and decorate during //label update servicing. //Note: resultCache and pendingUpdate modifications //must be done atomically. synchronized (resultLock) { if (adaptedResult != null) { resultCache.put(adapted, adaptedResult); } // Add the decoration even if it's empty in order to indicate that the decoration is ready resultCache.put( element, cacheResult.createResult()); //Add an update for only the original element to //prevent multiple updates and clear the cache. pendingUpdate.add(element); } } } // Only notify listeners when we have exhausted the // queue of decoration requests. if (awaitingDecoration.isEmpty()) { decorated(); } } monitor.worked(100 - workCount); monitor.done(); return Status.OK_STATUS; } /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object) */ public boolean belongsTo(Object family) { return DecoratorManager.FAMILY_DECORATE == family; } }; decorationJob.setPriority(Job.DECORATE); decorationJob.schedule(); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/1dfb19eecd536385f7d009afac2843666046b28e/DecorationScheduler.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
updateJob.schedule();
updateJob.schedule(100);
synchronized void decorated() { //Don't bother if we are shutdown now if (shutdown) return; //Lazy initialize the job if (updateJob == null) { updateJob = getUpdateJob(); updateJob.setPriority(Job.DECORATE); } updateJob.schedule(); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/1dfb19eecd536385f7d009afac2843666046b28e/DecorationScheduler.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
job.setSystem(true);
private WorkbenchJob getUpdateJob() { WorkbenchJob job = new WorkbenchJob(WorkbenchMessages.getString("DecorationScheduler.UpdateJobName")) {//$NON-NLS-1$ public IStatus runInUIThread(IProgressMonitor monitor) { //Check again in case someone has already cleared it out. synchronized (resultLock) { if (pendingUpdate.isEmpty()) return Status.OK_STATUS; //Get the elements awaiting update and then //clear the list Object[] elements = pendingUpdate.toArray(new Object[pendingUpdate.size()]); monitor.beginTask(WorkbenchMessages.getString("DecorationScheduler.UpdatingTask"), elements.length + 20); //$NON-NLS-1$ pendingUpdate.clear(); monitor.worked(15); decoratorManager.fireListeners( new LabelProviderChangedEvent( decoratorManager, elements)); monitor.worked(elements.length); //Other decoration requests may have occured due to //updates. Only clear the results if there are none pending. if (awaitingDecoration.isEmpty()) resultCache.clear(); monitor.worked(5); monitor.done(); } return Status.OK_STATUS; } /* (non-Javadoc) * @see org.eclipse.ui.progress.WorkbenchJob#performDone(org.eclipse.core.runtime.jobs.IJobChangeEvent) */ public void performDone(IJobChangeEvent event) { if(!pendingUpdate.isEmpty()) decorated(); } }; return job; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/1dfb19eecd536385f7d009afac2843666046b28e/DecorationScheduler.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
if ( weight != null && weight == IdentValue.BOLD ) {
if ( weight != null && ( weight == IdentValue.BOLD || weight == IdentValue.FONT_WEIGHT_700 || weight == IdentValue.FONT_WEIGHT_800 || weight == IdentValue.FONT_WEIGHT_900 )) {
protected Font createFont( Context c, Font root_font, float size, IdentValue weight, IdentValue style, IdentValue variant ) { //Uu.p("creating font: " + root_font + " size = " + size + // " weight = " + weight + " style = " + style + " variant = " + variant); int font_const = Font.PLAIN; if ( weight != null && weight == IdentValue.BOLD ) { font_const = font_const | Font.BOLD; } if ( style != null && style == IdentValue.ITALIC ) { font_const = font_const | Font.ITALIC; } // scale relative to java's default 72.0 dpi float dpi = c.getRenderingContext().getDPI(); float dpiscale = dpi / 72f; // scale vs font scale value too float scale = c.getRenderingContext().getTextRenderer().getFontScale(); size = size * dpiscale * scale; Font fnt = root_font.deriveFont( font_const, size ); if ( variant != null ) { if ( variant == IdentValue.SMALL_CAPS ) { fnt = fnt.deriveFont( (float)( ( (float)fnt.getSize() ) * 0.6 ) ); } } return fnt; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1b93102839a4f136ac081dfa4dfd53ff5387556c/FontResolver.java/buggy/src/java/org/xhtmlrenderer/css/FontResolver.java
VerticalAlign.setupVerticalAlign(c, style, box);
public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line) { InlineBlockBox box = new InlineBlockBox(); box.element = content.getElement(); CalculatedStyle style = c.getCurrentStyle(); // use the prev_align to calculate the x if (prev_align != null && !prev_align.break_after) { box.x = prev_align.x + prev_align.width; } else { box.x = 0; } box.y = 0;// it's relative to the line // do vertical alignment VerticalAlign.setupVerticalAlign(c, style, box); c.translate(box.x + curr_line.x, box.y + curr_line.y); c.translateInsets(box); Rectangle bounds = null; BlockBox block = null; JComponent cc = c.getNamespaceHandler().getCustomComponent(content.getElement(), c); if (cc != null) { bounds = cc.getBounds(); } else { block = (BlockBox) Boxing.layout(c, content); //Uu.p("got a block box from the sub layout: " + block); bounds = new Rectangle(block.x, block.y, block.width, block.height); //Uu.p("bounds = " + bounds); } //box.replaced = true; box.sub_block = block; if (block != null) block.setParent(box); box.component = cc; // set up the extents box.width = bounds.width + box.totalHorizontalPadding(c.getCurrentStyle()); box.height = bounds.height + box.totalVerticalPadding(c.getCurrentStyle()); box.break_after = false; // if it won't fit on this line, then put it on the next one // the box will be discarded and recalculated if (box.width > avail && prev_align != null && !prev_align.break_after) { box.break_before = true; box.x = 0; } if (cc != null && !box.break_before) {//It will be discarded if break_before is true! Point origin = c.getOriginOffset(); cc.setLocation((int) origin.getX(), (int) origin.getY()); c.getCanvas().add(cc); } c.untranslateInsets(box); c.translate(-box.x - curr_line.x, -box.y - curr_line.y); return box; }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/71b2cfce5b6554582e24848d6c3702480ac8ba6c/LineBreaker.java/buggy/src/java/org/xhtmlrenderer/layout/LineBreaker.java
void handleListChange(IObservableList source, ListDiff diff);
void handleListChange(ListChangeEvent event);
void handleListChange(IObservableList source, ListDiff diff);
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6aecdb31231a8602dbf72944625703c440949c78/IListChangeListener.java/clean/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/IListChangeListener.java
AddressLocalServiceUtil.deleteAll(
AddressLocalServiceUtil.deleteAddresses(
private void _upgradeUser() throws Exception { Connection con = null; PreparedStatement ps = null; ResultSet rs = null; try { con = DataAccess.getConnection(Constants.DATA_SOURCE); ps = con.prepareStatement(_UPGRADE_USER); rs = ps.executeQuery(); while (rs.next()) { String userId = rs.getString("userId"); String companyId = rs.getString("companyId"); String password = StringPool.BLANK; String firstName = rs.getString("firstName"); String middleName = rs.getString("middleName"); String lastName = rs.getString("lastName"); String nickName = rs.getString("nickName"); boolean male = rs.getBoolean("male"); Timestamp birthday = rs.getTimestamp("birthday"); String emailAddress = rs.getString("emailAddress"); String smsId = rs.getString("smsId"); String aimId = rs.getString("aimId"); String icqId = rs.getString("icqId"); String msnId = rs.getString("msnId"); String ymId = rs.getString("ymId"); String languageId = rs.getString("languageId"); String timeZoneId = rs.getString("timeZoneId"); String greeting = rs.getString("greeting"); String resolution = rs.getString("resolution"); String comments = rs.getString("comments"); String prefixId = StringPool.BLANK; String suffixId = StringPool.BLANK; Calendar birthdayCal = new GregorianCalendar(); birthdayCal.setTime(birthday); int birthdayMonth = birthdayCal.get(Calendar.MONTH); int birthdayDay = birthdayCal.get(Calendar.DATE); int birthdayYear = birthdayCal.get(Calendar.YEAR); String smsSn = smsId; String aimSn = aimId; String icqSn = icqId; String msnSn = msnId; String ymSn = ymId; String jobTitle = StringPool.BLANK; String organizationId = null; String locationId = null; _log.debug("Upgrading user " + userId); User user = UserLocalServiceUtil.getUserById(userId); user = UserLocalServiceUtil.updateUser( userId, password, emailAddress, languageId, timeZoneId, greeting, resolution, comments, firstName, middleName, lastName, nickName, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn, icqSn, msnSn, ymSn, jobTitle, organizationId, locationId); Contact contact = user.getContact(); List addresses = AddressLocalServiceUtil.getAddresses( companyId, User.class.getName(), userId); AddressLocalServiceUtil.deleteAll( companyId, User.class.getName(), userId); for (int i = 0; i < addresses.size(); i++) { Address address = (Address)addresses.get(i); AddressLocalServiceUtil.addAddress( userId, Contact.class.getName(), contact.getContactId(), address.getStreet1(), address.getStreet2(), address.getStreet3(), address.getCity(), address.getZip(), address.getRegionId(), address.getCountryId(), address.getTypeId(), address.isMailing(), address.isPrimary()); } } } finally { DataAccess.cleanUp(con, ps, rs); } }
57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/f3ad9fb1651cda52873ea772c3df0bb9bd03b52f/UpgradeUser.java/buggy/portal-ejb/src/com/liferay/portal/upgrade/v4_0_0/UpgradeUser.java
private Object findParent(NavigatorContentExtension foundExtension, Object anElement) { Object parent = null; INavigatorContentDescriptor foundDescriptor; parent = foundExtension.getContentProvider().getParent(anElement); if(parent == null && (foundDescriptor = foundExtension.getDescriptor()).getOverriddenDescriptor() != null) { return findParent(contentService.getExtension(foundDescriptor.getOverriddenDescriptor()), anElement); } return parent;
private Object findParent(NavigatorContentExtension anExtension, Object anElement, Object aSuggestedParent) { /* the last valid (non-null) parent for the anElement */ Object lastValidParent = aSuggestedParent; /* used to keep track of new suggestions */ Object suggestedOverriddenParent = null; IPipelinedTreeContentProvider piplineContentProvider; NavigatorContentExtension[] overridingExtensions = anExtension.getOverridingExtensionsForPossibleChild(anElement); for (int i = 0; i < overridingExtensions.length; i++) { if(overridingExtensions[i].getContentProvider() instanceof IPipelinedTreeContentProvider) { piplineContentProvider = (IPipelinedTreeContentProvider) overridingExtensions[i].getContentProvider(); suggestedOverriddenParent = piplineContentProvider.getPipelinedParent(anElement, lastValidParent); if(suggestedOverriddenParent != null) lastValidParent = suggestedOverriddenParent; lastValidParent = findParent(overridingExtensions[i], anElement, lastValidParent); } } return lastValidParent;
private Object findParent(NavigatorContentExtension foundExtension, Object anElement) { Object parent = null; INavigatorContentDescriptor foundDescriptor; parent = foundExtension.getContentProvider().getParent(anElement); if(parent == null && (foundDescriptor = foundExtension.getDescriptor()).getOverriddenDescriptor() != null) { return findParent(contentService.getExtension(foundDescriptor.getOverriddenDescriptor()), anElement); } return parent; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/760f9bf6c2e4d21502cb533a888c5fe64e58bdf8/NavigatorContentServiceContentProvider.java/buggy/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java
if (!shouldDeferToOverridePath(foundExtension.getDescriptor(),
if (!isOverridingExtensionInSet(foundExtension.getDescriptor(),
public synchronized Object[] getElements(Object anInputElement) { Set rootContentExtensions = contentService .findRootContentExtensions(anInputElement); if (rootContentExtensions.size() == 0) { return NO_CHILDREN; } ContributorTrackingSet finalElementsSet = new ContributorTrackingSet(contentService); ContributorTrackingSet localSet = new ContributorTrackingSet(contentService); Object[] contributedChildren = null; NavigatorContentExtension foundExtension; NavigatorContentExtension[] overridingExtensions; for (Iterator itr = rootContentExtensions.iterator(); itr.hasNext();) { foundExtension = (NavigatorContentExtension) itr.next(); try { if (!shouldDeferToOverridePath(foundExtension.getDescriptor(), rootContentExtensions)) { contributedChildren = foundExtension.internalGetContentProvider() .getElements(anInputElement); localSet.setContents(contributedChildren); overridingExtensions = foundExtension .getOverridingExtensionsForTriggerPoint(anInputElement); if (overridingExtensions.length > 0) { localSet = pipelineElements(anInputElement, overridingExtensions, localSet); } finalElementsSet.addAll(localSet); } } catch (RuntimeException re) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), re); } catch (Error e) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), e); } } return finalElementsSet.toArray(); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/760f9bf6c2e4d21502cb533a888c5fe64e58bdf8/NavigatorContentServiceContentProvider.java/buggy/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java
if (!shouldDeferToOverridePath(foundExtension.getDescriptor(),
if (!isOverridingExtensionInSet(foundExtension.getDescriptor(),
public synchronized Object getParent(Object anElement) { Set extensions = contentService .findContentExtensionsWithPossibleChild(anElement); Object parent; NavigatorContentExtension foundExtension; NavigatorContentExtension[] overridingExtensions; for (Iterator itr = extensions.iterator(); itr.hasNext();) { foundExtension = (NavigatorContentExtension) itr.next(); try { if (!shouldDeferToOverridePath(foundExtension.getDescriptor(), extensions)) { parent = foundExtension.internalGetContentProvider().getParent( anElement); overridingExtensions = foundExtension .getOverridingExtensionsForPossibleChild(anElement); if (overridingExtensions.length > 0) { parent = pipelineParent(anElement, overridingExtensions, parent); } if (parent != null) { return parent; } } } catch (RuntimeException re) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), re); } catch (Error e) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), e); } } return null; }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/760f9bf6c2e4d21502cb533a888c5fe64e58bdf8/NavigatorContentServiceContentProvider.java/buggy/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java
Set extensions = contentService .findContentExtensionsWithPossibleChild(anElement); Set result = new HashSet(); NavigatorContentExtension foundExtension; NavigatorContentExtension[] overridingExtensions; for (Iterator itr = extensions.iterator(); itr.hasNext();) { foundExtension = (NavigatorContentExtension) itr.next(); try {
public TreePath[] getParents(Object anElement) { Set extensions = contentService .findContentExtensionsWithPossibleChild(anElement); Set result = new HashSet(); NavigatorContentExtension foundExtension; NavigatorContentExtension[] overridingExtensions; for (Iterator itr = extensions.iterator(); itr.hasNext();) { foundExtension = (NavigatorContentExtension) itr.next(); try { if (!shouldDeferToOverridePath(foundExtension.getDescriptor(), extensions)) { // We know the content provider is a SafeDelegateTreeContentProvider // which implements ITreePathContentProvider ITreeContentProvider tcp = foundExtension.getContentProvider(); if (tcp instanceof ITreePathContentProvider) { ITreePathContentProvider tpcp = (ITreePathContentProvider) tcp; TreePath[] parents = tpcp.getParents(anElement); Set parentPaths = asSet(parents); overridingExtensions = foundExtension .getOverridingExtensionsForPossibleChild(anElement); if (overridingExtensions.length > 0) { parentPaths = pipelineParents(anElement, overridingExtensions, parentPaths); } result.addAll(parentPaths); } else { List segments = new ArrayList(); Object parent = findParent(foundExtension, anElement); Object lastParent = null; while(parent != null && parent != viewer.getInput() && parent != lastParent) { lastParent = parent; segments.add(0, parent); parent = findParent(foundExtension, parent); } result.add(new TreePath(segments.toArray())); } } } catch (RuntimeException re) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), re); } catch (Error e) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), e); } } return (TreePath[]) result.toArray(new TreePath[result.size()]); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/760f9bf6c2e4d21502cb533a888c5fe64e58bdf8/NavigatorContentServiceContentProvider.java/buggy/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java
if (!shouldDeferToOverridePath(foundExtension.getDescriptor(), extensions)) { ITreeContentProvider tcp = foundExtension.getContentProvider(); if (tcp instanceof ITreePathContentProvider) { ITreePathContentProvider tpcp = (ITreePathContentProvider) tcp; TreePath[] parents = tpcp.getParents(anElement); Set parentPaths = asSet(parents); overridingExtensions = foundExtension .getOverridingExtensionsForPossibleChild(anElement); if (overridingExtensions.length > 0) { parentPaths = pipelineParents(anElement, overridingExtensions, parentPaths); } result.addAll(parentPaths); } else { List segments = new ArrayList(); Object parent = findParent(foundExtension, anElement); Object lastParent = null; while(parent != null && parent != viewer.getInput() && parent != lastParent) { lastParent = parent; segments.add(0, parent); parent = findParent(foundExtension, parent); } result.add(new TreePath(segments.toArray())); } } } catch (RuntimeException re) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), re); } catch (Error e) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), e); }
List paths = new ArrayList(); TreePathCompiler compiler = new TreePathCompiler(anElement); Set compilers = findPaths(compiler); for (Iterator iter = compilers.iterator(); iter.hasNext();) { TreePathCompiler c = (TreePathCompiler) iter.next(); paths.add(c.createParentPath());
public TreePath[] getParents(Object anElement) { Set extensions = contentService .findContentExtensionsWithPossibleChild(anElement); Set result = new HashSet(); NavigatorContentExtension foundExtension; NavigatorContentExtension[] overridingExtensions; for (Iterator itr = extensions.iterator(); itr.hasNext();) { foundExtension = (NavigatorContentExtension) itr.next(); try { if (!shouldDeferToOverridePath(foundExtension.getDescriptor(), extensions)) { // We know the content provider is a SafeDelegateTreeContentProvider // which implements ITreePathContentProvider ITreeContentProvider tcp = foundExtension.getContentProvider(); if (tcp instanceof ITreePathContentProvider) { ITreePathContentProvider tpcp = (ITreePathContentProvider) tcp; TreePath[] parents = tpcp.getParents(anElement); Set parentPaths = asSet(parents); overridingExtensions = foundExtension .getOverridingExtensionsForPossibleChild(anElement); if (overridingExtensions.length > 0) { parentPaths = pipelineParents(anElement, overridingExtensions, parentPaths); } result.addAll(parentPaths); } else { List segments = new ArrayList(); Object parent = findParent(foundExtension, anElement); Object lastParent = null; while(parent != null && parent != viewer.getInput() && parent != lastParent) { lastParent = parent; segments.add(0, parent); parent = findParent(foundExtension, parent); } result.add(new TreePath(segments.toArray())); } } } catch (RuntimeException re) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), re); } catch (Error e) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), e); } } return (TreePath[]) result.toArray(new TreePath[result.size()]); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/760f9bf6c2e4d21502cb533a888c5fe64e58bdf8/NavigatorContentServiceContentProvider.java/buggy/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java
return (TreePath[]) result.toArray(new TreePath[result.size()]);
return (TreePath[]) paths.toArray(new TreePath[paths.size()]);
public TreePath[] getParents(Object anElement) { Set extensions = contentService .findContentExtensionsWithPossibleChild(anElement); Set result = new HashSet(); NavigatorContentExtension foundExtension; NavigatorContentExtension[] overridingExtensions; for (Iterator itr = extensions.iterator(); itr.hasNext();) { foundExtension = (NavigatorContentExtension) itr.next(); try { if (!shouldDeferToOverridePath(foundExtension.getDescriptor(), extensions)) { // We know the content provider is a SafeDelegateTreeContentProvider // which implements ITreePathContentProvider ITreeContentProvider tcp = foundExtension.getContentProvider(); if (tcp instanceof ITreePathContentProvider) { ITreePathContentProvider tpcp = (ITreePathContentProvider) tcp; TreePath[] parents = tpcp.getParents(anElement); Set parentPaths = asSet(parents); overridingExtensions = foundExtension .getOverridingExtensionsForPossibleChild(anElement); if (overridingExtensions.length > 0) { parentPaths = pipelineParents(anElement, overridingExtensions, parentPaths); } result.addAll(parentPaths); } else { List segments = new ArrayList(); Object parent = findParent(foundExtension, anElement); Object lastParent = null; while(parent != null && parent != viewer.getInput() && parent != lastParent) { lastParent = parent; segments.add(0, parent); parent = findParent(foundExtension, parent); } result.add(new TreePath(segments.toArray())); } } } catch (RuntimeException re) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), re); } catch (Error e) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), e); } } return (TreePath[]) result.toArray(new TreePath[result.size()]); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/760f9bf6c2e4d21502cb533a888c5fe64e58bdf8/NavigatorContentServiceContentProvider.java/buggy/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java
if (!shouldDeferToOverridePath(foundExtension.getDescriptor(),
if (!isOverridingExtensionInSet(foundExtension.getDescriptor(),
private Object[] internalGetChildren(Object aParentElementOrPath) { Object aParentElement = internalAsElement(aParentElementOrPath); Set enabledExtensions = contentService .findContentExtensionsByTriggerPoint(aParentElement); if (enabledExtensions.size() == 0) { return NO_CHILDREN; } ContributorTrackingSet finalChildrenSet = new ContributorTrackingSet(contentService); ContributorTrackingSet localSet = new ContributorTrackingSet(contentService); Object[] contributedChildren = null; NavigatorContentExtension foundExtension; NavigatorContentExtension[] overridingExtensions; for (Iterator itr = enabledExtensions.iterator(); itr.hasNext();) { foundExtension = (NavigatorContentExtension) itr.next(); try { if (!shouldDeferToOverridePath(foundExtension.getDescriptor(), enabledExtensions)) { contributedChildren = foundExtension.internalGetContentProvider() .getChildren(aParentElementOrPath); overridingExtensions = foundExtension .getOverridingExtensionsForTriggerPoint(aParentElement); localSet.setContents(contributedChildren); if (overridingExtensions.length > 0) { // TODO: could pass tree path through pipeline localSet = pipelineChildren(aParentElement, overridingExtensions, localSet); } finalChildrenSet.addAll(localSet); } } catch (RuntimeException re) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), re); } catch (Error e) { NavigatorPlugin .logError( 0, NLS .bind( CommonNavigatorMessages.Could_not_provide_children_for_element, new Object[] { foundExtension .getDescriptor() .getId() }), e); } } return finalChildrenSet.toArray(); }
57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/760f9bf6c2e4d21502cb533a888c5fe64e58bdf8/NavigatorContentServiceContentProvider.java/buggy/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java
System.out .println("Cleaning test dir (" + files.length + " files/dirs)");
System.out.println("Cleaning test dir (" + files.length + " files/dirs)");
public static void cleanTestDir() { File testDir = getTestDir(); File[] files = testDir.listFiles(); if (files == null) { return; } System.out .println("Cleaning test dir (" + files.length + " files/dirs)"); for (File file : files) { try { if (file.isDirectory()) { FileUtils.deleteDirectory(file); } else if (file.isFile()) { FileUtils.forceDelete(file); } } catch (IOException e) { // log().error(e); } } }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/a49171da04ec10edf60306c84d71f188b2bbb3f8/TestHelper.java/clean/src/test/de/dal33t/powerfolder/test/TestHelper.java
private static final String createRandomFilename() {
public static final String createRandomFilename() {
private static final String createRandomFilename() { String str = UUID.randomUUID().toString(); StringBuffer buf = new StringBuffer(); int l = (int) (Math.random() * str.length()); for (int i = 0; i < l; i++) { char c; if (i % 2 == 0) { c = Character.toLowerCase(str.charAt(i)); } else { c = Character.toUpperCase(str.charAt(i)); } buf.append(c); } buf.append(".test"); return buf.toString(); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/a49171da04ec10edf60306c84d71f188b2bbb3f8/TestHelper.java/clean/src/test/de/dal33t/powerfolder/test/TestHelper.java
int l = (int) (Math.random() * str.length());
int l = 1 + (int) (Math.random() * (str.length() - 1));
private static final String createRandomFilename() { String str = UUID.randomUUID().toString(); StringBuffer buf = new StringBuffer(); int l = (int) (Math.random() * str.length()); for (int i = 0; i < l; i++) { char c; if (i % 2 == 0) { c = Character.toLowerCase(str.charAt(i)); } else { c = Character.toUpperCase(str.charAt(i)); } buf.append(c); } buf.append(".test"); return buf.toString(); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/a49171da04ec10edf60306c84d71f188b2bbb3f8/TestHelper.java/clean/src/test/de/dal33t/powerfolder/test/TestHelper.java
} catch (IOException ioExcpn) {
} catch (Exception e) { e.printStackTrace();
public void execute() throws BuildException { Map fileMap = new HashMap(); FileNameMapper mapper = null; if (mapperElement != null) { mapper = mapperElement.getImplementation(); } else { mapper = new GlobPatternMapper(); mapper.setFrom("*.rb"); mapper.setTo("*.rb.ast.ser"); } SourceFileScanner sfs = new SourceFileScanner(this); for (int i = 0, size = fileSets.size(); i < size; i++) { FileSet fs = (FileSet) fileSets.get(i); DirectoryScanner ds = fs.getDirectoryScanner(project); File dir = fs.getDir(project); String[] files = ds.getIncludedFiles(); files = sfs.restrict(files, dir, destdir, mapper); for (int j = 0; j < files.length; j++) { File src = new File(dir, files[j]); File dest = new File(destdir, mapper.mapFileName(files[j])[0]); fileMap.put(src, dest); } } if (fileMap.size() > 0) { log( "Serializing " + fileMap.size() + " file" + (fileMap.size() == 1 ? "" : "s") + " to " + destdir.getAbsolutePath()); Iterator iter = fileMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); try { ((File) entry.getValue()).getParentFile().mkdirs(); if (verbose) System.out.println(entry.getKey()); ASTSerializer.serialize((File) entry.getKey(), (File) entry.getValue()); } catch (IOException ioExcpn) { } } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f275f45542bf672d8eb07f9a43b5812354182c8b/JRubySerialize.java/clean/src/org/jruby/util/ant/JRubySerialize.java
box.y -= fm.getDescent();
box.y += fm.getDescent();
public static void setupVerticalAlign( Context c, Node node, InlineBox box ) { //u.p("setup vertical align: node = " + node + " box = " + box); // get the parent node for styling Node parent = node.getParentNode(); //u.p("parent = " + parent); Element elem = null; if ( node.getNodeType() == node.TEXT_NODE ) { parent = parent.getParentNode(); elem = (Element)node.getParentNode(); } else { elem = (Element)node; } //u.p("parent = " + parent + " elem = " + elem); //int parent_height = FontUtil.lineHeight(c,parent); Font parent_font = FontUtil.getFont( c, parent ); LineMetrics parent_metrics = null; if ( !InlineLayout.isReplaced( node ) ) { if ( !InlineLayout.isFloatedBlock( node, c ) ) { parent_metrics = parent_font.getLineMetrics( box.getText(), ( (Graphics2D)c.getGraphics() ).getFontRenderContext() ); } else { parent_metrics = parent_font.getLineMetrics( "Test", ( (Graphics2D)c.getGraphics() ).getFontRenderContext() ); } } else { parent_metrics = parent_font.getLineMetrics( "Test", ( (Graphics2D)c.getGraphics() ).getFontRenderContext() ); } // the height of the font float parent_height = parent_metrics.getHeight(); //u.p("parent strikethrough height = " + parent_metrics.getStrikethroughOffset()); String vertical_align = c.css.getStringProperty( elem, "vertical-align" ); // set the height of the box to the height of the font if ( !InlineLayout.isReplaced( node ) ) { box.height = FontUtil.lineHeight( c, node ); //u.p("set height of box: " + box.height + " == " + box); } //u.p("vertical align = " + vertical_align); if ( vertical_align == null ) { vertical_align = "baseline"; } box.baseline = 0; // box.y is relative to the parent's baseline box.y = 0; // do nothing for 'baseline' box.vset = true; if ( vertical_align.equals( "baseline" ) ) { //u.p("doing baseline"); Font font = FontUtil.getFont( c, node ); //u.p("font = " + font); FontMetrics fm = c.getGraphics().getFontMetrics( font ); //noop box.y = box.y; box.y -= fm.getDescent(); } // works okay i think if ( vertical_align.equals( "super" ) ) { box.y = box.y + (int)( parent_metrics.getStrikethroughOffset() * 2.0 ); } // works okay, i think if ( vertical_align.equals( "sub" ) ) { box.y = box.y - (int)parent_metrics.getStrikethroughOffset(); } // joshy: this is using the current baseline instead of the parent's baseline // must fix if ( vertical_align.equals( "text-top" ) ) { // the top of this text is equal to the top of the parent's text // so we take the parent's height above the baseline and subtract our // height above the baseline box.y = -( (int)parent_height - box.height );//(int) (parent_metrics.getStrikethroughOffset()*2.0); } // not implemented correctly yet if ( vertical_align.equals( "text-bottom" ) ) { box.y = 0; } // not implemented correctly yet. if ( vertical_align.equals( "top" ) ) { //u.p("before y = " + box.y); //u.p("baseline = " + box.baseline); box.y = box.y - box.baseline;//(int) (parent_metrics.getStrikethroughOffset()*2.0); box.top_align = true; //u.p("after y = " + box.y); box.vset = false; } if ( vertical_align.equals( "bottom" ) ) { //u.p("before y = " + box.y); //u.p("baseline = " + box.baseline); box.y = box.y - box.baseline;//(int) (parent_metrics.getStrikethroughOffset()*2.0); box.bottom_align = true; //u.p("after y = " + box.y); box.vset = false; } //u.p("returning box: " + box); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e79f8be3a1eeb16a1f4aa765b39fbfb66b65bdc9/FontUtil.java/buggy/src/java/org/xhtmlrenderer/layout/FontUtil.java
public static void setupVerticalAlign( Context c, Node node, InlineBox box ) { //u.p("setup vertical align: node = " + node + " box = " + box); // get the parent node for styling Node parent = node.getParentNode(); //u.p("parent = " + parent); Element elem = null; if ( node.getNodeType() == node.TEXT_NODE ) { parent = parent.getParentNode(); elem = (Element)node.getParentNode(); } else { elem = (Element)node; } //u.p("parent = " + parent + " elem = " + elem); //int parent_height = FontUtil.lineHeight(c,parent); Font parent_font = FontUtil.getFont( c, parent ); LineMetrics parent_metrics = null; if ( !InlineLayout.isReplaced( node ) ) { if ( !InlineLayout.isFloatedBlock( node, c ) ) { parent_metrics = parent_font.getLineMetrics( box.getText(), ( (Graphics2D)c.getGraphics() ).getFontRenderContext() ); } else { parent_metrics = parent_font.getLineMetrics( "Test", ( (Graphics2D)c.getGraphics() ).getFontRenderContext() ); } } else { parent_metrics = parent_font.getLineMetrics( "Test", ( (Graphics2D)c.getGraphics() ).getFontRenderContext() ); } // the height of the font float parent_height = parent_metrics.getHeight(); //u.p("parent strikethrough height = " + parent_metrics.getStrikethroughOffset()); String vertical_align = c.css.getStringProperty( elem, "vertical-align" ); // set the height of the box to the height of the font if ( !InlineLayout.isReplaced( node ) ) { box.height = FontUtil.lineHeight( c, node ); //u.p("set height of box: " + box.height + " == " + box); } //u.p("vertical align = " + vertical_align); if ( vertical_align == null ) { vertical_align = "baseline"; } box.baseline = 0; // box.y is relative to the parent's baseline box.y = 0; // do nothing for 'baseline' box.vset = true; if ( vertical_align.equals( "baseline" ) ) { //u.p("doing baseline"); Font font = FontUtil.getFont( c, node ); //u.p("font = " + font); FontMetrics fm = c.getGraphics().getFontMetrics( font ); //noop box.y = box.y; box.y -= fm.getDescent(); } // works okay i think if ( vertical_align.equals( "super" ) ) { box.y = box.y + (int)( parent_metrics.getStrikethroughOffset() * 2.0 ); } // works okay, i think if ( vertical_align.equals( "sub" ) ) { box.y = box.y - (int)parent_metrics.getStrikethroughOffset(); } // joshy: this is using the current baseline instead of the parent's baseline // must fix if ( vertical_align.equals( "text-top" ) ) { // the top of this text is equal to the top of the parent's text // so we take the parent's height above the baseline and subtract our // height above the baseline box.y = -( (int)parent_height - box.height );//(int) (parent_metrics.getStrikethroughOffset()*2.0); } // not implemented correctly yet if ( vertical_align.equals( "text-bottom" ) ) { box.y = 0; } // not implemented correctly yet. if ( vertical_align.equals( "top" ) ) { //u.p("before y = " + box.y); //u.p("baseline = " + box.baseline); box.y = box.y - box.baseline;//(int) (parent_metrics.getStrikethroughOffset()*2.0); box.top_align = true; //u.p("after y = " + box.y); box.vset = false; } if ( vertical_align.equals( "bottom" ) ) { //u.p("before y = " + box.y); //u.p("baseline = " + box.baseline); box.y = box.y - box.baseline;//(int) (parent_metrics.getStrikethroughOffset()*2.0); box.bottom_align = true; //u.p("after y = " + box.y); box.vset = false; } //u.p("returning box: " + box); }
57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/e79f8be3a1eeb16a1f4aa765b39fbfb66b65bdc9/FontUtil.java/buggy/src/java/org/xhtmlrenderer/layout/FontUtil.java
&& !node.isMySelf()) {
&& !node.isMySelf()) {
public void addChatMember(Member node) { if (chatTreeNodes != null && !chatTreeNodes.contains(node) && !node.isMySelf()) { chatTreeNodes.addChild(node); } updateTreeNode(); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/5e02adc216a5e874559c0e9881d81ec39d41c9bd/MemberUI.java/buggy/src/main/de/dal33t/powerfolder/ui/MemberUI.java
private void updateOnlineStatus(Member member) {// UI Stuff if (onlineTreeNodes != null) { boolean inOnlineList = onlineTreeNodes.indexOf(member) >= 0; if (member.isCompleteyConnected()) { if (!inOnlineList) { // Add if not already in list onlineTreeNodes.addChild(member); } } else { if (inOnlineList) { // Remove from list onlineTreeNodes.removeChild(member); } } } updateTreeNode(); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/5e02adc216a5e874559c0e9881d81ec39d41c9bd/MemberUI.java/buggy/src/main/de/dal33t/powerfolder/ui/MemberUI.java
getUIController().getControlQuarter().getNavigationTreeModel().updateFriendsAndOnlineTreeNodes();
getUIController().getControlQuarter().getNavigationTreeModel() .updateFriendsAndOnlineTreeNodes();
private void updateTreeNode() { getUIController().getControlQuarter().getNavigationTreeModel().updateFriendsAndOnlineTreeNodes(); }
51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/5e02adc216a5e874559c0e9881d81ec39d41c9bd/MemberUI.java/buggy/src/main/de/dal33t/powerfolder/ui/MemberUI.java
PackerApp pa = (PackerApp) packApps.get(new Integer(type));
PackerMoteApp pa = (PackerMoteApp) packApps.get(new Integer(type));
public BigPack buildPack(short type) { PackerApp pa = (PackerApp) packApps.get(new Integer(type)); if (pa == null) return null; BigPack bp = pa.buildPack(id); if (bp == null) return null; return bp; }
52796 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52796/e4b1dd13d7bb52d8759a2c5fe719f1d893aa4897/PackerMote.java/clean/java/edu/rice/compass/bigpack/PackerMote.java
BigPack bp = pa.buildPack(id);
BigPack bp = pa.buildPack();
public BigPack buildPack(short type) { PackerApp pa = (PackerApp) packApps.get(new Integer(type)); if (pa == null) return null; BigPack bp = pa.buildPack(id); if (bp == null) return null; return bp; }
52796 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52796/e4b1dd13d7bb52d8759a2c5fe719f1d893aa4897/PackerMote.java/clean/java/edu/rice/compass/bigpack/PackerMote.java
PackerApp pa = (PackerApp) packApps.get(new Integer(type));
PackerMoteApp pa = (PackerMoteApp) packApps.get(new Integer(type));
public void packerDone(short type) { PackerApp pa = (PackerApp) packApps.get(new Integer(type)); if (pa == null) return; pa.packerDone(id); }
52796 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52796/e4b1dd13d7bb52d8759a2c5fe719f1d893aa4897/PackerMote.java/clean/java/edu/rice/compass/bigpack/PackerMote.java
pa.packerDone(id);
pa.packerDone();
public void packerDone(short type) { PackerApp pa = (PackerApp) packApps.get(new Integer(type)); if (pa == null) return; pa.packerDone(id); }
52796 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52796/e4b1dd13d7bb52d8759a2c5fe719f1d893aa4897/PackerMote.java/clean/java/edu/rice/compass/bigpack/PackerMote.java