rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
sessionPane.getComponent(sessionPane.getSelectedIndex()).requestFocus();
((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus();
private void nextSession() { int index = sessionPane.getSelectedIndex(); sessionPane.setForegroundAt(index,Color.black); sessionPane.setIconAt(index,unfocused); if (index < sessionPane.getTabCount() - 1) { sessionPane.setSelectedIndex(++index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); } else { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); } sessionPane.getComponent(sessionPane.getSelectedIndex()).requestFocus(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/7a82ce3041cbc092c0d9eec362f4d9e8b4157e53/Gui5250Frame.java/clean/tn5250j/src/org/tn5250j/Gui5250Frame.java
sessionPane.getComponent(sessionPane.getSelectedIndex()).requestFocus();
((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus();
private void prevSession() { int index = sessionPane.getSelectedIndex(); sessionPane.setForegroundAt(index,Color.black); sessionPane.setIconAt(index,unfocused); if (index == 0) { sessionPane.setSelectedIndex(sessionPane.getTabCount() - 1); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue); sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused); } else { sessionPane.setSelectedIndex(--index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); } sessionPane.getComponent(sessionPane.getSelectedIndex()).requestFocus(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/7a82ce3041cbc092c0d9eec362f4d9e8b4157e53/Gui5250Frame.java/clean/tn5250j/src/org/tn5250j/Gui5250Frame.java
((Session)sessionPane.getComponentAt(index)).requestFocus();
((Session)sessionPane.getComponentAt(index)).grabFocus();
public void removeSessionView(Session targetSession) { int index = sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (index < tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); ((Session)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); ((Session)sessionPane.getComponentAt(0)).requestFocus(); } } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/7a82ce3041cbc092c0d9eec362f4d9e8b4157e53/Gui5250Frame.java/clean/tn5250j/src/org/tn5250j/Gui5250Frame.java
((Session)sessionPane.getComponentAt(0)).requestFocus();
((Session)sessionPane.getComponentAt(0)).grabFocus();
public void removeSessionView(Session targetSession) { int index = sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (index < tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); ((Session)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); ((Session)sessionPane.getComponentAt(0)).requestFocus(); } } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/7a82ce3041cbc092c0d9eec362f4d9e8b4157e53/Gui5250Frame.java/clean/tn5250j/src/org/tn5250j/Gui5250Frame.java
sg.requestFocus();
sg.grabFocus();
public void stateChanged(ChangeEvent e) { JTabbedPane p = (JTabbedPane)e.getSource(); p.setForegroundAt(selectedIndex,Color.black); p.setIconAt(selectedIndex,unfocused); Session sg = (Session)p.getComponentAt(selectedIndex); sg.setVisible(false); sg = (Session)p.getSelectedComponent(); if (sg == null) return; sg.setVisible(true); sg.requestFocus(); selectedIndex = p.getSelectedIndex(); p.setForegroundAt(selectedIndex,Color.blue); p.setIconAt(selectedIndex,focused); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/7a82ce3041cbc092c0d9eec362f4d9e8b4157e53/Gui5250Frame.java/clean/tn5250j/src/org/tn5250j/Gui5250Frame.java
public void drawLine(int lineIndex, Graphics g, int x, int y)
protected void drawLine(int lineIndex, Graphics g, int x, int y)
public void drawLine(int lineIndex, Graphics g, int x, int y) { try { metrics = g.getFontMetrics(); // FIXME: Selected text are not drawn yet. Element line = getDocument().getDefaultRootElement().getElement(lineIndex); drawUnselectedText(g, x, y, line.getStartOffset(), line.getEndOffset()); //drawSelectedText(g, , , , ); } catch (BadLocationException e) { // This should never happen. } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/PlainView.java/clean/core/src/classpath/javax/javax/swing/text/PlainView.java
public int getTabSize()
protected int getTabSize()
public int getTabSize() { return 8; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/PlainView.java/clean/core/src/classpath/javax/javax/swing/text/PlainView.java
public Number decrementDimension() { Number dim = getDimension(); if (dim == null) { Log.error(" in DataCube, incrementDimentsion, the dimension is undef"); return null;
public int decrementDimension() { if (dimension == 0) { Log.error(" in DataCube, incrementDimentsion, the dimension is 0"); return 0;
public Number decrementDimension() { Number dim = getDimension(); if (dim == null) { Log.error(" in DataCube, incrementDimentsion, the dimension is undef"); return null; } else return setDimension(new Integer(dim.intValue()-1));}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
return setDimension(new Integer(dim.intValue()-1));
return dimension--;
public Number decrementDimension() { Number dim = getDimension(); if (dim == null) { Log.error(" in DataCube, incrementDimentsion, the dimension is undef"); return null; } else return setDimension(new Integer(dim.intValue()-1));}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
public Number getDimension() { return (Number) ((XMLAttribute) attribHash.get("dimension")).getAttribValue();
public int getDimension() { return dimension;
public Number getDimension() { return (Number) ((XMLAttribute) attribHash.get("dimension")).getAttribValue();}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
for(int i = 0; i < axes.size(); i++) {
int stop = axes.size(); for(int i = 0; i < stop; i++) {
public int[] getMaxDataIndex() { List axes = parentArray.getAxisList(); int[] maxDataIndices = new int[axes.size()]; for(int i = 0; i < axes.size(); i++) { maxDataIndices[i]=((Axis) axes.get(i)).getLength(); } //update the *maxDimensionIndex* attribute attribHash.put("maxDimensionIndex", maxDataIndices); return maxDataIndices;}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
attribHash.put("maxDimensionIndex", maxDataIndices);
public int[] getMaxDataIndex() { List axes = parentArray.getAxisList(); int[] maxDataIndices = new int[axes.size()]; for(int i = 0; i < axes.size(); i++) { maxDataIndices[i]=((Axis) axes.get(i)).getLength(); } //update the *maxDimensionIndex* attribute attribHash.put("maxDimensionIndex", maxDataIndices); return maxDataIndices;}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
public Number incrementDimension(Axis axis) { Number dim = getDimension(); if (dim.intValue()==0) {
public int incrementDimension(Axis axis) { if (dimension==0) {
public Number incrementDimension(Axis axis) { Number dim = getDimension(); if (dim.intValue()==0) { //add first dimension data.add(null); data.add(null); return setDimension(new Integer(1)); } if (dim.intValue() == 1) { //add second dimension int length = axis.getLength(); for (int i = 2; i < 2*length; i++) data.add(i,null); } else{ //dimension >= 2 List oldData = data; int length = axis.getLength(); data = Collections.synchronizedList(new ArrayList(length)); data.add(0,oldData); for (int i = 1; i < length; i++) data.add(i,null); } return setDimension(new Integer(dim.intValue()+1));}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
return setDimension(new Integer(1));
return dimension++;
public Number incrementDimension(Axis axis) { Number dim = getDimension(); if (dim.intValue()==0) { //add first dimension data.add(null); data.add(null); return setDimension(new Integer(1)); } if (dim.intValue() == 1) { //add second dimension int length = axis.getLength(); for (int i = 2; i < 2*length; i++) data.add(i,null); } else{ //dimension >= 2 List oldData = data; int length = axis.getLength(); data = Collections.synchronizedList(new ArrayList(length)); data.add(0,oldData); for (int i = 1; i < length; i++) data.add(i,null); } return setDimension(new Integer(dim.intValue()+1));}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
if (dim.intValue() == 1) {
if (dimension == 1) {
public Number incrementDimension(Axis axis) { Number dim = getDimension(); if (dim.intValue()==0) { //add first dimension data.add(null); data.add(null); return setDimension(new Integer(1)); } if (dim.intValue() == 1) { //add second dimension int length = axis.getLength(); for (int i = 2; i < 2*length; i++) data.add(i,null); } else{ //dimension >= 2 List oldData = data; int length = axis.getLength(); data = Collections.synchronizedList(new ArrayList(length)); data.add(0,oldData); for (int i = 1; i < length; i++) data.add(i,null); } return setDimension(new Integer(dim.intValue()+1));}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
return setDimension(new Integer(dim.intValue()+1));
return dimension++;
public Number incrementDimension(Axis axis) { Number dim = getDimension(); if (dim.intValue()==0) { //add first dimension data.add(null); data.add(null); return setDimension(new Integer(1)); } if (dim.intValue() == 1) { //add second dimension int length = axis.getLength(); for (int i = 2; i < 2*length; i++) data.add(i,null); } else{ //dimension >= 2 List oldData = data; int length = axis.getLength(); data = Collections.synchronizedList(new ArrayList(length)); data.add(0,oldData); for (int i = 1; i < length; i++) data.add(i,null); } return setDimension(new Integer(dim.intValue()+1));}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
attribOrder.add(0,"maxDimensionIndex"); attribOrder.add(0,"dimension");
private void init() { classXDFNodeName = "data"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"maxDimensionIndex"); attribOrder.add(0,"dimension"); attribOrder.add(0,"compression"); attribOrder.add(0,"checksum"); attribOrder.add(0,"href"); //set up the attribute hashtable key with the default initial value attribHash.put("maxDimensionIndex", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("dimension", new XMLAttribute(new Integer(0), Constants.NUMBER_TYPE)); attribHash.put("compression", new XMLAttribute(null, Constants.STRING_TYPE)); //double check init value attribHash.put("checksum", new XMLAttribute(new Double(0), Constants.NUMBER_TYPE)); //double check attribHash.put("href", new XMLAttribute(null, Constants.STRING_TYPE)); };
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
attribHash.put("maxDimensionIndex", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("dimension", new XMLAttribute(new Integer(0), Constants.NUMBER_TYPE));
private void init() { classXDFNodeName = "data"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"maxDimensionIndex"); attribOrder.add(0,"dimension"); attribOrder.add(0,"compression"); attribOrder.add(0,"checksum"); attribOrder.add(0,"href"); //set up the attribute hashtable key with the default initial value attribHash.put("maxDimensionIndex", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("dimension", new XMLAttribute(new Integer(0), Constants.NUMBER_TYPE)); attribHash.put("compression", new XMLAttribute(null, Constants.STRING_TYPE)); //double check init value attribHash.put("checksum", new XMLAttribute(new Double(0), Constants.NUMBER_TYPE)); //double check attribHash.put("href", new XMLAttribute(null, Constants.STRING_TYPE)); };
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
attribHash.put("checksum", new XMLAttribute(new Double(0), Constants.NUMBER_TYPE));
attribHash.put("encoding", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("checksum", new XMLAttribute(null, Constants.NUMBER_TYPE));
private void init() { classXDFNodeName = "data"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"maxDimensionIndex"); attribOrder.add(0,"dimension"); attribOrder.add(0,"compression"); attribOrder.add(0,"checksum"); attribOrder.add(0,"href"); //set up the attribute hashtable key with the default initial value attribHash.put("maxDimensionIndex", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("dimension", new XMLAttribute(new Integer(0), Constants.NUMBER_TYPE)); attribHash.put("compression", new XMLAttribute(null, Constants.STRING_TYPE)); //double check init value attribHash.put("checksum", new XMLAttribute(new Double(0), Constants.NUMBER_TYPE)); //double check attribHash.put("href", new XMLAttribute(null, Constants.STRING_TYPE)); };
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
Log.info("in DataCube.setChecksum()"); return (Number) ((XMLAttribute) attribHash.get("checksum")).setAttribValue(checksum); }
Log.info("in DataCube.setChecksum()"); return (Number) ((XMLAttribute) attribHash.get("checksum")).setAttribValue(checksum); }
public Number setChecksum (Number checksum) { Log.info("in DataCube.setChecksum()"); return (Number) ((XMLAttribute) attribHash.get("checksum")).setAttribValue(checksum);}
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
if (!Utility.isValidDataCompression(strCompression)) return null;
public String setCompression (String strCompression) { return (String) ((XMLAttribute) attribHash.get("compression")).setAttribValue(strCompression); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
String checksum = getChecksum().toString();
Number checksum = getChecksum();
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent ) { boolean niceOutput = sPrettyXDFOutput; String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); String checksum = getChecksum().toString(); if (checksum !=null) writeOut(outputstream, " checksum = \"" + checksum + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); if (href !=null) { //write out to another file, double check } currentLocator = parentArray.createLocator(); if (readObj.getClass().getName().endsWith("TaggedXMLDataIOStyle")) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } if (!parentArray.hasFieldAxis()) { //even with FieldAxis, it is ok, double check int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(outputstream, currentLocator, indent, axisLength, tags, 0); } } //done dealwith with TaggedXMLDataIOSytle //close the tagged data section if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
writeOut(outputstream, " checksum = \"" + checksum + "\"");
writeOut(outputstream, " checksum = \"" + checksum.toString() + "\"");
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent ) { boolean niceOutput = sPrettyXDFOutput; String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); String checksum = getChecksum().toString(); if (checksum !=null) writeOut(outputstream, " checksum = \"" + checksum + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); if (href !=null) { //write out to another file, double check } currentLocator = parentArray.createLocator(); if (readObj.getClass().getName().endsWith("TaggedXMLDataIOStyle")) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } if (!parentArray.hasFieldAxis()) { //even with FieldAxis, it is ok, double check int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(outputstream, currentLocator, indent, axisLength, tags, 0); } } //done dealwith with TaggedXMLDataIOSytle //close the tagged data section if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent ) { boolean niceOutput = sPrettyXDFOutput; String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); String checksum = getChecksum().toString(); if (checksum !=null) writeOut(outputstream, " checksum = \"" + checksum + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); if (href !=null) { //write out to another file, double check } currentLocator = parentArray.createLocator(); if (readObj.getClass().getName().endsWith("TaggedXMLDataIOStyle")) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } if (!parentArray.hasFieldAxis()) { //even with FieldAxis, it is ok, double check int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(outputstream, currentLocator, indent, axisLength, tags, 0); } } //done dealwith with TaggedXMLDataIOSytle //close the tagged data section if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent ) { boolean niceOutput = sPrettyXDFOutput; String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); String checksum = getChecksum().toString(); if (checksum !=null) writeOut(outputstream, " checksum = \"" + checksum + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); if (href !=null) { //write out to another file, double check } currentLocator = parentArray.createLocator(); if (readObj.getClass().getName().endsWith("TaggedXMLDataIOStyle")) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } if (!parentArray.hasFieldAxis()) { //even with FieldAxis, it is ok, double check int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(outputstream, currentLocator, indent, axisLength, tags, 0); } } //done dealwith with TaggedXMLDataIOSytle //close the tagged data section if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent ) { boolean niceOutput = sPrettyXDFOutput; String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); String checksum = getChecksum().toString(); if (checksum !=null) writeOut(outputstream, " checksum = \"" + checksum + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); if (href !=null) { //write out to another file, double check } currentLocator = parentArray.createLocator(); if (readObj.getClass().getName().endsWith("TaggedXMLDataIOStyle")) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } if (!parentArray.hasFieldAxis()) { //even with FieldAxis, it is ok, double check int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(outputstream, currentLocator, indent, axisLength, tags, 0); } } //done dealwith with TaggedXMLDataIOSytle //close the tagged data section if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent ) { boolean niceOutput = sPrettyXDFOutput; String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); String checksum = getChecksum().toString(); if (checksum !=null) writeOut(outputstream, " checksum = \"" + checksum + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); if (href !=null) { //write out to another file, double check } currentLocator = parentArray.createLocator(); if (readObj.getClass().getName().endsWith("TaggedXMLDataIOStyle")) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } if (!parentArray.hasFieldAxis()) { //even with FieldAxis, it is ok, double check int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(outputstream, currentLocator, indent, axisLength, tags, 0); } } //done dealwith with TaggedXMLDataIOSytle //close the tagged data section if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
Locator locator,
Locator locator,
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = axisLength[axisLength.length-1]; int dataNum = 0; while (dataNum < fastestAxisLength) { try { writeOut( outputstream, "<" + tag1 + ">"); writeOut(outputstream, getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { writeOut(outputstream, e.toString()); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = axisLength[axisLength.length-1]; int dataNum = 0; while (dataNum < fastestAxisLength) { try { writeOut( outputstream, "<" + tag1 + ">"); writeOut(outputstream, getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { writeOut(outputstream, e.toString()); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/8b52fb16dca9cddb258fee9dd8dfc0365ee9e414/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
public BasicStroke()
public BasicStroke(float width, int cap, int join, float miterlimit, float[] dash, float dashPhase)
public BasicStroke() { this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0);
if (width < 0.0f ) throw new IllegalArgumentException("width " + width + " < 0"); else if (cap < CAP_BUTT || cap > CAP_SQUARE) throw new IllegalArgumentException("cap " + cap + " out of range [" + CAP_BUTT + ".." + CAP_SQUARE + "]"); else if (miterlimit < 1.0f && join == JOIN_MITER) throw new IllegalArgumentException("miterlimit " + miterlimit + " < 1.0f while join == JOIN_MITER"); else if (join < JOIN_MITER || join > JOIN_BEVEL) throw new IllegalArgumentException("join " + join + " out of range [" + JOIN_MITER + ".." + JOIN_BEVEL + "]"); else if (dashPhase < 0.0f && dash != null) throw new IllegalArgumentException("dashPhase " + dashPhase + " < 0.0f while dash != null"); else if (dash != null) if (dash.length == 0) throw new IllegalArgumentException("dash.length is 0"); else { boolean allZero = true; for ( int i = 0; i < dash.length; ++i) { if (dash[i] != 0.0f) { allZero = false; break; } } if (allZero) throw new IllegalArgumentException("all dashes are 0.0f"); } this.width = width; this.cap = cap; this.join = join; limit = miterlimit; this.dash = dash == null ? null : (float[]) dash.clone(); phase = dashPhase;
public BasicStroke() { this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
double[] p0 = start.last.last(); double[] p1 = new double[]{start.last.P2.getX(), start.last.P2.getY()}; double[] p2 = new double[]{segments[0].P1.getX(), segments[0].P1.getY()}; double[] p3 = segments[0].first(); Point2D p; double det = (p1[0] - p0[0])*(p3[1] - p2[1]) - (p3[0] - p2[0])*(p1[1] - p0[1]); if( det > 0 ) { p = lineIntersection(p0[0],p0[1],p1[0],p1[1],p2[0],p2[1],p3[0],p3[1], false); if( p == null ) { start.add(new LineSegment(start.last.P2, segments[0].P1)); p = new Point2D.Double((segments[0].P1.getX()+ start.last.P2.getX())/2.0, (segments[0].P1.getY()+ start.last.P2.getY())/2.0); } else segments[0].P1 = start.last.P2 = p; start.add( segments[0] ); joinSegments(end, segments[1], p); } else { p0 = end.last.last(); p1 = new double[]{end.last.P2.getX(), end.last.P2.getY()}; p2 = new double[]{segments[1].P1.getX(), segments[1].P1.getY()}; p3 = segments[1].first(); p = lineIntersection(p0[0],p0[1],p1[0],p1[1], p2[0],p2[1],p3[0],p3[1], false); if( p == null ) { end.add(new LineSegment(end.last.P2, segments[1].P1)); p = new Point2D.Double((segments[1].P1.getX()+ end.last.P2.getX())/2.0, (segments[1].P1.getY()+ end.last.P2.getY())/2.0); } else segments[1].P1 = end.last.P2 = p; end.add( segments[1] ); joinSegments(start, segments[0], p); }
joinSegments(segments); start.add(segments[0]); end.add(segments[1]);
private void addSegments(Segment[] segments) { double[] p0 = start.last.last(); double[] p1 = new double[]{start.last.P2.getX(), start.last.P2.getY()}; double[] p2 = new double[]{segments[0].P1.getX(), segments[0].P1.getY()}; double[] p3 = segments[0].first(); Point2D p; double det = (p1[0] - p0[0])*(p3[1] - p2[1]) - (p3[0] - p2[0])*(p1[1] - p0[1]); if( det > 0 ) { // start and segment[0] form the 'inner' part of a join, // connect the overlapping segments p = lineIntersection(p0[0],p0[1],p1[0],p1[1],p2[0],p2[1],p3[0],p3[1], false); if( p == null ) { // Dodgy. start.add(new LineSegment(start.last.P2, segments[0].P1)); p = new Point2D.Double((segments[0].P1.getX()+ start.last.P2.getX())/2.0, (segments[0].P1.getY()+ start.last.P2.getY())/2.0); } else segments[0].P1 = start.last.P2 = p; start.add( segments[0] ); joinSegments(end, segments[1], p); } else { // end and segment[1] form the 'inner' part p0 = end.last.last(); p1 = new double[]{end.last.P2.getX(), end.last.P2.getY()}; p2 = new double[]{segments[1].P1.getX(), segments[1].P1.getY()}; p3 = segments[1].first(); p = lineIntersection(p0[0],p0[1],p1[0],p1[1], p2[0],p2[1],p3[0],p3[1], false); if( p == null ) { // Dodgy. end.add(new LineSegment(end.last.P2, segments[1].P1)); p = new Point2D.Double((segments[1].P1.getX()+ end.last.P2.getX())/2.0, (segments[1].P1.getY()+ end.last.P2.getY())/2.0); } else segments[1].P1 = end.last.P2 = p; end.add( segments[1] ); joinSegments(start, segments[0], p); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
p0 = a.last.last();
p0 = a.last.cp2();
private void capEnd(Segment a, Segment b) { double[] p0, p1; double dx, dy, l; Point2D c1,c2; switch( cap ) { case CAP_BUTT: a.add(new LineSegment(a.last.P2, b.P1)); break; case CAP_SQUARE: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); c2 = new Point2D.Double(b.P1.getX() + dx, b.P1.getY() + dy); a.add(new LineSegment(a.last.P2, c1)); a.add(new LineSegment(c1, c2)); a.add(new LineSegment(c2, b.P1)); break; case CAP_ROUND: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = (2.0/3.0)*width*dx/l; dy = (2.0/3.0)*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); c2 = new Point2D.Double(b.P1.getX() + dx, b.P1.getY() + dy); a.add(new CubicSegment(a.last.P2, c1, c2, b.P1)); break; } a.add(b); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
p0 = a.last.last();
p0 = a.last.cp2();
private void capEnd(Segment a, Segment b) { double[] p0, p1; double dx, dy, l; Point2D c1,c2; switch( cap ) { case CAP_BUTT: a.add(new LineSegment(a.last.P2, b.P1)); break; case CAP_SQUARE: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); c2 = new Point2D.Double(b.P1.getX() + dx, b.P1.getY() + dy); a.add(new LineSegment(a.last.P2, c1)); a.add(new LineSegment(c1, c2)); a.add(new LineSegment(c2, b.P1)); break; case CAP_ROUND: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = (2.0/3.0)*width*dx/l; dy = (2.0/3.0)*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); c2 = new Point2D.Double(b.P1.getX() + dx, b.P1.getY() + dy); a.add(new CubicSegment(a.last.P2, c1, c2, b.P1)); break; } a.add(b); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
PathIterator pi = s.getPathIterator( new AffineTransform() );
PathIterator pi = s.getPathIterator(null);
public Shape createStrokedShape(Shape s) { PathIterator pi = s.getPathIterator( new AffineTransform() ); if( dash == null ) return solidStroke( pi ); return dashedStroke( pi ); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
GeneralPath out = new GeneralPath(); return out;
FlatteningPathIterator flat = new FlatteningPathIterator(pi, Math.sqrt(width / 3)); double[] coords = new double[2]; double x, y, x0, y0; x = x0 = y = y0 = 0; boolean pathOpen = false; boolean dashOn = true; boolean offsetting = (phase != 0); double distance = 0; int dashIndex = 0; GeneralPath output = new GeneralPath(); Segment[] p; while (! flat.isDone()) { switch (flat.currentSegment(coords)) { case PathIterator.SEG_MOVETO: x0 = x = coords[0]; y0 = y = coords[1]; if (pathOpen) { capEnds(); convertPath(output, start); start = end = null; pathOpen = false; } break; case PathIterator.SEG_LINETO: boolean segmentConsumed = false; while (! segmentConsumed) { double segLength = Math.sqrt((x - coords[0]) * (x - coords[0]) + (y - coords[1]) * (y - coords[1])); boolean spanBoundary = true; double[] segmentEnd = null; if ((offsetting && distance + segLength <= phase) || distance + segLength <= dash[dashIndex]) { spanBoundary = false; } else { segmentEnd = (double[]) coords.clone(); double reqLength; if (offsetting) reqLength = phase - distance; else reqLength = dash[dashIndex] - distance; coords[0] = x + ((coords[0] - x) * reqLength / segLength); coords[1] = y + ((coords[1] - y) * reqLength / segLength); } if (offsetting || ! dashOn) { x0 = x = coords[0]; y0 = y = coords[1]; if (pathOpen) { capEnds(); convertPath(output, start); start = end = null; pathOpen = false; } } else { p = (new LineSegment(x, y, coords[0], coords[1])).getDisplacedSegments(width / 2.0); if (! pathOpen) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; } if (! spanBoundary) { distance += segLength; segmentConsumed = true; } else { if (offsetting) offsetting = false; dashOn = ! dashOn; distance = 0; coords = segmentEnd; if (dashIndex + 1 == dash.length) dashIndex = 0; else dashIndex++; } } break; } flat.next(); } if (pathOpen) { capEnds(); convertPath(output, start); } return output;
private Shape dashedStroke(PathIterator pi) { GeneralPath out = new GeneralPath(); return out; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
private void joinSegments(Segment a, Segment b, Point2D insideP)
private void joinSegments(Segment[] segments)
private void joinSegments(Segment a, Segment b, Point2D insideP) { double[] p0, p1; double dx, dy, l; Point2D c1,c2; switch( join ) { case JOIN_MITER: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; double[] p2 = new double[]{b.P1.getX(), b.P1.getY()}; double[] p3 = b.first(); Point2D p = lineIntersection(p0[0],p0[1],p1[0],p1[1],p2[0],p2[1],p3[0],p3[1], true); if( p == null || insideP == null ) a.add(new LineSegment(a.last.P2, b.P1)); else if((p.distance(insideP)/width) < limit) { a.add(new LineSegment(a.last.P2, p)); a.add(new LineSegment(p, b.P1)); } else { // outside miter limit, do a bevel join. a.add(new LineSegment(a.last.P2, b.P1)); } break; case JOIN_ROUND: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); p0 = new double[]{b.P1.getX(), b.P1.getY()}; p1 = b.first(); dx = p0[0] - p1[0]; // backwards direction. dy = p0[1] - p1[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c2 = new Point2D.Double(p0[0] + dx, p0[1] + dy); a.add(new CubicSegment(a.last.P2, c1, c2, b.P1)); break; case JOIN_BEVEL: a.add(new LineSegment(a.last.P2, b.P1)); break; } a.add(b); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
double[] p0, p1; double dx, dy, l; Point2D c1,c2;
double[] p0 = start.last.cp2(); double[] p1 = new double[]{start.last.P2.getX(), start.last.P2.getY()}; double[] p2 = new double[]{segments[0].first.P1.getX(), segments[0].first.P1.getY()}; double[] p3 = segments[0].cp1(); Point2D p;
private void joinSegments(Segment a, Segment b, Point2D insideP) { double[] p0, p1; double dx, dy, l; Point2D c1,c2; switch( join ) { case JOIN_MITER: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; double[] p2 = new double[]{b.P1.getX(), b.P1.getY()}; double[] p3 = b.first(); Point2D p = lineIntersection(p0[0],p0[1],p1[0],p1[1],p2[0],p2[1],p3[0],p3[1], true); if( p == null || insideP == null ) a.add(new LineSegment(a.last.P2, b.P1)); else if((p.distance(insideP)/width) < limit) { a.add(new LineSegment(a.last.P2, p)); a.add(new LineSegment(p, b.P1)); } else { // outside miter limit, do a bevel join. a.add(new LineSegment(a.last.P2, b.P1)); } break; case JOIN_ROUND: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); p0 = new double[]{b.P1.getX(), b.P1.getY()}; p1 = b.first(); dx = p0[0] - p1[0]; // backwards direction. dy = p0[1] - p1[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c2 = new Point2D.Double(p0[0] + dx, p0[1] + dy); a.add(new CubicSegment(a.last.P2, c1, c2, b.P1)); break; case JOIN_BEVEL: a.add(new LineSegment(a.last.P2, b.P1)); break; } a.add(b); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
switch( join )
p = lineIntersection(p0[0],p0[1],p1[0],p1[1], p2[0],p2[1],p3[0],p3[1], false); double det = (p1[0] - p0[0])*(p3[1] - p2[1]) - (p3[0] - p2[0])*(p1[1] - p0[1]); if( det > 0 )
private void joinSegments(Segment a, Segment b, Point2D insideP) { double[] p0, p1; double dx, dy, l; Point2D c1,c2; switch( join ) { case JOIN_MITER: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; double[] p2 = new double[]{b.P1.getX(), b.P1.getY()}; double[] p3 = b.first(); Point2D p = lineIntersection(p0[0],p0[1],p1[0],p1[1],p2[0],p2[1],p3[0],p3[1], true); if( p == null || insideP == null ) a.add(new LineSegment(a.last.P2, b.P1)); else if((p.distance(insideP)/width) < limit) { a.add(new LineSegment(a.last.P2, p)); a.add(new LineSegment(p, b.P1)); } else { // outside miter limit, do a bevel join. a.add(new LineSegment(a.last.P2, b.P1)); } break; case JOIN_ROUND: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); p0 = new double[]{b.P1.getX(), b.P1.getY()}; p1 = b.first(); dx = p0[0] - p1[0]; // backwards direction. dy = p0[1] - p1[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c2 = new Point2D.Double(p0[0] + dx, p0[1] + dy); a.add(new CubicSegment(a.last.P2, c1, c2, b.P1)); break; case JOIN_BEVEL: a.add(new LineSegment(a.last.P2, b.P1)); break; } a.add(b); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
case JOIN_MITER: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; double[] p2 = new double[]{b.P1.getX(), b.P1.getY()}; double[] p3 = b.first(); Point2D p = lineIntersection(p0[0],p0[1],p1[0],p1[1],p2[0],p2[1],p3[0],p3[1], true); if( p == null || insideP == null ) a.add(new LineSegment(a.last.P2, b.P1)); else if((p.distance(insideP)/width) < limit) { a.add(new LineSegment(a.last.P2, p)); a.add(new LineSegment(p, b.P1)); } else { a.add(new LineSegment(a.last.P2, b.P1)); } break; case JOIN_ROUND: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); p0 = new double[]{b.P1.getX(), b.P1.getY()}; p1 = b.first(); dx = p0[0] - p1[0]; dy = p0[1] - p1[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c2 = new Point2D.Double(p0[0] + dx, p0[1] + dy); a.add(new CubicSegment(a.last.P2, c1, c2, b.P1)); break; case JOIN_BEVEL: a.add(new LineSegment(a.last.P2, b.P1)); break;
joinInnerSegments(start, segments[0], p); joinOuterSegments(end, segments[1], p);
private void joinSegments(Segment a, Segment b, Point2D insideP) { double[] p0, p1; double dx, dy, l; Point2D c1,c2; switch( join ) { case JOIN_MITER: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; double[] p2 = new double[]{b.P1.getX(), b.P1.getY()}; double[] p3 = b.first(); Point2D p = lineIntersection(p0[0],p0[1],p1[0],p1[1],p2[0],p2[1],p3[0],p3[1], true); if( p == null || insideP == null ) a.add(new LineSegment(a.last.P2, b.P1)); else if((p.distance(insideP)/width) < limit) { a.add(new LineSegment(a.last.P2, p)); a.add(new LineSegment(p, b.P1)); } else { // outside miter limit, do a bevel join. a.add(new LineSegment(a.last.P2, b.P1)); } break; case JOIN_ROUND: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); p0 = new double[]{b.P1.getX(), b.P1.getY()}; p1 = b.first(); dx = p0[0] - p1[0]; // backwards direction. dy = p0[1] - p1[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c2 = new Point2D.Double(p0[0] + dx, p0[1] + dy); a.add(new CubicSegment(a.last.P2, c1, c2, b.P1)); break; case JOIN_BEVEL: a.add(new LineSegment(a.last.P2, b.P1)); break; } a.add(b); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
a.add(b);
else { joinInnerSegments(end, segments[1], p); joinOuterSegments(start, segments[0], p); }
private void joinSegments(Segment a, Segment b, Point2D insideP) { double[] p0, p1; double dx, dy, l; Point2D c1,c2; switch( join ) { case JOIN_MITER: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; double[] p2 = new double[]{b.P1.getX(), b.P1.getY()}; double[] p3 = b.first(); Point2D p = lineIntersection(p0[0],p0[1],p1[0],p1[1],p2[0],p2[1],p3[0],p3[1], true); if( p == null || insideP == null ) a.add(new LineSegment(a.last.P2, b.P1)); else if((p.distance(insideP)/width) < limit) { a.add(new LineSegment(a.last.P2, p)); a.add(new LineSegment(p, b.P1)); } else { // outside miter limit, do a bevel join. a.add(new LineSegment(a.last.P2, b.P1)); } break; case JOIN_ROUND: p0 = a.last.last(); p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()}; dx = p1[0] - p0[0]; dy = p1[1] - p0[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy); p0 = new double[]{b.P1.getX(), b.P1.getY()}; p1 = b.first(); dx = p0[0] - p1[0]; // backwards direction. dy = p0[1] - p1[1]; l = Math.sqrt(dx * dx + dy * dy); dx = 0.5*width*dx/l; dy = 0.5*width*dy/l; c2 = new Point2D.Double(p0[0] + dx, p0[1] + dy); a.add(new CubicSegment(a.last.P2, c1, c2, b.P1)); break; case JOIN_BEVEL: a.add(new LineSegment(a.last.P2, b.P1)); break; } a.add(b); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
x = coords[0]; y = coords[1];
x = coords[2]; y = coords[3];
private Shape solidStroke(PathIterator pi) { double[] coords = new double[6]; double x, y, x0, y0; boolean pathOpen = false; GeneralPath output = new GeneralPath( ); Segment[] p; x = x0 = y = y0 = 0; while( !pi.isDone() ) { switch( pi.currentSegment(coords) ) { case PathIterator.SEG_MOVETO: x0 = x = coords[0]; y0 = y = coords[1]; if( pathOpen ) { capEnds(); convertPath(output, start); start = end = null; pathOpen = false; } break; case PathIterator.SEG_LINETO: p = (new LineSegment(x, y, coords[0], coords[1])). getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_QUADTO: p = (new QuadSegment(x, y, coords[0], coords[1], coords[2], coords[3])).getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_CUBICTO: p = new CubicSegment(x, y, coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]).getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_CLOSE: p = (new LineSegment(x, y, x0, y0)).getDisplacedSegments(width/2.0); addSegments(p); convertPath(output, start); convertPath(output, end); start = end = null; pathOpen = false; break; } pi.next(); } if( pathOpen ) { capEnds(); convertPath(output, start); } return output; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
x = coords[0]; y = coords[1];
x = coords[4]; y = coords[5];
private Shape solidStroke(PathIterator pi) { double[] coords = new double[6]; double x, y, x0, y0; boolean pathOpen = false; GeneralPath output = new GeneralPath( ); Segment[] p; x = x0 = y = y0 = 0; while( !pi.isDone() ) { switch( pi.currentSegment(coords) ) { case PathIterator.SEG_MOVETO: x0 = x = coords[0]; y0 = y = coords[1]; if( pathOpen ) { capEnds(); convertPath(output, start); start = end = null; pathOpen = false; } break; case PathIterator.SEG_LINETO: p = (new LineSegment(x, y, coords[0], coords[1])). getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_QUADTO: p = (new QuadSegment(x, y, coords[0], coords[1], coords[2], coords[3])).getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_CUBICTO: p = new CubicSegment(x, y, coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]).getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_CLOSE: p = (new LineSegment(x, y, x0, y0)).getDisplacedSegments(width/2.0); addSegments(p); convertPath(output, start); convertPath(output, end); start = end = null; pathOpen = false; break; } pi.next(); } if( pathOpen ) { capEnds(); convertPath(output, start); } return output; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
p = (new LineSegment(x, y, x0, y0)).getDisplacedSegments(width/2.0);
if (x == x0 && y == y0) { joinSegments(new Segment[] { start.first, end.first }); } else { p = (new LineSegment(x, y, x0, y0)).getDisplacedSegments(width / 2.0);
private Shape solidStroke(PathIterator pi) { double[] coords = new double[6]; double x, y, x0, y0; boolean pathOpen = false; GeneralPath output = new GeneralPath( ); Segment[] p; x = x0 = y = y0 = 0; while( !pi.isDone() ) { switch( pi.currentSegment(coords) ) { case PathIterator.SEG_MOVETO: x0 = x = coords[0]; y0 = y = coords[1]; if( pathOpen ) { capEnds(); convertPath(output, start); start = end = null; pathOpen = false; } break; case PathIterator.SEG_LINETO: p = (new LineSegment(x, y, coords[0], coords[1])). getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_QUADTO: p = (new QuadSegment(x, y, coords[0], coords[1], coords[2], coords[3])).getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_CUBICTO: p = new CubicSegment(x, y, coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]).getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_CLOSE: p = (new LineSegment(x, y, x0, y0)).getDisplacedSegments(width/2.0); addSegments(p); convertPath(output, start); convertPath(output, end); start = end = null; pathOpen = false; break; } pi.next(); } if( pathOpen ) { capEnds(); convertPath(output, start); } return output; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
output.setWindingRule(GeneralPath.WIND_EVEN_ODD);
private Shape solidStroke(PathIterator pi) { double[] coords = new double[6]; double x, y, x0, y0; boolean pathOpen = false; GeneralPath output = new GeneralPath( ); Segment[] p; x = x0 = y = y0 = 0; while( !pi.isDone() ) { switch( pi.currentSegment(coords) ) { case PathIterator.SEG_MOVETO: x0 = x = coords[0]; y0 = y = coords[1]; if( pathOpen ) { capEnds(); convertPath(output, start); start = end = null; pathOpen = false; } break; case PathIterator.SEG_LINETO: p = (new LineSegment(x, y, coords[0], coords[1])). getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_QUADTO: p = (new QuadSegment(x, y, coords[0], coords[1], coords[2], coords[3])).getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_CUBICTO: p = new CubicSegment(x, y, coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]).getDisplacedSegments(width/2.0); if( !pathOpen ) { start = p[0]; end = p[1]; pathOpen = true; } else addSegments(p); x = coords[0]; y = coords[1]; break; case PathIterator.SEG_CLOSE: p = (new LineSegment(x, y, x0, y0)).getDisplacedSegments(width/2.0); addSegments(p); convertPath(output, start); convertPath(output, end); start = end = null; pathOpen = false; break; } pi.next(); } if( pathOpen ) { capEnds(); convertPath(output, start); } return output; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/564d5a4fe6696ea6c8710997b68012950f28e18a/BasicStroke.java/clean/core/src/classpath/java/java/awt/BasicStroke.java
last = last.next;
last = last.next.last;
public void add(Segment newsegment) { last.next = newsegment; last = last.next; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3745505a7d2835f7ecc46a1f562d0058cf71c6bd/Segment.java/buggy/core/src/classpath/gnu/gnu/java/awt/java2d/Segment.java
public LineSegment(Point2D p1, Point2D p2)
public LineSegment(double x1, double y1, double x2, double y2)
public LineSegment(Point2D p1, Point2D p2) { super(); P1 = (Point2D) p1.clone(); P2 = (Point2D) p2.clone(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3745505a7d2835f7ecc46a1f562d0058cf71c6bd/LineSegment.java/buggy/core/src/classpath/gnu/gnu/java/awt/java2d/LineSegment.java
P1 = (Point2D) p1.clone(); P2 = (Point2D) p2.clone();
P1 = new Point2D.Double(x1, y1); P2 = new Point2D.Double(x2, y2);
public LineSegment(Point2D p1, Point2D p2) { super(); P1 = (Point2D) p1.clone(); P2 = (Point2D) p2.clone(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3745505a7d2835f7ecc46a1f562d0058cf71c6bd/LineSegment.java/buggy/core/src/classpath/gnu/gnu/java/awt/java2d/LineSegment.java
public CubicSegment(Point2D p1, Point2D cp1, Point2D cp2, Point2D p2)
public CubicSegment(double x1, double y1, double c1x, double c1y, double c2x, double c2y, double x2, double y2)
public CubicSegment(Point2D p1, Point2D cp1, Point2D cp2, Point2D p2) { super(); P1 = p1; P2 = p2; this.cp1 = cp1; this.cp2 = cp2; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3745505a7d2835f7ecc46a1f562d0058cf71c6bd/CubicSegment.java/buggy/core/src/classpath/gnu/gnu/java/awt/java2d/CubicSegment.java
P1 = p1; P2 = p2; this.cp1 = cp1; this.cp2 = cp2;
P1 = new Point2D.Double(x1, y1); P2 = new Point2D.Double(x2, y2); cp1 = new Point2D.Double(c1x, c1y); cp2 = new Point2D.Double(c2x, c2y);
public CubicSegment(Point2D p1, Point2D cp1, Point2D cp2, Point2D p2) { super(); P1 = p1; P2 = p2; this.cp1 = cp1; this.cp2 = cp2; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3745505a7d2835f7ecc46a1f562d0058cf71c6bd/CubicSegment.java/buggy/core/src/classpath/gnu/gnu/java/awt/java2d/CubicSegment.java
first = last;
public void reverseAll() { reverse(); Segment v = next; Segment former = this; next = null; while (v != null) { v.reverse(); v.last = this; Segment oldnext = v.next; v.next = former; former = v; v = oldnext; // move to the next in list } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3745505a7d2835f7ecc46a1f562d0058cf71c6bd/Segment.java/buggy/core/src/classpath/gnu/gnu/java/awt/java2d/Segment.java
double x0 = P1.getX(); double y0 = P1.getY(); double x1 = cp1.getX(); double y1 = cp1.getY(); double x2 = cp2.getX(); double y2 = cp2.getY(); double x3 = P2.getX(); double y3 = P2.getY(); double[] p1 = normal(x0, y0, x1, y1); double[] p2 = normal(x2, y2, x3, y3);
public Segment[] getDisplacedSegments(double radius) { this.radius = radius; double x0 = P1.getX(); double y0 = P1.getY(); double x1 = cp1.getX(); double y1 = cp1.getY(); double x2 = cp2.getX(); double y2 = cp2.getY(); double x3 = P2.getX(); double y3 = P2.getY(); double[] p1 = normal(x0, y0, x1, y1); double[] p2 = normal(x2, y2, x3, y3); // FIXME: Doesn't compile. // return new Segment[]{s1, s2}; return new Segment[0]; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3745505a7d2835f7ecc46a1f562d0058cf71c6bd/CubicSegment.java/buggy/core/src/classpath/gnu/gnu/java/awt/java2d/CubicSegment.java
return new Segment[0];
return new Segment[] { segmentTop, segmentBottom };
public Segment[] getDisplacedSegments(double radius) { this.radius = radius; double x0 = P1.getX(); double y0 = P1.getY(); double x1 = cp1.getX(); double y1 = cp1.getY(); double x2 = cp2.getX(); double y2 = cp2.getY(); double x3 = P2.getX(); double y3 = P2.getY(); double[] p1 = normal(x0, y0, x1, y1); double[] p2 = normal(x2, y2, x3, y3); // FIXME: Doesn't compile. // return new Segment[]{s1, s2}; return new Segment[0]; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3745505a7d2835f7ecc46a1f562d0058cf71c6bd/CubicSegment.java/buggy/core/src/classpath/gnu/gnu/java/awt/java2d/CubicSegment.java
protected void resolve() throws PluginException {
protected void resolve(PluginRegistryModel registry) throws PluginException { registry.registerExtensionPoint(this);
protected void resolve() throws PluginException { // Do nothing }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a4bc60fa9952eee4e8b6801b3a5736f52717054a/ExtensionPointModel.java/buggy/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java
protected void unresolve() throws PluginException {
protected void unresolve(PluginRegistryModel registry) throws PluginException { registry.unregisterExtensionPoint(this);
protected void unresolve() throws PluginException { // Do nothing }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a4bc60fa9952eee4e8b6801b3a5736f52717054a/ExtensionPointModel.java/buggy/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java
public DoubleSeqHolder(double[] initial_value)
public DoubleSeqHolder()
public DoubleSeqHolder(double[] initial_value) { value = initial_value; typecode.setLength(value.length); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9b55eb78411ab1a82da7ba097b7b93a8cd80865/DoubleSeqHolder.java/clean/core/src/classpath/org/org/omg/CORBA/DoubleSeqHolder.java
value = initial_value; typecode.setLength(value.length);
public DoubleSeqHolder(double[] initial_value) { value = initial_value; typecode.setLength(value.length); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9b55eb78411ab1a82da7ba097b7b93a8cd80865/DoubleSeqHolder.java/clean/core/src/classpath/org/org/omg/CORBA/DoubleSeqHolder.java
public void append(PathIterator iter, boolean connect)
public void append(Shape s, boolean connect)
public void append(PathIterator iter, boolean connect) { // A bad implementation of this method had caused Classpath bug #6076. float[] f = new float[6]; while (! iter.isDone()) { switch (iter.currentSegment(f)) { case PathIterator.SEG_MOVETO: if (! connect || (index == 0)) { moveTo(f[0], f[1]); break; } if ((index >= 1) && (types[index - 1] == PathIterator.SEG_CLOSE) && (f[0] == xpoints[index - 1]) && (f[1] == ypoints[index - 1])) break; // Fall through. case PathIterator.SEG_LINETO: lineTo(f[0], f[1]); break; case PathIterator.SEG_QUADTO: quadTo(f[0], f[1], f[2], f[3]); break; case PathIterator.SEG_CUBICTO: curveTo(f[0], f[1], f[2], f[3], f[4], f[5]); break; case PathIterator.SEG_CLOSE: closePath(); break; } connect = false; iter.next(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/560cf787ab92cba97cf57ce7b258e72947e5efbc/GeneralPath.java/buggy/core/src/classpath/java/java/awt/geom/GeneralPath.java
float[] f = new float[6]; while (! iter.isDone()) { switch (iter.currentSegment(f)) { case PathIterator.SEG_MOVETO: if (! connect || (index == 0)) { moveTo(f[0], f[1]); break; } if ((index >= 1) && (types[index - 1] == PathIterator.SEG_CLOSE) && (f[0] == xpoints[index - 1]) && (f[1] == ypoints[index - 1])) break; case PathIterator.SEG_LINETO: lineTo(f[0], f[1]); break; case PathIterator.SEG_QUADTO: quadTo(f[0], f[1], f[2], f[3]); break; case PathIterator.SEG_CUBICTO: curveTo(f[0], f[1], f[2], f[3], f[4], f[5]); break; case PathIterator.SEG_CLOSE: closePath(); break; } connect = false; iter.next(); }
append(s.getPathIterator(null), connect);
public void append(PathIterator iter, boolean connect) { // A bad implementation of this method had caused Classpath bug #6076. float[] f = new float[6]; while (! iter.isDone()) { switch (iter.currentSegment(f)) { case PathIterator.SEG_MOVETO: if (! connect || (index == 0)) { moveTo(f[0], f[1]); break; } if ((index >= 1) && (types[index - 1] == PathIterator.SEG_CLOSE) && (f[0] == xpoints[index - 1]) && (f[1] == ypoints[index - 1])) break; // Fall through. case PathIterator.SEG_LINETO: lineTo(f[0], f[1]); break; case PathIterator.SEG_QUADTO: quadTo(f[0], f[1], f[2], f[3]); break; case PathIterator.SEG_CUBICTO: curveTo(f[0], f[1], f[2], f[3], f[4], f[5]); break; case PathIterator.SEG_CLOSE: closePath(); break; } connect = false; iter.next(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/560cf787ab92cba97cf57ce7b258e72947e5efbc/GeneralPath.java/buggy/core/src/classpath/java/java/awt/geom/GeneralPath.java
rb.append ('\n');
public void parseFields(byte[] cByte, ArrayList ffd, StringBuffer rb) { FileFieldDef f; // write out the html record information for each field that is selected for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { switch (f.getFieldType()) { case 'P': case 'S': rb.append(f.parseData(cByte).trim() + delimiter); break; default: rb.append(stringQualifier + f.parseData(cByte).trim() + stringQualifier + delimiter); break; } } } rb.append ('\n'); fout.println(rb); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d168ed72700f29af0ae56810df6fe5dbdb8a8a8c/DelimitedOutputFilter.java/clean/tn5250j/src/org/tn5250j/tools/filters/DelimitedOutputFilter.java
try {
FileFieldDef f; StringBuffer sb = new StringBuffer(); for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { sb.append(f.getFieldName() + delimiter); } }
public void writeHeader(String fileName, String host, ArrayList ffd, char decChar) { try { FileFieldDef f; StringBuffer sb = new StringBuffer(); // loop through each of the fields and write out the field name for // each selected field for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { sb.append(f.getFieldName() + delimiter); } } fout.write (sb.toString().getBytes()); fout.write ('\n'); } catch (IOException ioe) {// printFTPInfo(" error writing header " + ioe.getMessage()); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d168ed72700f29af0ae56810df6fe5dbdb8a8a8c/DelimitedOutputFilter.java/clean/tn5250j/src/org/tn5250j/tools/filters/DelimitedOutputFilter.java
FileFieldDef f; StringBuffer sb = new StringBuffer(); for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { sb.append(f.getFieldName() + delimiter); } } fout.write (sb.toString().getBytes()); fout.write ('\n'); } catch (IOException ioe) { }
fout.println (sb.toString().toCharArray());
public void writeHeader(String fileName, String host, ArrayList ffd, char decChar) { try { FileFieldDef f; StringBuffer sb = new StringBuffer(); // loop through each of the fields and write out the field name for // each selected field for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { sb.append(f.getFieldName() + delimiter); } } fout.write (sb.toString().getBytes()); fout.write ('\n'); } catch (IOException ioe) {// printFTPInfo(" error writing header " + ioe.getMessage()); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d168ed72700f29af0ae56810df6fe5dbdb8a8a8c/DelimitedOutputFilter.java/clean/tn5250j/src/org/tn5250j/tools/filters/DelimitedOutputFilter.java
if (animationIndex > (numFrames) / 2)
if (animationIndex > numFrames / 2)
protected Rectangle getBox(Rectangle r) { if (!progressBar.isIndeterminate()) return null; if (r == null) r = new Rectangle(); Rectangle vr = new Rectangle(); SwingUtilities.calculateInnerArea(progressBar, vr); // Recalculate the metrics only when size of the progressbar has changed. if (incr == -1 || boxDependent == -1 || boxIndependent == -1) { //numFrames has to be an even number as defined by spec. int iterations = numFrames / 2; if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) { boxDependent = vr.width / 6.; incr = ((double) (vr.width - boxDependent)) / (double) iterations; boxIndependent = vr.height; } else { boxDependent = vr.height / 6.; incr = ((double) (vr.height - boxDependent)) / (double) iterations; boxIndependent = vr.width; } } int index = getAnimationIndex(); if (animationIndex > (numFrames) / 2) index = numFrames - getAnimationIndex(); if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) { r.x = vr.x + (int) (incr * index); r.y = vr.y; r.width = (int) boxDependent; r.height = (int) boxIndependent; } else { r.x = vr.x; r.y = vr.height - (int) (incr * index) + vr.y - (int) boxDependent; r.width = (int) boxIndependent; r.height = (int) boxDependent; } return r; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicProgressBarUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicProgressBarUI.java
g.fillRect(vr.x, vr.y + vr.height - amountFull, vr.width, amountFull);
g.fillRect(vr.x, vr.y + vr.height - amountFull, vr.width, amountFull);
protected void paintDeterminate(Graphics g, JComponent c) { Color saved = g.getColor(); int space = getCellSpacing(); int len = getCellLength(); int max = progressBar.getMaximum(); int min = progressBar.getMinimum(); int value = progressBar.getValue(); Rectangle vr = SwingUtilities.calculateInnerArea(c, new Rectangle()); Rectangle or = progressBar.getBounds(); Insets insets = c.getInsets(); int amountFull = getAmountFull(insets, or.width, or.height); if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) { g.setColor(c.getForeground()); g.fillRect(vr.x, vr.y, amountFull, vr.height); } else { g.setColor(c.getForeground()); g.fillRect(vr.x, vr.y + vr.height - amountFull, vr.width, amountFull); } if (progressBar.isStringPainted() && !progressBar.getString().equals("")) paintString(g, 0, 0, or.width, or.height, amountFull, insets); g.setColor(saved); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicProgressBarUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicProgressBarUI.java
public ProgressBarUI() { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/ProgressBarUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/ProgressBarUI.java
System.out.println("i1 % i2=" + NumberUtils.hex(i1 % i2)); System.out.println("i1 & i2=" + NumberUtils.hex(i1 & i2)); System.out.println("i1 | i2=" + NumberUtils.hex(i1 | i2)); System.out.println("i1 ^ i2=" + NumberUtils.hex(i1 ^ i2));
System.out.println("i1 % i2 =" + NumberUtils.hex(i1 % i2)); System.out.println("i1 & i2 =" + NumberUtils.hex(i1 & i2)); System.out.println("i1 | i2 =" + NumberUtils.hex(i1 | i2)); System.out.println("i1 ^ i2 =" + NumberUtils.hex(i1 ^ i2));
public static void main(String[] args) { final int i1 = 0x00450078; final int i2 = 0x45007800; System.out.println("i1 % i2=" + NumberUtils.hex(i1 % i2)); System.out.println("i1 & i2=" + NumberUtils.hex(i1 & i2)); System.out.println("i1 | i2=" + NumberUtils.hex(i1 | i2)); System.out.println("i1 ^ i2=" + NumberUtils.hex(i1 ^ i2)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d974d9b7c8007292fb3bf35e9f401b7489394db3/BinOpTest.java/buggy/core/src/test/org/jnode/test/BinOpTest.java
System.out.println("l1 % l2 =" + NumberUtils.hex(l1 % l2)); System.out.println("l1 & l2 =" + NumberUtils.hex(l1 & l2)); System.out.println("l1 | l2 =" + NumberUtils.hex(l1 | l2)); System.out.println("l1 ^ l2 =" + NumberUtils.hex(l1 ^ l2)); System.out.println("l1 >> 3 =" + NumberUtils.hex(l1 >> 3)); System.out.println("l1 >> 33 =" + NumberUtils.hex(l1 >> 33)); System.out.println("l1 >>> 3 =" + NumberUtils.hex(l1 >>> 3)); System.out.println("l1 >>> 33=" + NumberUtils.hex(l1 >>> 33));
public static void main(String[] args) { final int i1 = 0x00450078; final int i2 = 0x45007800; System.out.println("i1 % i2=" + NumberUtils.hex(i1 % i2)); System.out.println("i1 & i2=" + NumberUtils.hex(i1 & i2)); System.out.println("i1 | i2=" + NumberUtils.hex(i1 | i2)); System.out.println("i1 ^ i2=" + NumberUtils.hex(i1 ^ i2)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d974d9b7c8007292fb3bf35e9f401b7489394db3/BinOpTest.java/buggy/core/src/test/org/jnode/test/BinOpTest.java
public final static VmArrayClass getPrimitiveArrayClass(int type) {
public final static VmType getPrimitiveArrayClass(char type) {
public final static VmArrayClass getPrimitiveArrayClass(int type) { switch (type) { case 4: return BooleanArrayClass; case 8: return ByteArrayClass; case 5: return CharArrayClass; case 9: return ShortArrayClass; case 10: return IntArrayClass; case 6: return FloatArrayClass; case 11: return LongArrayClass; case 7: return DoubleArrayClass; default: throw new IllegalArgumentException("Unknown type " + type); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java
case 4:
case 'Z':
public final static VmArrayClass getPrimitiveArrayClass(int type) { switch (type) { case 4: return BooleanArrayClass; case 8: return ByteArrayClass; case 5: return CharArrayClass; case 9: return ShortArrayClass; case 10: return IntArrayClass; case 6: return FloatArrayClass; case 11: return LongArrayClass; case 7: return DoubleArrayClass; default: throw new IllegalArgumentException("Unknown type " + type); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java
case 8:
case 'B':
public final static VmArrayClass getPrimitiveArrayClass(int type) { switch (type) { case 4: return BooleanArrayClass; case 8: return ByteArrayClass; case 5: return CharArrayClass; case 9: return ShortArrayClass; case 10: return IntArrayClass; case 6: return FloatArrayClass; case 11: return LongArrayClass; case 7: return DoubleArrayClass; default: throw new IllegalArgumentException("Unknown type " + type); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java
case 5:
case 'C':
public final static VmArrayClass getPrimitiveArrayClass(int type) { switch (type) { case 4: return BooleanArrayClass; case 8: return ByteArrayClass; case 5: return CharArrayClass; case 9: return ShortArrayClass; case 10: return IntArrayClass; case 6: return FloatArrayClass; case 11: return LongArrayClass; case 7: return DoubleArrayClass; default: throw new IllegalArgumentException("Unknown type " + type); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java
case 9:
case 'S':
public final static VmArrayClass getPrimitiveArrayClass(int type) { switch (type) { case 4: return BooleanArrayClass; case 8: return ByteArrayClass; case 5: return CharArrayClass; case 9: return ShortArrayClass; case 10: return IntArrayClass; case 6: return FloatArrayClass; case 11: return LongArrayClass; case 7: return DoubleArrayClass; default: throw new IllegalArgumentException("Unknown type " + type); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java
case 10:
case 'I':
public final static VmArrayClass getPrimitiveArrayClass(int type) { switch (type) { case 4: return BooleanArrayClass; case 8: return ByteArrayClass; case 5: return CharArrayClass; case 9: return ShortArrayClass; case 10: return IntArrayClass; case 6: return FloatArrayClass; case 11: return LongArrayClass; case 7: return DoubleArrayClass; default: throw new IllegalArgumentException("Unknown type " + type); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java
case 6:
case 'F':
public final static VmArrayClass getPrimitiveArrayClass(int type) { switch (type) { case 4: return BooleanArrayClass; case 8: return ByteArrayClass; case 5: return CharArrayClass; case 9: return ShortArrayClass; case 10: return IntArrayClass; case 6: return FloatArrayClass; case 11: return LongArrayClass; case 7: return DoubleArrayClass; default: throw new IllegalArgumentException("Unknown type " + type); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java
case 11:
case 'J':
public final static VmArrayClass getPrimitiveArrayClass(int type) { switch (type) { case 4: return BooleanArrayClass; case 8: return ByteArrayClass; case 5: return CharArrayClass; case 9: return ShortArrayClass; case 10: return IntArrayClass; case 6: return FloatArrayClass; case 11: return LongArrayClass; case 7: return DoubleArrayClass; default: throw new IllegalArgumentException("Unknown type " + type); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java
case 7:
case 'D':
public final static VmArrayClass getPrimitiveArrayClass(int type) { switch (type) { case 4: return BooleanArrayClass; case 8: return ByteArrayClass; case 5: return CharArrayClass; case 9: return ShortArrayClass; case 10: return IntArrayClass; case 6: return FloatArrayClass; case 11: return LongArrayClass; case 7: return DoubleArrayClass; default: throw new IllegalArgumentException("Unknown type " + type); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java
{ super();
{
public NoSuchFieldError() { super(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/NoSuchFieldError.java/buggy/core/src/classpath/java/java/lang/NoSuchFieldError.java
public StackOverflowError() { super();
public StackOverflowError() {
public StackOverflowError() { super(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StackOverflowError.java/buggy/core/src/classpath/java/java/lang/StackOverflowError.java
public UnknownError(String s) { super(s);
public UnknownError() {
public UnknownError(String s) { super(s); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/UnknownError.java/buggy/core/src/classpath/java/java/lang/UnknownError.java
}
}
public AbstractColorChooserPanel() { } // AbstractColorChooserPanel()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/AbstractColorChooserPanel.java/buggy/core/src/classpath/javax/javax/swing/colorchooser/AbstractColorChooserPanel.java
public AddressPcEntry(VmMethod method, int pc, int offset) {
public AddressPcEntry(VmMethod method, int pc, int offset, int inlineDepth) {
public AddressPcEntry(VmMethod method, int pc, int offset) { this.method = method; this.pc = (char)pc; this.offset = offset; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
this.pc = (char)pc;
this.pc = (char) pc;
public AddressPcEntry(VmMethod method, int pc, int offset) { this.method = method; this.pc = (char)pc; this.offset = offset; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
this.inlineDepth = (byte)inlineDepth;
public AddressPcEntry(VmMethod method, int pc, int offset) { this.method = method; this.pc = (char)pc; this.offset = offset; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
public void add(VmMethod method, int pc, int offset) { if (offsetTable != null) { throw new RuntimeException( "Address table is locked"); } final AddressPcEntry entry = new AddressPcEntry(method, pc, offset);
public void add(VmMethod method, int pc, int offset, int inlineDepth) { if (offsetTable != null) { throw new RuntimeException("Address table is locked"); } final AddressPcEntry entry = new AddressPcEntry(method, pc, offset, inlineDepth);
public void add(VmMethod method, int pc, int offset) { if (offsetTable != null) { throw new RuntimeException( "Address table is locked"); } final AddressPcEntry entry = new AddressPcEntry(method, pc, offset); if (list == null) { list = entry; } else { // Sort on offset (from low to high) if (offset < list.offset) { entry.next = list; list = entry; } else { AddressPcEntry p = list; while ((p.next != null) && (offset > p.next.offset)) { p = p.next; } entry.next = p.next; p.next = entry; } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
final int[] offsetTable = new int[ count];
final int methodCount = methods.size(); final int[] offsetTable = new int[count];
final void lock() { AddressPcEntry p = list; int count = 0; final ArrayList<VmMethod> methods = new ArrayList<VmMethod>(); while (p != null) { count++; final VmMethod m = p.method; if (!methods.contains(m)) { methods.add(m); } p = p.next; } final int[] offsetTable = new int[ count]; final char[] pcTable = new char[count]; final byte[] methodIndexTable = new byte[count]; this.methodTable = (VmMethod[]) methods.toArray(new VmMethod[ methods .size()]); p = list; int i = 0; int lastOffset = -1; while (p != null) { methodIndexTable[i] = (byte)methods.indexOf(p.method); pcTable[i] = p.pc; offsetTable[i] = p.offset; if (p.offset < lastOffset) { throw new InternalError( "unordered offset found"); } lastOffset = p.offset; i++; p = p.next; } this.offsetTable = offsetTable; this.pcTable = pcTable; this.methodIndexTable = methodIndexTable; this.list = null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
final byte[] methodIndexTable = new byte[count]; this.methodTable = (VmMethod[]) methods.toArray(new VmMethod[ methods .size()]);
final byte[] methodIndexTable = (methodCount > 1) ? new byte[count] : null; final byte[] inlineDepthTable = (maxInlineDepth == 0) ? null : new byte[count]; this.methodTable = (VmMethod[]) methods.toArray(new VmMethod[methodCount]);
final void lock() { AddressPcEntry p = list; int count = 0; final ArrayList<VmMethod> methods = new ArrayList<VmMethod>(); while (p != null) { count++; final VmMethod m = p.method; if (!methods.contains(m)) { methods.add(m); } p = p.next; } final int[] offsetTable = new int[ count]; final char[] pcTable = new char[count]; final byte[] methodIndexTable = new byte[count]; this.methodTable = (VmMethod[]) methods.toArray(new VmMethod[ methods .size()]); p = list; int i = 0; int lastOffset = -1; while (p != null) { methodIndexTable[i] = (byte)methods.indexOf(p.method); pcTable[i] = p.pc; offsetTable[i] = p.offset; if (p.offset < lastOffset) { throw new InternalError( "unordered offset found"); } lastOffset = p.offset; i++; p = p.next; } this.offsetTable = offsetTable; this.pcTable = pcTable; this.methodIndexTable = methodIndexTable; this.list = null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
methodIndexTable[i] = (byte)methods.indexOf(p.method);
if (methodIndexTable != null) { methodIndexTable[i] = (byte) methods.indexOf(p.method); }
final void lock() { AddressPcEntry p = list; int count = 0; final ArrayList<VmMethod> methods = new ArrayList<VmMethod>(); while (p != null) { count++; final VmMethod m = p.method; if (!methods.contains(m)) { methods.add(m); } p = p.next; } final int[] offsetTable = new int[ count]; final char[] pcTable = new char[count]; final byte[] methodIndexTable = new byte[count]; this.methodTable = (VmMethod[]) methods.toArray(new VmMethod[ methods .size()]); p = list; int i = 0; int lastOffset = -1; while (p != null) { methodIndexTable[i] = (byte)methods.indexOf(p.method); pcTable[i] = p.pc; offsetTable[i] = p.offset; if (p.offset < lastOffset) { throw new InternalError( "unordered offset found"); } lastOffset = p.offset; i++; p = p.next; } this.offsetTable = offsetTable; this.pcTable = pcTable; this.methodIndexTable = methodIndexTable; this.list = null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
if (p.offset < lastOffset) { throw new InternalError( "unordered offset found"); }
if (inlineDepthTable != null) { inlineDepthTable[i] = p.inlineDepth; } if (p.offset < lastOffset) { throw new InternalError("unordered offset found"); }
final void lock() { AddressPcEntry p = list; int count = 0; final ArrayList<VmMethod> methods = new ArrayList<VmMethod>(); while (p != null) { count++; final VmMethod m = p.method; if (!methods.contains(m)) { methods.add(m); } p = p.next; } final int[] offsetTable = new int[ count]; final char[] pcTable = new char[count]; final byte[] methodIndexTable = new byte[count]; this.methodTable = (VmMethod[]) methods.toArray(new VmMethod[ methods .size()]); p = list; int i = 0; int lastOffset = -1; while (p != null) { methodIndexTable[i] = (byte)methods.indexOf(p.method); pcTable[i] = p.pc; offsetTable[i] = p.offset; if (p.offset < lastOffset) { throw new InternalError( "unordered offset found"); } lastOffset = p.offset; i++; p = p.next; } this.offsetTable = offsetTable; this.pcTable = pcTable; this.methodIndexTable = methodIndexTable; this.list = null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
this.inlineDepthTable = inlineDepthTable;
final void lock() { AddressPcEntry p = list; int count = 0; final ArrayList<VmMethod> methods = new ArrayList<VmMethod>(); while (p != null) { count++; final VmMethod m = p.method; if (!methods.contains(m)) { methods.add(m); } p = p.next; } final int[] offsetTable = new int[ count]; final char[] pcTable = new char[count]; final byte[] methodIndexTable = new byte[count]; this.methodTable = (VmMethod[]) methods.toArray(new VmMethod[ methods .size()]); p = list; int i = 0; int lastOffset = -1; while (p != null) { methodIndexTable[i] = (byte)methods.indexOf(p.method); pcTable[i] = p.pc; offsetTable[i] = p.offset; if (p.offset < lastOffset) { throw new InternalError( "unordered offset found"); } lastOffset = p.offset; i++; p = p.next; } this.offsetTable = offsetTable; this.pcTable = pcTable; this.methodIndexTable = methodIndexTable; this.list = null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
final int methodIdx = methodIndexTable[i];
final int methodIdx = (methodIndexTable != null) ? methodIndexTable[i] : 0;
public void writeTo(PrintStream out) { for (int i = 0; i < offsetTable.length; i++) { final int methodIdx = methodIndexTable[i]; final int pc = pcTable[i]; final int offset = offsetTable[i]; out.println(methodTable[ methodIdx].getName() + ", pc[" + pc + "]\t0x" + NumberUtils.hex(offset)); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
out.println(methodTable[ methodIdx].getName() + ", pc[" + pc
out.println(methodTable[methodIdx].getName() + ", pc[" + pc
public void writeTo(PrintStream out) { for (int i = 0; i < offsetTable.length; i++) { final int methodIdx = methodIndexTable[i]; final int pc = pcTable[i]; final int offset = offsetTable[i]; out.println(methodTable[ methodIdx].getName() + ", pc[" + pc + "]\t0x" + NumberUtils.hex(offset)); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8f674dc620388d2013aaf9ed54e97f8ee02b418d/VmAddressMap.java/clean/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
public EthernetHeader(SocketBuffer skbuf) { this.destination = new EthernetAddress(skbuf, 0); this.source = new EthernetAddress(skbuf, 6); this.lengthType = skbuf.get16(12);
public EthernetHeader( EthernetAddress destination, EthernetAddress source, int lengthType) { this.destination = destination; this.source = source; this.lengthType = lengthType;
public EthernetHeader(SocketBuffer skbuf) { this.destination = new EthernetAddress(skbuf, 0); this.source = new EthernetAddress(skbuf, 6); this.lengthType = skbuf.get16(12); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/EthernetHeader.java/buggy/net/src/net/org/jnode/net/ethernet/EthernetHeader.java
public ScrollBarUI() { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/ScrollBarUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/ScrollBarUI.java
initial_references.put("DynAnyFactory", factory);
public ORB_1_4() { super(); try { rootPOA = new gnuPOA(null, "RootPOA", null, policySets.rootPoa(), this); } catch (InvalidPolicy ex) { // Invalid default policy set. InternalError ierr = new InternalError(); ierr.initCause(ex); throw ierr; } initial_references.put("RootPOA", rootPOA); initial_references.put("RootPOAManager", rootPOA.the_POAManager()); initial_references.put("POACurrent", currents); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/ORB_1_4.java/clean/core/src/classpath/gnu/gnu/CORBA/Poa/ORB_1_4.java
dirty.setBounds(fmWidth * numCols,fmHeight * numRows,0,0);
dirty.setBounds(tArea.getBounds());
protected void clearGuiStuff() { for (int x = 0; x < lenScreen; x++) {// screen[x].setCharAndAttr(' ',initAttr,false); screen[x].setUseGUI(ScreenChar.NO_GUI); }// dirty.setBounds(tArea.getBounds()); dirty.setBounds(fmWidth * numCols,fmHeight * numRows,0,0); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/6a23de0d5ab12f72eb326ce880d79c3f8f62a42f/Screen5250.java/clean/tn5250j/src/org/tn5250j/Screen5250.java
dirty.setBounds(fmWidth * numCols,fmHeight * numRows,0,0);
dirty.setBounds(tArea.getBounds());
public void clearScreen() { for (int x = 0; x < lenScreen; x++) { screen[x].setCharAndAttr(' ',initAttr,false); screen[x].setUseGUI(ScreenChar.NO_GUI); }// dirty.setBounds(tArea.getBounds()); dirty.setBounds(fmWidth * numCols,fmHeight * numRows,0,0); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/6a23de0d5ab12f72eb326ce880d79c3f8f62a42f/Screen5250.java/clean/tn5250j/src/org/tn5250j/Screen5250.java
if (evt.getKeyCode() == KeyEvent.VK_DOWN) {
public void keyPressed( KeyEvent evt ) { if (evt.getKeyCode() == KeyEvent.VK_DOWN) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if (evt.getKeyCode() == KeyEvent.VK_UP) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicListUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
else if (evt.getKeyCode() == KeyEvent.VK_UP)
else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP))
public void keyPressed( KeyEvent evt ) { if (evt.getKeyCode() == KeyEvent.VK_DOWN) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if (evt.getKeyCode() == KeyEvent.VK_UP) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicListUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
int lead = BasicListUI.this.list.getLeadSelectionIndex();
public void keyPressed( KeyEvent evt ) { if (evt.getKeyCode() == KeyEvent.VK_DOWN) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if (evt.getKeyCode() == KeyEvent.VK_UP) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicListUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java
else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { BasicListUI.this.list.setSelectionInterval(0, max); BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); }
public void keyPressed( KeyEvent evt ) { if (evt.getKeyCode() == KeyEvent.VK_DOWN) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if (evt.getKeyCode() == KeyEvent.VK_UP) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicListUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicListUI.java