rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
double loc = tickRect.x;
|
double loc = tickRect.x + 0.5;
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
: minorSpace * (double) tickRect.width / (max - min);
|
: minorSpace * (double) (tickRect.width - 1) / (max - min);
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
double loc = tickRect.height + tickRect.y;
|
double loc = tickRect.height + tickRect.y + 0.5;
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
: -minorSpace * (double) tickRect.height / (max - min);
|
: -minorSpace * (double) (tickRect.height - 1) / (max - min);
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
loc = tickRect.y;
|
loc = tickRect.y + 0.5;
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
g.translate(-tickRect.x, 0);
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
|
Polygon high; Polygon shadow;
|
public void paintTrack(Graphics g) { Color saved_color = g.getColor(); int width; int height; Point a = new Point(trackRect.x, trackRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Polygon high; Polygon shadow; if (slider.getOrientation() == JSlider.HORIZONTAL) { width = trackRect.width; height = (thumbRect.height / 4 == 0) ? 1 : thumbRect.height / 4; a.translate(0, (trackRect.height / 2) - (height / 2)); b.translate(0, (trackRect.height / 2) + (height / 2)); c.translate(trackRect.width, (trackRect.height / 2) + (height / 2)); d.translate(trackRect.width, (trackRect.height / 2) - (height / 2)); } else { width = (thumbRect.width / 4 == 0) ? 1 : thumbRect.width / 4; height = trackRect.height; a.translate((trackRect.width / 2) - (width / 2), 0); b.translate((trackRect.width / 2) - (width / 2), trackRect.height); c.translate((trackRect.width / 2) + (width / 2), trackRect.height); d.translate((trackRect.width / 2) + (width / 2), 0); } g.setColor(Color.GRAY); g.fillRect(a.x, a.y, width, height); g.setColor(getHighlightColor()); g.drawLine(b.x, b.y, c.x, c.y); g.drawLine(c.x, c.y, d.x, d.y); g.setColor(getShadowColor()); g.drawLine(b.x, b.y, a.x, a.y); g.drawLine(a.x, a.y, d.x, d.y); g.setColor(saved_color); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
|
public int valueForXPosition(int xPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider is. // This really shouldn't ever happen, but just in case, we'll return the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((xPos - trackRect.x) * (max - min) / len + min); else value = ((len - (xPos - trackRect.x)) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
||
public int valueForYPosition(int yPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the slider is. // This really shouldn't ever happen, but just in case, we'll return the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((len - (yPos - trackRect.y)) * (max - min) / len + min); else value = ((yPos - trackRect.y) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
||
int extent = slider.getExtent(); int len = trackRect.width;
|
int len = trackRect.width - 1;
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = trackRect.width - xPos; xPos += trackRect.x; } return xPos; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
xPos = trackRect.width - xPos;
|
xPos = len - xPos;
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = trackRect.width - xPos; xPos += trackRect.x; } return xPos; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
int extent = slider.getExtent(); int len = trackRect.height;
|
int len = trackRect.height - 1;
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = trackRect.height - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
yPos = trackRect.height - yPos;
|
yPos = len - yPos;
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = trackRect.height - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c4eda97e6e5feb8e7650d83d5066d85580f1249c/BasicSliderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicSliderUI.java
|
groupObject.removeMemberObj(this);
|
groupObject.removeMemberObject((Object) this);
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObj(this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/84c74253fd1cbb9549e2de79eeaa8d6c90582ffc/BaseObject.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObject.java
|
if (fromList !=null) { if ( what !=null) {
|
if (fromList != null) { if ( what != null) {
|
protected boolean removeFromList ( Object what, List fromList, String listName ) { if (fromList !=null) { if ( what !=null) { int index = fromList.indexOf(what); if (index !=-1) { //object to be removed is found in the list fromList.remove(index); return true; } else { //cant find the object in the list Log.warn("warn: can't find object in" + listName + ", ignoring remove"); return false; } } else { //object to remove is null Log.error("Error: object to remove is null"); return false; } } else { //the list to remove from is null Log.error("Error: Passed list to remove from is null, no object to remove"); return false; } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/84c74253fd1cbb9549e2de79eeaa8d6c90582ffc/BaseObject.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObject.java
|
Log.error("Weird error: unknown XML attribute type for item:"+item);
|
Log.errorln("Weird error: unknown XML attribute type for item:"+item);
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.error("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/84c74253fd1cbb9549e2de79eeaa8d6c90582ffc/BaseObject.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObject.java
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.error("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/84c74253fd1cbb9549e2de79eeaa8d6c90582ffc/BaseObject.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObject.java
|
||
Filler glue = new Filler(new Dimension(0,0), new Dimension(0,0), new Dimension(Short.MAX_VALUE,Short.MAX_VALUE) );
|
Filler glue = new Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
|
public static Component createGlue() { Filler glue = new Filler(new Dimension(0,0), new Dimension(0,0), new Dimension(Short.MAX_VALUE,Short.MAX_VALUE) ); return glue; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/Box.java/clean/core/src/classpath/javax/javax/swing/Box.java
|
Filler glue = new Filler(new Dimension(0,0), new Dimension(0,0), new Dimension(Short.MAX_VALUE, 0) );
|
Filler glue = new Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(Short.MAX_VALUE, 0));
|
public static Component createHorizontalGlue() { Filler glue = new Filler(new Dimension(0,0), new Dimension(0,0), new Dimension(Short.MAX_VALUE, 0) ); return glue; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/Box.java/clean/core/src/classpath/javax/javax/swing/Box.java
|
if (!extendedMode) vk = keys.getKey(scancode).getLowerVirtuelKey();
|
if (!extendedMode){ if((flags & InputEvent.ALT_GRAPH_DOWN_MASK) != 0){ vk = keys.getKey(scancode).getAltGrVirtuelKey(); }else if((flags & InputEvent.SHIFT_DOWN_MASK) != 0){ vk = keys.getKey(scancode).getUpperVirtuelKey(); }else{ vk = keys.getKey(scancode).getLowerVirtuelKey(); } }
|
public final KeyboardEvent interpretScancode(int scancode) { final boolean extendedMode = this.extendedMode; if (scancode == XT_EXTENDED) { this.extendedMode = true; return null; } else { this.extendedMode = false; } final boolean released = ((scancode & XT_RELEASE) != 0); final long time = System.currentTimeMillis(); scancode &= 0x7f; int vk = deriveKeyCode(scancode, extendedMode); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); if (!extendedMode) vk = keys.getKey(scancode).getLowerVirtuelKey(); adjustFlags(vk, released); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); try { final char ch; ch = interpretExtendedScanCode(scancode, vk, released, extendedMode); return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (UnsupportedKeyException e) { final char ch; if ((flags & InputEvent.SHIFT_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getUpperChar(); if (!extendedMode) vk = keys.getKey(scancode).getUpperVirtuelKey(); } else if ((flags & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getAltGrChar(); if (!extendedMode) vk = keys.getKey(scancode).getAltGrVirtuelKey(); } else { ch = keys.getKey(scancode).getLowerChar(); } return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (DeadKeyException e) { return null; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/316f0ce1c74f95b1e1bb7c1780fbd90cd0f892c6/KeyboardInterpreter.java/clean/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java
|
tabs = t;
|
if (t != null) tabs = (TabStop[]) t.clone(); else tabs = new TabStop[0];
|
public TabSet(TabStop[] t) { tabs = t; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/TabSet.java/buggy/core/src/classpath/javax/javax/swing/text/TabSet.java
|
if (i < 0 || i >= tabs.length) throw new IllegalArgumentException("Index out of bounds.");
|
public TabStop getTab(int i) { return tabs[i]; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/TabSet.java/buggy/core/src/classpath/javax/javax/swing/text/TabSet.java
|
|
int idx = -1; for (int i = 0; i < tabs.length; ++i)
|
for (int i = 0; i < tabs.length; i++)
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/TabSet.java/buggy/core/src/classpath/javax/javax/swing/text/TabSet.java
|
if (location < tabs[i].getPosition()) idx = i;
|
if (location <= tabs[i].getPosition()) return i;
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/TabSet.java/buggy/core/src/classpath/javax/javax/swing/text/TabSet.java
|
return idx;
|
return -1;
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/TabSet.java/buggy/core/src/classpath/javax/javax/swing/text/TabSet.java
|
sb.append("[");
|
sb.append("[ ");
|
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("["); for (int i = 0; i < tabs.length; ++i) { if (i != 0) sb.append(" - "); sb.append(tabs[i].toString()); } sb.append("]"); return sb.toString(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/TabSet.java/buggy/core/src/classpath/javax/javax/swing/text/TabSet.java
|
sb.append("]");
|
sb.append(" ]");
|
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("["); for (int i = 0; i < tabs.length; ++i) { if (i != 0) sb.append(" - "); sb.append(tabs[i].toString()); } sb.append("]"); return sb.toString(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/TabSet.java/buggy/core/src/classpath/javax/javax/swing/text/TabSet.java
|
StringTokenizer st = new StringTokenizer(fontspec, "-");
|
StringTokenizer st = new StringTokenizer(fontspec, "- ");
|
public static Font decode (String fontspec){ String name = null; int style = PLAIN; int size = 12; StringTokenizer st = new StringTokenizer(fontspec, "-"); while (st.hasMoreTokens()) { String token = st.nextToken(); if (name == null) { name = token; continue; } if (token.toUpperCase().equals("BOLD")) { style = BOLD; continue; } if (token.toUpperCase().equals("ITALIC")) { style = ITALIC; continue; } if (token.toUpperCase().equals("BOLDITALIC")) { style = BOLD | ITALIC; continue; } int tokenval = 0; try { tokenval = Integer.parseInt(token); } catch(NumberFormatException e) { // Ignored. } if (tokenval != 0) size = tokenval; } HashMap attrs = new HashMap(); ClasspathFontPeer.copyStyleToAttrs (style, attrs); ClasspathFontPeer.copySizeToAttrs (size, attrs); return getFontFromToolkit (name, attrs);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f9edc08acdeb1f2f4fe82f01243818bd374a3e46/Font.java/buggy/core/src/classpath/java/java/awt/Font.java
|
return result;
|
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException { if (keySpec instanceof DHPrivateKeySpec) { DHPrivateKeySpec spec = (DHPrivateKeySpec) keySpec; BigInteger p = spec.getP(); BigInteger g = spec.getG(); BigInteger x = spec.getX(); return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, null, p, g, x); } if (keySpec instanceof PKCS8EncodedKeySpec) { PKCS8EncodedKeySpec spec = (PKCS8EncodedKeySpec) keySpec; byte[] encoded = spec.getEncoded(); PrivateKey result; try { result = new DHKeyPairPKCS8Codec().decodePrivateKey(encoded); } catch (RuntimeException x) { InvalidKeySpecException y = new InvalidKeySpecException(); y.initCause(x); throw y; } } throw new InvalidKeySpecException("Unsupported (private) key specification"); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyFactory.java/clean/core/src/classpath/gnu/gnu/javax/crypto/jce/sig/DHKeyFactory.java
|
|
return result;
|
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException { if (keySpec instanceof DHPublicKeySpec) { DHPublicKeySpec spec = (DHPublicKeySpec) keySpec; BigInteger p = spec.getP(); BigInteger g = spec.getG(); BigInteger y = spec.getY(); return new GnuDHPublicKey(Registry.X509_ENCODING_ID, null, p, g, y); } if (keySpec instanceof X509EncodedKeySpec) { X509EncodedKeySpec spec = (X509EncodedKeySpec) keySpec; byte[] encoded = spec.getEncoded(); PublicKey result; try { result = new DHKeyPairX509Codec().decodePublicKey(encoded); } catch (RuntimeException x) { InvalidKeySpecException y = new InvalidKeySpecException(); y.initCause(x); throw y; } } throw new InvalidKeySpecException("Unsupported (public) key specification"); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyFactory.java/clean/core/src/classpath/gnu/gnu/javax/crypto/jce/sig/DHKeyFactory.java
|
|
checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field");
|
DerUtil.checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field");
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairPKCS8Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.java
|
checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field");
|
DerUtil.checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field");
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairPKCS8Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.java
|
checkIsConstructed(derParams, "Wrong DSS Parameters field");
|
DerUtil.checkIsConstructed(derParams, "Wrong DSS Parameters field");
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairPKCS8Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.java
|
checkIsBigInteger(val, "Wrong P field");
|
DerUtil.checkIsBigInteger(val, "Wrong P field");
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairPKCS8Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.java
|
checkIsBigInteger(val, "Wrong G field");
|
DerUtil.checkIsBigInteger(val, "Wrong G field");
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairPKCS8Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.java
|
checkIsBigInteger(val, "Wrong Q field");
|
DerUtil.checkIsBigInteger(val, "Wrong Q field");
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairPKCS8Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.java
|
checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field");
|
DerUtil.checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field");
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairX509Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java
|
checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field");
|
DerUtil.checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field");
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairX509Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java
|
checkIsConstructed(derParams, "Wrong DH Parameters field");
|
DerUtil.checkIsConstructed(derParams, "Wrong DH Parameters field");
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairX509Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java
|
checkIsBigInteger(val, "Wrong P field");
|
DerUtil.checkIsBigInteger(val, "Wrong P field");
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairX509Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java
|
checkIsBigInteger(val, "Wrong G field");
|
DerUtil.checkIsBigInteger(val, "Wrong G field");
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairX509Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java
|
checkIsBigInteger(val, "Wrong Q field");
|
DerUtil.checkIsBigInteger(val, "Wrong Q field");
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairX509Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java
|
checkIsBigInteger(val, "Wrong Y field");
|
DerUtil.checkIsBigInteger(val, "Wrong Y field");
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/DHKeyPairX509Codec.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java
|
Level logLevel = logger.getLevel(); String searchName = name; String parentName = parent != null ? parent.getName() : ""; while (logLevel == null && ! searchName.equals(parentName)) { logLevel = getLevelProperty(searchName + ".level", logLevel); int index = searchName.lastIndexOf('.'); if(index > -1) searchName = searchName.substring(0,index); else searchName = ""; } logger.setLevel(logLevel);
|
public synchronized boolean addLogger(Logger logger) { /* To developers thinking about to remove the 'synchronized' * declaration from this method: Please read the comment * in java.util.logging.Logger.getLogger(String, String) * and make sure that whatever you change wrt. synchronization * does not endanger thread-safety of Logger.getLogger. * The current implementation of Logger.getLogger assumes * that LogManager does its synchronization on the globally * shared instance of LogManager. */ String name; WeakReference ref; /* This will throw a NullPointerException if logger is null, * as required by the API specification. */ name = logger.getName(); ref = (WeakReference) loggers.get(name); if (ref != null) { if (ref.get() != null) return false; /* There has been a logger under this name in the past, * but it has been garbage collected. */ loggers.remove(ref); } /* Adding a named logger requires a security permission. */ if ((name != null) && ! name.equals("")) checkAccess(); Logger parent = findAncestor(logger); loggers.put(name, new WeakReference(logger)); if (parent != logger.getParent()) logger.setParent(parent); /* It can happen that existing loggers should be children of * the newly added logger. For example, assume that there * already exist loggers under the names "", "foo", and "foo.bar.baz". * When adding "foo.bar", the logger "foo.bar.baz" should change * its parent to "foo.bar". */ if (parent != rootLogger) { for (Iterator iter = loggers.keySet().iterator(); iter.hasNext();) { Logger possChild = (Logger) ((WeakReference) loggers.get(iter.next())) .get(); if ((possChild == null) || (possChild == logger) || (possChild.getParent() != parent)) continue; if (! possChild.getName().startsWith(name)) continue; if (possChild.getName().charAt(name.length()) != '.') continue; possChild.setParent(logger); } } return true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/LogManager.java/clean/core/src/classpath/java/java/util/logging/LogManager.java
|
|
/* Close the stream in order to save * resources such as file descriptors. */
|
public synchronized void readConfiguration() throws IOException, SecurityException { String path; InputStream inputStream; path = System.getProperty("java.util.logging.config.file"); if ((path == null) || (path.length() == 0)) { String url = (System.getProperty("gnu.classpath.home.url") + "/logging.properties"); inputStream = new URL(url).openStream(); } else inputStream = new java.io.FileInputStream(path); try { readConfiguration(inputStream); } finally { /* Close the stream in order to save * resources such as file descriptors. */ inputStream.close(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/LogManager.java/clean/core/src/classpath/java/java/util/logging/LogManager.java
|
|
public DHCPMessage(BOOTPHeader hdr, int msgType) { this(hdr); messageType = msgType;
|
private DHCPMessage(BOOTPHeader hdr) { header = hdr;
|
public DHCPMessage(BOOTPHeader hdr, int msgType) { this(hdr); messageType = msgType; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/DHCPMessage.java/buggy/net/src/net/org/jnode/net/ipv4/dhcp/DHCPMessage.java
|
prefSize = null;
|
public void invalidateLayout(Container target) { synchronized (this) { glassPaneBounds = null; layeredPaneBounds = null; contentPaneBounds = null; menuBarBounds = null; prefSize = null; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/JRootPane.java/clean/core/src/classpath/javax/javax/swing/JRootPane.java
|
|
synchronized (this) { if (prefSize == null) {
|
Dimension prefSize = new Dimension();
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/JRootPane.java/clean/core/src/classpath/javax/javax/swing/JRootPane.java
|
} return new Dimension(prefSize); }
|
return prefSize;
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/JRootPane.java/clean/core/src/classpath/javax/javax/swing/JRootPane.java
|
titlePane.setBorder(new EmptyBorder(2, 2, 2, 2));
|
protected JComponent createNorthPane(JInternalFrame w) { titlePane = new MetalInternalFrameTitlePane(w); titlePane.setBorder(new EmptyBorder(2, 2, 2, 2)); return titlePane; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MetalInternalFrameUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/metal/MetalInternalFrameUI.java
|
|
if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalInternalFrameUI instance; if (o == null) { instance = new MetalInternalFrameUI((JInternalFrame) component); instances.put(component, instance); } else instance = (MetalInternalFrameUI) o; return instance;
|
return new MetalInternalFrameUI((JInternalFrame) component);
|
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalInternalFrameUI instance; if (o == null) { instance = new MetalInternalFrameUI((JInternalFrame) component); instances.put(component, instance); } else instance = (MetalInternalFrameUI) o; return instance; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MetalInternalFrameUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/metal/MetalInternalFrameUI.java
|
currentRepaintManagers = new HashMap();
|
currentRepaintManagers = new WeakHashMap();
|
public static RepaintManager currentManager(Component component) { if (currentRepaintManagers == null) currentRepaintManagers = new HashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); RepaintManager currentManager = (RepaintManager) currentRepaintManagers.get(threadGroup); if (currentManager == null) { currentManager = new RepaintManager(); currentRepaintManagers.put(threadGroup, currentManager); } return currentManager; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/39b6fa6b2c83d98e97f872ed8ae18d9f4803884d/RepaintManager.java/buggy/core/src/classpath/javax/javax/swing/RepaintManager.java
|
currentRepaintManagers = new HashMap();
|
currentRepaintManagers = new WeakHashMap();
|
public static void setCurrentManager(RepaintManager manager) { if (currentRepaintManagers == null) currentRepaintManagers = new HashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); currentRepaintManagers.put(threadGroup, manager); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/39b6fa6b2c83d98e97f872ed8ae18d9f4803884d/RepaintManager.java/buggy/core/src/classpath/javax/javax/swing/RepaintManager.java
|
String parentNodeName = getParentNodeName();
|
String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP);
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/9421d26b1bb995bf2f486aa2edb09faf0f1bea88/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
} else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) {
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/9421d26b1bb995bf2f486aa2edb09faf0f1bea88/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
|
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat ) { // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) { CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FixedDataFormat) { Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat) { Integer number = new Integer (thisString); CurrentArray.setData(dataLocator, number.intValue()); } else if ( CurrentDataFormat instanceof ExponentialDataFormat) { // hurm.. this is a stop-gap. Exponential format needs to be // preserved better than this. -b.t. Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else { Log.warnln("The dataFormat:"+CurrentDataFormat.toString()+" is not allowed in tagged data."); Log.warnln("Unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/9421d26b1bb995bf2f486aa2edb09faf0f1bea88/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
||
Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>");
|
public void processingInstruction(String target, String data) throws SAXException { // Log.debugln("<?"+target+" "+data+"?>"); // do nothing, method required by interface }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/9421d26b1bb995bf2f486aa2edb09faf0f1bea88/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
|
public void setDocumentLocator (org.xml.sax.Locator l) { // we'd record this if we needed to resolve relative URIs // in content or attributes, or wanted to give diagnostics. // Right now, do nothing here. // do nothing, method required by interface }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/9421d26b1bb995bf2f486aa2edb09faf0f1bea88/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
|
||
if (lowerBound < 1) throw new IllegalArgumentException("lowerBound may not be less than 1");
|
public JobImpressionsSupported(int lowerBound, int upperBound) { super(lowerBound, upperBound); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/JobImpressionsSupported.java/buggy/core/src/classpath/javax/javax/print/attribute/standard/JobImpressionsSupported.java
|
|
writePUSH(Register.EDX); writePUSH(Register.EAX);
|
writePUSH64(Register.EAX, Register.EDX);
|
public final void invokeJavaMethod(String signature, X86CompilerContext context) { os.writeCALL(Register.EAX, context.getVmMethodNativeCodeField().getOffset()); //writeJumpTableCALL(X86JumpTable.VM_INVOKE_OFS); char ch = signature.charAt(signature.length() - 1); if (ch == 'V') { /** No return value */ } else if ((ch == 'J') || (ch == 'D')) { /** Wide return value */ writePUSH(Register.EDX); writePUSH(Register.EAX); } else { /** Normal return value */ writePUSH(Register.EAX); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/X86CompilerHelper.java/clean/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java
|
public final void writeLoadSTATICS(X86CompilerContext context) {
|
public final void writeLoadSTATICS(X86CompilerContext context, Label labelPrefix, boolean isTestOnly) {
|
public final void writeLoadSTATICS(X86CompilerContext context) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/X86CompilerHelper.java/clean/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java
|
os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset);
|
if (isTestOnly) { /*final Label ok = new Label(labelPrefix + "$$ediok"); os.writePrefix(X86Constants.FS_PREFIX); os.writeCMP_MEM(STATICS, offset); os.writeJCC(ok, X86Constants.JE); os.writeINT(0x88); os.setObjectRef(ok);*/ } else { os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
|
public final void writeLoadSTATICS(X86CompilerContext context) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/X86CompilerHelper.java/clean/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java
|
public ISO9660File(ISO9660Entry entry) { this.entry = entry; }
|
public ISO9660File(ISO9660Entry entry) { this.entry = entry; }
|
public ISO9660File(ISO9660Entry entry) { this.entry = entry; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/aa324658a8e5c25a895787936a31595462ad8442/ISO9660File.java/buggy/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java
|
public void flush() throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
public void flush() throws IOException { }
|
public void flush() throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/aa324658a8e5c25a895787936a31595462ad8442/ISO9660File.java/buggy/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java
|
public FileSystem getFileSystem() { return null; }
|
public final FileSystem getFileSystem() { return entry.getFileSystem(); }
|
public FileSystem getFileSystem() { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/aa324658a8e5c25a895787936a31595462ad8442/ISO9660File.java/buggy/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java
|
public long getLength() { return entry.getCDFSentry().getDataLength(); }
|
public long getLength() { return entry.getCDFSentry().getDataLength(); }
|
public long getLength() { return entry.getCDFSentry().getDataLength(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/aa324658a8e5c25a895787936a31595462ad8442/ISO9660File.java/buggy/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java
|
public boolean isValid() { return true; }
|
public boolean isValid() { return true; }
|
public boolean isValid() { return true; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/aa324658a8e5c25a895787936a31595462ad8442/ISO9660File.java/buggy/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java
|
throws IOException { this.entry.getCDFSentry().readFileData(fileOffset,dest,off,len); }
|
throws IOException { this.entry.getCDFSentry().readFileData(fileOffset, dest, off, len); }
|
public void read(long fileOffset, byte[] dest, int off, int len) throws IOException { this.entry.getCDFSentry().readFileData(fileOffset,dest,off,len); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/aa324658a8e5c25a895787936a31595462ad8442/ISO9660File.java/buggy/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java
|
public void setLength(long length) throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
public void setLength(long length) throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
public void setLength(long length) throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/aa324658a8e5c25a895787936a31595462ad8442/ISO9660File.java/buggy/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java
|
throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/aa324658a8e5c25a895787936a31595462ad8442/ISO9660File.java/buggy/fs/src/fs/org/jnode/fs/iso9660/ISO9660File.java
|
if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt");
|
if (attachmentName == null || attachmentName.length() == 0) { fbp.setFileName("tn5250j.txt"); }
|
public boolean send() throws Exception { try { if(!loadConfig(configFile)) return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from == null) from = SMTPProperties.getProperty("mail.smtp.from"); if (from != null && from.length() > 0) { pers = SMTPProperties.getProperty("mail.smtp.realname"); if (pers != null) msg.setFrom(new InternetAddress(from, pers)); } if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg); return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/4ccdbe874cb1f262f6091d88cd5a1cd338cfe6a0/SendEMail.java/clean/tn5250j/src/org/tn5250j/mailtools/SendEMail.java
|
SecurityManager sm = SecurityManager.current; if (sm != null) sm.checkLink(filename); if (loadLib(filename) == 0) throw new UnsatisfiedLinkError("Could not load library " + filename);
|
load(filename, VMStackWalker.getCallingClassLoader());
|
public void load(String filename) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkLink(filename); if (loadLib(filename) == 0) throw new UnsatisfiedLinkError("Could not load library " + filename); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/Runtime.java/clean/core/src/classpath/java/java/lang/Runtime.java
|
private static int loadLib(String filename)
|
private static int loadLib(String filename, ClassLoader loader)
|
private static int loadLib(String filename) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkRead(filename); return VMRuntime.nativeLoad(filename); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/Runtime.java/clean/core/src/classpath/java/java/lang/Runtime.java
|
return VMRuntime.nativeLoad(filename);
|
return VMRuntime.nativeLoad(filename, loader);
|
private static int loadLib(String filename) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkRead(filename); return VMRuntime.nativeLoad(filename); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/Runtime.java/clean/core/src/classpath/java/java/lang/Runtime.java
|
SecurityManager sm = SecurityManager.current; if (sm != null) sm.checkLink(libname); String filename; ClassLoader cl = VMSecurityManager.currentClassLoader(); if (cl != null) { filename = cl.findLibrary(libname); if (filename != null) { if (loadLib(filename) != 0) return; else throw new UnsatisfiedLinkError("Could not load library " + filename); } } filename = VMRuntime.mapLibraryName(libname); for (int i = 0; i < libpath.length; i++) if (loadLib(libpath[i] + filename) != 0) return; throw new UnsatisfiedLinkError("Could not find library " + libname + "."); }
|
loadLibrary(libname, VMStackWalker.getCallingClassLoader()); }
|
public void loadLibrary(String libname) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkLink(libname); String filename; ClassLoader cl = VMSecurityManager.currentClassLoader(); if (cl != null) { filename = cl.findLibrary(libname); if (filename != null) { if (loadLib(filename) != 0) return; else throw new UnsatisfiedLinkError("Could not load library " + filename); } } filename = VMRuntime.mapLibraryName(libname); for (int i = 0; i < libpath.length; i++) if (loadLib(libpath[i] + filename) != 0) return; throw new UnsatisfiedLinkError("Could not find library " + libname + "."); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c65f6a6914005749230b8f31c6890448761cd6f4/Runtime.java/clean/core/src/classpath/java/java/lang/Runtime.java
|
if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); }
|
if (in.available() < 5) throw new KeyAgreementException("not enough bytes for a private key in message");
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/IncomingMessage.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/IncomingMessage.java
|
{
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/IncomingMessage.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/IncomingMessage.java
|
|
}
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/IncomingMessage.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/IncomingMessage.java
|
|
IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); }
|
IKeyPairCodec kpc = getKeyPairCodec(keyTypeAndFormatID);
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/IncomingMessage.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/IncomingMessage.java
|
if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); }
|
if (in.available() < 5) throw new KeyAgreementException("not enough bytes for a public key in message");
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/IncomingMessage.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/IncomingMessage.java
|
{
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/IncomingMessage.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/IncomingMessage.java
|
|
}
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/IncomingMessage.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/IncomingMessage.java
|
|
IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); }
|
IKeyPairCodec kpc = getKeyPairCodec(keyTypeAndFormatID);
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/IncomingMessage.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/IncomingMessage.java
|
public void reset() { userData.setEnabled(false); userData.setText(""); //select.setSelected(false); all.setSelected(true); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/9d37884a41d03e0f09109f25894f74c9df2e594b/UserDataTabPanel.java/buggy/tn5250j/src/org/tn5250j/spoolfile/UserDataTabPanel.java
|
||
public void reset() { userData.setEnabled(false); userData.setText(""); //select.setSelected(false); all.setSelected(true); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/9d37884a41d03e0f09109f25894f74c9df2e594b/UserDataTabPanel.java/buggy/tn5250j/src/org/tn5250j/spoolfile/UserDataTabPanel.java
|
||
if (b.isFocusOwner())
|
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); SwingUtilities.calculateInnerArea(b, vr); String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), b.getText(), currentIcon(b), b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if ((b.getModel().isArmed() && b.getModel().isPressed()) || b.isSelected()) paintButtonPressed(g, b); else paintButtonNormal(g, vr, c); paintIcon(g, c, ir); if (text != null) paintText(g, b, tr, text); paintFocus(g, b, vr, tr, ir); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/72da40e5e4e3a49848a07aeb7fb7c8735af24ae0/BasicButtonUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicButtonUI.java
|
|
if (b.hasFocus() && b.isFocusPainted()) { Color saved_color = g.getColor(); g.setColor(focusColor); Rectangle focusRect = ir.union(tr); g.drawRect(focusRect.x, focusRect.y, focusRect.width, focusRect.height); g.setColor(saved_color); }
|
protected void paintFocus(Graphics g, AbstractButton b, Rectangle vr, Rectangle tr, Rectangle ir) { if (b.hasFocus() && b.isFocusPainted()) { Color saved_color = g.getColor(); g.setColor(focusColor); Rectangle focusRect = ir.union(tr); g.drawRect(focusRect.x, focusRect.y, focusRect.width, focusRect.height); g.setColor(saved_color); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/72da40e5e4e3a49848a07aeb7fb7c8735af24ae0/BasicButtonUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicButtonUI.java
|
|
public ActionMap() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/ActionMap.java/buggy/core/src/classpath/javax/javax/swing/ActionMap.java
|
||
String inputLine, outputLine;
|
private void getNewSessionOptions() { try { BufferedReader in = new BufferedReader( new InputStreamReader( socket.getInputStream())); String inputLine, outputLine; bootEvent = new BootEvent(this,in.readLine()); System.out.println(bootEvent.getNewSessionOptions()); fireBootEvent(); in.close(); socket.close(); } catch (IOException e) { e.printStackTrace(); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/BootStrapper.java/clean/tn5250j/src/org/tn5250j/BootStrapper.java
|
|
else throw new IllegalArgumentException();
|
public void addLayoutComponent(String key, Component component) { if (key == VIEWPORT) viewport = (JViewport) component; else if (key == VERTICAL_SCROLLBAR) vsb = (JScrollBar) component; else if (key == HORIZONTAL_SCROLLBAR) hsb = (JScrollBar) component; else if (key == ROW_HEADER) rowHead = (JViewport) component; else if (key == COLUMN_HEADER) colHead = (JViewport) component; else if (key == LOWER_RIGHT_CORNER) lowerRight = component; else if (key == UPPER_RIGHT_CORNER) upperRight = component; else if (key == LOWER_LEFT_CORNER) lowerLeft = component; else if (key == UPPER_LEFT_CORNER) upperLeft = component; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ScrollPaneLayout.java/buggy/core/src/classpath/javax/javax/swing/ScrollPaneLayout.java
|
|
Component newComponent) { return null;
|
Component newComponent) { if (oldComponent != null && oldComponent != newComponent) oldComponent.getParent().remove(oldComponent); return newComponent;
|
protected Component addSingletonComponent(Component oldComponent, Component newComponent) { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ScrollPaneLayout.java/buggy/core/src/classpath/javax/javax/swing/ScrollPaneLayout.java
|
Dimension viewSize = viewport.getViewSize();
|
Dimension viewSize = viewport.getViewSize();
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ScrollPaneLayout.java/buggy/core/src/classpath/javax/javax/swing/ScrollPaneLayout.java
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ScrollPaneLayout.java/buggy/core/src/classpath/javax/javax/swing/ScrollPaneLayout.java
|
||
vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2));
|
vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2));
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ScrollPaneLayout.java/buggy/core/src/classpath/javax/javax/swing/ScrollPaneLayout.java
|
hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3));
|
hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3));
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ScrollPaneLayout.java/buggy/core/src/classpath/javax/javax/swing/ScrollPaneLayout.java
|
viewportInsets = viewportBorder.getBorderInsets(parent);
|
viewportInsets = viewportBorder.getBorderInsets(parent);
|
public Dimension preferredLayoutSize(Container parent) { if (parent != null && parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); if (viewport != null) { Component view = null; Scrollable scr = null; Dimension pref = null; view = viewport.getView(); if (view != null && view instanceof Scrollable) scr = (Scrollable) view; if (scr != null) pref = scr.getPreferredScrollableViewportSize(); if (pref == null) pref = viewport.getPreferredSize(); if (pref != null) viewportSize.setSize(pref); } maybeSetPreferredSize(colHead, columnHeaderSize); maybeSetPreferredSize(rowHead, rowHeaderSize); maybeSetPreferredSize(vsb, verticalScrollBarSize); maybeSetPreferredSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ScrollPaneLayout.java/buggy/core/src/classpath/javax/javax/swing/ScrollPaneLayout.java
|
if (policy != HORIZONTAL_SCROLLBAR_AS_NEEDED && policy != HORIZONTAL_SCROLLBAR_NEVER && policy != HORIZONTAL_SCROLLBAR_ALWAYS) throw new IllegalArgumentException("Illegal Scrollbar Policy");
|
public void setHorizontalScrollBarPolicy(int policy) { hsbPolicy = policy; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ScrollPaneLayout.java/buggy/core/src/classpath/javax/javax/swing/ScrollPaneLayout.java
|
|
if (policy != VERTICAL_SCROLLBAR_AS_NEEDED && policy != VERTICAL_SCROLLBAR_NEVER && policy != VERTICAL_SCROLLBAR_ALWAYS) throw new IllegalArgumentException("Illegal Scrollbar Policy");
|
public void setVerticalScrollBarPolicy(int policy) { vsbPolicy = policy; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/ScrollPaneLayout.java/buggy/core/src/classpath/javax/javax/swing/ScrollPaneLayout.java
|
|
{ super.setLayout(new BorderLayout(1, 1));
|
{ super.setLayout(new BorderLayout(1, 1));
|
public JApplet() { super.setLayout(new BorderLayout(1, 1)); getRootPane(); // Will do set/create. initStageDone = true; // Init stage is now over. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JApplet.java/clean/core/src/classpath/javax/javax/swing/JApplet.java
|
}
|
}
|
public JApplet() { super.setLayout(new BorderLayout(1, 1)); getRootPane(); // Will do set/create. initStageDone = true; // Init stage is now over. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JApplet.java/clean/core/src/classpath/javax/javax/swing/JApplet.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.