rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
stringEditor = new StringFieldEditor( | serverUrlEditor = new UrlFieldEditor( | protected void createFieldEditors() { StringFieldEditor stringEditor = new StringFieldEditor( ConnectionConstants.JMS_CONNECTION_FACTORY_KEY, "Connection factory name", getFieldEditorParent() ); addField(stringEditor); stringEditor = new StringFieldEditor( ConnectionConstants.JMS_CONTEXT_FACTORY_KEY, "Context factory name", getFieldEditorParent() ); addField(stringEditor); stringEditor = new StringFieldEditor( ConnectionConstants.JMS_INCOMING_TOPIC_KEY, "Incoming topic name", getFieldEditorParent() ); addField(stringEditor); stringEditor = new StringFieldEditor( ConnectionConstants.JMS_OUTGOING_QUEUE_KEY, "Outgoing queue name", getFieldEditorParent() ); addField(stringEditor); stringEditor = new StringFieldEditor( ConnectionConstants.JMS_URL_KEY, "Server URL", getFieldEditorParent() ); addField(stringEditor); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/b329de304a1922f59f08ed44a156121180f196a9/JMSPreferencePage.java/buggy/source/trunk/plugins/org.marketcetera.photon/src/main/java/org/marketcetera/photon/preferences/JMSPreferencePage.java |
addField(stringEditor); | addField(serverUrlEditor); | protected void createFieldEditors() { StringFieldEditor stringEditor = new StringFieldEditor( ConnectionConstants.JMS_CONNECTION_FACTORY_KEY, "Connection factory name", getFieldEditorParent() ); addField(stringEditor); stringEditor = new StringFieldEditor( ConnectionConstants.JMS_CONTEXT_FACTORY_KEY, "Context factory name", getFieldEditorParent() ); addField(stringEditor); stringEditor = new StringFieldEditor( ConnectionConstants.JMS_INCOMING_TOPIC_KEY, "Incoming topic name", getFieldEditorParent() ); addField(stringEditor); stringEditor = new StringFieldEditor( ConnectionConstants.JMS_OUTGOING_QUEUE_KEY, "Outgoing queue name", getFieldEditorParent() ); addField(stringEditor); stringEditor = new StringFieldEditor( ConnectionConstants.JMS_URL_KEY, "Server URL", getFieldEditorParent() ); addField(stringEditor); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/b329de304a1922f59f08ed44a156121180f196a9/JMSPreferencePage.java/buggy/source/trunk/plugins/org.marketcetera.photon/src/main/java/org/marketcetera/photon/preferences/JMSPreferencePage.java |
mPreferences.save(); | serverUrlEditor.setStringValue(serverUrlEditor.getStringValue().trim()); super.performOk(); preferences.save(); | public boolean performOk() { try { mPreferences.save(); } catch (IOException e) { //TODO: do something } return super.performOk(); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/b329de304a1922f59f08ed44a156121180f196a9/JMSPreferencePage.java/buggy/source/trunk/plugins/org.marketcetera.photon/src/main/java/org/marketcetera/photon/preferences/JMSPreferencePage.java |
return super.performOk(); | return true; | public boolean performOk() { try { mPreferences.save(); } catch (IOException e) { //TODO: do something } return super.performOk(); } | 52787 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52787/b329de304a1922f59f08ed44a156121180f196a9/JMSPreferencePage.java/buggy/source/trunk/plugins/org.marketcetera.photon/src/main/java/org/marketcetera/photon/preferences/JMSPreferencePage.java |
private InlineBox calculateInline( Context c, Node node, int avail, int max_width, LineBox line, InlineBox prev, Element containing_block, InlineBox prev_align ) { // calculate the starting index int start = 0; // if this is another box from the same node as the previous one if ( prev != null && prev.node == node ) { start = prev.end_index; } // get the text of the node String text = node.getNodeValue(); // transform the text if required (like converting to caps) // this must be done before any measuring since it might change the // size of the text text = TextUtil.transformText( c, node, text ); // u.p("calculating inline: text = " + text); // u.p("avail space = " + avail + " max = " + max_width + " start index = " + start); // get the current font. required for sizing Font font = FontUtil.getFont( c, node ); // handle each case if ( LayoutUtil.isReplaced(c, node ) ) { //u.p("is replaced"); return LineBreaker.generateReplacedInlineBox( c, node, avail, prev, text, prev_align, font ); } //u.p("calc inline on node : " + node); if ( LayoutUtil.isFloatedBlock( node, c ) ) { //u.p("calcinline: is floated block"); return FloatUtil.generateFloatedBlockInlineBox( c, node, avail, prev, text, prev_align, font ); } if ( LineBreaker.isFirstLetter( c, node, start ) ) { // u.p("is first letter"); return LineBreaker.generateFirstLetterInlineBox( c, node, start, text, prev, prev_align, avail); } if ( c.getRenderingContext().getLayoutFactory().isBreak( node ) ) { // u.p("is break"); return LineBreaker.generateBreakInlineBox( node ); } if ( LineBreaker.isWhitespace( c, containing_block ) ) { // u.p("is whitespace"); return LineBreaker.generateWhitespaceInlineBox( c, node, start, prev, text, prev_align, font ); } // ==== unbreakable long word ===== if ( LineBreaker.isUnbreakableLine( c, node, start, text, avail, font ) ) { // u.p("is unbreakable"); return LineBreaker.generateUnbreakableInlineBox( c, node, start, text, prev, prev_align, font ); } // rest of this string can fit on the line if ( LineBreaker.canFitOnLine( c, node, start, text, avail, font ) ) { // u.p("can fit on line"); return LineBreaker.generateRestOfTextNodeInlineBox( c, node, start, text, prev, prev_align, font ); } // normal multiline break // u.p("normal multi line break"); return LineBreaker.generateMultilineBreak( c, node, start, text, prev, prev_align, avail ); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/631ee187cba274ce571d6a7e5b800c58f77b1142/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
||
} | private InlineBox calculateInline( Context c, Node node, int avail, int max_width, LineBox line, InlineBox prev, Element containing_block, InlineBox prev_align ) { // calculate the starting index int start = 0; // if this is another box from the same node as the previous one if ( prev != null && prev.node == node ) { start = prev.end_index; } // get the text of the node String text = node.getNodeValue(); // transform the text if required (like converting to caps) // this must be done before any measuring since it might change the // size of the text text = TextUtil.transformText( c, node, text ); // u.p("calculating inline: text = " + text); // u.p("avail space = " + avail + " max = " + max_width + " start index = " + start); // get the current font. required for sizing Font font = FontUtil.getFont( c, node ); // handle each case if ( LayoutUtil.isReplaced(c, node ) ) { //u.p("is replaced"); return LineBreaker.generateReplacedInlineBox( c, node, avail, prev, text, prev_align, font ); } //u.p("calc inline on node : " + node); if ( LayoutUtil.isFloatedBlock( node, c ) ) { //u.p("calcinline: is floated block"); return FloatUtil.generateFloatedBlockInlineBox( c, node, avail, prev, text, prev_align, font ); } if ( LineBreaker.isFirstLetter( c, node, start ) ) { // u.p("is first letter"); return LineBreaker.generateFirstLetterInlineBox( c, node, start, text, prev, prev_align, avail); } if ( c.getRenderingContext().getLayoutFactory().isBreak( node ) ) { // u.p("is break"); return LineBreaker.generateBreakInlineBox( node ); } if ( LineBreaker.isWhitespace( c, containing_block ) ) { // u.p("is whitespace"); return LineBreaker.generateWhitespaceInlineBox( c, node, start, prev, text, prev_align, font ); } // ==== unbreakable long word ===== if ( LineBreaker.isUnbreakableLine( c, node, start, text, avail, font ) ) { // u.p("is unbreakable"); return LineBreaker.generateUnbreakableInlineBox( c, node, start, text, prev, prev_align, font ); } // rest of this string can fit on the line if ( LineBreaker.canFitOnLine( c, node, start, text, avail, font ) ) { // u.p("can fit on line"); return LineBreaker.generateRestOfTextNodeInlineBox( c, node, start, text, prev, prev_align, font ); } // normal multiline break // u.p("normal multi line break"); return LineBreaker.generateMultilineBreak( c, node, start, text, prev, prev_align, avail ); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/631ee187cba274ce571d6a7e5b800c58f77b1142/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
|
TextUtil.stripWhitespace( c, current_node, elem ); | if(!Configuration.isTrue("xr.layout.whitespace.experimental",false)) { TextUtil.stripWhitespace( c, current_node, elem ); } | public Box layoutChildren( Context c, Box box ) { //u.p("starting to lay out the children"); if ( LayoutUtil.isHiddenNode( box.getElement(), c ) ) { return box; } if ( !box.isAnonymous() ) { if ( LayoutUtil.isBlockLayout( box.getElement(), c ) ) { // u.p("doing up block for: " + box); return super.layoutChildren( c, box ); } } //int debug_counter = 0; //int childcount = 0; BlockBox block = (BlockBox)box; // calculate the initial position and dimensions Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; bounds.width -= box.margin.left + box.border.left + box.padding.left + box.padding.right + box.border.right + box.margin.right; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = new LineBox(); c.setFirstLine(true); curr_line.setParent(box); curr_line.x = bounds.x; curr_line.width = 0; // account for text-indent Element elem = block.getElement(); remaining_width = InlineUtil.doTextIndent( c, elem, remaining_width, curr_line ); LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // get the list of inlines for this run List inline_node_list = null; if ( box.isAnonymous() ) { inline_node_list = ( (AnonymousBlockBox)box ).node_list; } else { inline_node_list = InlineUtil.getInlineNodeList( elem, elem, c ); } //u.p("in box: " + box); //u.p("final inline node list = "); //u.p(inline_node_list); // loop until no more nodes Node current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); // adjust the first line for tabs remaining_width = FloatUtil.adjustForTab( c, prev_line, remaining_width ); while ( current_node != null ) { // loop until no more text in this node while ( true ) { // debugging check if ( bounds.width < 0 ) { u.p( "bounds width = " + bounds.width ); u.dump_stack(); System.exit( -1 ); } // test if there is no more text in the current text node // if there is a prev, and if the prev was part of this current node if ( prev_inline != null && prev_inline.node == current_node ) { // replaced elements aren't split, so done with this one if ( LayoutUtil.isReplaced(c, current_node ) ) { break; } if ( LayoutUtil.isFloatedBlock( current_node, c ) ) { break; } if ( c.getRenderingContext().getLayoutFactory().isBreak( current_node ) ) { break; } // if no more unused text in this node if ( prev_inline.end_index >= current_node.getNodeValue().length() ) { // then break break; } } // the crash warning code if ( bounds.width < 1 ) { u.p( "warning. width < 1 " + bounds.width ); } // look at current inline // break off the longest section that will fit InlineBox new_inline = calculateInline( c, current_node, remaining_width, bounds.width, curr_line, prev_inline, elem, prev_align_inline ); // if this inline needs to be on a new line if ( new_inline.break_before && !new_inline.floated ) { // u.p("breaking before"); // finish up the current line remaining_width = bounds.width; saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // save the new inline to the list curr_line.addChild( new_inline ); // calc new height of the line // don't count the inline towards the line height and //line baseline if it's a floating inline. if ( !LayoutUtil.isFloated( new_inline, c ) ) { if ( !LayoutUtil.isFloatedBlock( new_inline.node, c ) ) { //u.p("calcing new height of line"); if ( new_inline.height + new_inline.y > curr_line.height ) { curr_line.height = new_inline.height + new_inline.y; } if ( new_inline.baseline > curr_line.baseline ) { curr_line.baseline = new_inline.baseline; } } } //u.p("curr line: " + curr_line); //u.p("parent = " + curr_line.getParent()); FloatUtil.handleFloated( c, new_inline, curr_line, bounds.width, elem ); // calc new width of the line curr_line.width += new_inline.width; // reduce the available width remaining_width = remaining_width - new_inline.width; // if the last inline was at the end of a line, then go to next line if ( new_inline.break_after ) { // u.p("breaking after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // set the inline to use for left alignment if ( !LayoutUtil.isFloated( new_inline, c ) ) { prev_align_inline = new_inline; } else { prev_align_inline = prev_inline; } prev_inline = new_inline; } current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); } saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , true); bounds.height += curr_line.height; block.width = bounds.width; block.height = bounds.height; block.x = 0; block.y = 0; return block; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/631ee187cba274ce571d6a7e5b800c58f77b1142/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
if ( prev_inline.end_index >= current_node.getNodeValue().length() ) { break; | if(Configuration.isTrue("xr.layout.whitespace.experimental",false)) { if ( prev_inline.end_index >= prev_inline.getMasterText().length()) { break; } } else { if ( prev_inline.end_index >= current_node.getNodeValue().length() ) { break; } | public Box layoutChildren( Context c, Box box ) { //u.p("starting to lay out the children"); if ( LayoutUtil.isHiddenNode( box.getElement(), c ) ) { return box; } if ( !box.isAnonymous() ) { if ( LayoutUtil.isBlockLayout( box.getElement(), c ) ) { // u.p("doing up block for: " + box); return super.layoutChildren( c, box ); } } //int debug_counter = 0; //int childcount = 0; BlockBox block = (BlockBox)box; // calculate the initial position and dimensions Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; bounds.width -= box.margin.left + box.border.left + box.padding.left + box.padding.right + box.border.right + box.margin.right; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = new LineBox(); c.setFirstLine(true); curr_line.setParent(box); curr_line.x = bounds.x; curr_line.width = 0; // account for text-indent Element elem = block.getElement(); remaining_width = InlineUtil.doTextIndent( c, elem, remaining_width, curr_line ); LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // get the list of inlines for this run List inline_node_list = null; if ( box.isAnonymous() ) { inline_node_list = ( (AnonymousBlockBox)box ).node_list; } else { inline_node_list = InlineUtil.getInlineNodeList( elem, elem, c ); } //u.p("in box: " + box); //u.p("final inline node list = "); //u.p(inline_node_list); // loop until no more nodes Node current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); // adjust the first line for tabs remaining_width = FloatUtil.adjustForTab( c, prev_line, remaining_width ); while ( current_node != null ) { // loop until no more text in this node while ( true ) { // debugging check if ( bounds.width < 0 ) { u.p( "bounds width = " + bounds.width ); u.dump_stack(); System.exit( -1 ); } // test if there is no more text in the current text node // if there is a prev, and if the prev was part of this current node if ( prev_inline != null && prev_inline.node == current_node ) { // replaced elements aren't split, so done with this one if ( LayoutUtil.isReplaced(c, current_node ) ) { break; } if ( LayoutUtil.isFloatedBlock( current_node, c ) ) { break; } if ( c.getRenderingContext().getLayoutFactory().isBreak( current_node ) ) { break; } // if no more unused text in this node if ( prev_inline.end_index >= current_node.getNodeValue().length() ) { // then break break; } } // the crash warning code if ( bounds.width < 1 ) { u.p( "warning. width < 1 " + bounds.width ); } // look at current inline // break off the longest section that will fit InlineBox new_inline = calculateInline( c, current_node, remaining_width, bounds.width, curr_line, prev_inline, elem, prev_align_inline ); // if this inline needs to be on a new line if ( new_inline.break_before && !new_inline.floated ) { // u.p("breaking before"); // finish up the current line remaining_width = bounds.width; saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // save the new inline to the list curr_line.addChild( new_inline ); // calc new height of the line // don't count the inline towards the line height and //line baseline if it's a floating inline. if ( !LayoutUtil.isFloated( new_inline, c ) ) { if ( !LayoutUtil.isFloatedBlock( new_inline.node, c ) ) { //u.p("calcing new height of line"); if ( new_inline.height + new_inline.y > curr_line.height ) { curr_line.height = new_inline.height + new_inline.y; } if ( new_inline.baseline > curr_line.baseline ) { curr_line.baseline = new_inline.baseline; } } } //u.p("curr line: " + curr_line); //u.p("parent = " + curr_line.getParent()); FloatUtil.handleFloated( c, new_inline, curr_line, bounds.width, elem ); // calc new width of the line curr_line.width += new_inline.width; // reduce the available width remaining_width = remaining_width - new_inline.width; // if the last inline was at the end of a line, then go to next line if ( new_inline.break_after ) { // u.p("breaking after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // set the inline to use for left alignment if ( !LayoutUtil.isFloated( new_inline, c ) ) { prev_align_inline = new_inline; } else { prev_align_inline = prev_inline; } prev_inline = new_inline; } current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); } saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , true); bounds.height += curr_line.height; block.width = bounds.width; block.height = bounds.height; block.x = 0; block.y = 0; return block; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/631ee187cba274ce571d6a7e5b800c58f77b1142/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
public Box layoutChildren( Context c, Box box ) { //u.p("starting to lay out the children"); if ( LayoutUtil.isHiddenNode( box.getElement(), c ) ) { return box; } if ( !box.isAnonymous() ) { if ( LayoutUtil.isBlockLayout( box.getElement(), c ) ) { // u.p("doing up block for: " + box); return super.layoutChildren( c, box ); } } //int debug_counter = 0; //int childcount = 0; BlockBox block = (BlockBox)box; // calculate the initial position and dimensions Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; bounds.width -= box.margin.left + box.border.left + box.padding.left + box.padding.right + box.border.right + box.margin.right; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = new LineBox(); c.setFirstLine(true); curr_line.setParent(box); curr_line.x = bounds.x; curr_line.width = 0; // account for text-indent Element elem = block.getElement(); remaining_width = InlineUtil.doTextIndent( c, elem, remaining_width, curr_line ); LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // get the list of inlines for this run List inline_node_list = null; if ( box.isAnonymous() ) { inline_node_list = ( (AnonymousBlockBox)box ).node_list; } else { inline_node_list = InlineUtil.getInlineNodeList( elem, elem, c ); } //u.p("in box: " + box); //u.p("final inline node list = "); //u.p(inline_node_list); // loop until no more nodes Node current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); // adjust the first line for tabs remaining_width = FloatUtil.adjustForTab( c, prev_line, remaining_width ); while ( current_node != null ) { // loop until no more text in this node while ( true ) { // debugging check if ( bounds.width < 0 ) { u.p( "bounds width = " + bounds.width ); u.dump_stack(); System.exit( -1 ); } // test if there is no more text in the current text node // if there is a prev, and if the prev was part of this current node if ( prev_inline != null && prev_inline.node == current_node ) { // replaced elements aren't split, so done with this one if ( LayoutUtil.isReplaced(c, current_node ) ) { break; } if ( LayoutUtil.isFloatedBlock( current_node, c ) ) { break; } if ( c.getRenderingContext().getLayoutFactory().isBreak( current_node ) ) { break; } // if no more unused text in this node if ( prev_inline.end_index >= current_node.getNodeValue().length() ) { // then break break; } } // the crash warning code if ( bounds.width < 1 ) { u.p( "warning. width < 1 " + bounds.width ); } // look at current inline // break off the longest section that will fit InlineBox new_inline = calculateInline( c, current_node, remaining_width, bounds.width, curr_line, prev_inline, elem, prev_align_inline ); // if this inline needs to be on a new line if ( new_inline.break_before && !new_inline.floated ) { // u.p("breaking before"); // finish up the current line remaining_width = bounds.width; saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // save the new inline to the list curr_line.addChild( new_inline ); // calc new height of the line // don't count the inline towards the line height and //line baseline if it's a floating inline. if ( !LayoutUtil.isFloated( new_inline, c ) ) { if ( !LayoutUtil.isFloatedBlock( new_inline.node, c ) ) { //u.p("calcing new height of line"); if ( new_inline.height + new_inline.y > curr_line.height ) { curr_line.height = new_inline.height + new_inline.y; } if ( new_inline.baseline > curr_line.baseline ) { curr_line.baseline = new_inline.baseline; } } } //u.p("curr line: " + curr_line); //u.p("parent = " + curr_line.getParent()); FloatUtil.handleFloated( c, new_inline, curr_line, bounds.width, elem ); // calc new width of the line curr_line.width += new_inline.width; // reduce the available width remaining_width = remaining_width - new_inline.width; // if the last inline was at the end of a line, then go to next line if ( new_inline.break_after ) { // u.p("breaking after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // set the inline to use for left alignment if ( !LayoutUtil.isFloated( new_inline, c ) ) { prev_align_inline = new_inline; } else { prev_align_inline = prev_inline; } prev_inline = new_inline; } current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); } saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , true); bounds.height += curr_line.height; block.width = bounds.width; block.height = bounds.height; block.x = 0; block.y = 0; return block; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/631ee187cba274ce571d6a7e5b800c58f77b1142/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
||
public Box layoutChildren( Context c, Box box ) { //u.p("starting to lay out the children"); if ( LayoutUtil.isHiddenNode( box.getElement(), c ) ) { return box; } if ( !box.isAnonymous() ) { if ( LayoutUtil.isBlockLayout( box.getElement(), c ) ) { // u.p("doing up block for: " + box); return super.layoutChildren( c, box ); } } //int debug_counter = 0; //int childcount = 0; BlockBox block = (BlockBox)box; // calculate the initial position and dimensions Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; bounds.width -= box.margin.left + box.border.left + box.padding.left + box.padding.right + box.border.right + box.margin.right; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = new LineBox(); c.setFirstLine(true); curr_line.setParent(box); curr_line.x = bounds.x; curr_line.width = 0; // account for text-indent Element elem = block.getElement(); remaining_width = InlineUtil.doTextIndent( c, elem, remaining_width, curr_line ); LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // get the list of inlines for this run List inline_node_list = null; if ( box.isAnonymous() ) { inline_node_list = ( (AnonymousBlockBox)box ).node_list; } else { inline_node_list = InlineUtil.getInlineNodeList( elem, elem, c ); } //u.p("in box: " + box); //u.p("final inline node list = "); //u.p(inline_node_list); // loop until no more nodes Node current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); // adjust the first line for tabs remaining_width = FloatUtil.adjustForTab( c, prev_line, remaining_width ); while ( current_node != null ) { // loop until no more text in this node while ( true ) { // debugging check if ( bounds.width < 0 ) { u.p( "bounds width = " + bounds.width ); u.dump_stack(); System.exit( -1 ); } // test if there is no more text in the current text node // if there is a prev, and if the prev was part of this current node if ( prev_inline != null && prev_inline.node == current_node ) { // replaced elements aren't split, so done with this one if ( LayoutUtil.isReplaced(c, current_node ) ) { break; } if ( LayoutUtil.isFloatedBlock( current_node, c ) ) { break; } if ( c.getRenderingContext().getLayoutFactory().isBreak( current_node ) ) { break; } // if no more unused text in this node if ( prev_inline.end_index >= current_node.getNodeValue().length() ) { // then break break; } } // the crash warning code if ( bounds.width < 1 ) { u.p( "warning. width < 1 " + bounds.width ); } // look at current inline // break off the longest section that will fit InlineBox new_inline = calculateInline( c, current_node, remaining_width, bounds.width, curr_line, prev_inline, elem, prev_align_inline ); // if this inline needs to be on a new line if ( new_inline.break_before && !new_inline.floated ) { // u.p("breaking before"); // finish up the current line remaining_width = bounds.width; saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // save the new inline to the list curr_line.addChild( new_inline ); // calc new height of the line // don't count the inline towards the line height and //line baseline if it's a floating inline. if ( !LayoutUtil.isFloated( new_inline, c ) ) { if ( !LayoutUtil.isFloatedBlock( new_inline.node, c ) ) { //u.p("calcing new height of line"); if ( new_inline.height + new_inline.y > curr_line.height ) { curr_line.height = new_inline.height + new_inline.y; } if ( new_inline.baseline > curr_line.baseline ) { curr_line.baseline = new_inline.baseline; } } } //u.p("curr line: " + curr_line); //u.p("parent = " + curr_line.getParent()); FloatUtil.handleFloated( c, new_inline, curr_line, bounds.width, elem ); // calc new width of the line curr_line.width += new_inline.width; // reduce the available width remaining_width = remaining_width - new_inline.width; // if the last inline was at the end of a line, then go to next line if ( new_inline.break_after ) { // u.p("breaking after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // set the inline to use for left alignment if ( !LayoutUtil.isFloated( new_inline, c ) ) { prev_align_inline = new_inline; } else { prev_align_inline = prev_inline; } prev_inline = new_inline; } current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); } saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , true); bounds.height += curr_line.height; block.width = bounds.width; block.height = bounds.height; block.x = 0; block.y = 0; return block; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/631ee187cba274ce571d6a7e5b800c58f77b1142/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
||
public Box layoutChildren( Context c, Box box ) { //u.p("starting to lay out the children"); if ( LayoutUtil.isHiddenNode( box.getElement(), c ) ) { return box; } if ( !box.isAnonymous() ) { if ( LayoutUtil.isBlockLayout( box.getElement(), c ) ) { // u.p("doing up block for: " + box); return super.layoutChildren( c, box ); } } //int debug_counter = 0; //int childcount = 0; BlockBox block = (BlockBox)box; // calculate the initial position and dimensions Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; bounds.width -= box.margin.left + box.border.left + box.padding.left + box.padding.right + box.border.right + box.margin.right; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = new LineBox(); c.setFirstLine(true); curr_line.setParent(box); curr_line.x = bounds.x; curr_line.width = 0; // account for text-indent Element elem = block.getElement(); remaining_width = InlineUtil.doTextIndent( c, elem, remaining_width, curr_line ); LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // get the list of inlines for this run List inline_node_list = null; if ( box.isAnonymous() ) { inline_node_list = ( (AnonymousBlockBox)box ).node_list; } else { inline_node_list = InlineUtil.getInlineNodeList( elem, elem, c ); } //u.p("in box: " + box); //u.p("final inline node list = "); //u.p(inline_node_list); // loop until no more nodes Node current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); // adjust the first line for tabs remaining_width = FloatUtil.adjustForTab( c, prev_line, remaining_width ); while ( current_node != null ) { // loop until no more text in this node while ( true ) { // debugging check if ( bounds.width < 0 ) { u.p( "bounds width = " + bounds.width ); u.dump_stack(); System.exit( -1 ); } // test if there is no more text in the current text node // if there is a prev, and if the prev was part of this current node if ( prev_inline != null && prev_inline.node == current_node ) { // replaced elements aren't split, so done with this one if ( LayoutUtil.isReplaced(c, current_node ) ) { break; } if ( LayoutUtil.isFloatedBlock( current_node, c ) ) { break; } if ( c.getRenderingContext().getLayoutFactory().isBreak( current_node ) ) { break; } // if no more unused text in this node if ( prev_inline.end_index >= current_node.getNodeValue().length() ) { // then break break; } } // the crash warning code if ( bounds.width < 1 ) { u.p( "warning. width < 1 " + bounds.width ); } // look at current inline // break off the longest section that will fit InlineBox new_inline = calculateInline( c, current_node, remaining_width, bounds.width, curr_line, prev_inline, elem, prev_align_inline ); // if this inline needs to be on a new line if ( new_inline.break_before && !new_inline.floated ) { // u.p("breaking before"); // finish up the current line remaining_width = bounds.width; saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // save the new inline to the list curr_line.addChild( new_inline ); // calc new height of the line // don't count the inline towards the line height and //line baseline if it's a floating inline. if ( !LayoutUtil.isFloated( new_inline, c ) ) { if ( !LayoutUtil.isFloatedBlock( new_inline.node, c ) ) { //u.p("calcing new height of line"); if ( new_inline.height + new_inline.y > curr_line.height ) { curr_line.height = new_inline.height + new_inline.y; } if ( new_inline.baseline > curr_line.baseline ) { curr_line.baseline = new_inline.baseline; } } } //u.p("curr line: " + curr_line); //u.p("parent = " + curr_line.getParent()); FloatUtil.handleFloated( c, new_inline, curr_line, bounds.width, elem ); // calc new width of the line curr_line.width += new_inline.width; // reduce the available width remaining_width = remaining_width - new_inline.width; // if the last inline was at the end of a line, then go to next line if ( new_inline.break_after ) { // u.p("breaking after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // set the inline to use for left alignment if ( !LayoutUtil.isFloated( new_inline, c ) ) { prev_align_inline = new_inline; } else { prev_align_inline = prev_inline; } prev_inline = new_inline; } current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); } saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , true); bounds.height += curr_line.height; block.width = bounds.width; block.height = bounds.height; block.x = 0; block.y = 0; return block; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/631ee187cba274ce571d6a7e5b800c58f77b1142/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
||
TextUtil.stripWhitespace( c, current_node, elem ); | if(!Configuration.isTrue("xr.layout.whitespace.experimental",false)) { TextUtil.stripWhitespace( c, current_node, elem ); } | public Box layoutChildren( Context c, Box box ) { //u.p("starting to lay out the children"); if ( LayoutUtil.isHiddenNode( box.getElement(), c ) ) { return box; } if ( !box.isAnonymous() ) { if ( LayoutUtil.isBlockLayout( box.getElement(), c ) ) { // u.p("doing up block for: " + box); return super.layoutChildren( c, box ); } } //int debug_counter = 0; //int childcount = 0; BlockBox block = (BlockBox)box; // calculate the initial position and dimensions Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; bounds.width -= box.margin.left + box.border.left + box.padding.left + box.padding.right + box.border.right + box.margin.right; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = new LineBox(); c.setFirstLine(true); curr_line.setParent(box); curr_line.x = bounds.x; curr_line.width = 0; // account for text-indent Element elem = block.getElement(); remaining_width = InlineUtil.doTextIndent( c, elem, remaining_width, curr_line ); LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // get the list of inlines for this run List inline_node_list = null; if ( box.isAnonymous() ) { inline_node_list = ( (AnonymousBlockBox)box ).node_list; } else { inline_node_list = InlineUtil.getInlineNodeList( elem, elem, c ); } //u.p("in box: " + box); //u.p("final inline node list = "); //u.p(inline_node_list); // loop until no more nodes Node current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); // adjust the first line for tabs remaining_width = FloatUtil.adjustForTab( c, prev_line, remaining_width ); while ( current_node != null ) { // loop until no more text in this node while ( true ) { // debugging check if ( bounds.width < 0 ) { u.p( "bounds width = " + bounds.width ); u.dump_stack(); System.exit( -1 ); } // test if there is no more text in the current text node // if there is a prev, and if the prev was part of this current node if ( prev_inline != null && prev_inline.node == current_node ) { // replaced elements aren't split, so done with this one if ( LayoutUtil.isReplaced(c, current_node ) ) { break; } if ( LayoutUtil.isFloatedBlock( current_node, c ) ) { break; } if ( c.getRenderingContext().getLayoutFactory().isBreak( current_node ) ) { break; } // if no more unused text in this node if ( prev_inline.end_index >= current_node.getNodeValue().length() ) { // then break break; } } // the crash warning code if ( bounds.width < 1 ) { u.p( "warning. width < 1 " + bounds.width ); } // look at current inline // break off the longest section that will fit InlineBox new_inline = calculateInline( c, current_node, remaining_width, bounds.width, curr_line, prev_inline, elem, prev_align_inline ); // if this inline needs to be on a new line if ( new_inline.break_before && !new_inline.floated ) { // u.p("breaking before"); // finish up the current line remaining_width = bounds.width; saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // save the new inline to the list curr_line.addChild( new_inline ); // calc new height of the line // don't count the inline towards the line height and //line baseline if it's a floating inline. if ( !LayoutUtil.isFloated( new_inline, c ) ) { if ( !LayoutUtil.isFloatedBlock( new_inline.node, c ) ) { //u.p("calcing new height of line"); if ( new_inline.height + new_inline.y > curr_line.height ) { curr_line.height = new_inline.height + new_inline.y; } if ( new_inline.baseline > curr_line.baseline ) { curr_line.baseline = new_inline.baseline; } } } //u.p("curr line: " + curr_line); //u.p("parent = " + curr_line.getParent()); FloatUtil.handleFloated( c, new_inline, curr_line, bounds.width, elem ); // calc new width of the line curr_line.width += new_inline.width; // reduce the available width remaining_width = remaining_width - new_inline.width; // if the last inline was at the end of a line, then go to next line if ( new_inline.break_after ) { // u.p("breaking after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , false); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = new LineBox(); curr_line.x = bounds.x; // adjust remaining width for floats curr_line.y = prev_line.y + prev_line.height; curr_line.setParent(prev_line.getParent()); //u.p("set parent to: " + curr_line.getParent()); remaining_width = FloatUtil.adjustForTab( c, curr_line, remaining_width ); curr_line.width = 0; } // set the inline to use for left alignment if ( !LayoutUtil.isFloated( new_inline, c ) ) { prev_align_inline = new_inline; } else { prev_align_inline = prev_inline; } prev_inline = new_inline; } current_node = InlineUtil.nextTextNode( inline_node_list ); TextUtil.stripWhitespace( c, current_node, elem ); } saveLine( curr_line, prev_line, elem, bounds.width, bounds.x, c, block , true); bounds.height += curr_line.height; block.width = bounds.width; block.height = bounds.height; block.x = 0; block.y = 0; return block; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/631ee187cba274ce571d6a7e5b800c58f77b1142/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
if (name.equalsIgnoreCase(IWorkbenchConstants.PL_PREFERENCES)) { loadPreferencePages(ext); return; } | private void appear(IExtensionPoint extPt, IExtension ext) { String name = extPt.getSimpleIdentifier(); if (name .equalsIgnoreCase(IWorkbenchConstants.PL_ACTION_SET_PART_ASSOCIATIONS)) { loadActionSetPartAssociation(ext); return; } if (name.equalsIgnoreCase(IWorkbenchConstants.PL_WORKINGSETS)) { loadWorkingSets(ext); return; } if (name.equalsIgnoreCase(IWorkbenchConstants.PL_PREFERENCES)) { loadPreferencePages(ext); return; } if (name.equalsIgnoreCase(IWorkbenchConstants.PL_FONT_DEFINITIONS)) { loadFontDefinitions(ext); return; } if (name.equalsIgnoreCase(IWorkbenchConstants.PL_THEMES)) { loadThemes(ext); return; } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/ae3e100ae6878a705a77e44dd4224a8c8afb3d99/ExtensionEventHandler.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ExtensionEventHandler.java |
|
RubyObject origin = body.getOrigin(); | public RubyObject eval(Ruby ruby, RubyObject self) { if (getDefnNode() != null) { if (ruby.getRubyClass() == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); MethodNode body = ruby.getRubyClass().searchMethod(getMId()); RubyObject origin = body.getOrigin(); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } int noex; if (ruby.isScope(Constants.SCOPE_PRIVATE) || getMId().equals(ruby.intern("initialize"))) { noex = Constants.NOEX_PRIVATE; } else if (ruby.isScope(Constants.SCOPE_PROTECTED)) { noex = Constants.NOEX_PROTECTED; } else if (ruby.getRubyClass() == ruby.getClasses().getObjectClass()) { noex = getNoex(); } else { noex = Constants.NOEX_PUBLIC; } if (body != null && origin == ruby.getRubyClass() && (body.getNoex() & Constants.NOEX_UNDEF) != 0) { noex |= Constants.NOEX_UNDEF; } Node defn = getDefnNode(); // +++ .copyNodeScope(ruby.getCRef()); ruby.getRubyClass().addMethod(getMId(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (ruby.getActMethodScope() == Constants.SCOPE_MODFUNC) { ruby.getRubyClass().getSingletonClass().addMethod(getMId(), defn, Constants.NOEX_PUBLIC); ruby.getRubyClass().funcall(ruby.intern("singleton_method_added"), getMId().toSymbol()); } if (ruby.getRubyClass().isSingleton()) { ruby.getRubyClass().getInstanceVar("__attached__").funcall(ruby.intern("singleton_method_added"), getMId().toSymbol()); } else { ruby.getRubyClass().funcall(ruby.intern("method_added"), getMId().toSymbol()); } } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/12748a4b8db7fd4836cd04c81e3cf2343735bfb6/DefnNode.java/buggy/org/jruby/nodes/DefnNode.java |
|
if (body != null && origin == ruby.getRubyClass() && (body.getNoex() & Constants.NOEX_UNDEF) != 0) { | if (body != null && body.getOrigin() == ruby.getRubyClass() && (body.getNoex() & Constants.NOEX_UNDEF) != 0) { | public RubyObject eval(Ruby ruby, RubyObject self) { if (getDefnNode() != null) { if (ruby.getRubyClass() == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); MethodNode body = ruby.getRubyClass().searchMethod(getMId()); RubyObject origin = body.getOrigin(); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } int noex; if (ruby.isScope(Constants.SCOPE_PRIVATE) || getMId().equals(ruby.intern("initialize"))) { noex = Constants.NOEX_PRIVATE; } else if (ruby.isScope(Constants.SCOPE_PROTECTED)) { noex = Constants.NOEX_PROTECTED; } else if (ruby.getRubyClass() == ruby.getClasses().getObjectClass()) { noex = getNoex(); } else { noex = Constants.NOEX_PUBLIC; } if (body != null && origin == ruby.getRubyClass() && (body.getNoex() & Constants.NOEX_UNDEF) != 0) { noex |= Constants.NOEX_UNDEF; } Node defn = getDefnNode(); // +++ .copyNodeScope(ruby.getCRef()); ruby.getRubyClass().addMethod(getMId(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (ruby.getActMethodScope() == Constants.SCOPE_MODFUNC) { ruby.getRubyClass().getSingletonClass().addMethod(getMId(), defn, Constants.NOEX_PUBLIC); ruby.getRubyClass().funcall(ruby.intern("singleton_method_added"), getMId().toSymbol()); } if (ruby.getRubyClass().isSingleton()) { ruby.getRubyClass().getInstanceVar("__attached__").funcall(ruby.intern("singleton_method_added"), getMId().toSymbol()); } else { ruby.getRubyClass().funcall(ruby.intern("method_added"), getMId().toSymbol()); } } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/12748a4b8db7fd4836cd04c81e3cf2343735bfb6/DefnNode.java/buggy/org/jruby/nodes/DefnNode.java |
if (!style.hasProperty(CSSName.DISPLAY)) return false; String float_val = style.propertyByName(CSSName.DISPLAY).getValue().getCssText(); | if (!style.hasProperty(CSSName.FLOAT)) return false; String float_val = style.propertyByName(CSSName.FLOAT).getValue().getCssText(); | public static boolean isFloated(CascadedStyle style) { if (style == null) return false; if (!style.hasProperty(CSSName.DISPLAY)) return false;//default is inline String float_val = style.propertyByName(CSSName.DISPLAY).getValue().getCssText(); if (float_val == null) { return false; } if (float_val.equals("left")) { return true; } if (float_val.equals("right")) { return true; } return false; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/1b3ffb852741837c0aa49f38d40c1e017d2cfcf8/ContentUtil.java/buggy/src/java/org/xhtmlrenderer/layout/content/ContentUtil.java |
System.out.println("VersionCompareTest"); | public void testCompare() { System.out.println("VersionCompareTest"); assertTrue(Util.compareVersions("1", "0.9.3")); assertTrue(Util.compareVersions("1 devel", "0.9.3")); assertFalse(Util.compareVersions("0.3 devel", "0.9.3")); assertFalse(Util.compareVersions("0.3.0", "0.9.3")); assertFalse(Util.compareVersions("0.3", "0.9.3")); assertFalse(Util.compareVersions("0", "0.9.3")); assertFalse(Util.compareVersions("0.9.3", "0.9.3")); assertTrue(Util.compareVersions("1.0.0", "0.9.3")); assertFalse(Util.compareVersions("0.9.3", "1.0.0")); assertTrue(Util.compareVersions("0.9.3", "0.9.3 devel")); assertTrue(Util.compareVersions("0.9.4", "0.9.3 devel")); assertFalse(Util.compareVersions("1.0.1 devel", "1.0.1")); assertTrue(Util.compareVersions("1.0.1", "1.0.0")); } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/8dbc5e8c4287546530816ebadfd2697a5a26ff45/VersionCompareTest.java/clean/src/test/de/dal33t/powerfolder/test/util/VersionCompareTest.java |
|
prev_inline.rightPadding = prev_inline.totalRightPadding(c.getCurrentStyle()); prev_inline.width += prev_inline.rightPadding; pendingRightPadding -= prev_inline.rightPadding; | int rp = prev_inline.totalRightPadding(c.getCurrentStyle()); prev_inline.rightPadding += rp; prev_inline.width += rp; pendingRightPadding -= rp; remaining_width -= rp; | public static void layoutContent(Context c, Box box, List contentList) { //Here we should always be inside something that corresponds to a block-level element //for formatting purposes Rectangle bounds = new Rectangle(); bounds.width = c.getExtents().width; Border border = c.getCurrentStyle().getBorderWidth(c.getBlockFormattingContext().getWidth(), c.getBlockFormattingContext().getHeight()); Border margin = c.getCurrentStyle().getMarginWidth(c.getBlockFormattingContext().getWidth(), c.getBlockFormattingContext().getHeight()); Border padding = c.getCurrentStyle().getPaddingWidth(c.getBlockFormattingContext().getWidth(), c.getBlockFormattingContext().getHeight()); //below should maybe be done somewhere else? bounds.width -= margin.left + border.left + padding.left + padding.right + border.right + margin.right; validateBounds(bounds); bounds.x = 0; bounds.y = 0; bounds.height = 0; //dummy style to make sure that text nodes don't get extra padding and such c.pushStyle(new CascadedStyle()); int blockLineHeight = FontUtil.lineHeight(c); LineMetrics blockLineMetrics = c.getTextRenderer().getLineMetrics(c.getGraphics(), FontUtil.getFont(c), "thequickbrownfoxjumpedoverthelazydogTHEQUICKBROWNFOXJUMPEDOVERTHELAZYDOG"); // prepare remaining width and first linebox int remaining_width = bounds.width; LineBox curr_line = newLine(box, bounds, null); c.setFirstLine(true); LinkedList pushedOnFirstLine = null; // account for text-indent CalculatedStyle parentStyle = c.getCurrentStyle(); remaining_width = TextIndent.doTextIndent(parentStyle, remaining_width, curr_line); // more setup LineBox prev_line = new LineBox(); prev_line.setParent(box); prev_line.y = bounds.y; prev_line.height = 0; InlineBox prev_inline = null; InlineBox prev_align_inline = null; // adjust the first line for float tabs remaining_width = FloatUtil.adjustForTab(c, prev_line, remaining_width); CalculatedStyle currentStyle = parentStyle; boolean isFirstLetter = true; List pendingPushStyles = null; int pendingLeftPadding = 0; int pendingRightPadding = 0; InlineBox helper = new InlineTextBox(); // loop until no more nodes while (contentList.size() > 0) { Object o = contentList.get(0); contentList.remove(0); if (o instanceof FirstLineStyle) {//can actually only be the first object in list box.firstLineStyle = ((FirstLineStyle) o).getStyle(); pushedOnFirstLine = new LinkedList(); c.pushStyle(box.firstLineStyle); continue; } if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list box.firstLetterStyle = ((FirstLetterStyle) o).getStyle(); continue; } if (o instanceof StylePush) { CascadedStyle style; StylePush sp = (StylePush) o; if (sp.getPseudoElement() != null) { style = c.getCss().getPseudoElementStyle(sp.getElement(), sp.getPseudoElement()); } else { style = c.getCss().getCascadedStyle(sp.getElement(), false);//already restyled by ContentUtil } c.pushStyle(style); if (pendingPushStyles == null) { pendingPushStyles = new LinkedList(); } pendingPushStyles.add((StylePush) o); Relative.translateRelative(c); if (pushedOnFirstLine != null) { pushedOnFirstLine.addLast(style); } pendingLeftPadding += helper.totalLeftPadding(c.getCurrentStyle()); pendingRightPadding += helper.totalRightPadding(); continue; } if (o instanceof StylePop) { if (pendingPushStyles != null && pendingPushStyles.size() != 0) { pendingPushStyles.remove(pendingPushStyles.size() - 1);//was a redundant one } else { //can't happen unless it's a bad error somewhere: if (prev_inline != null) { //CHECK: not sure this is where the padding really goes, always prev_inline.rightPadding = prev_inline.totalRightPadding(c.getCurrentStyle()); prev_inline.width += prev_inline.rightPadding; pendingRightPadding -= prev_inline.rightPadding; if (prev_inline.popstyles == null) { prev_inline.popstyles = new LinkedList(); } prev_inline.popstyles.add(o); //} } if (pushedOnFirstLine != null) { pushedOnFirstLine.removeLast(); } Relative.untranslateRelative(c); c.popStyle(); continue; } Content currentContent = (Content) o; if (currentContent.getStyle() != null) { c.pushStyle(currentContent.getStyle()); } // loop until no more text in this node InlineBox new_inline = null; int start = 0; do { new_inline = null; if (currentContent instanceof AbsolutelyPositionedContent) { // Uu.p("this might be a problem, but it could just be an absolute block"); // result = new BoxLayout().layout(c,content); Box absolute = Absolute.generateAbsoluteBox(c, currentContent); curr_line.addChild(absolute); break; } // debugging check if (bounds.width < 0) { Uu.p("bounds width = " + bounds.width); Uu.dump_stack(); System.exit(-1); } // the crash warning code if (bounds.width < 1) { Uu.p("warning. width < 1 " + bounds.width); } currentStyle = c.getCurrentStyle(); // look at current inline // break off the longest section that will fit int fit = pendingRightPadding;//Note: this is not necessarily entirely correct if (start == 0) fit += pendingLeftPadding; new_inline = calculateInline(c, currentContent, remaining_width - fit, bounds.width, prev_align_inline, isFirstLetter, box.firstLetterStyle, curr_line, start); // Uu.p("got back inline: " + new_inline); // if this inline needs to be on a new line if (prev_align_inline != null && new_inline.break_before) { // Uu.p("break before"); remaining_width = bounds.width; if (pushedOnFirstLine != null) { for (int i = 0; i < pushedOnFirstLine.size(); i++) c.popStyle(); c.popStyle();//the firstLineStyle //reinstate for (Iterator i = pushedOnFirstLine.iterator(); i.hasNext();) { c.pushStyle((CascadedStyle) i.next()); } pushedOnFirstLine = null; } saveLine(curr_line, currentStyle, prev_line, bounds.width, bounds.x, c, box, false, blockLineHeight); bounds.height += curr_line.height; prev_line = curr_line; curr_line = newLine(box, bounds, prev_line); remaining_width = FloatUtil.adjustForTab(c, curr_line, remaining_width); //have to discard it and recalculate, particularly if this was the first line //HACK: is my thinking straight? - tobe prev_align_inline.break_after = true; new_inline = null; continue; } // save the new inline to the list // Uu.p("adding inline child: " + new_inline); //the inline might be set to size 0,0 after this, if it is first whitespace on line. // Cannot discard because it may contain style-pushes curr_line.addInlineChild(c, new_inline); // Uu.p("current line = " + curr_line); if (new_inline instanceof InlineTextBox) { start = ((InlineTextBox) new_inline).end_index; } isFirstLetter = false; new_inline.pushstyles = pendingPushStyles; pendingPushStyles = null; new_inline.width += pendingLeftPadding; pendingLeftPadding = 0; // calc new height of the line // don't count floats and absolutes if (!new_inline.floated && !new_inline.absolute) { adjustLineHeight(c, curr_line, new_inline, blockLineHeight, blockLineMetrics); } if (!(currentContent instanceof FloatedBlockContent)) { // calc new width of the line curr_line.width += new_inline.width; } // reduce the available width remaining_width = remaining_width - new_inline.width; // if the last inline was at the end of a line, then go to next line if (new_inline.break_after) { // Uu.p("break after"); // then remaining_width = max_width remaining_width = bounds.width; // save the line if (pushedOnFirstLine != null) { for (int i = 0; i < pushedOnFirstLine.size(); i++) c.popStyle(); c.popStyle();//the firstLineStyle //reinstate for (Iterator i = pushedOnFirstLine.iterator(); i.hasNext();) { c.pushStyle((CascadedStyle) i.next()); } pushedOnFirstLine = null; } saveLine(curr_line, currentStyle, prev_line, bounds.width, bounds.x, c, box, false, blockLineHeight); // increase bounds height to account for the new line bounds.height += curr_line.height; prev_line = curr_line; curr_line = newLine(box, bounds, prev_line); remaining_width = FloatUtil.adjustForTab(c, curr_line, remaining_width); } // set the inline to use for left alignment if (!isOutsideFlow(currentContent)) { prev_align_inline = new_inline; // } } prev_inline = new_inline; } while (new_inline == null || !new_inline.isEndOfParentContent()); if (currentContent.getStyle() != null) { c.popStyle(); } } // save the final line if (pushedOnFirstLine != null) { for (int i = 0; i < pushedOnFirstLine.size(); i++) c.popStyle(); c.popStyle();//the firstLineStyle //reinstate for (Iterator i = pushedOnFirstLine.iterator(); i.hasNext();) { c.pushStyle((CascadedStyle) i.next()); } pushedOnFirstLine = null; } saveLine(curr_line, currentStyle, prev_line, bounds.width, bounds.x, c, box, true, blockLineHeight); finishBlock(box, curr_line, bounds); // Uu.p("- InlineLayout.layoutContent(): " + box); //pop the dummy style c.popStyle(); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/4c6228ec4a20592f63d6203c86a98731914eea96/InlineBoxing.java/buggy/src/java/org/xhtmlrenderer/layout/InlineBoxing.java |
public void reloadPage() throws Exception { | public void reloadPage() { | public void reloadPage() throws Exception { logger.info("Reloading Page: "); if (manager.getBaseURL() != null) { loadPage(manager.getBaseURL()); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/0bcb35d367c0f0b2a89eb6aabedfe9807525ad3a/BrowserPanel.java/clean/demos/browser/src/java/org/xhtmlrenderer/demo/browser/BrowserPanel.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 articleId = doc.get("articleId"); String version = doc.get("version"); portletURL.setParameter("struts_action", "/journal/edit_article"); portletURL.setParameter("articleId", articleId); portletURL.setParameter("version", version); 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/journal/util/Indexer.java |
||
childNode.setElement(element); | if (element!=null) { childNode.setElement(element); } | final void createChildNode(final MenuElement element, final SLocation location) throws NotDefinedException { if (element == null) { throw new NullPointerException( "A child node cannot be created from a null element"); //$NON-NLS-1$ } final String id = element.getId(); LayoutNode childNode = null; if (childrenById == null) { childrenById = new HashMap(4); } else { childNode = (LayoutNode) childrenById.get(id); } if (childNode == null) { childNode = new LayoutNode(); childrenById.put(id, childNode); orderedChildren = null; } childNode.setElement(element); childNode.setLocation((location == null) ? getLocation(element) : location); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/5af242f9e1cef0507ee8fbeaa76acd846c7379b7/LayoutNode.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/LayoutNode.java |
return addr.isLoopbackAddress() || addr.isSiteLocalAddress() || getAllLocalNetworkAddresses().containsKey(addr); | return isOnAnySubnet((Inet4Address) addr) || addr.isLoopbackAddress() || addr.isSiteLocalAddress() || getAllLocalNetworkAddresses().containsKey(addr); | public static boolean isOnLanOrLoopback(InetAddress addr) { Reject.ifNull(addr, "Address is null"); try { return addr.isLoopbackAddress() || addr.isSiteLocalAddress() || getAllLocalNetworkAddresses().containsKey(addr); } catch (SocketException e) { return false; } } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/f00c09c383d7b5d659675ef7bdea2aab966fd666/NetworkUtil.java/buggy/src/main/de/dal33t/powerfolder/util/net/NetworkUtil.java |
InlineBlockBox box = new InlineBlockBox(); box.element = content.getElement(); CalculatedStyle style = c.getCurrentStyle(); if (prev_align != null && !prev_align.break_after) { box.x = prev_align.x + prev_align.width; } else { box.x = 0; } box.y = 0; VerticalAlign.setupVerticalAlign(c, style, box); c.translate(box.x + curr_line.x, box.y + curr_line.y); c.translateInsets(box); | public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line) { //Uu.p("generating replaced Inline 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); } /* * joshy: change this to just modify the existing block instead of creating * a new one */ // create new inline (null text is safe!) InlineBlockBox box = new InlineBlockBox(); box.element = content.getElement(); //box.width = bounds.width; //box.height = bounds.height; CalculatedStyle style = c.getCurrentStyle(); // use the prev_align to calculate the Xx 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 box.break_after = true; // do vertical alignment VerticalAlign.setupVerticalAlign(c, style, box); // adjust width based on borders and padding //box.width += box.totalHorizontalPadding(c.getCurrentStyle()); //box.height += box.totalVerticalPadding(); box = box; //joshy: activate this: box.block = block //Uu.p("created a new inline box"); //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 if (box.width > avail && prev_align != null && !prev_align.break_after) { box.break_before = true; box.x = 0; } c.translate(box.x, box.y); c.translateInsets(box); if (cc != null) { Point origin = c.getOriginOffset(); cc.setLocation((int) origin.getX(), (int) origin.getY() + curr_line.y); c.getCanvas().add(cc); } c.untranslateInsets(box); c.translate(-box.x, -box.y); // return //Uu.p("last replaced = " + box); return box; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3f960adf42e5e616b00f1ada861a28ed6b152987/LineBreaker.java/clean/src/java/org/xhtmlrenderer/layout/LineBreaker.java |
|
/* * joshy: change this to just modify the existing block instead of creating * a new one */ InlineBlockBox box = new InlineBlockBox(); box.element = content.getElement(); CalculatedStyle style = c.getCurrentStyle(); if (prev_align != null && !prev_align.break_after) { box.x = prev_align.x + prev_align.width; } else { box.x = 0; } box.y = 0; box.break_after = true; VerticalAlign.setupVerticalAlign(c, style, box); box = box; | public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line) { //Uu.p("generating replaced Inline 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); } /* * joshy: change this to just modify the existing block instead of creating * a new one */ // create new inline (null text is safe!) InlineBlockBox box = new InlineBlockBox(); box.element = content.getElement(); //box.width = bounds.width; //box.height = bounds.height; CalculatedStyle style = c.getCurrentStyle(); // use the prev_align to calculate the Xx 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 box.break_after = true; // do vertical alignment VerticalAlign.setupVerticalAlign(c, style, box); // adjust width based on borders and padding //box.width += box.totalHorizontalPadding(c.getCurrentStyle()); //box.height += box.totalVerticalPadding(); box = box; //joshy: activate this: box.block = block //Uu.p("created a new inline box"); //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 if (box.width > avail && prev_align != null && !prev_align.break_after) { box.break_before = true; box.x = 0; } c.translate(box.x, box.y); c.translateInsets(box); if (cc != null) { Point origin = c.getOriginOffset(); cc.setLocation((int) origin.getX(), (int) origin.getY() + curr_line.y); c.getCanvas().add(cc); } c.untranslateInsets(box); c.translate(-box.x, -box.y); // return //Uu.p("last replaced = " + box); return box; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3f960adf42e5e616b00f1ada861a28ed6b152987/LineBreaker.java/clean/src/java/org/xhtmlrenderer/layout/LineBreaker.java |
|
c.translate(box.x, box.y); c.translateInsets(box); if (cc != null) { | if (cc != null && !box.break_before) { | public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line) { //Uu.p("generating replaced Inline 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); } /* * joshy: change this to just modify the existing block instead of creating * a new one */ // create new inline (null text is safe!) InlineBlockBox box = new InlineBlockBox(); box.element = content.getElement(); //box.width = bounds.width; //box.height = bounds.height; CalculatedStyle style = c.getCurrentStyle(); // use the prev_align to calculate the Xx 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 box.break_after = true; // do vertical alignment VerticalAlign.setupVerticalAlign(c, style, box); // adjust width based on borders and padding //box.width += box.totalHorizontalPadding(c.getCurrentStyle()); //box.height += box.totalVerticalPadding(); box = box; //joshy: activate this: box.block = block //Uu.p("created a new inline box"); //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 if (box.width > avail && prev_align != null && !prev_align.break_after) { box.break_before = true; box.x = 0; } c.translate(box.x, box.y); c.translateInsets(box); if (cc != null) { Point origin = c.getOriginOffset(); cc.setLocation((int) origin.getX(), (int) origin.getY() + curr_line.y); c.getCanvas().add(cc); } c.untranslateInsets(box); c.translate(-box.x, -box.y); // return //Uu.p("last replaced = " + box); return box; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3f960adf42e5e616b00f1ada861a28ed6b152987/LineBreaker.java/clean/src/java/org/xhtmlrenderer/layout/LineBreaker.java |
cc.setLocation((int) origin.getX(), (int) origin.getY() + curr_line.y); | cc.setLocation((int) origin.getX(), (int) origin.getY()); | public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line) { //Uu.p("generating replaced Inline 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); } /* * joshy: change this to just modify the existing block instead of creating * a new one */ // create new inline (null text is safe!) InlineBlockBox box = new InlineBlockBox(); box.element = content.getElement(); //box.width = bounds.width; //box.height = bounds.height; CalculatedStyle style = c.getCurrentStyle(); // use the prev_align to calculate the Xx 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 box.break_after = true; // do vertical alignment VerticalAlign.setupVerticalAlign(c, style, box); // adjust width based on borders and padding //box.width += box.totalHorizontalPadding(c.getCurrentStyle()); //box.height += box.totalVerticalPadding(); box = box; //joshy: activate this: box.block = block //Uu.p("created a new inline box"); //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 if (box.width > avail && prev_align != null && !prev_align.break_after) { box.break_before = true; box.x = 0; } c.translate(box.x, box.y); c.translateInsets(box); if (cc != null) { Point origin = c.getOriginOffset(); cc.setLocation((int) origin.getX(), (int) origin.getY() + curr_line.y); c.getCanvas().add(cc); } c.untranslateInsets(box); c.translate(-box.x, -box.y); // return //Uu.p("last replaced = " + box); return box; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3f960adf42e5e616b00f1ada861a28ed6b152987/LineBreaker.java/clean/src/java/org/xhtmlrenderer/layout/LineBreaker.java |
c.translate(-box.x, -box.y); | c.translate(-box.x - curr_line.x, -box.y - curr_line.y); | public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line) { //Uu.p("generating replaced Inline 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); } /* * joshy: change this to just modify the existing block instead of creating * a new one */ // create new inline (null text is safe!) InlineBlockBox box = new InlineBlockBox(); box.element = content.getElement(); //box.width = bounds.width; //box.height = bounds.height; CalculatedStyle style = c.getCurrentStyle(); // use the prev_align to calculate the Xx 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 box.break_after = true; // do vertical alignment VerticalAlign.setupVerticalAlign(c, style, box); // adjust width based on borders and padding //box.width += box.totalHorizontalPadding(c.getCurrentStyle()); //box.height += box.totalVerticalPadding(); box = box; //joshy: activate this: box.block = block //Uu.p("created a new inline box"); //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 if (box.width > avail && prev_align != null && !prev_align.break_after) { box.break_before = true; box.x = 0; } c.translate(box.x, box.y); c.translateInsets(box); if (cc != null) { Point origin = c.getOriginOffset(); cc.setLocation((int) origin.getX(), (int) origin.getY() + curr_line.y); c.getCanvas().add(cc); } c.untranslateInsets(box); c.translate(-box.x, -box.y); // return //Uu.p("last replaced = " + box); return box; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/3f960adf42e5e616b00f1ada861a28ed6b152987/LineBreaker.java/clean/src/java/org/xhtmlrenderer/layout/LineBreaker.java |
if (getController().getConnectionListener() != null) { | if (getController().hasConnectionListener()) { | public boolean validateDynDns(String dynDns) { // validates the dynamic dns entry if there is one entered if (!StringUtils.isBlank(dynDns)) { if (getController().getConnectionListener() != null) { // sets the new dyndns with validation enabled int res = getController().getConnectionListener().setMyDynDns( dynDns, true); // check the result from validation switch (res) { case ConnectionListener.VALIDATION_FAILED : // validation failed ask the user if he/she // wants to continue with these settings String message = Translation .getTranslation("preferences.dialog.dyndnsmanager.nomatch.text"); String title = Translation .getTranslation("preferences.dialog.dyndnsmanager.nomatch.title"); int result = JOptionPane.showConfirmDialog( getController().getUIController().getMainFrame() .getUIComponent(), message, title, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (result == JOptionPane.YES_OPTION) { // the user is happy with his/her settings, then // set the new dyndns without further validation getController().getConnectionListener() .setMyDynDns(dynDns, false); } else { // the user wants to change the dyndns settings getController().getConnectionListener() .setMyDynDns(null, false); return false; } break; case ConnectionListener.CANNOT_RESOLVE : // the new dyndns could not be resolved // force the user to enter a new one getController().getConnectionListener().setMyDynDns( null, false); return false; case ConnectionListener.OK : log().info( "Successfully validated dyndns '" + dynDns + "'"); // getController().getUIController() // .showMessage(null, // "Success", // Translation.getTranslation("preferences.dialog.statusDynDnsSuccess", // dynDns)); } } } else { // just resets the dyndns entry if (getController().getConnectionListener() != null) { getController().getConnectionListener() .setMyDynDns(null, false); } } // all validations have passed return true; } | 51438 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51438/2c7f60a3745b4381aa2a4602b35d8d89b1bf571a/DynDnsManager.java/buggy/src/main/de/dal33t/powerfolder/net/DynDnsManager.java |
int view_height = this.enclosingScrollPane.getViewport().getHeight(); | if(enclosingScrollPane != null) { int view_height = this.enclosingScrollPane.getViewport().getHeight(); | protected void startLayout(Graphics g) { this.removeAll(); if ( g == null ) { return; } if ( doc == null ) { return; } Element html = (Element)doc.getDocumentElement(); Element body = x.child( html, "body" ); body = html; newContext( g ); // set up CSS c.setMaxWidth( 0 ); long start_time = new java.util.Date().getTime(); body_box = layout.layout( c, body ); long end_time = new java.util.Date().getTime(); if ( enclosingScrollPane != null ) { if ( this.body_box != null ) { this.enclosingScrollPane.getViewport().setBackground( body_box.background_color ); } } intrinsic_size = new Dimension( c.getMaxWidth(), layout.contents_height ); int view_height = this.enclosingScrollPane.getViewport().getHeight(); // resize the outter most box incase it is too small for the viewport if(intrinsic_size.getHeight() < view_height) { if(body_box != null) { body_box.height = view_height; } } if ( !intrinsic_size.equals( this.getSize() ) ) { this.setPreferredSize( intrinsic_size ); this.revalidate(); } this.fireDocumentLoaded(); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/dab5f0ea0f21b11bc9059602a912aff22532b469/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java |
if(intrinsic_size.getHeight() < view_height) { if(body_box != null) { body_box.height = view_height; | if(intrinsic_size.getHeight() < view_height) { if(body_box != null) { body_box.height = view_height; } | protected void startLayout(Graphics g) { this.removeAll(); if ( g == null ) { return; } if ( doc == null ) { return; } Element html = (Element)doc.getDocumentElement(); Element body = x.child( html, "body" ); body = html; newContext( g ); // set up CSS c.setMaxWidth( 0 ); long start_time = new java.util.Date().getTime(); body_box = layout.layout( c, body ); long end_time = new java.util.Date().getTime(); if ( enclosingScrollPane != null ) { if ( this.body_box != null ) { this.enclosingScrollPane.getViewport().setBackground( body_box.background_color ); } } intrinsic_size = new Dimension( c.getMaxWidth(), layout.contents_height ); int view_height = this.enclosingScrollPane.getViewport().getHeight(); // resize the outter most box incase it is too small for the viewport if(intrinsic_size.getHeight() < view_height) { if(body_box != null) { body_box.height = view_height; } } if ( !intrinsic_size.equals( this.getSize() ) ) { this.setPreferredSize( intrinsic_size ); this.revalidate(); } this.fireDocumentLoaded(); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/dab5f0ea0f21b11bc9059602a912aff22532b469/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java |
protected void startLayout(Graphics g) { this.removeAll(); if ( g == null ) { return; } if ( doc == null ) { return; } Element html = (Element)doc.getDocumentElement(); Element body = x.child( html, "body" ); body = html; newContext( g ); // set up CSS c.setMaxWidth( 0 ); long start_time = new java.util.Date().getTime(); body_box = layout.layout( c, body ); long end_time = new java.util.Date().getTime(); if ( enclosingScrollPane != null ) { if ( this.body_box != null ) { this.enclosingScrollPane.getViewport().setBackground( body_box.background_color ); } } intrinsic_size = new Dimension( c.getMaxWidth(), layout.contents_height ); int view_height = this.enclosingScrollPane.getViewport().getHeight(); // resize the outter most box incase it is too small for the viewport if(intrinsic_size.getHeight() < view_height) { if(body_box != null) { body_box.height = view_height; } } if ( !intrinsic_size.equals( this.getSize() ) ) { this.setPreferredSize( intrinsic_size ); this.revalidate(); } this.fireDocumentLoaded(); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/dab5f0ea0f21b11bc9059602a912aff22532b469/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java |
||
threaded = true; | public LayoutThread(HTMLPanel panel) { this.panel = panel; done = true; graphics = null; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/dab5f0ea0f21b11bc9059602a912aff22532b469/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java |
|
private synchronized void completeLayout() { //u.p("layout thread ending"); done = true; graphics = null; panel.repaint(); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/dab5f0ea0f21b11bc9059602a912aff22532b469/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java |
||
private synchronized void completeLayout() { //u.p("layout thread ending"); done = true; graphics = null; panel.repaint(); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/dab5f0ea0f21b11bc9059602a912aff22532b469/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java |
||
public void run() { //u.p("layout thread starting"); //u.p("graphics = " + graphics); panel.startLayout(graphics); this.completeLayout(); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/dab5f0ea0f21b11bc9059602a912aff22532b469/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java |
||
new Thread(this).start(); | if(threaded) { new Thread(this).start(); } else { run(); } | public synchronized void startLayout(Graphics g) { if(isLayoutDone()) { //u.p("really starting new thread"); done = false; graphics = g; new Thread(this).start(); } else { //u.p("layout already in progress. skipping layout"); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/dab5f0ea0f21b11bc9059602a912aff22532b469/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java |
public synchronized void startRender(Graphics g) { g.setColor(Color.black); if(this.isLayoutDone()) { if(panel.body_box != null) { //u.p("really painting"); try { panel.layout.getRenderer().paint( panel.c, panel.body_box ); } catch (Throwable thr) { u.p("current thread = " + Thread.currentThread()); u.p(thr); thr.printStackTrace(); } } else { g.drawString("body box is null", 50,50); u.p("body box is null"); } } else { g.drawString("still doing layout", 50,50); //u.p("still doing layout"); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/dab5f0ea0f21b11bc9059602a912aff22532b469/HTMLPanel.java/buggy/src/java/org/xhtmlrenderer/swing/HTMLPanel.java |
||
public static void main(String[] args) throws Exception { Toolkit.getDefaultToolkit().setDynamicLayout(true); XHTMLPanel panel = new XHTMLPanel(); Dimension size = new Dimension(200,200); panel.setPreferredSize(size); panel.setDocument(new File("demos/photogallery/xhtml/gallery.xhtml").toURL()); JScrollPane scroll = new JScrollPane(panel); JFrame frame = new JFrame("PhotoGallery"); frame.getContentPane().add(scroll); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setSize(500,500); frame.setVisible(true); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9914a9774412cb33b91d4136ee4bc7038267d52b/PhotoGallery.java/buggy/demos/photogallery/src/java/org/xhtmlrenderer/demo/photogallery/PhotoGallery.java |
||
Dimension size = new Dimension(200,200); | Dimension size = new Dimension(200, 200); | public static void main(String[] args) throws Exception { Toolkit.getDefaultToolkit().setDynamicLayout(true); XHTMLPanel panel = new XHTMLPanel(); Dimension size = new Dimension(200,200); panel.setPreferredSize(size); panel.setDocument(new File("demos/photogallery/xhtml/gallery.xhtml").toURL()); JScrollPane scroll = new JScrollPane(panel); JFrame frame = new JFrame("PhotoGallery"); frame.getContentPane().add(scroll); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setSize(500,500); frame.setVisible(true); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9914a9774412cb33b91d4136ee4bc7038267d52b/PhotoGallery.java/buggy/demos/photogallery/src/java/org/xhtmlrenderer/demo/photogallery/PhotoGallery.java |
panel.setDocument(new File("demos/photogallery/xhtml/gallery.xhtml").toURL()); | panel.setDocument(new File("demos/photogallery/xhtml/gallery.xhtml").toURL().toExternalForm()); | public static void main(String[] args) throws Exception { Toolkit.getDefaultToolkit().setDynamicLayout(true); XHTMLPanel panel = new XHTMLPanel(); Dimension size = new Dimension(200,200); panel.setPreferredSize(size); panel.setDocument(new File("demos/photogallery/xhtml/gallery.xhtml").toURL()); JScrollPane scroll = new JScrollPane(panel); JFrame frame = new JFrame("PhotoGallery"); frame.getContentPane().add(scroll); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setSize(500,500); frame.setVisible(true); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9914a9774412cb33b91d4136ee4bc7038267d52b/PhotoGallery.java/buggy/demos/photogallery/src/java/org/xhtmlrenderer/demo/photogallery/PhotoGallery.java |
JFrame frame = new JFrame("PhotoGallery"); | JFrame frame = new JFrame("PhotoGallery"); | public static void main(String[] args) throws Exception { Toolkit.getDefaultToolkit().setDynamicLayout(true); XHTMLPanel panel = new XHTMLPanel(); Dimension size = new Dimension(200,200); panel.setPreferredSize(size); panel.setDocument(new File("demos/photogallery/xhtml/gallery.xhtml").toURL()); JScrollPane scroll = new JScrollPane(panel); JFrame frame = new JFrame("PhotoGallery"); frame.getContentPane().add(scroll); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setSize(500,500); frame.setVisible(true); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9914a9774412cb33b91d4136ee4bc7038267d52b/PhotoGallery.java/buggy/demos/photogallery/src/java/org/xhtmlrenderer/demo/photogallery/PhotoGallery.java |
frame.setSize(500,500); | frame.setSize(500, 500); | public static void main(String[] args) throws Exception { Toolkit.getDefaultToolkit().setDynamicLayout(true); XHTMLPanel panel = new XHTMLPanel(); Dimension size = new Dimension(200,200); panel.setPreferredSize(size); panel.setDocument(new File("demos/photogallery/xhtml/gallery.xhtml").toURL()); JScrollPane scroll = new JScrollPane(panel); JFrame frame = new JFrame("PhotoGallery"); frame.getContentPane().add(scroll); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setSize(500,500); frame.setVisible(true); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9914a9774412cb33b91d4136ee4bc7038267d52b/PhotoGallery.java/buggy/demos/photogallery/src/java/org/xhtmlrenderer/demo/photogallery/PhotoGallery.java |
CalculatedStyle style = c.css.getStyle(LineBreaker.getElement(node)); Font font = FontUtil.getFont(c, style, node); | CalculatedStyle style = c.css.getStyle(node); Font font = FontUtil.getFont(c, style); | private InlineBox calculateInline(Context c, Node node, int avail, int max_width, LineBox line, InlineBox prev, Element containing_block, InlineBox prev_align) { // calculate the starting index int start = 0; // if this is another box from the same node as the previous one if (prev != null && prev.getNode() == node) { start = prev.end_index; } // get the text of the node String text = node.getNodeValue(); // transform the text if required (like converting to caps) // this must be done before any measuring since it might change the // size of the text //u.p("text from the node = \"" + text + "\""); text = TextUtil.transformText(c, node, text); // u.p("calculating inline: text = " + text); // u.p("avail space = " + avail + " max = " + max_width + " start index = " + start); // get the current font. required for sizing CalculatedStyle style = c.css.getStyle(LineBreaker.getElement(node)); Font font = FontUtil.getFont(c, style, node); // handle each case if (LayoutUtil.isReplaced(c, node)) { //u.p("is replaced"); return LineBreaker.generateReplacedInlineBox(c, node, avail, prev, text, prev_align, font); } //u.p("calc inline on node : " + node); if (LayoutUtil.isFloatedBlock(node, c)) { //u.p("calcinline: is floated block"); return FloatUtil.generateFloatedBlockInlineBox(c, node, avail, prev, text, prev_align, font); } if (LineBreaker.isFirstLetter(c, node, start)) { //u.p("is first letter"); return LineBreaker.generateFirstLetterInlineBox(c, node, start, text, prev, prev_align, avail); } if (c.getRenderingContext().getLayoutFactory().isBreak(node)) { // u.p("is break"); return LineBreaker.generateBreakInlineBox(node); } // new whitespace code if (Configuration.isTrue("xr.layout.whitespace.experimental", false)) { WhitespaceStripper whitespace = new WhitespaceStripper(); // u.p("calling whitespace stripper on node: " + node); // u.p(" prev = " + prev); return whitespace.createInline(c, node, text, prev, prev_align, avail, max_width, font); } else { if (LineBreaker.isWhitespace(c, containing_block)) { // u.p("is whitespace"); return LineBreaker.generateWhitespaceInlineBox(c, node, start, prev, text, prev_align, font); } // ==== unbreakable long word ===== if (LineBreaker.isUnbreakableLine(c, node, start, text, avail, font)) { // u.p("is unbreakable"); return LineBreaker.generateUnbreakableInlineBox(c, node, start, text, prev, prev_align, font); } // rest of this string can fit on the line if (LineBreaker.canFitOnLine(c, node, start, text, avail, font)) { // u.p("can fit on line"); return LineBreaker.generateRestOfTextNodeInlineBox(c, node, start, text, prev, prev_align, font); } // normal multiline break // u.p("normal multi line break"); return LineBreaker.generateMultilineBreak(c, node, start, text, prev, prev_align, avail); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/810d20da09b135490001c813971ac26af6d13f00/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
VerticalAlign.setupVerticalAlign(c, containing_block, line_to_save); | VerticalAlign.setupVerticalAlign(line_to_save); | private void saveLine(LineBox line_to_save, LineBox prev_line, Element containing_block, int width, int x, Context c, Box block, boolean last) { c.setFirstLine(false); // account for text-align TextAlign.adjustTextAlignment(c, line_to_save, containing_block, width, x, last); // set the y line_to_save.y = prev_line.y + prev_line.height; // new float code line_to_save.x += c.getBlockFormattingContext().getLeftFloatDistance(line_to_save); VerticalAlign.setupVerticalAlign(c, containing_block, line_to_save); block.addChild(line_to_save); } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/810d20da09b135490001c813971ac26af6d13f00/InlineLayout.java/buggy/src/java/org/xhtmlrenderer/layout/InlineLayout.java |
return (RubyClass)getRubyClass(); | return getRubyClass(); | public RubyModule m_type() { return (RubyClass)getRubyClass(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/60d09f0d06e157ff7d9bb828d89273706e4e2798/RubyNil.java/buggy/org/jruby/RubyNil.java |
setAnimated(false); | void dispose() { JobProgressManager.getInstance().removeListener(listener); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/ee8dbe87291055d799d63a72120a5699545484d8/AnimationManager.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/AnimationManager.java |
|
pullRulesets(style, sheet); | CSSRuleList rl = style.getCssRules(); pullRulesets(rl, sheet, info); | public Stylesheet parse(java.io.Reader reader, StylesheetInfo info) { InputSource is = new InputSource(reader); CSSStyleSheet style = null; try { style = parser.parseStyleSheet(is); } catch (java.io.IOException e) { throw new XRRuntimeException("IOException on parsing style seet from a Reader; don't know the URI.", e); } Stylesheet sheet = new Stylesheet(info); pullRulesets(style, sheet); return sheet; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/37a4a3d1b1f6a7c86c2b59853a3db3638b9bf1e0/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
private void pullRulesets(org.w3c.dom.css.CSSStyleSheet cssSheet, Stylesheet stylesheet) { org.w3c.dom.css.CSSRuleList rl = cssSheet.getCssRules(); | private void pullRulesets(CSSRuleList rl, Stylesheet stylesheet, StylesheetInfo sheetInfo) { | private void pullRulesets(org.w3c.dom.css.CSSStyleSheet cssSheet, Stylesheet stylesheet) { org.w3c.dom.css.CSSRuleList rl = cssSheet.getCssRules(); int nr = rl.getLength(); for (int i = 0; i < nr; i++) { if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.IMPORT_RULE) { //note: the steadystate parser does not fetch and load imported stylesheets CSSImportRule cssir = (CSSImportRule) rl.item(i); String href = cssir.getHref(); MediaList media = cssir.getMedia(); String uri = null; try { uri = new java.net.URL(new URL(stylesheet.getURI()), href).toString(); StylesheetInfo info = new StylesheetInfo(); info.setOrigin(stylesheet.getOrigin()); info.setUri(uri); info.setMedia(media.getMediaText()); info.setType("text/css"); stylesheet.addStylesheet(info); } catch (java.net.MalformedURLException e) { XRLog.exception("bad URL for imported stylesheet", e); } } else if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.STYLE_RULE) { stylesheet.addRuleset(new Ruleset((org.w3c.dom.css.CSSStyleRule) rl.item(i), stylesheet.getOrigin())); } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/37a4a3d1b1f6a7c86c2b59853a3db3638b9bf1e0/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.IMPORT_RULE) { | if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.STYLE_RULE) { stylesheet.addRuleset(new Ruleset((org.w3c.dom.css.CSSStyleRule) rl.item(i), stylesheet.getOrigin())); } else if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.IMPORT_RULE) { | private void pullRulesets(org.w3c.dom.css.CSSStyleSheet cssSheet, Stylesheet stylesheet) { org.w3c.dom.css.CSSRuleList rl = cssSheet.getCssRules(); int nr = rl.getLength(); for (int i = 0; i < nr; i++) { if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.IMPORT_RULE) { //note: the steadystate parser does not fetch and load imported stylesheets CSSImportRule cssir = (CSSImportRule) rl.item(i); String href = cssir.getHref(); MediaList media = cssir.getMedia(); String uri = null; try { uri = new java.net.URL(new URL(stylesheet.getURI()), href).toString(); StylesheetInfo info = new StylesheetInfo(); info.setOrigin(stylesheet.getOrigin()); info.setUri(uri); info.setMedia(media.getMediaText()); info.setType("text/css"); stylesheet.addStylesheet(info); } catch (java.net.MalformedURLException e) { XRLog.exception("bad URL for imported stylesheet", e); } } else if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.STYLE_RULE) { stylesheet.addRuleset(new Ruleset((org.w3c.dom.css.CSSStyleRule) rl.item(i), stylesheet.getOrigin())); } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/37a4a3d1b1f6a7c86c2b59853a3db3638b9bf1e0/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
MediaList media = cssir.getMedia(); | MediaList mediaList = cssir.getMedia(); String media = mediaList.getMediaText(); if (media.equals("")) media = sheetInfo.getMedia(); | private void pullRulesets(org.w3c.dom.css.CSSStyleSheet cssSheet, Stylesheet stylesheet) { org.w3c.dom.css.CSSRuleList rl = cssSheet.getCssRules(); int nr = rl.getLength(); for (int i = 0; i < nr; i++) { if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.IMPORT_RULE) { //note: the steadystate parser does not fetch and load imported stylesheets CSSImportRule cssir = (CSSImportRule) rl.item(i); String href = cssir.getHref(); MediaList media = cssir.getMedia(); String uri = null; try { uri = new java.net.URL(new URL(stylesheet.getURI()), href).toString(); StylesheetInfo info = new StylesheetInfo(); info.setOrigin(stylesheet.getOrigin()); info.setUri(uri); info.setMedia(media.getMediaText()); info.setType("text/css"); stylesheet.addStylesheet(info); } catch (java.net.MalformedURLException e) { XRLog.exception("bad URL for imported stylesheet", e); } } else if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.STYLE_RULE) { stylesheet.addRuleset(new Ruleset((org.w3c.dom.css.CSSStyleRule) rl.item(i), stylesheet.getOrigin())); } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/37a4a3d1b1f6a7c86c2b59853a3db3638b9bf1e0/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
info.setMedia(media.getMediaText()); | info.setMedia(media); | private void pullRulesets(org.w3c.dom.css.CSSStyleSheet cssSheet, Stylesheet stylesheet) { org.w3c.dom.css.CSSRuleList rl = cssSheet.getCssRules(); int nr = rl.getLength(); for (int i = 0; i < nr; i++) { if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.IMPORT_RULE) { //note: the steadystate parser does not fetch and load imported stylesheets CSSImportRule cssir = (CSSImportRule) rl.item(i); String href = cssir.getHref(); MediaList media = cssir.getMedia(); String uri = null; try { uri = new java.net.URL(new URL(stylesheet.getURI()), href).toString(); StylesheetInfo info = new StylesheetInfo(); info.setOrigin(stylesheet.getOrigin()); info.setUri(uri); info.setMedia(media.getMediaText()); info.setType("text/css"); stylesheet.addStylesheet(info); } catch (java.net.MalformedURLException e) { XRLog.exception("bad URL for imported stylesheet", e); } } else if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.STYLE_RULE) { stylesheet.addRuleset(new Ruleset((org.w3c.dom.css.CSSStyleRule) rl.item(i), stylesheet.getOrigin())); } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/37a4a3d1b1f6a7c86c2b59853a3db3638b9bf1e0/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
} else if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.STYLE_RULE) { stylesheet.addRuleset(new Ruleset((org.w3c.dom.css.CSSStyleRule) rl.item(i), stylesheet.getOrigin())); | } else if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.MEDIA_RULE) { CSSMediaRule cssmr = (CSSMediaRule) rl.item(i); StylesheetInfo info = new StylesheetInfo(); info.setMedia(cssmr.getMedia().getMediaText()); info.setOrigin(stylesheet.getOrigin()); info.setType("text/css"); Stylesheet mr = new Stylesheet(info); info.setStylesheet(mr); pullRulesets(cssmr.getCssRules(), mr, info); stylesheet.addStylesheet(info); | private void pullRulesets(org.w3c.dom.css.CSSStyleSheet cssSheet, Stylesheet stylesheet) { org.w3c.dom.css.CSSRuleList rl = cssSheet.getCssRules(); int nr = rl.getLength(); for (int i = 0; i < nr; i++) { if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.IMPORT_RULE) { //note: the steadystate parser does not fetch and load imported stylesheets CSSImportRule cssir = (CSSImportRule) rl.item(i); String href = cssir.getHref(); MediaList media = cssir.getMedia(); String uri = null; try { uri = new java.net.URL(new URL(stylesheet.getURI()), href).toString(); StylesheetInfo info = new StylesheetInfo(); info.setOrigin(stylesheet.getOrigin()); info.setUri(uri); info.setMedia(media.getMediaText()); info.setType("text/css"); stylesheet.addStylesheet(info); } catch (java.net.MalformedURLException e) { XRLog.exception("bad URL for imported stylesheet", e); } } else if (rl.item(i).getType() == org.w3c.dom.css.CSSRule.STYLE_RULE) { stylesheet.addRuleset(new Ruleset((org.w3c.dom.css.CSSStyleRule) rl.item(i), stylesheet.getOrigin())); } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/37a4a3d1b1f6a7c86c2b59853a3db3638b9bf1e0/StylesheetFactory.java/buggy/src/java/org/xhtmlrenderer/css/sheet/StylesheetFactory.java |
c.getGraphics().translate(0, -ty); | void paint(Context c, LineBox line, int start, int width, int sides) { if (width <= 0) return; int ty = line.getBaseline() - y - height - margin.top - border.top - padding.top + line.y; ty += (int) lm.getDescent(); c.translate(0, ty); Rectangle bounds = new Rectangle(start, y + margin.top, width, height + border.top + padding.top + padding.bottom + border.bottom); //first the background if (background_color != null) { // skip transparent background if (!background_color.equals(BackgroundPainter.transparent)) { //TODO. make conf controlled Uu.p("filling a background"); c.getGraphics().setColor(background_color); c.getGraphics().fillRect(bounds.x, bounds.y, bounds.width, bounds.height); } } //then the border BorderPainter.paint(bounds, sides, style, c.getGraphics(), c.getCtx(), xOffset); c.translate(0, -ty); xOffset += width; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/ea25c36d8670e0a2297b9a25e4765c46f98952c5/InlineBorder.java/clean/src/java/org/xhtmlrenderer/render/InlineBorder.java |
|
previousAfter = previous.getStyle().getCalculatedStyle().getIdent( | previous.getStyle().getCalculatedStyle().getIdent( | public void markRun(int offset, BlockBox previous, BlockBox current) { RelayoutData previousData = get(offset-1); RelayoutData currentData = get(offset); IdentValue previousAfter = previousAfter = previous.getStyle().getCalculatedStyle().getIdent( CSSName.PAGE_BREAK_AFTER); IdentValue currentBefore = current.getStyle().getCalculatedStyle().getIdent( CSSName.PAGE_BREAK_BEFORE); if ( (previousAfter == IdentValue.AVOID && currentBefore == IdentValue.AUTO) || (previousAfter == IdentValue.AUTO && currentBefore == IdentValue.AVOID) || (previousAfter == IdentValue.AVOID && currentBefore == IdentValue.AVOID)) { if (! previousData.isInRun()) { previousData.setStartsRun(true); } previousData.setInRun(true); currentData.setInRun(true); if (offset == _hints.size() - 1) { currentData.setEndsRun(true); } } else { if (previousData.isInRun()) { previousData.setEndsRun(true); } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
if (o instanceof AnonymousBlockContent) { List pendingInlineElements = block.getPendingInlineElements(); if (pendingInlineElements != null) { System.out.println("SETTING"); relayoutData.setHasPendingInlines(true); } | if (o instanceof AnonymousBlockContent && block.getPendingInlineElements() != null) { relayoutData.setHasPendingInlines(true); | public static void layoutContent(final LayoutContext c, final BlockBox block, List contentList) { Boxing.StyleSetListener styleSetListener = new Boxing.StyleSetListener() { public void onStyleSet(BlockBox child) { boolean moved = false; if (child.getStyle().isRelative()) { Dimension delta = child.positionRelative(c); c.translate(delta.width, delta.height); moved = true; } if (c.isPrint() && (child.isNeedPageClear() || child.getStyle().isForcePageBreakBefore())) { int delta = child.moveToNextPage(c); c.translate(0, delta); moved = true; child.setNeedPageClear(false); } if (child.getStyle().isCleared()) { c.translate(0, -child.y); c.getBlockFormattingContext().clear(c, child); c.translate(0, child.y); moved = true; } if (moved) { child.calcCanvasLocation(); } } }; boolean resetMargins = false; int listIndex = 0; int offset = -1; List localContentList = contentList; if (c.isPrint() && ! (localContentList instanceof RandomAccess)) { localContentList = new ArrayList(localContentList); } Iterator contentIterator = localContentList.iterator(); RelayoutDataList relayoutDataList = null; if (c.isPrint()) { relayoutDataList = new RelayoutDataList(localContentList.size()); } BlockBox previousChildBox = null; while (contentIterator.hasNext()) { Object o = contentIterator.next(); offset++; if (o instanceof FirstLineStyle || o instanceof FirstLetterStyle) { continue; } listIndex++; Content currentContent = (Content) o; RelayoutData relayoutData = null; if (c.isPrint()) { relayoutData = relayoutDataList.get(offset); relayoutData.setLayoutState(c.copyStateForRelayout()); relayoutData.setInitialParentHeight(block.height); relayoutData.setContent(currentContent); relayoutData.setListIndex(listIndex); relayoutData.setResetMargins(resetMargins); if (o instanceof AnonymousBlockContent) { List pendingInlineElements = block.getPendingInlineElements(); if (pendingInlineElements != null) { System.out.println("SETTING"); relayoutData.setHasPendingInlines(true); } } } BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks childBox = layoutBlockChild( c, block, styleSetListener, listIndex, resetMargins, false, currentContent); if (c.isPrint() && childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { if (o instanceof AnonymousBlockContent && relayoutData.isHasPendingInlines()) { XRLog.layout(Level.WARNING, "Unable to relayout anonymous block with pending inlines. Dropping rule."); } else { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, listIndex, resetMargins, true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } } if (c.isPrint()) { c.getRootLayer().ensureHasPage(c, childBox); } if (childBox instanceof AnonymousBlockBox) { listIndex--; } // increase the final layout width if the child was greater block.adjustWidthForChild(childBox.getWidth()); // increase the final layout height by the height of the child block.height = childBox.y + childBox.height; if (c.isPrint()) { if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } if (previousChildBox != null) { relayoutDataList.markRun(offset, previousChildBox, childBox); } processPageBreakAvoidRun(c, block, contentList, styleSetListener, offset, relayoutDataList, relayoutData, childBox); resetMargins = childBox.getStyle().isForcePageBreakBefore(); } if (c.shouldStop()) { break; } previousChildBox = childBox; dispatchRepaintEvent(c, block); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
BlockBox secondTry = layoutBlockChild( | childBox.detach(); childBox = layoutBlockChild( | public static void layoutContent(final LayoutContext c, final BlockBox block, List contentList) { Boxing.StyleSetListener styleSetListener = new Boxing.StyleSetListener() { public void onStyleSet(BlockBox child) { boolean moved = false; if (child.getStyle().isRelative()) { Dimension delta = child.positionRelative(c); c.translate(delta.width, delta.height); moved = true; } if (c.isPrint() && (child.isNeedPageClear() || child.getStyle().isForcePageBreakBefore())) { int delta = child.moveToNextPage(c); c.translate(0, delta); moved = true; child.setNeedPageClear(false); } if (child.getStyle().isCleared()) { c.translate(0, -child.y); c.getBlockFormattingContext().clear(c, child); c.translate(0, child.y); moved = true; } if (moved) { child.calcCanvasLocation(); } } }; boolean resetMargins = false; int listIndex = 0; int offset = -1; List localContentList = contentList; if (c.isPrint() && ! (localContentList instanceof RandomAccess)) { localContentList = new ArrayList(localContentList); } Iterator contentIterator = localContentList.iterator(); RelayoutDataList relayoutDataList = null; if (c.isPrint()) { relayoutDataList = new RelayoutDataList(localContentList.size()); } BlockBox previousChildBox = null; while (contentIterator.hasNext()) { Object o = contentIterator.next(); offset++; if (o instanceof FirstLineStyle || o instanceof FirstLetterStyle) { continue; } listIndex++; Content currentContent = (Content) o; RelayoutData relayoutData = null; if (c.isPrint()) { relayoutData = relayoutDataList.get(offset); relayoutData.setLayoutState(c.copyStateForRelayout()); relayoutData.setInitialParentHeight(block.height); relayoutData.setContent(currentContent); relayoutData.setListIndex(listIndex); relayoutData.setResetMargins(resetMargins); if (o instanceof AnonymousBlockContent) { List pendingInlineElements = block.getPendingInlineElements(); if (pendingInlineElements != null) { System.out.println("SETTING"); relayoutData.setHasPendingInlines(true); } } } BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks childBox = layoutBlockChild( c, block, styleSetListener, listIndex, resetMargins, false, currentContent); if (c.isPrint() && childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { if (o instanceof AnonymousBlockContent && relayoutData.isHasPendingInlines()) { XRLog.layout(Level.WARNING, "Unable to relayout anonymous block with pending inlines. Dropping rule."); } else { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, listIndex, resetMargins, true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } } if (c.isPrint()) { c.getRootLayer().ensureHasPage(c, childBox); } if (childBox instanceof AnonymousBlockBox) { listIndex--; } // increase the final layout width if the child was greater block.adjustWidthForChild(childBox.getWidth()); // increase the final layout height by the height of the child block.height = childBox.y + childBox.height; if (c.isPrint()) { if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } if (previousChildBox != null) { relayoutDataList.markRun(offset, previousChildBox, childBox); } processPageBreakAvoidRun(c, block, contentList, styleSetListener, offset, relayoutDataList, relayoutData, childBox); resetMargins = childBox.getStyle().isForcePageBreakBefore(); } if (c.shouldStop()) { break; } previousChildBox = childBox; dispatchRepaintEvent(c, block); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } | public static void layoutContent(final LayoutContext c, final BlockBox block, List contentList) { Boxing.StyleSetListener styleSetListener = new Boxing.StyleSetListener() { public void onStyleSet(BlockBox child) { boolean moved = false; if (child.getStyle().isRelative()) { Dimension delta = child.positionRelative(c); c.translate(delta.width, delta.height); moved = true; } if (c.isPrint() && (child.isNeedPageClear() || child.getStyle().isForcePageBreakBefore())) { int delta = child.moveToNextPage(c); c.translate(0, delta); moved = true; child.setNeedPageClear(false); } if (child.getStyle().isCleared()) { c.translate(0, -child.y); c.getBlockFormattingContext().clear(c, child); c.translate(0, child.y); moved = true; } if (moved) { child.calcCanvasLocation(); } } }; boolean resetMargins = false; int listIndex = 0; int offset = -1; List localContentList = contentList; if (c.isPrint() && ! (localContentList instanceof RandomAccess)) { localContentList = new ArrayList(localContentList); } Iterator contentIterator = localContentList.iterator(); RelayoutDataList relayoutDataList = null; if (c.isPrint()) { relayoutDataList = new RelayoutDataList(localContentList.size()); } BlockBox previousChildBox = null; while (contentIterator.hasNext()) { Object o = contentIterator.next(); offset++; if (o instanceof FirstLineStyle || o instanceof FirstLetterStyle) { continue; } listIndex++; Content currentContent = (Content) o; RelayoutData relayoutData = null; if (c.isPrint()) { relayoutData = relayoutDataList.get(offset); relayoutData.setLayoutState(c.copyStateForRelayout()); relayoutData.setInitialParentHeight(block.height); relayoutData.setContent(currentContent); relayoutData.setListIndex(listIndex); relayoutData.setResetMargins(resetMargins); if (o instanceof AnonymousBlockContent) { List pendingInlineElements = block.getPendingInlineElements(); if (pendingInlineElements != null) { System.out.println("SETTING"); relayoutData.setHasPendingInlines(true); } } } BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks childBox = layoutBlockChild( c, block, styleSetListener, listIndex, resetMargins, false, currentContent); if (c.isPrint() && childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { if (o instanceof AnonymousBlockContent && relayoutData.isHasPendingInlines()) { XRLog.layout(Level.WARNING, "Unable to relayout anonymous block with pending inlines. Dropping rule."); } else { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, listIndex, resetMargins, true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } } if (c.isPrint()) { c.getRootLayer().ensureHasPage(c, childBox); } if (childBox instanceof AnonymousBlockBox) { listIndex--; } // increase the final layout width if the child was greater block.adjustWidthForChild(childBox.getWidth()); // increase the final layout height by the height of the child block.height = childBox.y + childBox.height; if (c.isPrint()) { if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } if (previousChildBox != null) { relayoutDataList.markRun(offset, previousChildBox, childBox); } processPageBreakAvoidRun(c, block, contentList, styleSetListener, offset, relayoutDataList, relayoutData, childBox); resetMargins = childBox.getStyle().isForcePageBreakBefore(); } if (c.shouldStop()) { break; } previousChildBox = childBox; dispatchRepaintEvent(c, block); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
|
int heightBeforeRelayout = block.height; | private static void processPageBreakAvoidRun(final LayoutContext c, final BlockBox block, List contentList, Boxing.StyleSetListener styleSetListener, int offset, RelayoutDataList relayoutDataList, RelayoutData relayoutData, BlockBox childBox) { if (offset > 0) { boolean mightNeedRelayout = false; int runEnd = -1; if (offset == contentList.size() - 1 && relayoutData.isEndsRun()) { mightNeedRelayout = true; runEnd = offset; } else if (offset > 0){ RelayoutData previousRelayoutData = relayoutDataList.get(offset-1); if (previousRelayoutData.isEndsRun()) { mightNeedRelayout = true; runEnd = offset - 1; } } if (mightNeedRelayout) { int heightBeforeRelayout = block.height; int runStart = relayoutDataList.getRunStart(runEnd); if (c.getRootLayer().crossesPageBreak(c, block.getChild(runStart).getAbsY(), block.getChild(runEnd).getAbsY() + childBox.getHeight())) { RelayoutResult result = relayoutOnNewPage(c, contentList, block, styleSetListener, relayoutDataList, runStart, offset); if (! result.isCanceled()) { if (result.isFits()) { block.detachChildren(runStart, offset); } else { block.detachChildren(offset+1, block.getChildCount()-1); block.height = heightBeforeRelayout; } } } } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
|
block.getChild(runEnd).getAbsY() + childBox.getHeight())) { RelayoutResult result = relayoutOnNewPage(c, contentList, block, | block.getChild(runEnd).getAbsY() + childBox.getHeight()) && ! checkForPendingInlines(relayoutDataList, runStart, offset)) { block.detachChildren(runStart, offset); relayoutOnNewPage(c, contentList, block, | private static void processPageBreakAvoidRun(final LayoutContext c, final BlockBox block, List contentList, Boxing.StyleSetListener styleSetListener, int offset, RelayoutDataList relayoutDataList, RelayoutData relayoutData, BlockBox childBox) { if (offset > 0) { boolean mightNeedRelayout = false; int runEnd = -1; if (offset == contentList.size() - 1 && relayoutData.isEndsRun()) { mightNeedRelayout = true; runEnd = offset; } else if (offset > 0){ RelayoutData previousRelayoutData = relayoutDataList.get(offset-1); if (previousRelayoutData.isEndsRun()) { mightNeedRelayout = true; runEnd = offset - 1; } } if (mightNeedRelayout) { int heightBeforeRelayout = block.height; int runStart = relayoutDataList.getRunStart(runEnd); if (c.getRootLayer().crossesPageBreak(c, block.getChild(runStart).getAbsY(), block.getChild(runEnd).getAbsY() + childBox.getHeight())) { RelayoutResult result = relayoutOnNewPage(c, contentList, block, styleSetListener, relayoutDataList, runStart, offset); if (! result.isCanceled()) { if (result.isFits()) { block.detachChildren(runStart, offset); } else { block.detachChildren(offset+1, block.getChildCount()-1); block.height = heightBeforeRelayout; } } } } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
if (! result.isCanceled()) { if (result.isFits()) { block.detachChildren(runStart, offset); } else { block.detachChildren(offset+1, block.getChildCount()-1); block.height = heightBeforeRelayout; } } | private static void processPageBreakAvoidRun(final LayoutContext c, final BlockBox block, List contentList, Boxing.StyleSetListener styleSetListener, int offset, RelayoutDataList relayoutDataList, RelayoutData relayoutData, BlockBox childBox) { if (offset > 0) { boolean mightNeedRelayout = false; int runEnd = -1; if (offset == contentList.size() - 1 && relayoutData.isEndsRun()) { mightNeedRelayout = true; runEnd = offset; } else if (offset > 0){ RelayoutData previousRelayoutData = relayoutDataList.get(offset-1); if (previousRelayoutData.isEndsRun()) { mightNeedRelayout = true; runEnd = offset - 1; } } if (mightNeedRelayout) { int heightBeforeRelayout = block.height; int runStart = relayoutDataList.getRunStart(runEnd); if (c.getRootLayer().crossesPageBreak(c, block.getChild(runStart).getAbsY(), block.getChild(runEnd).getAbsY() + childBox.getHeight())) { RelayoutResult result = relayoutOnNewPage(c, contentList, block, styleSetListener, relayoutDataList, runStart, offset); if (! result.isCanceled()) { if (result.isFits()) { block.detachChildren(runStart, offset); } else { block.detachChildren(offset+1, block.getChildCount()-1); block.height = heightBeforeRelayout; } } } } } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
|
private static RelayoutResult relayoutOnNewPage( | private static void relayoutOnNewPage( | private static RelayoutResult relayoutOnNewPage( LayoutContext c, List contentList, BlockBox block, StyleSetListener styleSetListener, RelayoutDataList relayoutDataList, int start, int end) { if (checkForPendingInlines(relayoutDataList, start, end)) { RelayoutResult result = new RelayoutResult(); result.setCanceled(true); return result; } block.height = relayoutDataList.get(start).getInitialParentHeight(); block.expandToPageBottom(c); int startAbsY = block.getAbsY() + block.ty + block.height; int endAbsY = 0; for (int i = start; i <= end; i++) { Content currentContent = (Content)contentList.get(i); RelayoutData relayoutData = relayoutDataList.get(i); BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks c.restoreStateForRelayout(relayoutData.getLayoutState()); childBox = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), false, currentContent); if (childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } c.getRootLayer().ensureHasPage(c, childBox); block.adjustWidthForChild(childBox.getWidth()); block.height = childBox.y + childBox.height; if ((i == end && end == contentList.size()-1) || (i == end - 1)) { endAbsY = childBox.getAbsY() + childBox.getHeight(); } if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } } RelayoutResult result = new RelayoutResult(); result.setFits(! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY)); return result; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
if (checkForPendingInlines(relayoutDataList, start, end)) { RelayoutResult result = new RelayoutResult(); result.setCanceled(true); return result; } | private static RelayoutResult relayoutOnNewPage( LayoutContext c, List contentList, BlockBox block, StyleSetListener styleSetListener, RelayoutDataList relayoutDataList, int start, int end) { if (checkForPendingInlines(relayoutDataList, start, end)) { RelayoutResult result = new RelayoutResult(); result.setCanceled(true); return result; } block.height = relayoutDataList.get(start).getInitialParentHeight(); block.expandToPageBottom(c); int startAbsY = block.getAbsY() + block.ty + block.height; int endAbsY = 0; for (int i = start; i <= end; i++) { Content currentContent = (Content)contentList.get(i); RelayoutData relayoutData = relayoutDataList.get(i); BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks c.restoreStateForRelayout(relayoutData.getLayoutState()); childBox = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), false, currentContent); if (childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } c.getRootLayer().ensureHasPage(c, childBox); block.adjustWidthForChild(childBox.getWidth()); block.height = childBox.y + childBox.height; if ((i == end && end == contentList.size()-1) || (i == end - 1)) { endAbsY = childBox.getAbsY() + childBox.getHeight(); } if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } } RelayoutResult result = new RelayoutResult(); result.setFits(! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY)); return result; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
|
int startAbsY = block.getAbsY() + block.ty + block.height; int endAbsY = 0; | private static RelayoutResult relayoutOnNewPage( LayoutContext c, List contentList, BlockBox block, StyleSetListener styleSetListener, RelayoutDataList relayoutDataList, int start, int end) { if (checkForPendingInlines(relayoutDataList, start, end)) { RelayoutResult result = new RelayoutResult(); result.setCanceled(true); return result; } block.height = relayoutDataList.get(start).getInitialParentHeight(); block.expandToPageBottom(c); int startAbsY = block.getAbsY() + block.ty + block.height; int endAbsY = 0; for (int i = start; i <= end; i++) { Content currentContent = (Content)contentList.get(i); RelayoutData relayoutData = relayoutDataList.get(i); BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks c.restoreStateForRelayout(relayoutData.getLayoutState()); childBox = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), false, currentContent); if (childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } c.getRootLayer().ensureHasPage(c, childBox); block.adjustWidthForChild(childBox.getWidth()); block.height = childBox.y + childBox.height; if ((i == end && end == contentList.size()-1) || (i == end - 1)) { endAbsY = childBox.getAbsY() + childBox.getHeight(); } if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } } RelayoutResult result = new RelayoutResult(); result.setFits(! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY)); return result; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
|
if (childBox.getStyle().isAvoidPageBreakInside() && | if (childBox.getStyle().isAvoidPageBreakInside() && | private static RelayoutResult relayoutOnNewPage( LayoutContext c, List contentList, BlockBox block, StyleSetListener styleSetListener, RelayoutDataList relayoutDataList, int start, int end) { if (checkForPendingInlines(relayoutDataList, start, end)) { RelayoutResult result = new RelayoutResult(); result.setCanceled(true); return result; } block.height = relayoutDataList.get(start).getInitialParentHeight(); block.expandToPageBottom(c); int startAbsY = block.getAbsY() + block.ty + block.height; int endAbsY = 0; for (int i = start; i <= end; i++) { Content currentContent = (Content)contentList.get(i); RelayoutData relayoutData = relayoutDataList.get(i); BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks c.restoreStateForRelayout(relayoutData.getLayoutState()); childBox = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), false, currentContent); if (childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } c.getRootLayer().ensureHasPage(c, childBox); block.adjustWidthForChild(childBox.getWidth()); block.height = childBox.y + childBox.height; if ((i == end && end == contentList.size()-1) || (i == end - 1)) { endAbsY = childBox.getAbsY() + childBox.getHeight(); } if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } } RelayoutResult result = new RelayoutResult(); result.setFits(! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY)); return result; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); | if (currentContent instanceof AnonymousBlockContent && relayoutData.isHasPendingInlines()) { XRLog.layout(Level.WARNING, "Unable to relayout anonymous block with pending inlines. Dropping rule."); | private static RelayoutResult relayoutOnNewPage( LayoutContext c, List contentList, BlockBox block, StyleSetListener styleSetListener, RelayoutDataList relayoutDataList, int start, int end) { if (checkForPendingInlines(relayoutDataList, start, end)) { RelayoutResult result = new RelayoutResult(); result.setCanceled(true); return result; } block.height = relayoutDataList.get(start).getInitialParentHeight(); block.expandToPageBottom(c); int startAbsY = block.getAbsY() + block.ty + block.height; int endAbsY = 0; for (int i = start; i <= end; i++) { Content currentContent = (Content)contentList.get(i); RelayoutData relayoutData = relayoutDataList.get(i); BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks c.restoreStateForRelayout(relayoutData.getLayoutState()); childBox = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), false, currentContent); if (childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } c.getRootLayer().ensureHasPage(c, childBox); block.adjustWidthForChild(childBox.getWidth()); block.height = childBox.y + childBox.height; if ((i == end && end == contentList.size()-1) || (i == end - 1)) { endAbsY = childBox.getAbsY() + childBox.getHeight(); } if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } } RelayoutResult result = new RelayoutResult(); result.setFits(! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY)); return result; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
childBox = secondTry; | childBox = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); | private static RelayoutResult relayoutOnNewPage( LayoutContext c, List contentList, BlockBox block, StyleSetListener styleSetListener, RelayoutDataList relayoutDataList, int start, int end) { if (checkForPendingInlines(relayoutDataList, start, end)) { RelayoutResult result = new RelayoutResult(); result.setCanceled(true); return result; } block.height = relayoutDataList.get(start).getInitialParentHeight(); block.expandToPageBottom(c); int startAbsY = block.getAbsY() + block.ty + block.height; int endAbsY = 0; for (int i = start; i <= end; i++) { Content currentContent = (Content)contentList.get(i); RelayoutData relayoutData = relayoutDataList.get(i); BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks c.restoreStateForRelayout(relayoutData.getLayoutState()); childBox = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), false, currentContent); if (childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } c.getRootLayer().ensureHasPage(c, childBox); block.adjustWidthForChild(childBox.getWidth()); block.height = childBox.y + childBox.height; if ((i == end && end == contentList.size()-1) || (i == end - 1)) { endAbsY = childBox.getAbsY() + childBox.getHeight(); } if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } } RelayoutResult result = new RelayoutResult(); result.setFits(! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY)); return result; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
if ((i == end && end == contentList.size()-1) || (i == end - 1)) { endAbsY = childBox.getAbsY() + childBox.getHeight(); } | private static RelayoutResult relayoutOnNewPage( LayoutContext c, List contentList, BlockBox block, StyleSetListener styleSetListener, RelayoutDataList relayoutDataList, int start, int end) { if (checkForPendingInlines(relayoutDataList, start, end)) { RelayoutResult result = new RelayoutResult(); result.setCanceled(true); return result; } block.height = relayoutDataList.get(start).getInitialParentHeight(); block.expandToPageBottom(c); int startAbsY = block.getAbsY() + block.ty + block.height; int endAbsY = 0; for (int i = start; i <= end; i++) { Content currentContent = (Content)contentList.get(i); RelayoutData relayoutData = relayoutDataList.get(i); BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks c.restoreStateForRelayout(relayoutData.getLayoutState()); childBox = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), false, currentContent); if (childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } c.getRootLayer().ensureHasPage(c, childBox); block.adjustWidthForChild(childBox.getWidth()); block.height = childBox.y + childBox.height; if ((i == end && end == contentList.size()-1) || (i == end - 1)) { endAbsY = childBox.getAbsY() + childBox.getHeight(); } if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } } RelayoutResult result = new RelayoutResult(); result.setFits(! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY)); return result; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
|
RelayoutResult result = new RelayoutResult(); result.setFits(! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY)); return result; | private static RelayoutResult relayoutOnNewPage( LayoutContext c, List contentList, BlockBox block, StyleSetListener styleSetListener, RelayoutDataList relayoutDataList, int start, int end) { if (checkForPendingInlines(relayoutDataList, start, end)) { RelayoutResult result = new RelayoutResult(); result.setCanceled(true); return result; } block.height = relayoutDataList.get(start).getInitialParentHeight(); block.expandToPageBottom(c); int startAbsY = block.getAbsY() + block.ty + block.height; int endAbsY = 0; for (int i = start; i <= end; i++) { Content currentContent = (Content)contentList.get(i); RelayoutData relayoutData = relayoutDataList.get(i); BlockBox childBox = null; //TODO:handle run-ins. For now, treat them as blocks c.restoreStateForRelayout(relayoutData.getLayoutState()); childBox = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), false, currentContent); if (childBox.getStyle().isAvoidPageBreakInside() && childBox.crossesPageBreak(c)) { c.restoreStateForRelayout(relayoutData.getLayoutState()); BlockBox secondTry = layoutBlockChild( c, block, styleSetListener, relayoutData.getListIndex(), relayoutData.isResetMargins(), true, currentContent); if (secondTry.crossesPageBreak(c)) { secondTry.detach(); } else { childBox.detach(); childBox = secondTry; } } c.getRootLayer().ensureHasPage(c, childBox); block.adjustWidthForChild(childBox.getWidth()); block.height = childBox.y + childBox.height; if ((i == end && end == contentList.size()-1) || (i == end - 1)) { endAbsY = childBox.getAbsY() + childBox.getHeight(); } if (childBox.getStyle().isForcePageBreakAfter()) { block.expandToPageBottom(c); } } RelayoutResult result = new RelayoutResult(); result.setFits(! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY)); return result; } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/374d17ea4f8f5f5914c5c65d8a4c5a5ce9f4749d/BlockBoxing.java/clean/src/java/org/xhtmlrenderer/layout/BlockBoxing.java |
|
result.defineMethod("include?", callbackFactory.getMethod("include_p", IRubyObject.class)); | public static RubyClass createRangeClass(Ruby runtime) { RubyClass result = runtime.defineClass("Range", runtime.getClasses().getObjectClass()); CallbackFactory callbackFactory = runtime.callbackFactory(RubyRange.class); result.includeModule(runtime.getClasses().getEnumerableModule()); result.defineMethod("==", callbackFactory.getMethod("equal", IRubyObject.class)); result.defineMethod("===", callbackFactory.getMethod("op_eqq", IRubyObject.class)); result.defineMethod("begin", callbackFactory.getMethod("first")); result.defineMethod("each", callbackFactory.getMethod("each")); result.defineMethod("end", callbackFactory.getMethod("last")); result.defineMethod("exclude_end?", callbackFactory.getMethod("exclude_end_p")); result.defineMethod("first", callbackFactory.getMethod("first")); result.defineMethod("initialize", callbackFactory.getOptMethod("initialize")); result.defineMethod("inspect", callbackFactory.getMethod("inspect")); result.defineMethod("last", callbackFactory.getMethod("last")); result.defineMethod("length", callbackFactory.getMethod("length")); result.defineMethod("size", callbackFactory.getMethod("length")); result.defineMethod("to_s", callbackFactory.getMethod("inspect")); result.defineMethod("to_a", callbackFactory.getMethod("to_a")); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a6e193d9102b579d9aa01db756d486ed0c99f31f/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
|
if (!(obj instanceof RubyNumeric)) { return getRuntime().getFalse(); } | public RubyBoolean op_eqq(IRubyObject obj) { if (begin instanceof RubyFixnum && obj instanceof RubyFixnum && end instanceof RubyFixnum) { long b = RubyNumeric.fix2long(begin); long o = RubyNumeric.fix2long(obj); if (b <= o) { long e = RubyNumeric.fix2long(end); if (isExclusive) { if (o < e) { return getRuntime().getTrue(); } } else { if (o <= e) { return getRuntime().getTrue(); } } } return getRuntime().getFalse(); } else if (begin.callMethod("<=", obj).isTrue()) { if (isExclusive) { if (end.callMethod(">", obj).isTrue()) { return getRuntime().getTrue(); } } else { if (end.callMethod(">=", obj).isTrue()) { return getRuntime().getTrue(); } } } return getRuntime().getFalse(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a6e193d9102b579d9aa01db756d486ed0c99f31f/RubyRange.java/buggy/src/org/jruby/RubyRange.java |
|
public void testForRedundantKeySequenceBindings() throws ComponentException { | public void testForRedundantKeySequenceBindings() { | public void testForRedundantKeySequenceBindings() throws ComponentException { final IWorkbenchWindow window = openTestWindow(); final IWorkbench workbench = window.getWorkbench(); final IBindingService bindingService = (IBindingService) workbench .getService(IBindingService.class); final Binding[] bindings = bindingService.getBindings(); final int bindingCount = bindings.length; Map keySequenceBindingsByKeySequence = new HashMap(); for (int i = 0; i < bindingCount; i++) { // Retrieve the key binding. final Binding binding = bindings[i]; // Find the point the bindings with matching key sequences. TriggerSequence triggerSequence = binding.getTriggerSequence(); List matches = (List) keySequenceBindingsByKeySequence .get(triggerSequence); if (matches == null) { matches = new ArrayList(); keySequenceBindingsByKeySequence.put(triggerSequence, matches); } // Check that we don't have any redundancy or other wackiness. Iterator matchItr = matches.iterator(); while (matchItr.hasNext()) { final Binding matchedBinding = (Binding) matchItr.next(); ParameterizedCommand commandA = binding .getParameterizedCommand(); ParameterizedCommand commandB = matchedBinding .getParameterizedCommand(); String contextA = binding.getContextId(); String contextB = matchedBinding.getContextId(); String keyConfA = binding.getSchemeId(); String keyConfB = matchedBinding.getSchemeId(); String localeA = binding.getLocale(); String localeB = matchedBinding.getLocale(); String platformA = binding.getPlatform(); String platformB = matchedBinding.getPlatform(); boolean same = true; int nullMatches = 0; same &= (commandA == null) ? (commandB == null) : (commandA .equals(commandB)); same &= (contextA == null) || (contextB == null) || (contextA.equals(contextB)); if (((contextA == null) || (contextB == null)) && (contextA != contextB)) { nullMatches++; } same &= (keyConfA == null) || (keyConfB == null) || (keyConfA.equals(keyConfB)); if (((keyConfA == null) || (keyConfB == null)) && (keyConfA != keyConfB)) { nullMatches++; } same &= (localeA == null) || (localeB == null) || (localeA.equals(localeB)); if (((localeA == null) || (localeB == null)) && (localeA != localeB)) { nullMatches++; } same &= (platformA == null) || (platformB == null) || (platformA.equals(platformB)); if (((platformA == null) || (platformB == null)) && (platformA != platformB)) { nullMatches++; } assertFalse( "Redundant key bindings: " + binding + ", " + matchedBinding, same && (nullMatches < 1)); //$NON-NLS-1$ //$NON-NLS-2$ } // Add the key binding. matches.add(binding); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/Bug36537Test.java/clean/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug36537Test.java |
.getService(IBindingService.class); | .getAdapter(IBindingService.class); | public void testForRedundantKeySequenceBindings() throws ComponentException { final IWorkbenchWindow window = openTestWindow(); final IWorkbench workbench = window.getWorkbench(); final IBindingService bindingService = (IBindingService) workbench .getService(IBindingService.class); final Binding[] bindings = bindingService.getBindings(); final int bindingCount = bindings.length; Map keySequenceBindingsByKeySequence = new HashMap(); for (int i = 0; i < bindingCount; i++) { // Retrieve the key binding. final Binding binding = bindings[i]; // Find the point the bindings with matching key sequences. TriggerSequence triggerSequence = binding.getTriggerSequence(); List matches = (List) keySequenceBindingsByKeySequence .get(triggerSequence); if (matches == null) { matches = new ArrayList(); keySequenceBindingsByKeySequence.put(triggerSequence, matches); } // Check that we don't have any redundancy or other wackiness. Iterator matchItr = matches.iterator(); while (matchItr.hasNext()) { final Binding matchedBinding = (Binding) matchItr.next(); ParameterizedCommand commandA = binding .getParameterizedCommand(); ParameterizedCommand commandB = matchedBinding .getParameterizedCommand(); String contextA = binding.getContextId(); String contextB = matchedBinding.getContextId(); String keyConfA = binding.getSchemeId(); String keyConfB = matchedBinding.getSchemeId(); String localeA = binding.getLocale(); String localeB = matchedBinding.getLocale(); String platformA = binding.getPlatform(); String platformB = matchedBinding.getPlatform(); boolean same = true; int nullMatches = 0; same &= (commandA == null) ? (commandB == null) : (commandA .equals(commandB)); same &= (contextA == null) || (contextB == null) || (contextA.equals(contextB)); if (((contextA == null) || (contextB == null)) && (contextA != contextB)) { nullMatches++; } same &= (keyConfA == null) || (keyConfB == null) || (keyConfA.equals(keyConfB)); if (((keyConfA == null) || (keyConfB == null)) && (keyConfA != keyConfB)) { nullMatches++; } same &= (localeA == null) || (localeB == null) || (localeA.equals(localeB)); if (((localeA == null) || (localeB == null)) && (localeA != localeB)) { nullMatches++; } same &= (platformA == null) || (platformB == null) || (platformA.equals(platformB)); if (((platformA == null) || (platformB == null)) && (platformA != platformB)) { nullMatches++; } assertFalse( "Redundant key bindings: " + binding + ", " + matchedBinding, same && (nullMatches < 1)); //$NON-NLS-1$ //$NON-NLS-2$ } // Add the key binding. matches.add(binding); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/2aa0965bbe6d7e1c9acd243af620354c7eb93e19/Bug36537Test.java/clean/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug36537Test.java |
Border margin = c.getCurrentStyle().getMarginWidth(width, height, c.getCtx()); | Border margin = block.getMarginWidth(c, width); | public static void paint(Context c, Box block) { // don't draw if the backgrounds are turned off if (!Configuration.isTrue("xr.renderer.draw.backgrounds", true)) { return; } int width = block.getWidth(); int height = block.getHeight(); Border border = c.getCurrentStyle().getBorderWidth(c.getCtx()); if (border == null) { return; } Border margin = c.getCurrentStyle().getMarginWidth(width, height, c.getCtx()); Rectangle box = new Rectangle(block.x + margin.left + border.left, block.y + margin.top + border.top, block.width - margin.left - margin.right - border.left - border.right, block.height - margin.top - border.top - border.bottom - margin.bottom); // paint the background Color background_color = c.getCurrentStyle().getBackgroundColor(); if (background_color != null) { // skip transparent background if (!background_color.equals(transparent)) { c.getGraphics().setColor(background_color); c.getGraphics().fillRect(box.x, box.y, box.width + 1, box.height + 1); } } int xoff = 0; int yoff = 0; if (block.attachment == IdentValue.FIXED) { yoff = c.getCanvas().getLocation().y; c.getGraphics().setClip(c.getCanvas().getVisibleRect()); } if (block.background_image != null) { int left_insets = box.x; int top_insets = box.y; int back_width = box.width; int back_height = box.height; Rectangle2D oldclip = (Rectangle2D) c.getGraphics().getClip(); Rectangle new_clip = new Rectangle(left_insets, top_insets, back_width, back_height); c.getGraphics().setClip(oldclip.createIntersection(new_clip)); xoff += block.background_position_horizontal; yoff -= block.background_position_vertical; // tile the image as appropriate // do fixed tile image boolean horiz = false; boolean vert = false; if (block.repeat == IdentValue.REPEAT_X) { horiz = true; vert = false; } if (block.repeat == IdentValue.REPEAT_Y) { horiz = false; vert = true; } if (block.repeat == IdentValue.REPEAT) { horiz = true; vert = true; } tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); c.getGraphics().setClip(oldclip); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9ac58abece8ac0f02983d3b07df9656b6a59c78a/BackgroundPainter.java/clean/src/java/org/xhtmlrenderer/render/BackgroundPainter.java |
Rectangle2D oldclip = (Rectangle2D) c.getGraphics().getClip(); | Shape oldclip = (Shape) c.getGraphics().getClip(); | public static void paint(Context c, Box block) { // don't draw if the backgrounds are turned off if (!Configuration.isTrue("xr.renderer.draw.backgrounds", true)) { return; } int width = block.getWidth(); int height = block.getHeight(); Border border = c.getCurrentStyle().getBorderWidth(c.getCtx()); if (border == null) { return; } Border margin = c.getCurrentStyle().getMarginWidth(width, height, c.getCtx()); Rectangle box = new Rectangle(block.x + margin.left + border.left, block.y + margin.top + border.top, block.width - margin.left - margin.right - border.left - border.right, block.height - margin.top - border.top - border.bottom - margin.bottom); // paint the background Color background_color = c.getCurrentStyle().getBackgroundColor(); if (background_color != null) { // skip transparent background if (!background_color.equals(transparent)) { c.getGraphics().setColor(background_color); c.getGraphics().fillRect(box.x, box.y, box.width + 1, box.height + 1); } } int xoff = 0; int yoff = 0; if (block.attachment == IdentValue.FIXED) { yoff = c.getCanvas().getLocation().y; c.getGraphics().setClip(c.getCanvas().getVisibleRect()); } if (block.background_image != null) { int left_insets = box.x; int top_insets = box.y; int back_width = box.width; int back_height = box.height; Rectangle2D oldclip = (Rectangle2D) c.getGraphics().getClip(); Rectangle new_clip = new Rectangle(left_insets, top_insets, back_width, back_height); c.getGraphics().setClip(oldclip.createIntersection(new_clip)); xoff += block.background_position_horizontal; yoff -= block.background_position_vertical; // tile the image as appropriate // do fixed tile image boolean horiz = false; boolean vert = false; if (block.repeat == IdentValue.REPEAT_X) { horiz = true; vert = false; } if (block.repeat == IdentValue.REPEAT_Y) { horiz = false; vert = true; } if (block.repeat == IdentValue.REPEAT) { horiz = true; vert = true; } tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); c.getGraphics().setClip(oldclip); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9ac58abece8ac0f02983d3b07df9656b6a59c78a/BackgroundPainter.java/clean/src/java/org/xhtmlrenderer/render/BackgroundPainter.java |
c.getGraphics().setClip(oldclip.createIntersection(new_clip)); | c.getGraphics().clip(new_clip); | public static void paint(Context c, Box block) { // don't draw if the backgrounds are turned off if (!Configuration.isTrue("xr.renderer.draw.backgrounds", true)) { return; } int width = block.getWidth(); int height = block.getHeight(); Border border = c.getCurrentStyle().getBorderWidth(c.getCtx()); if (border == null) { return; } Border margin = c.getCurrentStyle().getMarginWidth(width, height, c.getCtx()); Rectangle box = new Rectangle(block.x + margin.left + border.left, block.y + margin.top + border.top, block.width - margin.left - margin.right - border.left - border.right, block.height - margin.top - border.top - border.bottom - margin.bottom); // paint the background Color background_color = c.getCurrentStyle().getBackgroundColor(); if (background_color != null) { // skip transparent background if (!background_color.equals(transparent)) { c.getGraphics().setColor(background_color); c.getGraphics().fillRect(box.x, box.y, box.width + 1, box.height + 1); } } int xoff = 0; int yoff = 0; if (block.attachment == IdentValue.FIXED) { yoff = c.getCanvas().getLocation().y; c.getGraphics().setClip(c.getCanvas().getVisibleRect()); } if (block.background_image != null) { int left_insets = box.x; int top_insets = box.y; int back_width = box.width; int back_height = box.height; Rectangle2D oldclip = (Rectangle2D) c.getGraphics().getClip(); Rectangle new_clip = new Rectangle(left_insets, top_insets, back_width, back_height); c.getGraphics().setClip(oldclip.createIntersection(new_clip)); xoff += block.background_position_horizontal; yoff -= block.background_position_vertical; // tile the image as appropriate // do fixed tile image boolean horiz = false; boolean vert = false; if (block.repeat == IdentValue.REPEAT_X) { horiz = true; vert = false; } if (block.repeat == IdentValue.REPEAT_Y) { horiz = false; vert = true; } if (block.repeat == IdentValue.REPEAT) { horiz = true; vert = true; } tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); c.getGraphics().setClip(oldclip); } } | 57883 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57883/9ac58abece8ac0f02983d3b07df9656b6a59c78a/BackgroundPainter.java/clean/src/java/org/xhtmlrenderer/render/BackgroundPainter.java |
Group group = null; if (Validator.isNotNull(groupId)) { group = GroupLocalServiceUtil.getGroup(groupId); } if (group == null) { group = user.getGroup(); } | Group group = GroupLocalServiceUtil.getGroup(groupId); | protected void checkPermissions(PortletRequest req) throws Exception { // See LEP-850 ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); User user = themeDisplay.getUser(); String groupId = ParamUtil.getString(req, "groupId"); Group group = null; if (Validator.isNotNull(groupId)) { group = GroupLocalServiceUtil.getGroup(groupId); } if (group == null) { group = user.getGroup(); } GroupPermission.check( themeDisplay.getPermissionChecker(), group.getGroupId(), ActionKeys.MANAGE_LAYOUTS); if (group.isUser() && group.getClassPK().equals(user.getUserId()) && !user.isLayoutsRequired()) { throw new PrincipalException(); } } | 57692 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57692/12f573fc094c0e9d1de408ef2f90785c2e59e772/EditPagesAction.java/clean/portal-ejb/src/com/liferay/portlet/communities/action/EditPagesAction.java |
if( args.length != 1 ) { | /*if( args.length != 1 ) { | public static void main( String[] args ) throws Exception { if( args.length != 1 ) { System.out.println( "Usage: " + "FIXLogViewer dictionary"); return; } String dictionaryFileName = args[0]; DataDictionary dataDictionary = new DataDictionary( dictionaryFileName ); try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch( Exception e ) { } Frame frame = new Frame( dataDictionary ); frame.setVisible( true ); } | 55685 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55685/4363305f238db09ca57c1bff107f3d4d2476840e/Main.java/buggy/quickfix/logviewer/Main.java |
*/ String dictionaryFileName = "FIX44.xml"; | public static void main( String[] args ) throws Exception { if( args.length != 1 ) { System.out.println( "Usage: " + "FIXLogViewer dictionary"); return; } String dictionaryFileName = args[0]; DataDictionary dataDictionary = new DataDictionary( dictionaryFileName ); try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch( Exception e ) { } Frame frame = new Frame( dataDictionary ); frame.setVisible( true ); } | 55685 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55685/4363305f238db09ca57c1bff107f3d4d2476840e/Main.java/buggy/quickfix/logviewer/Main.java |
|
if (id == GOTO_ACTION_ID) { IAction gotoAction = getGotoAction(); if (gotoAction != null) { if (!isMultipleJobErrors() || isPromptToClose()) { okPressed(); gotoAction.run(); } } } super.buttonPressed(id); } | if (id == GOTO_ACTION_ID) { IAction gotoAction = getGotoAction(); if (gotoAction != null) { if (!isMultipleJobErrors() || isPromptToClose()) { okPressed(); gotoAction.run(); } } } super.buttonPressed(id); } | protected void buttonPressed(int id) { if (id == GOTO_ACTION_ID) { IAction gotoAction = getGotoAction(); if (gotoAction != null) { if (!isMultipleJobErrors() || isPromptToClose()) { okPressed(); // close the dialog gotoAction.run(); // run the goto action } } } super.buttonPressed(id); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
Rectangle shellPosition = getShell().getBounds(); boolean result = super.close(); ProgressManagerUtil.animateDown(shellPosition); ProgressManager.getInstance().errorManager.dialogClosed(); return result; } | Rectangle shellPosition = getShell().getBounds(); boolean result = super.close(); ProgressManagerUtil.animateDown(shellPosition); return result; } | public boolean close() { Rectangle shellPosition = getShell().getBounds(); boolean result = super.close(); ProgressManagerUtil.animateDown(shellPosition); ProgressManager.getInstance().errorManager.dialogClosed(); return result; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
IAction gotoAction = getGotoAction(); String text = null; if (gotoAction != null) { text = gotoAction.getText(); } if (text == null) { text = ProgressMessages.JobErrorDialog_CustomJobText; } createButton(parent, GOTO_ACTION_ID, text, false); super.createButtonsForButtonBar(parent); } | IAction gotoAction = getGotoAction(); String text = null; if (gotoAction != null) { text = gotoAction.getText(); } if (text == null) { text = ProgressMessages.JobErrorDialog_CustomJobText; } createButton(parent, GOTO_ACTION_ID, text, false); super.createButtonsForButtonBar(parent); } | protected void createButtonsForButtonBar(Composite parent) { IAction gotoAction = getGotoAction(); String text = null; if (gotoAction != null) { text = gotoAction.getText(); } if (text == null) { // Text is set to this initiallybut will be changed for active job text = ProgressMessages.JobErrorDialog_CustomJobText; } createButton(parent, GOTO_ACTION_ID, text, false); super.createButtonsForButtonBar(parent); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
jobListViewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); jobListViewer.setSorter(getViewerSorter()); Control control = jobListViewer.getControl(); GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); data.heightHint = convertHeightInCharsToPixels(10); control.setLayoutData(data); initContentProvider(); initLabelProvider(); jobListViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { handleSelectionChange(); } }); applyDialogFont(parent); } | jobListViewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); jobListViewer.setSorter(getViewerSorter()); Control control = jobListViewer.getControl(); GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); data.heightHint = convertHeightInCharsToPixels(10); control.setLayoutData(data); initContentProvider(); initLabelProvider(); jobListViewer .addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { handleSelectionChange(); } }); applyDialogFont(parent); } | private void createJobListArea(Composite parent) { // Display a list of jobs that have reported errors jobListViewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); jobListViewer.setSorter(getViewerSorter()); Control control = jobListViewer.getControl(); GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); data.heightHint = convertHeightInCharsToPixels(10); control.setLayoutData(data); initContentProvider(); initLabelProvider(); jobListViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { handleSelectionChange(); } }); applyDialogFont(parent); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
handleSelectionChange(); } | handleSelectionChange(); } | public void selectionChanged(SelectionChangedEvent event) { handleSelectionChange(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
Object property = selectedError.getJob().getProperty(IProgressConstants.ACTION_PROPERTY); if (property instanceof IAction) { return (IAction)property; | Object property = selectedError.getJob().getProperty( IProgressConstants.ACTION_PROPERTY); if (property instanceof IAction) { return (IAction) property; | private IAction getGotoAction() { Object property = selectedError.getJob().getProperty(IProgressConstants.ACTION_PROPERTY); if (property instanceof IAction) { return (IAction)property; } return null; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return null; } | return null; } | private IAction getGotoAction() { Object property = selectedError.getJob().getProperty(IProgressConstants.ACTION_PROPERTY); if (property instanceof IAction) { return (IAction)property; } return null; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return ProgressManager.getInstance().errorManager; } | return ProgressManager.getInstance().errorManager; } | private ErrorNotificationManager getManager() { return ProgressManager.getInstance().errorManager; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return selectedError; } | return selectedError; } | public ErrorInfo getSelectedError() { return selectedError; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
ISelection rawSelection = jobListViewer.getSelection(); if (rawSelection != null && rawSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) rawSelection; if (selection.size() == 1) { | ISelection rawSelection = jobListViewer.getSelection(); if (rawSelection != null && rawSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) rawSelection; if (selection.size() == 1) { | private ErrorInfo getSingleSelection() { ISelection rawSelection = jobListViewer.getSelection(); if (rawSelection != null && rawSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) rawSelection; if (selection.size() == 1) { return (ErrorInfo) selection.getFirstElement(); } } return null; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
} return null; } | } return null; } | private ErrorInfo getSingleSelection() { ISelection rawSelection = jobListViewer.getSelection(); if (rawSelection != null && rawSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) rawSelection; if (selection.size() == 1) { return (ErrorInfo) selection.getFirstElement(); } } return null; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return new ViewerSorter() { /* (non-Javadoc) * * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public int compare(Viewer testViewer, Object e1, Object e2) { return ((Comparable) e1).compareTo(e2); } }; } | return new ViewerSorter() { /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public int compare(Viewer testViewer, Object e1, Object e2) { return ((Comparable) e1).compareTo(e2); } }; } | private ViewerSorter getViewerSorter() { return new ViewerSorter() { /* (non-Javadoc) * * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public int compare(Viewer testViewer, Object e1, Object e2) { return ((Comparable) e1).compareTo(e2); } }; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return ((Comparable) e1).compareTo(e2); } | return ((Comparable) e1).compareTo(e2); } | public int compare(Viewer testViewer, Object e1, Object e2) { return ((Comparable) e1).compareTo(e2); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
ErrorInfo newSelection = getSingleSelection(); if (newSelection != null && newSelection != selectedError) { selectedError = newSelection; setStatus(selectedError.getErrorStatus()); updateEnablements(); showDetailsArea(); } } | ErrorInfo newSelection = getSingleSelection(); if (newSelection != null && newSelection != selectedError) { selectedError = newSelection; setStatus(selectedError.getErrorStatus()); updateEnablements(); showDetailsArea(); } } | void handleSelectionChange() { ErrorInfo newSelection = getSingleSelection(); if (newSelection != null && newSelection != selectedError) { selectedError = newSelection; setStatus(selectedError.getErrorStatus()); updateEnablements(); showDetailsArea(); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
IContentProvider provider = new IStructuredContentProvider() { /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ public void dispose() { } | IContentProvider provider = new IStructuredContentProvider() { /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ public void dispose() { } | protected void initContentProvider() { IContentProvider provider = new IStructuredContentProvider() { /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ public void dispose() { //Nothing of interest here } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ public Object[] getElements(Object inputElement) { return getManager().getErrors().toArray(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput != null) { refreshJobList(); } } }; jobListViewer.setContentProvider(provider); jobListViewer.setInput(getManager()); jobListViewer.setSelection(new StructuredSelection(selectedError)); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
/* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ public Object[] getElements(Object inputElement) { return getManager().getErrors().toArray(); } | /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ public Object[] getElements(Object inputElement) { return getManager().getErrors().toArray(); } | protected void initContentProvider() { IContentProvider provider = new IStructuredContentProvider() { /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ public void dispose() { //Nothing of interest here } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ public Object[] getElements(Object inputElement) { return getManager().getErrors().toArray(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput != null) { refreshJobList(); } } }; jobListViewer.setContentProvider(provider); jobListViewer.setInput(getManager()); jobListViewer.setSelection(new StructuredSelection(selectedError)); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
/* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput != null) { | /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput != null) { | protected void initContentProvider() { IContentProvider provider = new IStructuredContentProvider() { /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ public void dispose() { //Nothing of interest here } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ public Object[] getElements(Object inputElement) { return getManager().getErrors().toArray(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput != null) { refreshJobList(); } } }; jobListViewer.setContentProvider(provider); jobListViewer.setInput(getManager()); jobListViewer.setSelection(new StructuredSelection(selectedError)); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
} }; jobListViewer.setContentProvider(provider); jobListViewer.setInput(getManager()); jobListViewer.setSelection(new StructuredSelection(selectedError)); } | } }; jobListViewer.setContentProvider(provider); jobListViewer.setInput(getManager()); jobListViewer.setSelection(new StructuredSelection(selectedError)); } | protected void initContentProvider() { IContentProvider provider = new IStructuredContentProvider() { /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ public void dispose() { //Nothing of interest here } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ public Object[] getElements(Object inputElement) { return getManager().getErrors().toArray(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput != null) { refreshJobList(); } } }; jobListViewer.setContentProvider(provider); jobListViewer.setInput(getManager()); jobListViewer.setSelection(new StructuredSelection(selectedError)); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
} | } | public void dispose() { //Nothing of interest here } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
return getManager().getErrors().toArray(); } | return getManager().getErrors().toArray(); } | public Object[] getElements(Object inputElement) { return getManager().getErrors().toArray(); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
Object newInput) { if (newInput != null) { | Object newInput) { if (newInput != null) { | public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput != null) { refreshJobList(); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
} | } | public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput != null) { refreshJobList(); } } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/3a0562fdabac5839be163527744a56eaeeb31ec5/JobErrorDialog.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobErrorDialog.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.