rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
public void addConsumer(ImageConsumer ic) {
|
synchronized public void addConsumer(ImageConsumer ic) {
|
public void addConsumer(ImageConsumer ic) { consumers.add(ic); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/366de835b47a9e4d33bcb1512684f2561b1dad5f/JNodeToolkit.java/buggy/gui/src/awt/org/jnode/awt/JNodeToolkit.java
|
public boolean isConsumer(ImageConsumer ic) {
|
synchronized public boolean isConsumer(ImageConsumer ic) {
|
public boolean isConsumer(ImageConsumer ic) { return consumers.contains(ic); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/366de835b47a9e4d33bcb1512684f2561b1dad5f/JNodeToolkit.java/buggy/gui/src/awt/org/jnode/awt/JNodeToolkit.java
|
public void removeConsumer(ImageConsumer ic) {
|
synchronized public void removeConsumer(ImageConsumer ic) {
|
public void removeConsumer(ImageConsumer ic) { consumers.remove(ic); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/366de835b47a9e4d33bcb1512684f2561b1dad5f/JNodeToolkit.java/buggy/gui/src/awt/org/jnode/awt/JNodeToolkit.java
|
public void startProduction(ImageConsumer ic) {
|
synchronized public void startProduction(ImageConsumer ic) {
|
public void startProduction(ImageConsumer ic) { consumers.add(ic); for (ImageConsumer c : consumers) { c.imageComplete(ImageConsumer.IMAGEERROR); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/366de835b47a9e4d33bcb1512684f2561b1dad5f/JNodeToolkit.java/buggy/gui/src/awt/org/jnode/awt/JNodeToolkit.java
|
return -1;
|
return 1;
|
public int getWidth(ImageObserver observer) { return -1; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/366de835b47a9e4d33bcb1512684f2561b1dad5f/JNodeToolkit.java/buggy/gui/src/awt/org/jnode/awt/JNodeToolkit.java
|
return null;
|
return getFontManager().createFont(format, stream);
|
public Font createFont(int format, InputStream stream) { // TODO Auto-generated method stub return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/366de835b47a9e4d33bcb1512684f2561b1dad5f/JNodeToolkit.java/buggy/gui/src/awt/org/jnode/awt/JNodeToolkit.java
|
ImageProducer producer = new FilteredImageSource(this.getSource(), new ReplicateScaleFilter(width, height)); return Toolkit.getDefaultToolkit().createImage(producer);
|
filter = new ReplicateScaleFilter(width, height); break; case SCALE_AREA_AVERAGING: filter = new AreaAveragingScaleFilter(width, height); break;
|
public Image getScaledInstance(int width, int height, int flags) { switch (flags) { case SCALE_DEFAULT: case SCALE_FAST: case SCALE_REPLICATE: ImageProducer producer = new FilteredImageSource(this.getSource(), new ReplicateScaleFilter(width, height)); return Toolkit.getDefaultToolkit().createImage(producer); case SCALE_SMOOTH: case SCALE_AREA_AVERAGING: default: throw new Error("not implemented"); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Image.java/buggy/core/src/classpath/java/java/awt/Image.java
|
case SCALE_AREA_AVERAGING:
|
throw new Error("SCALE_SMOOTH: not implemented");
|
public Image getScaledInstance(int width, int height, int flags) { switch (flags) { case SCALE_DEFAULT: case SCALE_FAST: case SCALE_REPLICATE: ImageProducer producer = new FilteredImageSource(this.getSource(), new ReplicateScaleFilter(width, height)); return Toolkit.getDefaultToolkit().createImage(producer); case SCALE_SMOOTH: case SCALE_AREA_AVERAGING: default: throw new Error("not implemented"); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Image.java/buggy/core/src/classpath/java/java/awt/Image.java
|
throw new Error("not implemented");
|
throw new Error("Unknown flag or not implemented: " + flags);
|
public Image getScaledInstance(int width, int height, int flags) { switch (flags) { case SCALE_DEFAULT: case SCALE_FAST: case SCALE_REPLICATE: ImageProducer producer = new FilteredImageSource(this.getSource(), new ReplicateScaleFilter(width, height)); return Toolkit.getDefaultToolkit().createImage(producer); case SCALE_SMOOTH: case SCALE_AREA_AVERAGING: default: throw new Error("not implemented"); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Image.java/buggy/core/src/classpath/java/java/awt/Image.java
|
ImageProducer producer = new FilteredImageSource(getSource(), filter); return Toolkit.getDefaultToolkit().createImage(producer);
|
public Image getScaledInstance(int width, int height, int flags) { switch (flags) { case SCALE_DEFAULT: case SCALE_FAST: case SCALE_REPLICATE: ImageProducer producer = new FilteredImageSource(this.getSource(), new ReplicateScaleFilter(width, height)); return Toolkit.getDefaultToolkit().createImage(producer); case SCALE_SMOOTH: case SCALE_AREA_AVERAGING: default: throw new Error("not implemented"); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Image.java/buggy/core/src/classpath/java/java/awt/Image.java
|
|
public JNodeFontPeer(String name, Map attrs) { super(name, attrs);
|
public JNodeFontPeer(String name, int style, int size) { super(name, style, size);
|
public JNodeFontPeer(String name, Map attrs) { super(name, attrs); // TODO Auto-generated constructor stub }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/JNodeFontPeer.java/buggy/gui/src/awt/org/jnode/awt/font/JNodeFontPeer.java
|
String taggedIndent = indent; if (writeHrefAttribute) { dataOutputWriter.write("<"+nodeName+">"); taggedIndent = ""; }
|
protected String basicXMLWriter ( Writer outputWriter, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) throws java.io.IOException { // init some internals boolean writeHrefAttribute = false; OutputStream dataOutputStream = null; Writer dataOutputWriter = null; boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; // get the node name String nodeName = getClassXDFNodeName(); if (newNodeNameString != null) nodeName = newNodeNameString; // indent up one indent = indent + strIndent; //open node if (niceOutput) outputWriter.write( indent); outputWriter.write("<" + nodeName ); Entity hrefObj = getHref(); XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); // Well here decide if we need to write out to another file, // In practice the systemId may correspond to an internet URI, // and we cant always write to that (!). Its not clear under which // situations we do want to do so. :P For the time being we just // take the following 'dumb' approach. if (hrefObj != null) { String fileName = hrefObj.getSystemId(); String hrefName = hrefObj.getName(); // Some parsers return systemId with the 'file:' prefix. Java // doenst currently understand this so we need to peal it off. int index = fileName.indexOf("file:"); if (index == 0) fileName = fileName.substring(5); if(hrefName == null) { Log.errorln("Error: href object in dataCube lacks name. Data being written into metadata instead.\n"); } else if (fileName != null) { writeHrefAttribute = true; try { dataOutputStream = new FileOutputStream(fileName); } catch (IOException e) { //oops, something. is wrong, writ out to the passed in OutputStream Log.warnln("Error: cannot open file:"+fileName+" for writing. Data being written into metadata.\n"); writeHrefAttribute = false; } } else { Log.warnln("Error: href:"+hrefName+" lacks systemId, cannot write data to a separate file."); Log.warnln("Data are being written into metadata instead.\n"); writeHrefAttribute = false; } } // write data node attributes if (writeHrefAttribute) { outputWriter.write( " "+HREF_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, hrefObj.getName()); outputWriter.write( "\""); } String checksum = getChecksum(); if (checksum != null) { outputWriter.write( " "+CHECKSUM_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, checksum.toString()); outputWriter.write( "\""); } /* String encoding = getEncoding(); if (encoding != null) { outputWriter.write( " "+ENCODING_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, encoding.toString()); outputWriter.write( "\""); }*/ String compress = getCompression(); if (compress != null && dataOutputStream != null ) { outputWriter.write( " "+COMPRESSION_TYPE_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, compress.toString()); outputWriter.write( "\""); if (hrefObj == null) { Log.errorln("Cant write compressed data within the XML file (use href instead for an external file). Aborting write."); return nodeName; } // change the data outputWriter to match if (compress.equals(Constants.DATA_COMPRESSION_GZIP)) { try { dataOutputStream = new GZIPOutputStream(dataOutputStream); } catch (java.io.IOException e) { Log.errorln("Cant open compressed (GZIP) outputstream to write to an href. Aborting."); return nodeName; } } else if (compress.equals(Constants.DATA_COMPRESSION_ZIP)) { dataOutputStream = new ZipOutputStream(dataOutputStream); try { ((ZipOutputStream) dataOutputStream).putNextEntry(new ZipEntry(hrefObj.getSystemId())); // write only to the first entry for now } catch (java.io.IOException e) { Log.errorln("Cant open compressed (ZIP) outputstream to write to an href. Aborting."); return nodeName; } } else { Log.errorln("Error: cant write data with compression type:"+compress+". Ignoring request."); return nodeName; } } if (writeHrefAttribute) outputWriter.write("/>"); //we just close the data node now else outputWriter.write(">"); //end of opening code // Locator currentLocator = parentArray.createLocator(); // List axisList = parentArray.getAxes(); List axisList = readObj.getIOAxesOrder(); if (axisList == null || axisList.size() == 0) { // we dont have axes to direct the write?!?. Well, then, we // wont be writing Data to either the XML file or an Href Log.errorln("No axes defined! Cannot write data. Ignoring request."); } else { // writing Data to either the XML file or an Href // // Init important dataFormat information into arrays, this // will help speed up long writes. Each entry corresponds to // cached information about a particular dataFormat object. In // the case where no FieldAxis (e.g. Fields) exist within the array, // then we only have 1 entry in each of these arrays. String[] noDataValues; //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String[] formatPattern; // cache of Java Formatter patterns for correct // formatting of output values. String[] negExponentialPattern; // Stupid Java DecimalFormatter cant work properly // on exponential data, so we compensate with this. String[] intFlag; // Integer format flag int[] numOfBytes; // number of bytes each data format has. DataFormat dataFormat[] = parentArray.getDataFormatList(); if (parentArray.hasFieldAxis()) { // If we have field axis then prepare to init multiple size arrays List fields = parentArray.getFieldAxis().getFields(); int nrofDataFormats = fields.size(); noDataValues = new String[nrofDataFormats]; formatPattern = new String[nrofDataFormats]; intFlag = new String[nrofDataFormats]; negExponentialPattern = new String[nrofDataFormats]; numOfBytes = new int[nrofDataFormats]; // now assign values for (int i = 0; i < nrofDataFormats; i++) { formatPattern[i] = dataFormat[i].getFormatPattern(); numOfBytes[i] = dataFormat[i].numOfBytes(); Field field = (Field) fields.get(i); if (field != null && field.getNoDataValue() != null) noDataValues[i] = field.getNoDataValue().toString(); if (dataFormat[i] instanceof FloatDataFormat) negExponentialPattern[i] = ((FloatDataFormat) dataFormat[i]).getNegativeExponentFormatPattern(); else negExponentialPattern[i] = null; if (dataFormat[i] instanceof IntegerDataFormat) intFlag[i] = ((IntegerDataFormat) dataFormat[i]).getType(); else intFlag[i] = null; } } else { // no field axis? then only one dataFormat and we get it from the Array // init single size arrays noDataValues = new String[1]; formatPattern = new String[1]; negExponentialPattern = new String[1]; intFlag = new String[1]; numOfBytes = new int[1]; // assign values formatPattern[0] = dataFormat[0].getFormatPattern(); numOfBytes[0] = dataFormat[0].numOfBytes(); String value = (String) null; if (parentArray.getNoDataValue() != null) { value = parentArray.getNoDataValue().toString(); // this is a HACK } noDataValues[0] = value; if (dataFormat[0] instanceof FloatDataFormat) negExponentialPattern[0] = ((FloatDataFormat) dataFormat[0]).getNegativeExponentFormatPattern(); else negExponentialPattern[0] = null; if (dataFormat[0] instanceof IntegerDataFormat) intFlag[0] = ((IntegerDataFormat) dataFormat[0]).getType(); else intFlag[0] = null; } // init the dataOutputWriter properly. To a file or to the same writer as the // rest of the XML metadata? if (dataOutputStream != null) { // if this exists, then we are re-directing to an outside file. // wrap the outputstream (compressed or otherwise) with bufferedWriter dataOutputWriter = new BufferedWriter(new OutputStreamWriter(dataOutputStream)); } else { // goes to same spot as meta-data, e.g. just use the XML output writer dataOutputWriter = outputWriter; } // some info about the format Object String endian = readObj.getEndian(); // now, based on outputstyle, write out the data if (readObj instanceof TaggedXMLDataIOStyle) { String[] tags = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int[] axes = getMaxDataIndex(readObj); int stop = axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] = axes[stop - 1 - i]; } int whichTagIsFieldAxis = -1; if (parentArray.hasFieldAxis()) { for (int i = 0; i < stop; i++) { whichTagIsFieldAxis = i; AxisInterface axisObj = ((TaggedXMLDataIOStyle) readObj).getAxisByTag("d" + i); if (axisObj instanceof FieldAxis) { break; } } } Locator taggedLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) axisList.get(0); int nrofDataFormats = dataFormat.length; writeTaggedData( dataOutputWriter, taggedLocator, indent, axisLength, tags, 0, 0, fastestAxis, noDataValues, nrofDataFormats, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, whichTagIsFieldAxis ); // this *shouldnt* be needed, but tests with both Java 1.2.2 and 1.3.0 // on SUN and Linux platforms show that it is. Hopefully we can remove // this in the future. dataOutputWriter.flush(); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { AxisInterface fastestAxis = (AxisInterface) axisList.get(0); writeDelimitedData( dataOutputWriter, (DelimitedXMLDataIOStyle) readObj, fastestAxis, noDataValues, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, writeHrefAttribute ? false : true ); } else { writeFormattedData( dataOutputWriter, (FormattedXMLDataIOStyle) readObj, noDataValues, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, writeHrefAttribute ? false : true ); } if (writeHrefAttribute) { try { // should work as flush() too, so no call needed here. dataOutputWriter.close(); } catch (java.io.IOException e) { Log.errorln("Cant close dataOuputStream! Aborting."); return nodeName; } } } } // finish writing data to XML/Href //close the data section appropriately if (!writeHrefAttribute && niceOutput) { outputWriter.write( Constants.NEW_LINE+indent); } // If we didnt write Href attribute, then means that data // were put into document. We need to close the open data // node appropriately. if (!writeHrefAttribute) outputWriter.write( "</" + nodeName + ">"); // if (niceOutput) // outputWriter.write( Constants.NEW_LINE); return nodeName; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/c841e18257a93c237a9c9e594943c8c1ef654c90/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
|
|
indent,
|
taggedIndent,
|
protected String basicXMLWriter ( Writer outputWriter, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) throws java.io.IOException { // init some internals boolean writeHrefAttribute = false; OutputStream dataOutputStream = null; Writer dataOutputWriter = null; boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; // get the node name String nodeName = getClassXDFNodeName(); if (newNodeNameString != null) nodeName = newNodeNameString; // indent up one indent = indent + strIndent; //open node if (niceOutput) outputWriter.write( indent); outputWriter.write("<" + nodeName ); Entity hrefObj = getHref(); XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); // Well here decide if we need to write out to another file, // In practice the systemId may correspond to an internet URI, // and we cant always write to that (!). Its not clear under which // situations we do want to do so. :P For the time being we just // take the following 'dumb' approach. if (hrefObj != null) { String fileName = hrefObj.getSystemId(); String hrefName = hrefObj.getName(); // Some parsers return systemId with the 'file:' prefix. Java // doenst currently understand this so we need to peal it off. int index = fileName.indexOf("file:"); if (index == 0) fileName = fileName.substring(5); if(hrefName == null) { Log.errorln("Error: href object in dataCube lacks name. Data being written into metadata instead.\n"); } else if (fileName != null) { writeHrefAttribute = true; try { dataOutputStream = new FileOutputStream(fileName); } catch (IOException e) { //oops, something. is wrong, writ out to the passed in OutputStream Log.warnln("Error: cannot open file:"+fileName+" for writing. Data being written into metadata.\n"); writeHrefAttribute = false; } } else { Log.warnln("Error: href:"+hrefName+" lacks systemId, cannot write data to a separate file."); Log.warnln("Data are being written into metadata instead.\n"); writeHrefAttribute = false; } } // write data node attributes if (writeHrefAttribute) { outputWriter.write( " "+HREF_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, hrefObj.getName()); outputWriter.write( "\""); } String checksum = getChecksum(); if (checksum != null) { outputWriter.write( " "+CHECKSUM_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, checksum.toString()); outputWriter.write( "\""); } /* String encoding = getEncoding(); if (encoding != null) { outputWriter.write( " "+ENCODING_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, encoding.toString()); outputWriter.write( "\""); }*/ String compress = getCompression(); if (compress != null && dataOutputStream != null ) { outputWriter.write( " "+COMPRESSION_TYPE_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, compress.toString()); outputWriter.write( "\""); if (hrefObj == null) { Log.errorln("Cant write compressed data within the XML file (use href instead for an external file). Aborting write."); return nodeName; } // change the data outputWriter to match if (compress.equals(Constants.DATA_COMPRESSION_GZIP)) { try { dataOutputStream = new GZIPOutputStream(dataOutputStream); } catch (java.io.IOException e) { Log.errorln("Cant open compressed (GZIP) outputstream to write to an href. Aborting."); return nodeName; } } else if (compress.equals(Constants.DATA_COMPRESSION_ZIP)) { dataOutputStream = new ZipOutputStream(dataOutputStream); try { ((ZipOutputStream) dataOutputStream).putNextEntry(new ZipEntry(hrefObj.getSystemId())); // write only to the first entry for now } catch (java.io.IOException e) { Log.errorln("Cant open compressed (ZIP) outputstream to write to an href. Aborting."); return nodeName; } } else { Log.errorln("Error: cant write data with compression type:"+compress+". Ignoring request."); return nodeName; } } if (writeHrefAttribute) outputWriter.write("/>"); //we just close the data node now else outputWriter.write(">"); //end of opening code // Locator currentLocator = parentArray.createLocator(); // List axisList = parentArray.getAxes(); List axisList = readObj.getIOAxesOrder(); if (axisList == null || axisList.size() == 0) { // we dont have axes to direct the write?!?. Well, then, we // wont be writing Data to either the XML file or an Href Log.errorln("No axes defined! Cannot write data. Ignoring request."); } else { // writing Data to either the XML file or an Href // // Init important dataFormat information into arrays, this // will help speed up long writes. Each entry corresponds to // cached information about a particular dataFormat object. In // the case where no FieldAxis (e.g. Fields) exist within the array, // then we only have 1 entry in each of these arrays. String[] noDataValues; //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String[] formatPattern; // cache of Java Formatter patterns for correct // formatting of output values. String[] negExponentialPattern; // Stupid Java DecimalFormatter cant work properly // on exponential data, so we compensate with this. String[] intFlag; // Integer format flag int[] numOfBytes; // number of bytes each data format has. DataFormat dataFormat[] = parentArray.getDataFormatList(); if (parentArray.hasFieldAxis()) { // If we have field axis then prepare to init multiple size arrays List fields = parentArray.getFieldAxis().getFields(); int nrofDataFormats = fields.size(); noDataValues = new String[nrofDataFormats]; formatPattern = new String[nrofDataFormats]; intFlag = new String[nrofDataFormats]; negExponentialPattern = new String[nrofDataFormats]; numOfBytes = new int[nrofDataFormats]; // now assign values for (int i = 0; i < nrofDataFormats; i++) { formatPattern[i] = dataFormat[i].getFormatPattern(); numOfBytes[i] = dataFormat[i].numOfBytes(); Field field = (Field) fields.get(i); if (field != null && field.getNoDataValue() != null) noDataValues[i] = field.getNoDataValue().toString(); if (dataFormat[i] instanceof FloatDataFormat) negExponentialPattern[i] = ((FloatDataFormat) dataFormat[i]).getNegativeExponentFormatPattern(); else negExponentialPattern[i] = null; if (dataFormat[i] instanceof IntegerDataFormat) intFlag[i] = ((IntegerDataFormat) dataFormat[i]).getType(); else intFlag[i] = null; } } else { // no field axis? then only one dataFormat and we get it from the Array // init single size arrays noDataValues = new String[1]; formatPattern = new String[1]; negExponentialPattern = new String[1]; intFlag = new String[1]; numOfBytes = new int[1]; // assign values formatPattern[0] = dataFormat[0].getFormatPattern(); numOfBytes[0] = dataFormat[0].numOfBytes(); String value = (String) null; if (parentArray.getNoDataValue() != null) { value = parentArray.getNoDataValue().toString(); // this is a HACK } noDataValues[0] = value; if (dataFormat[0] instanceof FloatDataFormat) negExponentialPattern[0] = ((FloatDataFormat) dataFormat[0]).getNegativeExponentFormatPattern(); else negExponentialPattern[0] = null; if (dataFormat[0] instanceof IntegerDataFormat) intFlag[0] = ((IntegerDataFormat) dataFormat[0]).getType(); else intFlag[0] = null; } // init the dataOutputWriter properly. To a file or to the same writer as the // rest of the XML metadata? if (dataOutputStream != null) { // if this exists, then we are re-directing to an outside file. // wrap the outputstream (compressed or otherwise) with bufferedWriter dataOutputWriter = new BufferedWriter(new OutputStreamWriter(dataOutputStream)); } else { // goes to same spot as meta-data, e.g. just use the XML output writer dataOutputWriter = outputWriter; } // some info about the format Object String endian = readObj.getEndian(); // now, based on outputstyle, write out the data if (readObj instanceof TaggedXMLDataIOStyle) { String[] tags = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int[] axes = getMaxDataIndex(readObj); int stop = axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] = axes[stop - 1 - i]; } int whichTagIsFieldAxis = -1; if (parentArray.hasFieldAxis()) { for (int i = 0; i < stop; i++) { whichTagIsFieldAxis = i; AxisInterface axisObj = ((TaggedXMLDataIOStyle) readObj).getAxisByTag("d" + i); if (axisObj instanceof FieldAxis) { break; } } } Locator taggedLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) axisList.get(0); int nrofDataFormats = dataFormat.length; writeTaggedData( dataOutputWriter, taggedLocator, indent, axisLength, tags, 0, 0, fastestAxis, noDataValues, nrofDataFormats, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, whichTagIsFieldAxis ); // this *shouldnt* be needed, but tests with both Java 1.2.2 and 1.3.0 // on SUN and Linux platforms show that it is. Hopefully we can remove // this in the future. dataOutputWriter.flush(); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { AxisInterface fastestAxis = (AxisInterface) axisList.get(0); writeDelimitedData( dataOutputWriter, (DelimitedXMLDataIOStyle) readObj, fastestAxis, noDataValues, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, writeHrefAttribute ? false : true ); } else { writeFormattedData( dataOutputWriter, (FormattedXMLDataIOStyle) readObj, noDataValues, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, writeHrefAttribute ? false : true ); } if (writeHrefAttribute) { try { // should work as flush() too, so no call needed here. dataOutputWriter.close(); } catch (java.io.IOException e) { Log.errorln("Cant close dataOuputStream! Aborting."); return nodeName; } } } } // finish writing data to XML/Href //close the data section appropriately if (!writeHrefAttribute && niceOutput) { outputWriter.write( Constants.NEW_LINE+indent); } // If we didnt write Href attribute, then means that data // were put into document. We need to close the open data // node appropriately. if (!writeHrefAttribute) outputWriter.write( "</" + nodeName + ">"); // if (niceOutput) // outputWriter.write( Constants.NEW_LINE); return nodeName; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/c841e18257a93c237a9c9e594943c8c1ef654c90/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
|
if (writeHrefAttribute) { if (niceOutput) dataOutputWriter.write(Constants.NEW_LINE); dataOutputWriter.write("</"+nodeName+">"); }
|
protected String basicXMLWriter ( Writer outputWriter, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) throws java.io.IOException { // init some internals boolean writeHrefAttribute = false; OutputStream dataOutputStream = null; Writer dataOutputWriter = null; boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; // get the node name String nodeName = getClassXDFNodeName(); if (newNodeNameString != null) nodeName = newNodeNameString; // indent up one indent = indent + strIndent; //open node if (niceOutput) outputWriter.write( indent); outputWriter.write("<" + nodeName ); Entity hrefObj = getHref(); XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); // Well here decide if we need to write out to another file, // In practice the systemId may correspond to an internet URI, // and we cant always write to that (!). Its not clear under which // situations we do want to do so. :P For the time being we just // take the following 'dumb' approach. if (hrefObj != null) { String fileName = hrefObj.getSystemId(); String hrefName = hrefObj.getName(); // Some parsers return systemId with the 'file:' prefix. Java // doenst currently understand this so we need to peal it off. int index = fileName.indexOf("file:"); if (index == 0) fileName = fileName.substring(5); if(hrefName == null) { Log.errorln("Error: href object in dataCube lacks name. Data being written into metadata instead.\n"); } else if (fileName != null) { writeHrefAttribute = true; try { dataOutputStream = new FileOutputStream(fileName); } catch (IOException e) { //oops, something. is wrong, writ out to the passed in OutputStream Log.warnln("Error: cannot open file:"+fileName+" for writing. Data being written into metadata.\n"); writeHrefAttribute = false; } } else { Log.warnln("Error: href:"+hrefName+" lacks systemId, cannot write data to a separate file."); Log.warnln("Data are being written into metadata instead.\n"); writeHrefAttribute = false; } } // write data node attributes if (writeHrefAttribute) { outputWriter.write( " "+HREF_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, hrefObj.getName()); outputWriter.write( "\""); } String checksum = getChecksum(); if (checksum != null) { outputWriter.write( " "+CHECKSUM_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, checksum.toString()); outputWriter.write( "\""); } /* String encoding = getEncoding(); if (encoding != null) { outputWriter.write( " "+ENCODING_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, encoding.toString()); outputWriter.write( "\""); }*/ String compress = getCompression(); if (compress != null && dataOutputStream != null ) { outputWriter.write( " "+COMPRESSION_TYPE_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, compress.toString()); outputWriter.write( "\""); if (hrefObj == null) { Log.errorln("Cant write compressed data within the XML file (use href instead for an external file). Aborting write."); return nodeName; } // change the data outputWriter to match if (compress.equals(Constants.DATA_COMPRESSION_GZIP)) { try { dataOutputStream = new GZIPOutputStream(dataOutputStream); } catch (java.io.IOException e) { Log.errorln("Cant open compressed (GZIP) outputstream to write to an href. Aborting."); return nodeName; } } else if (compress.equals(Constants.DATA_COMPRESSION_ZIP)) { dataOutputStream = new ZipOutputStream(dataOutputStream); try { ((ZipOutputStream) dataOutputStream).putNextEntry(new ZipEntry(hrefObj.getSystemId())); // write only to the first entry for now } catch (java.io.IOException e) { Log.errorln("Cant open compressed (ZIP) outputstream to write to an href. Aborting."); return nodeName; } } else { Log.errorln("Error: cant write data with compression type:"+compress+". Ignoring request."); return nodeName; } } if (writeHrefAttribute) outputWriter.write("/>"); //we just close the data node now else outputWriter.write(">"); //end of opening code // Locator currentLocator = parentArray.createLocator(); // List axisList = parentArray.getAxes(); List axisList = readObj.getIOAxesOrder(); if (axisList == null || axisList.size() == 0) { // we dont have axes to direct the write?!?. Well, then, we // wont be writing Data to either the XML file or an Href Log.errorln("No axes defined! Cannot write data. Ignoring request."); } else { // writing Data to either the XML file or an Href // // Init important dataFormat information into arrays, this // will help speed up long writes. Each entry corresponds to // cached information about a particular dataFormat object. In // the case where no FieldAxis (e.g. Fields) exist within the array, // then we only have 1 entry in each of these arrays. String[] noDataValues; //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String[] formatPattern; // cache of Java Formatter patterns for correct // formatting of output values. String[] negExponentialPattern; // Stupid Java DecimalFormatter cant work properly // on exponential data, so we compensate with this. String[] intFlag; // Integer format flag int[] numOfBytes; // number of bytes each data format has. DataFormat dataFormat[] = parentArray.getDataFormatList(); if (parentArray.hasFieldAxis()) { // If we have field axis then prepare to init multiple size arrays List fields = parentArray.getFieldAxis().getFields(); int nrofDataFormats = fields.size(); noDataValues = new String[nrofDataFormats]; formatPattern = new String[nrofDataFormats]; intFlag = new String[nrofDataFormats]; negExponentialPattern = new String[nrofDataFormats]; numOfBytes = new int[nrofDataFormats]; // now assign values for (int i = 0; i < nrofDataFormats; i++) { formatPattern[i] = dataFormat[i].getFormatPattern(); numOfBytes[i] = dataFormat[i].numOfBytes(); Field field = (Field) fields.get(i); if (field != null && field.getNoDataValue() != null) noDataValues[i] = field.getNoDataValue().toString(); if (dataFormat[i] instanceof FloatDataFormat) negExponentialPattern[i] = ((FloatDataFormat) dataFormat[i]).getNegativeExponentFormatPattern(); else negExponentialPattern[i] = null; if (dataFormat[i] instanceof IntegerDataFormat) intFlag[i] = ((IntegerDataFormat) dataFormat[i]).getType(); else intFlag[i] = null; } } else { // no field axis? then only one dataFormat and we get it from the Array // init single size arrays noDataValues = new String[1]; formatPattern = new String[1]; negExponentialPattern = new String[1]; intFlag = new String[1]; numOfBytes = new int[1]; // assign values formatPattern[0] = dataFormat[0].getFormatPattern(); numOfBytes[0] = dataFormat[0].numOfBytes(); String value = (String) null; if (parentArray.getNoDataValue() != null) { value = parentArray.getNoDataValue().toString(); // this is a HACK } noDataValues[0] = value; if (dataFormat[0] instanceof FloatDataFormat) negExponentialPattern[0] = ((FloatDataFormat) dataFormat[0]).getNegativeExponentFormatPattern(); else negExponentialPattern[0] = null; if (dataFormat[0] instanceof IntegerDataFormat) intFlag[0] = ((IntegerDataFormat) dataFormat[0]).getType(); else intFlag[0] = null; } // init the dataOutputWriter properly. To a file or to the same writer as the // rest of the XML metadata? if (dataOutputStream != null) { // if this exists, then we are re-directing to an outside file. // wrap the outputstream (compressed or otherwise) with bufferedWriter dataOutputWriter = new BufferedWriter(new OutputStreamWriter(dataOutputStream)); } else { // goes to same spot as meta-data, e.g. just use the XML output writer dataOutputWriter = outputWriter; } // some info about the format Object String endian = readObj.getEndian(); // now, based on outputstyle, write out the data if (readObj instanceof TaggedXMLDataIOStyle) { String[] tags = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int[] axes = getMaxDataIndex(readObj); int stop = axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] = axes[stop - 1 - i]; } int whichTagIsFieldAxis = -1; if (parentArray.hasFieldAxis()) { for (int i = 0; i < stop; i++) { whichTagIsFieldAxis = i; AxisInterface axisObj = ((TaggedXMLDataIOStyle) readObj).getAxisByTag("d" + i); if (axisObj instanceof FieldAxis) { break; } } } Locator taggedLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) axisList.get(0); int nrofDataFormats = dataFormat.length; writeTaggedData( dataOutputWriter, taggedLocator, indent, axisLength, tags, 0, 0, fastestAxis, noDataValues, nrofDataFormats, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, whichTagIsFieldAxis ); // this *shouldnt* be needed, but tests with both Java 1.2.2 and 1.3.0 // on SUN and Linux platforms show that it is. Hopefully we can remove // this in the future. dataOutputWriter.flush(); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { AxisInterface fastestAxis = (AxisInterface) axisList.get(0); writeDelimitedData( dataOutputWriter, (DelimitedXMLDataIOStyle) readObj, fastestAxis, noDataValues, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, writeHrefAttribute ? false : true ); } else { writeFormattedData( dataOutputWriter, (FormattedXMLDataIOStyle) readObj, noDataValues, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, writeHrefAttribute ? false : true ); } if (writeHrefAttribute) { try { // should work as flush() too, so no call needed here. dataOutputWriter.close(); } catch (java.io.IOException e) { Log.errorln("Cant close dataOuputStream! Aborting."); return nodeName; } } } } // finish writing data to XML/Href //close the data section appropriately if (!writeHrefAttribute && niceOutput) { outputWriter.write( Constants.NEW_LINE+indent); } // If we didnt write Href attribute, then means that data // were put into document. We need to close the open data // node appropriately. if (!writeHrefAttribute) outputWriter.write( "</" + nodeName + ">"); // if (niceOutput) // outputWriter.write( Constants.NEW_LINE); return nodeName; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/c841e18257a93c237a9c9e594943c8c1ef654c90/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
|
|
protected String basicXMLWriter ( Writer outputWriter, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) throws java.io.IOException { // init some internals boolean writeHrefAttribute = false; OutputStream dataOutputStream = null; Writer dataOutputWriter = null; boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; // get the node name String nodeName = getClassXDFNodeName(); if (newNodeNameString != null) nodeName = newNodeNameString; // indent up one indent = indent + strIndent; //open node if (niceOutput) outputWriter.write( indent); outputWriter.write("<" + nodeName ); Entity hrefObj = getHref(); XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); // Well here decide if we need to write out to another file, // In practice the systemId may correspond to an internet URI, // and we cant always write to that (!). Its not clear under which // situations we do want to do so. :P For the time being we just // take the following 'dumb' approach. if (hrefObj != null) { String fileName = hrefObj.getSystemId(); String hrefName = hrefObj.getName(); // Some parsers return systemId with the 'file:' prefix. Java // doenst currently understand this so we need to peal it off. int index = fileName.indexOf("file:"); if (index == 0) fileName = fileName.substring(5); if(hrefName == null) { Log.errorln("Error: href object in dataCube lacks name. Data being written into metadata instead.\n"); } else if (fileName != null) { writeHrefAttribute = true; try { dataOutputStream = new FileOutputStream(fileName); } catch (IOException e) { //oops, something. is wrong, writ out to the passed in OutputStream Log.warnln("Error: cannot open file:"+fileName+" for writing. Data being written into metadata.\n"); writeHrefAttribute = false; } } else { Log.warnln("Error: href:"+hrefName+" lacks systemId, cannot write data to a separate file."); Log.warnln("Data are being written into metadata instead.\n"); writeHrefAttribute = false; } } // write data node attributes if (writeHrefAttribute) { outputWriter.write( " "+HREF_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, hrefObj.getName()); outputWriter.write( "\""); } String checksum = getChecksum(); if (checksum != null) { outputWriter.write( " "+CHECKSUM_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, checksum.toString()); outputWriter.write( "\""); } /* String encoding = getEncoding(); if (encoding != null) { outputWriter.write( " "+ENCODING_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, encoding.toString()); outputWriter.write( "\""); }*/ String compress = getCompression(); if (compress != null && dataOutputStream != null ) { outputWriter.write( " "+COMPRESSION_TYPE_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputWriter, compress.toString()); outputWriter.write( "\""); if (hrefObj == null) { Log.errorln("Cant write compressed data within the XML file (use href instead for an external file). Aborting write."); return nodeName; } // change the data outputWriter to match if (compress.equals(Constants.DATA_COMPRESSION_GZIP)) { try { dataOutputStream = new GZIPOutputStream(dataOutputStream); } catch (java.io.IOException e) { Log.errorln("Cant open compressed (GZIP) outputstream to write to an href. Aborting."); return nodeName; } } else if (compress.equals(Constants.DATA_COMPRESSION_ZIP)) { dataOutputStream = new ZipOutputStream(dataOutputStream); try { ((ZipOutputStream) dataOutputStream).putNextEntry(new ZipEntry(hrefObj.getSystemId())); // write only to the first entry for now } catch (java.io.IOException e) { Log.errorln("Cant open compressed (ZIP) outputstream to write to an href. Aborting."); return nodeName; } } else { Log.errorln("Error: cant write data with compression type:"+compress+". Ignoring request."); return nodeName; } } if (writeHrefAttribute) outputWriter.write("/>"); //we just close the data node now else outputWriter.write(">"); //end of opening code // Locator currentLocator = parentArray.createLocator(); // List axisList = parentArray.getAxes(); List axisList = readObj.getIOAxesOrder(); if (axisList == null || axisList.size() == 0) { // we dont have axes to direct the write?!?. Well, then, we // wont be writing Data to either the XML file or an Href Log.errorln("No axes defined! Cannot write data. Ignoring request."); } else { // writing Data to either the XML file or an Href // // Init important dataFormat information into arrays, this // will help speed up long writes. Each entry corresponds to // cached information about a particular dataFormat object. In // the case where no FieldAxis (e.g. Fields) exist within the array, // then we only have 1 entry in each of these arrays. String[] noDataValues; //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String[] formatPattern; // cache of Java Formatter patterns for correct // formatting of output values. String[] negExponentialPattern; // Stupid Java DecimalFormatter cant work properly // on exponential data, so we compensate with this. String[] intFlag; // Integer format flag int[] numOfBytes; // number of bytes each data format has. DataFormat dataFormat[] = parentArray.getDataFormatList(); if (parentArray.hasFieldAxis()) { // If we have field axis then prepare to init multiple size arrays List fields = parentArray.getFieldAxis().getFields(); int nrofDataFormats = fields.size(); noDataValues = new String[nrofDataFormats]; formatPattern = new String[nrofDataFormats]; intFlag = new String[nrofDataFormats]; negExponentialPattern = new String[nrofDataFormats]; numOfBytes = new int[nrofDataFormats]; // now assign values for (int i = 0; i < nrofDataFormats; i++) { formatPattern[i] = dataFormat[i].getFormatPattern(); numOfBytes[i] = dataFormat[i].numOfBytes(); Field field = (Field) fields.get(i); if (field != null && field.getNoDataValue() != null) noDataValues[i] = field.getNoDataValue().toString(); if (dataFormat[i] instanceof FloatDataFormat) negExponentialPattern[i] = ((FloatDataFormat) dataFormat[i]).getNegativeExponentFormatPattern(); else negExponentialPattern[i] = null; if (dataFormat[i] instanceof IntegerDataFormat) intFlag[i] = ((IntegerDataFormat) dataFormat[i]).getType(); else intFlag[i] = null; } } else { // no field axis? then only one dataFormat and we get it from the Array // init single size arrays noDataValues = new String[1]; formatPattern = new String[1]; negExponentialPattern = new String[1]; intFlag = new String[1]; numOfBytes = new int[1]; // assign values formatPattern[0] = dataFormat[0].getFormatPattern(); numOfBytes[0] = dataFormat[0].numOfBytes(); String value = (String) null; if (parentArray.getNoDataValue() != null) { value = parentArray.getNoDataValue().toString(); // this is a HACK } noDataValues[0] = value; if (dataFormat[0] instanceof FloatDataFormat) negExponentialPattern[0] = ((FloatDataFormat) dataFormat[0]).getNegativeExponentFormatPattern(); else negExponentialPattern[0] = null; if (dataFormat[0] instanceof IntegerDataFormat) intFlag[0] = ((IntegerDataFormat) dataFormat[0]).getType(); else intFlag[0] = null; } // init the dataOutputWriter properly. To a file or to the same writer as the // rest of the XML metadata? if (dataOutputStream != null) { // if this exists, then we are re-directing to an outside file. // wrap the outputstream (compressed or otherwise) with bufferedWriter dataOutputWriter = new BufferedWriter(new OutputStreamWriter(dataOutputStream)); } else { // goes to same spot as meta-data, e.g. just use the XML output writer dataOutputWriter = outputWriter; } // some info about the format Object String endian = readObj.getEndian(); // now, based on outputstyle, write out the data if (readObj instanceof TaggedXMLDataIOStyle) { String[] tags = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int[] axes = getMaxDataIndex(readObj); int stop = axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] = axes[stop - 1 - i]; } int whichTagIsFieldAxis = -1; if (parentArray.hasFieldAxis()) { for (int i = 0; i < stop; i++) { whichTagIsFieldAxis = i; AxisInterface axisObj = ((TaggedXMLDataIOStyle) readObj).getAxisByTag("d" + i); if (axisObj instanceof FieldAxis) { break; } } } Locator taggedLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) axisList.get(0); int nrofDataFormats = dataFormat.length; writeTaggedData( dataOutputWriter, taggedLocator, indent, axisLength, tags, 0, 0, fastestAxis, noDataValues, nrofDataFormats, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, whichTagIsFieldAxis ); // this *shouldnt* be needed, but tests with both Java 1.2.2 and 1.3.0 // on SUN and Linux platforms show that it is. Hopefully we can remove // this in the future. dataOutputWriter.flush(); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { AxisInterface fastestAxis = (AxisInterface) axisList.get(0); writeDelimitedData( dataOutputWriter, (DelimitedXMLDataIOStyle) readObj, fastestAxis, noDataValues, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, writeHrefAttribute ? false : true ); } else { writeFormattedData( dataOutputWriter, (FormattedXMLDataIOStyle) readObj, noDataValues, dataFormat, numOfBytes, formatPattern, negExponentialPattern, endian, intFlag, writeHrefAttribute ? false : true ); } if (writeHrefAttribute) { try { // should work as flush() too, so no call needed here. dataOutputWriter.close(); } catch (java.io.IOException e) { Log.errorln("Cant close dataOuputStream! Aborting."); return nodeName; } } } } // finish writing data to XML/Href //close the data section appropriately if (!writeHrefAttribute && niceOutput) { outputWriter.write( Constants.NEW_LINE+indent); } // If we didnt write Href attribute, then means that data // were put into document. We need to close the open data // node appropriately. if (!writeHrefAttribute) outputWriter.write( "</" + nodeName + ">"); // if (niceOutput) // outputWriter.write( Constants.NEW_LINE); return nodeName; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/c841e18257a93c237a9c9e594943c8c1ef654c90/DataCube.java/buggy/src/gov/nasa/gsfc/adc/xdf/DataCube.java
|
||
ICC_ProfileRGB()
|
ICC_ProfileRGB(int cspace)
|
ICC_ProfileRGB() { super(ColorSpace.CS_sRGB); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileRGB.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileRGB.java
|
super(ColorSpace.CS_sRGB);
|
super(cspace); matrix = createMatrix(); whitePoint = getXYZData(icSigMediaWhitePointTag);
|
ICC_ProfileRGB() { super(ColorSpace.CS_sRGB); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileRGB.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileRGB.java
|
return 0;
|
short[] data; switch (component) { case REDCOMPONENT: data = getCurve(icSigRedTRCTag); break; case GREENCOMPONENT: data = getCurve(icSigGreenTRCTag); break; case BLUECOMPONENT: data = getCurve(icSigBlueTRCTag); break; default: throw new IllegalArgumentException("Not a valid component"); } if (data == null) throw new IllegalArgumentException("Error reading TRC"); if (data.length != 1) throw new ProfileDataException("Not a single-gamma TRC"); float gamma = (float) (((int) data[0] & 0xFF00) >> 8); double fraction = ((int) data[0] & 0x00FF) / 256.0; gamma += (float) fraction; return gamma;
|
public float getGamma(int component) { return 0; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileRGB.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileRGB.java
|
return null;
|
float[][] mat = new float[3][3]; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) mat[i][j] = matrix[i][j]; return mat;
|
public float[][] getMatrix() { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileRGB.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileRGB.java
|
return null;
|
float[] wp = new float[3]; wp[0] = whitePoint[0]; wp[1] = whitePoint[1]; wp[2] = whitePoint[2]; return wp;
|
public float[] getMediaWhitePoint() { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileRGB.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileRGB.java
|
return null;
|
short[] data; switch (component) { case REDCOMPONENT: data = getCurve(icSigRedTRCTag); break; case GREENCOMPONENT: data = getCurve(icSigGreenTRCTag); break; case BLUECOMPONENT: data = getCurve(icSigBlueTRCTag); break; default: throw new IllegalArgumentException("Not a valid component"); } if (data == null) throw new IllegalArgumentException("Error reading TRC"); if (data.length <= 1) throw new ProfileDataException("Gamma value, not a TRC table."); return data;
|
public short[] getTRC(int component) { return null; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/ICC_ProfileRGB.java/buggy/core/src/classpath/java/java/awt/color/ICC_ProfileRGB.java
|
firePropertyChange("componentOrientation", oldOrientation, o);
|
public void setComponentOrientation(ComponentOrientation o) { if (o == null) throw new NullPointerException(); orientation = o; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f9edc08acdeb1f2f4fe82f01243818bd374a3e46/Component.java/clean/core/src/classpath/java/java/awt/Component.java
|
|
public void setDisplayedMnemonic(char mnemonic)
|
public void setDisplayedMnemonic(int mnemonic)
|
public void setDisplayedMnemonic(char mnemonic) { setDisplayedMnemonic((int) Character.toUpperCase(mnemonic)); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JLabel.java/buggy/core/src/classpath/javax/javax/swing/JLabel.java
|
setDisplayedMnemonic((int) Character.toUpperCase(mnemonic));
|
if (displayedMnemonic != mnemonic) { firePropertyChange("displayedMnemonic", displayedMnemonic, mnemonic); displayedMnemonic = mnemonic; if (text != null) setDisplayedMnemonicIndex(text.toUpperCase().indexOf(mnemonic)); }
|
public void setDisplayedMnemonic(char mnemonic) { setDisplayedMnemonic((int) Character.toUpperCase(mnemonic)); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JLabel.java/buggy/core/src/classpath/javax/javax/swing/JLabel.java
|
public JSlider(int orientation, int minimum, int maximum, int value)
|
public JSlider()
|
public JSlider(int orientation, int minimum, int maximum, int value) { sliderModel = new DefaultBoundedRangeModel(value, 0, minimum, maximum); if (orientation != HORIZONTAL && orientation != VERTICAL) throw new IllegalArgumentException(orientation + " is not a legal orientation"); this.orientation = orientation; changeListener = createChangeListener(); sliderModel.addChangeListener(changeListener); updateUI(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/JSlider.java/buggy/core/src/classpath/javax/javax/swing/JSlider.java
|
sliderModel = new DefaultBoundedRangeModel(value, 0, minimum, maximum); if (orientation != HORIZONTAL && orientation != VERTICAL) throw new IllegalArgumentException(orientation + " is not a legal orientation"); this.orientation = orientation; changeListener = createChangeListener(); sliderModel.addChangeListener(changeListener); updateUI();
|
this(HORIZONTAL, 0, 100, 50);
|
public JSlider(int orientation, int minimum, int maximum, int value) { sliderModel = new DefaultBoundedRangeModel(value, 0, minimum, maximum); if (orientation != HORIZONTAL && orientation != VERTICAL) throw new IllegalArgumentException(orientation + " is not a legal orientation"); this.orientation = orientation; changeListener = createChangeListener(); sliderModel.addChangeListener(changeListener); updateUI(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/JSlider.java/buggy/core/src/classpath/javax/javax/swing/JSlider.java
|
return entry != null ? (ZipEntry) entry.clone() : null;
|
if (entry == null && !name.endsWith("/")) entry = (ZipEntry) entries.get(name + '/'); return entry != null ? new ZipEntry(entry, name) : null;
|
public ZipEntry getEntry(String name) { try { HashMap entries = getEntries(); ZipEntry entry = (ZipEntry) entries.get(name); return entry != null ? (ZipEntry) entry.clone() : null; } catch (IOException ioe) { return null; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/ZipFile.java/clean/core/src/classpath/java/java/util/zip/ZipFile.java
|
public EventSetDescriptor(Class eventSourceClass, String eventSetName, Class listenerType, String listenerMethodName) throws IntrospectionException {
|
public EventSetDescriptor(Class eventSourceClass, String eventSetName, Class listenerType, String listenerMethodName) throws IntrospectionException {
|
public EventSetDescriptor(Class eventSourceClass, String eventSetName, Class listenerType, String listenerMethodName) throws IntrospectionException { setName(eventSetName); if(!java.util.EventListener.class.isAssignableFrom(listenerType)) { throw new IntrospectionException("Listener type is not an EventListener."); } String[] names = new String[1]; names[0] = listenerMethodName; try { eventSetName = Character.toUpperCase(eventSetName.charAt(0)) + eventSetName.substring(1); } catch(StringIndexOutOfBoundsException e) { eventSetName = ""; } findMethods(eventSourceClass,listenerType,names,"add"+eventSetName+"Listener","remove"+eventSetName+"Listener",eventSetName+"Event"); this.listenerType = listenerType; checkAddListenerUnicast(); if(this.removeListenerMethod.getExceptionTypes().length > 0) { throw new IntrospectionException("Listener remove method throws exceptions."); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
if(!java.util.EventListener.class.isAssignableFrom(listenerType)) { throw new IntrospectionException("Listener type is not an EventListener.");
|
if (!java.util.EventListener.class.isAssignableFrom(listenerType)) { throw new IntrospectionException( "Listener type is not an EventListener.");
|
public EventSetDescriptor(Class eventSourceClass, String eventSetName, Class listenerType, String listenerMethodName) throws IntrospectionException { setName(eventSetName); if(!java.util.EventListener.class.isAssignableFrom(listenerType)) { throw new IntrospectionException("Listener type is not an EventListener."); } String[] names = new String[1]; names[0] = listenerMethodName; try { eventSetName = Character.toUpperCase(eventSetName.charAt(0)) + eventSetName.substring(1); } catch(StringIndexOutOfBoundsException e) { eventSetName = ""; } findMethods(eventSourceClass,listenerType,names,"add"+eventSetName+"Listener","remove"+eventSetName+"Listener",eventSetName+"Event"); this.listenerType = listenerType; checkAddListenerUnicast(); if(this.removeListenerMethod.getExceptionTypes().length > 0) { throw new IntrospectionException("Listener remove method throws exceptions."); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
try { eventSetName = Character.toUpperCase(eventSetName.charAt(0)) + eventSetName.substring(1); } catch(StringIndexOutOfBoundsException e) {
|
try { eventSetName = Character.toUpperCase(eventSetName.charAt(0)) + eventSetName.substring(1); } catch (StringIndexOutOfBoundsException e) {
|
public EventSetDescriptor(Class eventSourceClass, String eventSetName, Class listenerType, String listenerMethodName) throws IntrospectionException { setName(eventSetName); if(!java.util.EventListener.class.isAssignableFrom(listenerType)) { throw new IntrospectionException("Listener type is not an EventListener."); } String[] names = new String[1]; names[0] = listenerMethodName; try { eventSetName = Character.toUpperCase(eventSetName.charAt(0)) + eventSetName.substring(1); } catch(StringIndexOutOfBoundsException e) { eventSetName = ""; } findMethods(eventSourceClass,listenerType,names,"add"+eventSetName+"Listener","remove"+eventSetName+"Listener",eventSetName+"Event"); this.listenerType = listenerType; checkAddListenerUnicast(); if(this.removeListenerMethod.getExceptionTypes().length > 0) { throw new IntrospectionException("Listener remove method throws exceptions."); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
findMethods(eventSourceClass,listenerType,names,"add"+eventSetName+"Listener","remove"+eventSetName+"Listener",eventSetName+"Event");
|
findMethods(eventSourceClass, listenerType, names, "add" + eventSetName + "Listener", "remove" + eventSetName + "Listener", eventSetName + "Event");
|
public EventSetDescriptor(Class eventSourceClass, String eventSetName, Class listenerType, String listenerMethodName) throws IntrospectionException { setName(eventSetName); if(!java.util.EventListener.class.isAssignableFrom(listenerType)) { throw new IntrospectionException("Listener type is not an EventListener."); } String[] names = new String[1]; names[0] = listenerMethodName; try { eventSetName = Character.toUpperCase(eventSetName.charAt(0)) + eventSetName.substring(1); } catch(StringIndexOutOfBoundsException e) { eventSetName = ""; } findMethods(eventSourceClass,listenerType,names,"add"+eventSetName+"Listener","remove"+eventSetName+"Listener",eventSetName+"Event"); this.listenerType = listenerType; checkAddListenerUnicast(); if(this.removeListenerMethod.getExceptionTypes().length > 0) { throw new IntrospectionException("Listener remove method throws exceptions."); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
if(this.removeListenerMethod.getExceptionTypes().length > 0) { throw new IntrospectionException("Listener remove method throws exceptions.");
|
if (this.removeListenerMethod.getExceptionTypes().length > 0) { throw new IntrospectionException( "Listener remove method throws exceptions.");
|
public EventSetDescriptor(Class eventSourceClass, String eventSetName, Class listenerType, String listenerMethodName) throws IntrospectionException { setName(eventSetName); if(!java.util.EventListener.class.isAssignableFrom(listenerType)) { throw new IntrospectionException("Listener type is not an EventListener."); } String[] names = new String[1]; names[0] = listenerMethodName; try { eventSetName = Character.toUpperCase(eventSetName.charAt(0)) + eventSetName.substring(1); } catch(StringIndexOutOfBoundsException e) { eventSetName = ""; } findMethods(eventSourceClass,listenerType,names,"add"+eventSetName+"Listener","remove"+eventSetName+"Listener",eventSetName+"Event"); this.listenerType = listenerType; checkAddListenerUnicast(); if(this.removeListenerMethod.getExceptionTypes().length > 0) { throw new IntrospectionException("Listener remove method throws exceptions."); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
private void checkAddListenerUnicast() throws IntrospectionException {
|
private void checkAddListenerUnicast() throws IntrospectionException {
|
private void checkAddListenerUnicast() throws IntrospectionException { Class[] addListenerExceptions = this.addListenerMethod.getExceptionTypes(); if(addListenerExceptions.length > 1) { throw new IntrospectionException("Listener add method throws too many exceptions."); } else if(addListenerExceptions.length == 1 && !java.util.TooManyListenersException.class.isAssignableFrom(addListenerExceptions[0])) { throw new IntrospectionException("Listener add method throws too many exceptions."); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
if(addListenerExceptions.length > 1) { throw new IntrospectionException("Listener add method throws too many exceptions."); } else if(addListenerExceptions.length == 1 && !java.util.TooManyListenersException.class.isAssignableFrom(addListenerExceptions[0])) { throw new IntrospectionException("Listener add method throws too many exceptions.");
|
if (addListenerExceptions.length > 1) { throw new IntrospectionException( "Listener add method throws too many exceptions."); } else if (addListenerExceptions.length == 1 && !java.util.TooManyListenersException.class .isAssignableFrom(addListenerExceptions[0])) { throw new IntrospectionException( "Listener add method throws too many exceptions.");
|
private void checkAddListenerUnicast() throws IntrospectionException { Class[] addListenerExceptions = this.addListenerMethod.getExceptionTypes(); if(addListenerExceptions.length > 1) { throw new IntrospectionException("Listener add method throws too many exceptions."); } else if(addListenerExceptions.length == 1 && !java.util.TooManyListenersException.class.isAssignableFrom(addListenerExceptions[0])) { throw new IntrospectionException("Listener add method throws too many exceptions."); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
private void checkMethods() throws IntrospectionException { if(!addListenerMethod.getDeclaringClass().isAssignableFrom(removeListenerMethod.getDeclaringClass()) && !removeListenerMethod.getDeclaringClass().isAssignableFrom(addListenerMethod.getDeclaringClass())) { throw new IntrospectionException("add and remove listener methods do not come from the same class. This is bad.");
|
private void checkMethods() throws IntrospectionException { if (!addListenerMethod.getDeclaringClass() .isAssignableFrom(removeListenerMethod.getDeclaringClass()) && !removeListenerMethod.getDeclaringClass() .isAssignableFrom(addListenerMethod.getDeclaringClass())) { throw new IntrospectionException( "add and remove listener methods do not come from the" + " same class. This is bad.");
|
private void checkMethods() throws IntrospectionException { if(!addListenerMethod.getDeclaringClass().isAssignableFrom(removeListenerMethod.getDeclaringClass()) && !removeListenerMethod.getDeclaringClass().isAssignableFrom(addListenerMethod.getDeclaringClass())) { throw new IntrospectionException("add and remove listener methods do not come from the same class. This is bad."); } if(!addListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || addListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(addListenerMethod.getParameterTypes()[0]) || !Modifier.isPublic(addListenerMethod.getModifiers())) { throw new IntrospectionException("Add Listener Method invalid."); } if(!removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || removeListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(removeListenerMethod.getParameterTypes()[0]) || removeListenerMethod.getExceptionTypes().length > 0 || !Modifier.isPublic(removeListenerMethod.getModifiers())) { throw new IntrospectionException("Remove Listener Method invalid."); } for(int i=0;i<listenerMethods.length;i++) { if(!listenerMethods[i].getReturnType().equals(java.lang.Void.TYPE) || Modifier.isPrivate(listenerMethods[i].getModifiers())) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " non-void or private."); } if(!listenerMethods[i].getDeclaringClass().isAssignableFrom(listenerType)) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " not from class " + listenerType.getName()); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
if(!addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)
|
if (!addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)
|
private void checkMethods() throws IntrospectionException { if(!addListenerMethod.getDeclaringClass().isAssignableFrom(removeListenerMethod.getDeclaringClass()) && !removeListenerMethod.getDeclaringClass().isAssignableFrom(addListenerMethod.getDeclaringClass())) { throw new IntrospectionException("add and remove listener methods do not come from the same class. This is bad."); } if(!addListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || addListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(addListenerMethod.getParameterTypes()[0]) || !Modifier.isPublic(addListenerMethod.getModifiers())) { throw new IntrospectionException("Add Listener Method invalid."); } if(!removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || removeListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(removeListenerMethod.getParameterTypes()[0]) || removeListenerMethod.getExceptionTypes().length > 0 || !Modifier.isPublic(removeListenerMethod.getModifiers())) { throw new IntrospectionException("Remove Listener Method invalid."); } for(int i=0;i<listenerMethods.length;i++) { if(!listenerMethods[i].getReturnType().equals(java.lang.Void.TYPE) || Modifier.isPrivate(listenerMethods[i].getModifiers())) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " non-void or private."); } if(!listenerMethods[i].getDeclaringClass().isAssignableFrom(listenerType)) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " not from class " + listenerType.getName()); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
|| !Modifier.isPublic(addListenerMethod.getModifiers())) {
|
|| !Modifier.isPublic(addListenerMethod.getModifiers())) {
|
private void checkMethods() throws IntrospectionException { if(!addListenerMethod.getDeclaringClass().isAssignableFrom(removeListenerMethod.getDeclaringClass()) && !removeListenerMethod.getDeclaringClass().isAssignableFrom(addListenerMethod.getDeclaringClass())) { throw new IntrospectionException("add and remove listener methods do not come from the same class. This is bad."); } if(!addListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || addListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(addListenerMethod.getParameterTypes()[0]) || !Modifier.isPublic(addListenerMethod.getModifiers())) { throw new IntrospectionException("Add Listener Method invalid."); } if(!removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || removeListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(removeListenerMethod.getParameterTypes()[0]) || removeListenerMethod.getExceptionTypes().length > 0 || !Modifier.isPublic(removeListenerMethod.getModifiers())) { throw new IntrospectionException("Remove Listener Method invalid."); } for(int i=0;i<listenerMethods.length;i++) { if(!listenerMethods[i].getReturnType().equals(java.lang.Void.TYPE) || Modifier.isPrivate(listenerMethods[i].getModifiers())) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " non-void or private."); } if(!listenerMethods[i].getDeclaringClass().isAssignableFrom(listenerType)) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " not from class " + listenerType.getName()); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
if(!removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)
|
if (!removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)
|
private void checkMethods() throws IntrospectionException { if(!addListenerMethod.getDeclaringClass().isAssignableFrom(removeListenerMethod.getDeclaringClass()) && !removeListenerMethod.getDeclaringClass().isAssignableFrom(addListenerMethod.getDeclaringClass())) { throw new IntrospectionException("add and remove listener methods do not come from the same class. This is bad."); } if(!addListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || addListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(addListenerMethod.getParameterTypes()[0]) || !Modifier.isPublic(addListenerMethod.getModifiers())) { throw new IntrospectionException("Add Listener Method invalid."); } if(!removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || removeListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(removeListenerMethod.getParameterTypes()[0]) || removeListenerMethod.getExceptionTypes().length > 0 || !Modifier.isPublic(removeListenerMethod.getModifiers())) { throw new IntrospectionException("Remove Listener Method invalid."); } for(int i=0;i<listenerMethods.length;i++) { if(!listenerMethods[i].getReturnType().equals(java.lang.Void.TYPE) || Modifier.isPrivate(listenerMethods[i].getModifiers())) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " non-void or private."); } if(!listenerMethods[i].getDeclaringClass().isAssignableFrom(listenerType)) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " not from class " + listenerType.getName()); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
|| !Modifier.isPublic(removeListenerMethod.getModifiers())) {
|
|| !Modifier.isPublic(removeListenerMethod.getModifiers())) {
|
private void checkMethods() throws IntrospectionException { if(!addListenerMethod.getDeclaringClass().isAssignableFrom(removeListenerMethod.getDeclaringClass()) && !removeListenerMethod.getDeclaringClass().isAssignableFrom(addListenerMethod.getDeclaringClass())) { throw new IntrospectionException("add and remove listener methods do not come from the same class. This is bad."); } if(!addListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || addListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(addListenerMethod.getParameterTypes()[0]) || !Modifier.isPublic(addListenerMethod.getModifiers())) { throw new IntrospectionException("Add Listener Method invalid."); } if(!removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || removeListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(removeListenerMethod.getParameterTypes()[0]) || removeListenerMethod.getExceptionTypes().length > 0 || !Modifier.isPublic(removeListenerMethod.getModifiers())) { throw new IntrospectionException("Remove Listener Method invalid."); } for(int i=0;i<listenerMethods.length;i++) { if(!listenerMethods[i].getReturnType().equals(java.lang.Void.TYPE) || Modifier.isPrivate(listenerMethods[i].getModifiers())) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " non-void or private."); } if(!listenerMethods[i].getDeclaringClass().isAssignableFrom(listenerType)) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " not from class " + listenerType.getName()); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
for(int i=0;i<listenerMethods.length;i++) { if(!listenerMethods[i].getReturnType().equals(java.lang.Void.TYPE) || Modifier.isPrivate(listenerMethods[i].getModifiers())) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " non-void or private."); } if(!listenerMethods[i].getDeclaringClass().isAssignableFrom(listenerType)) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " not from class " + listenerType.getName());
|
for (int i = 0; i < listenerMethods.length; i++) { if (!listenerMethods[i].getReturnType().equals(java.lang.Void.TYPE) || Modifier.isPrivate(listenerMethods[i].getModifiers())) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " non-void or private."); } if (!listenerMethods[i].getDeclaringClass() .isAssignableFrom(listenerType)) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " not from class " + listenerType.getName());
|
private void checkMethods() throws IntrospectionException { if(!addListenerMethod.getDeclaringClass().isAssignableFrom(removeListenerMethod.getDeclaringClass()) && !removeListenerMethod.getDeclaringClass().isAssignableFrom(addListenerMethod.getDeclaringClass())) { throw new IntrospectionException("add and remove listener methods do not come from the same class. This is bad."); } if(!addListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || addListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(addListenerMethod.getParameterTypes()[0]) || !Modifier.isPublic(addListenerMethod.getModifiers())) { throw new IntrospectionException("Add Listener Method invalid."); } if(!removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE) || removeListenerMethod.getParameterTypes().length != 1 || !listenerType.equals(removeListenerMethod.getParameterTypes()[0]) || removeListenerMethod.getExceptionTypes().length > 0 || !Modifier.isPublic(removeListenerMethod.getModifiers())) { throw new IntrospectionException("Remove Listener Method invalid."); } for(int i=0;i<listenerMethods.length;i++) { if(!listenerMethods[i].getReturnType().equals(java.lang.Void.TYPE) || Modifier.isPrivate(listenerMethods[i].getModifiers())) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " non-void or private."); } if(!listenerMethods[i].getDeclaringClass().isAssignableFrom(listenerType)) { throw new IntrospectionException("Event Method " + listenerMethods[i].getName() + " not from class " + listenerType.getName()); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
private void findMethods(Class eventSourceClass, Class listenerType,
|
private void findMethods(Class eventSourceClass, Class listenerType,
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
String absurdEventClassCheckName) throws IntrospectionException {
|
String absurdEventClassCheckName) throws IntrospectionException {
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); }
|
try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName, listenerArgList); } catch (SecurityException E) { throw new IntrospectionException( "SecurityException trying to access method " + addListenerMethodName + "."); } catch (NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); }
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); }
|
if (this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException( "Add listener method does not exist, is not public," + " or is not void."); }
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void.");
|
try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName, listenerArgList); } catch (SecurityException E) { throw new IntrospectionException( "SecurityException trying to access method " + removeListenerMethodName + "."); } catch (NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if (this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType() .equals(java.lang.Void.TYPE)) { throw new IntrospectionException( "Remove listener method does not exist, is not public," + " or is not void.");
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
try {
|
try {
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
} catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class.");
|
} catch (SecurityException E) { throw new IntrospectionException( "Security: You cannot access fields in this class.");
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) {
|
for (int i = 0; i < methods.length; i++) { if (Modifier.isPrivate(methods[i].getModifiers())) {
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j])
|
if (retval.equals(java.lang.Void.TYPE)) { for (int j = 0; j < listenerMethodNames.length; j++) { if (currentMethod.getName().equals(listenerMethodNames[j])
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
&& ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) {
|
&& ((currentMethod.getParameterTypes()[0]) .getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]) .getName().endsWith("." + absurdEventClassCheckName))))) {
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]);
|
for (int i = 0; i < listenerMethodFound.length; i++) { if (!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]);
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i);
|
for (int i = 0; i < chosenMethods.size(); i++) { this.listenerMethods[i] = (Method) chosenMethods.elementAt(i);
|
private void findMethods(Class eventSourceClass, Class listenerType, String listenerMethodNames[], String addListenerMethodName, String removeListenerMethodName, String absurdEventClassCheckName) throws IntrospectionException { /* Find add listener method and remove listener method. */ Class[] listenerArgList = new Class[1]; listenerArgList[0] = listenerType; try { this.addListenerMethod = eventSourceClass.getMethod(addListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + addListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + addListenerMethodName + "."); } if(this.addListenerMethod == null || !this.addListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Add listener method does not exist, is not public, or is not void."); } try { this.removeListenerMethod = eventSourceClass.getMethod(removeListenerMethodName,listenerArgList); } catch(SecurityException E) { throw new IntrospectionException("SecurityException trying to access method " + removeListenerMethodName + "."); } catch(NoSuchMethodException E) { throw new IntrospectionException("Could not find method " + removeListenerMethodName + "."); } if(this.removeListenerMethod == null || !this.removeListenerMethod.getReturnType().equals(java.lang.Void.TYPE)) { throw new IntrospectionException("Remove listener method does not exist, is not public, or is not void."); } /* Find the listener methods. */ Method[] methods; try { methods = ClassHelper.getAllMethods(listenerType); } catch(SecurityException E) { throw new IntrospectionException("Security: You cannot access fields in this class."); } Vector chosenMethods = new Vector(); boolean[] listenerMethodFound = new boolean[listenerMethodNames.length]; for(int i=0;i<methods.length;i++) { if(Modifier.isPrivate(methods[i].getModifiers())) { continue; } Method currentMethod = methods[i]; Class retval = currentMethod.getReturnType(); if(retval.equals(java.lang.Void.TYPE)) { for(int j=0;j<listenerMethodNames.length;j++) { if(currentMethod.getName().equals(listenerMethodNames[j]) && (absurdEventClassCheckName == null || (currentMethod.getParameterTypes().length == 1 && ((currentMethod.getParameterTypes()[0]).getName().equals(absurdEventClassCheckName) || (currentMethod.getParameterTypes()[0]).getName().endsWith("."+absurdEventClassCheckName) ) ) ) ) { chosenMethods.addElement(currentMethod); listenerMethodFound[j] = true; } } } } /* Make sure we found all the methods we were looking for. */ for(int i=0;i<listenerMethodFound.length;i++) { if(!listenerMethodFound[i]) { throw new IntrospectionException("Could not find event method " + listenerMethodNames[i]); } } /* Now that we've chosen the listener methods we want, store them. */ this.listenerMethods = new Method[chosenMethods.size()]; for(int i=0;i<chosenMethods.size();i++) { this.listenerMethods[i] = (Method)chosenMethods.elementAt(i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
public Method getAddListenerMethod() {
|
public Method getAddListenerMethod() {
|
public Method getAddListenerMethod() { return addListenerMethod; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
public MethodDescriptor[] getListenerMethodDescriptors() { if(listenerMethodDescriptors == null) { listenerMethodDescriptors = new MethodDescriptor[listenerMethods.length]; for(int i=0;i<listenerMethods.length;i++) { listenerMethodDescriptors[i] = new MethodDescriptor(listenerMethods[i]);
|
public MethodDescriptor[] getListenerMethodDescriptors() { if (listenerMethodDescriptors == null) { listenerMethodDescriptors = new MethodDescriptor[listenerMethods.length]; for (int i = 0; i < listenerMethods.length; i++) { listenerMethodDescriptors[i] = new MethodDescriptor(listenerMethods[i]);
|
public MethodDescriptor[] getListenerMethodDescriptors() { if(listenerMethodDescriptors == null) { listenerMethodDescriptors = new MethodDescriptor[listenerMethods.length]; for(int i=0;i<listenerMethods.length;i++) { listenerMethodDescriptors[i] = new MethodDescriptor(listenerMethods[i]); } } return listenerMethodDescriptors; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
public MethodDescriptor[] getListenerMethodDescriptors() { if(listenerMethodDescriptors == null) { listenerMethodDescriptors = new MethodDescriptor[listenerMethods.length]; for(int i=0;i<listenerMethods.length;i++) { listenerMethodDescriptors[i] = new MethodDescriptor(listenerMethods[i]); } } return listenerMethodDescriptors; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
||
public Method[] getListenerMethods() {
|
public Method[] getListenerMethods() {
|
public Method[] getListenerMethods() { return listenerMethods; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
public Class getListenerType() {
|
public Class getListenerType() {
|
public Class getListenerType() { return listenerType; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
public Method getRemoveListenerMethod() {
|
public Method getRemoveListenerMethod() {
|
public Method getRemoveListenerMethod() { return removeListenerMethod; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
public boolean isInDefaultEventSet() {
|
public boolean isInDefaultEventSet() {
|
public boolean isInDefaultEventSet() { return inDefaultEventSet; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
public boolean isUnicast() {
|
public boolean isUnicast() {
|
public boolean isUnicast() { return unicast; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
public void setInDefaultEventSet(boolean inDefaultEventSet) {
|
public void setInDefaultEventSet(boolean inDefaultEventSet) {
|
public void setInDefaultEventSet(boolean inDefaultEventSet) { this.inDefaultEventSet = inDefaultEventSet; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
public void setUnicast(boolean unicast) {
|
public void setUnicast(boolean unicast) {
|
public void setUnicast(boolean unicast) { this.unicast = unicast; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/EventSetDescriptor.java/clean/core/src/classpath/java/java/beans/EventSetDescriptor.java
|
protected final Class defineClass(String name, byte[] data, int offset, int length) { return defineClass(name, data, offset, length, null);
|
protected final Class defineClass(byte[] data, int offset, int length) { return defineClass(null, data, offset, length, null);
|
protected final Class defineClass(String name, byte[] data, int offset, int length) { return defineClass(name, data, offset, length, null); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/ClassLoader.java/buggy/core/src/classpath/vm/java/lang/ClassLoader.java
|
if (text != null) {
|
if (bufferedKeys != null) {
|
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (text != null) { text = bufferedKeys + text; } keysBuffered = false; setKBIndicatorOff(); bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked && !isStatusErrorCode() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) { simulateMnemonic(getMnemonicValue(s)); } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } } } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/57b73659b9b1e1535885b82349fae6571c4177fc/Screen5250.java/clean/tn5250j/src/org/tn5250j/Screen5250.java
|
throw new BAD_OPERATION("ServiceContext[] expected.");
|
BAD_OPERATION bad = new BAD_OPERATION("ServiceContext[] expected"); bad.minor = Minor.Any; bad.initCause(ex); throw bad;
|
public static ServiceContext[] extract(Any any) { try { ServiceContextListHolder holder = (ServiceContextListHolder) any.extract_Streamable(); return holder.value; } catch (ClassCastException ex) { throw new BAD_OPERATION("ServiceContext[] expected."); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/ServiceContextListHelper.java/clean/core/src/classpath/org/org/omg/IOP/ServiceContextListHelper.java
|
this(0, 100, HORIZONTAL);
|
this(HORIZONTAL, 0, 100);
|
public JProgressBar() { this(0, 100, HORIZONTAL); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/JProgressBar.java/clean/core/src/classpath/javax/javax/swing/JProgressBar.java
|
public MultiLookAndFeel() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/MultiLookAndFeel.java/clean/core/src/classpath/javax/javax/swing/plaf/multi/MultiLookAndFeel.java
|
||
public static LookAndFeel[] getAuxiliaryLookAndFeels()
|
public static LookAndFeel[] getAuxiliaryLookAndFeels()
|
public static LookAndFeel[] getAuxiliaryLookAndFeels() { return auxLookAndFeels; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/UIManager.java/buggy/core/src/classpath/javax/javax/swing/UIManager.java
|
public final synchronized void draw(Shape shape, AffineTransform tx, Color color, int mode) {
|
public final synchronized void draw(Shape shape, Shape clip, AffineTransform tx, Color color, int mode) {
|
public final synchronized void draw(Shape shape, AffineTransform tx, Color color, int mode) { syncFIFO(); super.draw(shape, tx, color, mode); final Rectangle r = getBounds(shape, tx); updateScreen(r.x - 1, r.y - 1, r.width + 2, r.height + 2); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4557d0702a8d0890ae78e109ce9a6ba79d7a5beb/VMWareCore.java/clean/gui/src/driver/org/jnode/driver/video/vmware/VMWareCore.java
|
super.draw(shape, tx, color, mode);
|
super.draw(shape, clip, tx, color, mode);
|
public final synchronized void draw(Shape shape, AffineTransform tx, Color color, int mode) { syncFIFO(); super.draw(shape, tx, color, mode); final Rectangle r = getBounds(shape, tx); updateScreen(r.x - 1, r.y - 1, r.width + 2, r.height + 2); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4557d0702a8d0890ae78e109ce9a6ba79d7a5beb/VMWareCore.java/clean/gui/src/driver/org/jnode/driver/video/vmware/VMWareCore.java
|
public final synchronized void fill(Shape shape, AffineTransform tx, Color color, int mode) {
|
public final synchronized void fill(Shape shape, Shape clip, AffineTransform tx, Color color, int mode) {
|
public final synchronized void fill(Shape shape, AffineTransform tx, Color color, int mode) { syncFIFO(); super.fill(shape, tx, color, mode); final Rectangle b = getBounds(shape, tx); updateScreen(b.x, b.y, b.width, b.height); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4557d0702a8d0890ae78e109ce9a6ba79d7a5beb/VMWareCore.java/clean/gui/src/driver/org/jnode/driver/video/vmware/VMWareCore.java
|
super.fill(shape, tx, color, mode);
|
super.fill(shape, clip, tx, color, mode);
|
public final synchronized void fill(Shape shape, AffineTransform tx, Color color, int mode) { syncFIFO(); super.fill(shape, tx, color, mode); final Rectangle b = getBounds(shape, tx); updateScreen(b.x, b.y, b.width, b.height); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4557d0702a8d0890ae78e109ce9a6ba79d7a5beb/VMWareCore.java/clean/gui/src/driver/org/jnode/driver/video/vmware/VMWareCore.java
|
revalidate(); repaint();
|
setOpaque(b);
|
public void setContentAreaFilled(boolean b) { if (contentAreaFilled == b) return; boolean old = contentAreaFilled; contentAreaFilled = b; firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY, old, b); revalidate(); repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/AbstractButton.java/clean/core/src/classpath/javax/javax/swing/AbstractButton.java
|
output.write_wstring(value [ i ]);
|
output.write_string(value [ i ]);
|
public static void write(OutputStream output, String[] value) { output.write_long(value.length); for (int i = 0; i < value.length; i++) output.write_wstring(value [ i ]); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/72c2f223affb33a2850592b25490f4663c651bee/StringSeqHelper.java/clean/core/src/classpath/org/org/omg/CORBA/StringSeqHelper.java
|
public StringSeqHolder(String[] initial_value)
|
public StringSeqHolder()
|
public StringSeqHolder(String[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/72c2f223affb33a2850592b25490f4663c651bee/StringSeqHolder.java/buggy/core/src/classpath/org/org/omg/CORBA/StringSeqHolder.java
|
value = initial_value; typecode.setLength(value.length);
|
public StringSeqHolder(String[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/72c2f223affb33a2850592b25490f4663c651bee/StringSeqHolder.java/buggy/core/src/classpath/org/org/omg/CORBA/StringSeqHolder.java
|
|
public ComboBoxUI() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/ComboBoxUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/ComboBoxUI.java
|
||
goto_XY(icX,icY);
|
if (!isStatusErrorCode()) { goto_XY(icX,icY); }
|
public void setPendingInsert(boolean flag, int icX, int icY) { pendingInsert = flag; if (pendingInsert) { homePos = getPos(icX,icY); } goto_XY(icX,icY); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/138d7f531fedca589f174b282c497f86f7e83899/Screen5250.java/buggy/tn5250j/src/org/tn5250j/Screen5250.java
|
return alignmentX;
|
float ret = alignmentX; if (alignmentX < 0) ret = super.getAlignmentX(); return ret;
|
public float getAlignmentX() { return alignmentX; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/JComponent.java/clean/core/src/classpath/javax/javax/swing/JComponent.java
|
return alignmentY;
|
float ret = alignmentY; if (alignmentY < 0) ret = super.getAlignmentY(); return ret;
|
public float getAlignmentY() { return alignmentY; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/JComponent.java/clean/core/src/classpath/javax/javax/swing/JComponent.java
|
if (a < 0.0F) alignmentX = 0.0F; else if (a > 1.0) alignmentX = 1.0F; else
|
public void setAlignmentX(float a) { alignmentX = a; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/JComponent.java/clean/core/src/classpath/javax/javax/swing/JComponent.java
|
|
if (a < 0.0F) alignmentY = 0.0F; else if (a > 1.0) alignmentY = 1.0F; else
|
public void setAlignmentY(float a) { alignmentY = a; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/JComponent.java/clean/core/src/classpath/javax/javax/swing/JComponent.java
|
|
maximumSize = max;
|
maximumSize = new Dimension(max);
|
public void setMaximumSize(Dimension max) { Dimension oldMaximumSize = maximumSize; maximumSize = max; firePropertyChange("maximumSize", oldMaximumSize, maximumSize); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/JComponent.java/clean/core/src/classpath/javax/javax/swing/JComponent.java
|
minimumSize = min;
|
minimumSize = new Dimension(min);
|
public void setMinimumSize(Dimension min) { Dimension oldMinimumSize = minimumSize; minimumSize = min; firePropertyChange("minimumSize", oldMinimumSize, minimumSize); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/JComponent.java/clean/core/src/classpath/javax/javax/swing/JComponent.java
|
preferredSize = pref;
|
preferredSize = new Dimension(pref);
|
public void setPreferredSize(Dimension pref) { Dimension oldPreferredSize = preferredSize; preferredSize = pref; firePropertyChange("preferredSize", oldPreferredSize, preferredSize); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/JComponent.java/clean/core/src/classpath/javax/javax/swing/JComponent.java
|
aliasesEP.addListener(this);
|
public DefaultAliasManager(ExtensionPoint aliasesEP) { this.parent = null; this.aliasesEP = aliasesEP; refreshAliases(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/DefaultAliasManager.java/buggy/shell/src/shell/org/jnode/shell/alias/def/DefaultAliasManager.java
|
|
System.out.println("Refreshing alias list");
|
protected void refreshAliases() { if (aliasesEP != null) { aliases.clear(); final Extension[] extensions = aliasesEP.getExtensions(); for (int i = 0; i < extensions.length; i++) { final Extension ext = extensions[i]; final ConfigurationElement[] elements = ext.getConfigurationElements(); for (int j = 0; j < elements.length; j++) { createAlias(aliases, elements[j]); } } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/DefaultAliasManager.java/buggy/shell/src/shell/org/jnode/shell/alias/def/DefaultAliasManager.java
|
|
public void paint(Graphics g, Shape a) { // Adjust size if the size is changed. Rectangle bounds = a.getBounds(); if (bounds.width != getWidth() || bounds.height != getHeight()) setSize(bounds.width, bounds.height); Rectangle inside = getInsideAllocation(a); Rectangle copy = new Rectangle(inside); int count = getViewCount(); for (int i = 0; i < count; ++i) { // TODO: Figure out if the parameter to paintChild is meant to // be the child allocation or the allocation of this BoxView. // I assume the second option here. // We pass this method a copy of the inside rectangle here because // it modifies the actual values. copy.setBounds(inside); paintChild(g, copy, i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BoxView.java/clean/core/src/classpath/javax/javax/swing/text/BoxView.java
|
||
childAllocation(i, copy);
|
public void paint(Graphics g, Shape a) { // Adjust size if the size is changed. Rectangle bounds = a.getBounds(); if (bounds.width != getWidth() || bounds.height != getHeight()) setSize(bounds.width, bounds.height); Rectangle inside = getInsideAllocation(a); Rectangle copy = new Rectangle(inside); int count = getViewCount(); for (int i = 0; i < count; ++i) { // TODO: Figure out if the parameter to paintChild is meant to // be the child allocation or the allocation of this BoxView. // I assume the second option here. // We pass this method a copy of the inside rectangle here because // it modifies the actual values. copy.setBounds(inside); paintChild(g, copy, i); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BoxView.java/clean/core/src/classpath/javax/javax/swing/text/BoxView.java
|
|
childAllocation(index, alloc);
|
protected void paintChild(Graphics g, Rectangle alloc, int index) { View child = getView(index); childAllocation(index, alloc); child.paint(g, alloc); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BoxView.java/clean/core/src/classpath/javax/javax/swing/text/BoxView.java
|
|
if (mods)
|
if (mods) {
|
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("DONE")) { if (mods) mapper.saveKeyMap(); setVisible(false); } if (e.getActionCommand().equals("MAP")) { mapIt(); } if (e.getActionCommand().equals("REMOVE")) { removeIt(); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/fbb3a11710fb539ca6b78cd21966843c2117badd/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
|
mapper.fireKeyChangeEvent(); }
|
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("DONE")) { if (mods) mapper.saveKeyMap(); setVisible(false); } if (e.getActionCommand().equals("MAP")) { mapIt(); } if (e.getActionCommand().equals("REMOVE")) { removeIt(); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/fbb3a11710fb539ca6b78cd21966843c2117badd/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
|
|
mods = true;
|
private void removeIt() { if (!macros && !special) { mapper.removeKeyStroke(mnemonicData[functions.getSelectedIndex()]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[functions.getSelectedIndex()])); } else { if (macros) { mapper.removeKeyStroke((String)functions.getSelectedValue()); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke((String)functions.getSelectedValue()); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/fbb3a11710fb539ca6b78cd21966843c2117badd/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
|
|
mapper.fireKeyChangeEvent();
|
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { if (isLinux) mapper.setKeyStroke(mnemonicData[functions.getSelectedIndex()],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[functions.getSelectedIndex()],ke); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[functions.getSelectedIndex()])); mapper.fireKeyChangeEvent(); } else { if (macros) { System.out.println((String)functions.getSelectedValue()); if (isLinux) mapper.setKeyStroke((String)functions.getSelectedValue(),ke,isAltGr); else mapper.setKeyStroke((String)functions.getSelectedValue(),ke); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); if (isLinux) mapper.setKeyStroke(k,ke,isAltGr); else mapper.setKeyStroke(k,ke); strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/fbb3a11710fb539ca6b78cd21966843c2117badd/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
|
|
public static void main(String[] args) {
|
public static void main(String[] args) throws SyntaxErrorException {
|
public static void main(String[] args) { try { ParsedArguments cmdLine = HELP_INFO.parse(args); String device = ARG_DEVICE.getValue(cmdLine); String FSType = FS.getValue(cmdLine).intern(); String fsTypeName; Object params; int fatSize = 0; if (FSType == "fat16") { fatSize = Fat.FAT16; fsTypeName = FatFileSystemType.NAME; params = new Integer(fatSize); } else if (FSType == "fat12") { fatSize = Fat.FAT12; fsTypeName = FatFileSystemType.NAME; params = new Integer(fatSize); } else throw new FileSystemException( "Unsupported FS by format command"); DeviceManager dm; dm = (DeviceManager) InitialNaming.lookup(DeviceManager.NAME); Device dev = dm.getDevice(device); FileSystemService fileSystemService = (FileSystemService) InitialNaming .lookup(FileSystemService.NAME); FileSystemType type = fileSystemService .getFileSystemTypeForNameSystemTypes(fsTypeName); type.format(dev, params); // restart the device dm.stop(dev); dm.start(dev); } catch (NameNotFoundException e) { e.printStackTrace(); } catch (DeviceNotFoundException e) { e.printStackTrace(); } catch (DriverException e) { e.printStackTrace(); } catch (FileSystemException e) { // e.printStackTrace(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/FormatCommand.java/buggy/fs/src/fs/org/jnode/fs/command/FormatCommand.java
|
public AssignQuad(int address, IRBasicBlock block, int lhsIndex) {
|
public AssignQuad(int address, IRBasicBlock block, Variable lhs) {
|
public AssignQuad(int address, IRBasicBlock block, int lhsIndex) { super(address, block); this.variables = block.getVariables(); this.lhsIndex = lhsIndex; this.lhs = (Variable) variables[lhsIndex].clone(); lhs.setAssignQuad(this); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/AssignQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/AssignQuad.java
|
this.variables = block.getVariables(); this.lhsIndex = lhsIndex; this.lhs = (Variable) variables[lhsIndex].clone();
|
this.lhs = lhs;
|
public AssignQuad(int address, IRBasicBlock block, int lhsIndex) { super(address, block); this.variables = block.getVariables(); this.lhsIndex = lhsIndex; this.lhs = (Variable) variables[lhsIndex].clone(); lhs.setAssignQuad(this); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/568227fef1ae7ced51f104ef1af634c7a6188718/AssignQuad.java/clean/core/src/core/org/jnode/vm/compiler/ir/quad/AssignQuad.java
|
public Parser(String programName, final String versionString, boolean longOnly)
|
public Parser(String programName, String versionString)
|
public Parser(String programName, final String versionString, boolean longOnly) { this.programName = programName; this.longOnly = longOnly; // Put standard options in their own section near the end. OptionGroup finalGroup = new OptionGroup(Messages.getString("Parser.StdOptions")); //$NON-NLS-1$ finalGroup.add(new Option("help", Messages.getString("Parser.PrintHelp")) //$NON-NLS-1$ //$NON-NLS-2$ { public void parsed(String argument) throws OptionException { printHelp(System.out); System.exit(0); } }); finalGroup.add(new Option("version", Messages.getString("Parser.PrintVersion")) //$NON-NLS-1$ //$NON-NLS-2$ { public void parsed(String argument) throws OptionException { System.out.println(versionString); System.exit(0); } }); finalGroup.add(new Option('J', Messages.getString("Parser.JArgument"), Messages.getString("Parser.JName")) //$NON-NLS-1$ //$NON-NLS-2$ { public void parsed(String argument) throws OptionException { // -J should be handled by the appletviewer wrapper binary. // We add it here so that it shows up in the --help output. // Note that there is a special case for this in OptionGroup. } }); add(finalGroup); add(defaultGroup); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/bd3c4af88fcde25afb91781dd0bd56ebcfa8a15b/Parser.java/buggy/core/src/classpath/tools/gnu/classpath/tools/getopt/Parser.java
|
this.programName = programName; this.longOnly = longOnly; OptionGroup finalGroup = new OptionGroup(Messages.getString("Parser.StdOptions")); finalGroup.add(new Option("help", Messages.getString("Parser.PrintHelp")) { public void parsed(String argument) throws OptionException { printHelp(System.out); System.exit(0); } }); finalGroup.add(new Option("version", Messages.getString("Parser.PrintVersion")) { public void parsed(String argument) throws OptionException { System.out.println(versionString); System.exit(0); } }); finalGroup.add(new Option('J', Messages.getString("Parser.JArgument"), Messages.getString("Parser.JName")) { public void parsed(String argument) throws OptionException { } }); add(finalGroup); add(defaultGroup);
|
this(programName, versionString, false);
|
public Parser(String programName, final String versionString, boolean longOnly) { this.programName = programName; this.longOnly = longOnly; // Put standard options in their own section near the end. OptionGroup finalGroup = new OptionGroup(Messages.getString("Parser.StdOptions")); //$NON-NLS-1$ finalGroup.add(new Option("help", Messages.getString("Parser.PrintHelp")) //$NON-NLS-1$ //$NON-NLS-2$ { public void parsed(String argument) throws OptionException { printHelp(System.out); System.exit(0); } }); finalGroup.add(new Option("version", Messages.getString("Parser.PrintVersion")) //$NON-NLS-1$ //$NON-NLS-2$ { public void parsed(String argument) throws OptionException { System.out.println(versionString); System.exit(0); } }); finalGroup.add(new Option('J', Messages.getString("Parser.JArgument"), Messages.getString("Parser.JName")) //$NON-NLS-1$ //$NON-NLS-2$ { public void parsed(String argument) throws OptionException { // -J should be handled by the appletviewer wrapper binary. // We add it here so that it shows up in the --help output. // Note that there is a special case for this in OptionGroup. } }); add(finalGroup); add(defaultGroup); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/bd3c4af88fcde25afb91781dd0bd56ebcfa8a15b/Parser.java/buggy/core/src/classpath/tools/gnu/classpath/tools/getopt/Parser.java
|
throws NotImplementedException
|
public void addAccessibleSelection(int i) throws NotImplementedException { // TODO: Implement this properly. }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JTabbedPane.java/clean/core/src/classpath/javax/javax/swing/JTabbedPane.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.