rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
throws NotImplementedException
protected void uninstallKeyboardActions() throws NotImplementedException { // TODO: Implement this properly. }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTableHeaderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableHeaderUI.java
protected void uninstallKeyboardActions() throws NotImplementedException { // TODO: Implement this properly. }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicTableHeaderUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableHeaderUI.java
int prefWidth = resizingColumn.getPreferredWidth(); resizingColumn.setWidth(prefWidth);
public void doLayout() { TableColumn resizingColumn = null; int ncols = getColumnCount(); if (ncols < 1) return; int[] pref = new int[ncols]; int prefSum = 0; int rCol = -1; if (tableHeader != null) resizingColumn = tableHeader.getResizingColumn(); for (int i = 0; i < ncols; ++i) { TableColumn col = columnModel.getColumn(i); int p = col.getWidth(); pref[i] = p; prefSum += p; if (resizingColumn == col) rCol = i; } int spill = getWidth() - prefSum; if (resizingColumn != null) { TableColumn col; TableColumn [] cols; switch (getAutoResizeMode()) { case AUTO_RESIZE_LAST_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_NEXT_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_ALL_COLUMNS: cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); break; case AUTO_RESIZE_SUBSEQUENT_COLUMNS: cols = new TableColumn[ncols]; for (int i = rCol; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); break; case AUTO_RESIZE_OFF: default: } } else { TableColumn [] cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTable.java/buggy/core/src/classpath/javax/javax/swing/JTable.java
throw new FactoryConfigurationError();
return new gnu.xml.stream.XMLOutputFactoryImpl();
public static XMLOutputFactory newInstance() throws FactoryConfigurationError { ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { loader = XMLOutputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLOutputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); //return new gnu.xml.stream.XMLOutputFactoryImpl(); throw new FactoryConfigurationError(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/XMLOutputFactory.java/buggy/core/src/classpath/javax/javax/xml/stream/XMLOutputFactory.java
public abstract XMLStreamWriter createXMLStreamWriter(OutputStream stream)
public abstract XMLStreamWriter createXMLStreamWriter(Writer stream)
public abstract XMLStreamWriter createXMLStreamWriter(OutputStream stream) throws XMLStreamException;
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/XMLOutputFactory.java/buggy/core/src/classpath/javax/javax/xml/stream/XMLOutputFactory.java
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a readCell // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
if ( !(DataIOStyleAttribs.isEmpty()) ) {
if ( CurrentArray.getXMLDataIOStyle() instanceof TaggedXMLDataIOStyle ) {
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a readCell // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj);
XMLDataIOStyle readObj = createFormattedReadObj(DataIOStyleAttribs);
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a readCell // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
String readId = readObj.getReadId();
CurrentArray.setXMLDataIOStyle(readObj);
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a readCell // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
if (readId != null) { if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); ReadObj.put(readId, readObj); } DataIOStyleAttribs.clear();
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a readCell // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj)) return readCellObj; } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
DataIOStyleAttribs.clear();
public Object action (SaxDocumentHandler handler, Attributes attrs) { // save these for later, when we know what kind of dataIOstyle we got // Argh we really need a clone on Attributes. Just dumb copy for now. DataIOStyleAttribs.clear(); // all old values cleared DataIOStyleAttribs = attribListToHashtable(attrs); // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); // this will be used in formatted/delimited reads to // set the iteration order of the locator that will populate // the datacube AxisReadOrder = new ArrayList(); // If there is a reference object, clone it to get // the new readObj String readIdRef = (String) DataIOStyleAttribs.get("readIdRef"); if (readIdRef != null) { XMLDataIOStyle readObj = null; if (ReadObj.containsKey(readIdRef)) { XMLDataIOStyle refReadObj = (XMLDataIOStyle) ReadObj.get(readIdRef); try { readObj = (XMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone XMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of Read objects ReadObj.put(readObj.getReadId(), readObj); // we need to put in the local axes refs here, not use cloned ones // otherwise, references will be all screwy and nothing will work for // adding/getting data :). I suppose we should somehow put this code // inside the clone method of the readObject, but its difficult to do, // as well questionable utility. ArrayList newAxisOrderList = new ArrayList(); Iterator iter = CurrentArray.getAxes().iterator(); while (iter.hasNext()) { AxisInterface arrayAxisObj = (AxisInterface) iter.next(); String refAxisId = (String) AxisAliasId.get(arrayAxisObj.getAxisId()); Iterator iter2 = readObj.getIOAxesOrder().iterator(); while (iter2.hasNext()) { AxisInterface readAxisObj = (AxisInterface) iter2.next(); if (readAxisObj.getAxisId().equals(refAxisId)) { newAxisOrderList.add(arrayAxisObj); break; // got a match, go to next axis object } } } // now set the new IO Axes order with correct axis refs readObj.setIOAxesOrder(newAxisOrderList); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\""); Log.warnln("but no previous read node has that id! Ignoring add request."); return (Object) null; } // add read object to Current Array CurrentArray.setXMLDataIOStyle(readObj); // clear attrib table since we cloned to get values DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
public Object action (SaxDocumentHandler handler, Attributes attrs) { // save these for later, when we know what kind of dataIOstyle we got // Argh we really need a clone on Attributes. Just dumb copy for now. DataIOStyleAttribs.clear(); // all old values cleared DataIOStyleAttribs = attribListToHashtable(attrs); // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); // this will be used in formatted/delimited reads to // set the iteration order of the locator that will populate // the datacube AxisReadOrder = new ArrayList(); // If there is a reference object, clone it to get // the new readObj String readIdRef = (String) DataIOStyleAttribs.get("readIdRef"); if (readIdRef != null) { XMLDataIOStyle readObj = null; if (ReadObj.containsKey(readIdRef)) { XMLDataIOStyle refReadObj = (XMLDataIOStyle) ReadObj.get(readIdRef); try { readObj = (XMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone XMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of Read objects ReadObj.put(readObj.getReadId(), readObj); // we need to put in the local axes refs here, not use cloned ones // otherwise, references will be all screwy and nothing will work for // adding/getting data :). I suppose we should somehow put this code // inside the clone method of the readObject, but its difficult to do, // as well questionable utility. ArrayList newAxisOrderList = new ArrayList(); Iterator iter = CurrentArray.getAxes().iterator(); while (iter.hasNext()) { AxisInterface arrayAxisObj = (AxisInterface) iter.next(); String refAxisId = (String) AxisAliasId.get(arrayAxisObj.getAxisId()); Iterator iter2 = readObj.getIOAxesOrder().iterator(); while (iter2.hasNext()) { AxisInterface readAxisObj = (AxisInterface) iter2.next(); if (readAxisObj.getAxisId().equals(refAxisId)) { newAxisOrderList.add(arrayAxisObj); break; // got a match, go to next axis object } } } // now set the new IO Axes order with correct axis refs readObj.setIOAxesOrder(newAxisOrderList); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\""); Log.warnln("but no previous read node has that id! Ignoring add request."); return (Object) null; } // add read object to Current Array CurrentArray.setXMLDataIOStyle(readObj); // clear attrib table since we cloned to get values DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
XMLDataIOStyle readObj = null;
public Object action (SaxDocumentHandler handler, Attributes attrs) { // save these for later, when we know what kind of dataIOstyle we got // Argh we really need a clone on Attributes. Just dumb copy for now. DataIOStyleAttribs.clear(); // all old values cleared DataIOStyleAttribs = attribListToHashtable(attrs); // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); // this will be used in formatted/delimited reads to // set the iteration order of the locator that will populate // the datacube AxisReadOrder = new ArrayList(); // If there is a reference object, clone it to get // the new readObj String readIdRef = (String) DataIOStyleAttribs.get("readIdRef"); if (readIdRef != null) { XMLDataIOStyle readObj = null; if (ReadObj.containsKey(readIdRef)) { XMLDataIOStyle refReadObj = (XMLDataIOStyle) ReadObj.get(readIdRef); try { readObj = (XMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone XMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of Read objects ReadObj.put(readObj.getReadId(), readObj); // we need to put in the local axes refs here, not use cloned ones // otherwise, references will be all screwy and nothing will work for // adding/getting data :). I suppose we should somehow put this code // inside the clone method of the readObject, but its difficult to do, // as well questionable utility. ArrayList newAxisOrderList = new ArrayList(); Iterator iter = CurrentArray.getAxes().iterator(); while (iter.hasNext()) { AxisInterface arrayAxisObj = (AxisInterface) iter.next(); String refAxisId = (String) AxisAliasId.get(arrayAxisObj.getAxisId()); Iterator iter2 = readObj.getIOAxesOrder().iterator(); while (iter2.hasNext()) { AxisInterface readAxisObj = (AxisInterface) iter2.next(); if (readAxisObj.getAxisId().equals(refAxisId)) { newAxisOrderList.add(arrayAxisObj); break; // got a match, go to next axis object } } } // now set the new IO Axes order with correct axis refs readObj.setIOAxesOrder(newAxisOrderList); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\""); Log.warnln("but no previous read node has that id! Ignoring add request."); return (Object) null; } // add read object to Current Array CurrentArray.setXMLDataIOStyle(readObj); // clear attrib table since we cloned to get values DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
String refAxisId = (String) AxisAliasId.get(arrayAxisObj.getAxisId());
String refAxisId = (String) AxisAliasId.get(arrayAxisObj.getAxisId());
public Object action (SaxDocumentHandler handler, Attributes attrs) { // save these for later, when we know what kind of dataIOstyle we got // Argh we really need a clone on Attributes. Just dumb copy for now. DataIOStyleAttribs.clear(); // all old values cleared DataIOStyleAttribs = attribListToHashtable(attrs); // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); // this will be used in formatted/delimited reads to // set the iteration order of the locator that will populate // the datacube AxisReadOrder = new ArrayList(); // If there is a reference object, clone it to get // the new readObj String readIdRef = (String) DataIOStyleAttribs.get("readIdRef"); if (readIdRef != null) { XMLDataIOStyle readObj = null; if (ReadObj.containsKey(readIdRef)) { XMLDataIOStyle refReadObj = (XMLDataIOStyle) ReadObj.get(readIdRef); try { readObj = (XMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone XMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of Read objects ReadObj.put(readObj.getReadId(), readObj); // we need to put in the local axes refs here, not use cloned ones // otherwise, references will be all screwy and nothing will work for // adding/getting data :). I suppose we should somehow put this code // inside the clone method of the readObject, but its difficult to do, // as well questionable utility. ArrayList newAxisOrderList = new ArrayList(); Iterator iter = CurrentArray.getAxes().iterator(); while (iter.hasNext()) { AxisInterface arrayAxisObj = (AxisInterface) iter.next(); String refAxisId = (String) AxisAliasId.get(arrayAxisObj.getAxisId()); Iterator iter2 = readObj.getIOAxesOrder().iterator(); while (iter2.hasNext()) { AxisInterface readAxisObj = (AxisInterface) iter2.next(); if (readAxisObj.getAxisId().equals(refAxisId)) { newAxisOrderList.add(arrayAxisObj); break; // got a match, go to next axis object } } } // now set the new IO Axes order with correct axis refs readObj.setIOAxesOrder(newAxisOrderList); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\""); Log.warnln("but no previous read node has that id! Ignoring add request."); return (Object) null; } // add read object to Current Array CurrentArray.setXMLDataIOStyle(readObj); // clear attrib table since we cloned to get values DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
}
}
public Object action (SaxDocumentHandler handler, Attributes attrs) { // save these for later, when we know what kind of dataIOstyle we got // Argh we really need a clone on Attributes. Just dumb copy for now. DataIOStyleAttribs.clear(); // all old values cleared DataIOStyleAttribs = attribListToHashtable(attrs); // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); // this will be used in formatted/delimited reads to // set the iteration order of the locator that will populate // the datacube AxisReadOrder = new ArrayList(); // If there is a reference object, clone it to get // the new readObj String readIdRef = (String) DataIOStyleAttribs.get("readIdRef"); if (readIdRef != null) { XMLDataIOStyle readObj = null; if (ReadObj.containsKey(readIdRef)) { XMLDataIOStyle refReadObj = (XMLDataIOStyle) ReadObj.get(readIdRef); try { readObj = (XMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone XMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of Read objects ReadObj.put(readObj.getReadId(), readObj); // we need to put in the local axes refs here, not use cloned ones // otherwise, references will be all screwy and nothing will work for // adding/getting data :). I suppose we should somehow put this code // inside the clone method of the readObject, but its difficult to do, // as well questionable utility. ArrayList newAxisOrderList = new ArrayList(); Iterator iter = CurrentArray.getAxes().iterator(); while (iter.hasNext()) { AxisInterface arrayAxisObj = (AxisInterface) iter.next(); String refAxisId = (String) AxisAliasId.get(arrayAxisObj.getAxisId()); Iterator iter2 = readObj.getIOAxesOrder().iterator(); while (iter2.hasNext()) { AxisInterface readAxisObj = (AxisInterface) iter2.next(); if (readAxisObj.getAxisId().equals(refAxisId)) { newAxisOrderList.add(arrayAxisObj); break; // got a match, go to next axis object } } } // now set the new IO Axes order with correct axis refs readObj.setIOAxesOrder(newAxisOrderList); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\""); Log.warnln("but no previous read node has that id! Ignoring add request."); return (Object) null; } // add read object to Current Array CurrentArray.setXMLDataIOStyle(readObj); // clear attrib table since we cloned to get values DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj);
public Object action (SaxDocumentHandler handler, Attributes attrs) { // save these for later, when we know what kind of dataIOstyle we got // Argh we really need a clone on Attributes. Just dumb copy for now. DataIOStyleAttribs.clear(); // all old values cleared DataIOStyleAttribs = attribListToHashtable(attrs); // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); // this will be used in formatted/delimited reads to // set the iteration order of the locator that will populate // the datacube AxisReadOrder = new ArrayList(); // If there is a reference object, clone it to get // the new readObj String readIdRef = (String) DataIOStyleAttribs.get("readIdRef"); if (readIdRef != null) { XMLDataIOStyle readObj = null; if (ReadObj.containsKey(readIdRef)) { XMLDataIOStyle refReadObj = (XMLDataIOStyle) ReadObj.get(readIdRef); try { readObj = (XMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone XMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of Read objects ReadObj.put(readObj.getReadId(), readObj); // we need to put in the local axes refs here, not use cloned ones // otherwise, references will be all screwy and nothing will work for // adding/getting data :). I suppose we should somehow put this code // inside the clone method of the readObject, but its difficult to do, // as well questionable utility. ArrayList newAxisOrderList = new ArrayList(); Iterator iter = CurrentArray.getAxes().iterator(); while (iter.hasNext()) { AxisInterface arrayAxisObj = (AxisInterface) iter.next(); String refAxisId = (String) AxisAliasId.get(arrayAxisObj.getAxisId()); Iterator iter2 = readObj.getIOAxesOrder().iterator(); while (iter2.hasNext()) { AxisInterface readAxisObj = (AxisInterface) iter2.next(); if (readAxisObj.getAxisId().equals(refAxisId)) { newAxisOrderList.add(arrayAxisObj); break; // got a match, go to next axis object } } } // now set the new IO Axes order with correct axis refs readObj.setIOAxesOrder(newAxisOrderList); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\""); Log.warnln("but no previous read node has that id! Ignoring add request."); return (Object) null; } // add read object to Current Array CurrentArray.setXMLDataIOStyle(readObj); // clear attrib table since we cloned to get values DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // must be formatted style, thats the only style that has // repeat formatted commands FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a repeat // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); RepeatFormattedIOCmd repeatObj = new RepeatFormattedIOCmd(); repeatObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { CurrentFormatObjectList.add(repeatObj); if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { CurrentFormatObjectList.add(repeatObj); if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else { Log.warnln("Warning: cant add RepeatFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
if ( !DataIOStyleAttribs.isEmpty()) {
if ( CurrentArray.getXMLDataIOStyle() instanceof TaggedXMLDataIOStyle ) {
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // must be formatted style, thats the only style that has // repeat formatted commands FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a repeat // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); RepeatFormattedIOCmd repeatObj = new RepeatFormattedIOCmd(); repeatObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { CurrentFormatObjectList.add(repeatObj); if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { CurrentFormatObjectList.add(repeatObj); if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else { Log.warnln("Warning: cant add RepeatFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs);
XMLDataIOStyle readObj = createFormattedReadObj(DataIOStyleAttribs);
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // must be formatted style, thats the only style that has // repeat formatted commands FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a repeat // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); RepeatFormattedIOCmd repeatObj = new RepeatFormattedIOCmd(); repeatObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { CurrentFormatObjectList.add(repeatObj); if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { CurrentFormatObjectList.add(repeatObj); if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else { Log.warnln("Warning: cant add RepeatFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
String readId = readObj.getReadId(); if (readId != null) {
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // must be formatted style, thats the only style that has // repeat formatted commands FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a repeat // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); RepeatFormattedIOCmd repeatObj = new RepeatFormattedIOCmd(); repeatObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { CurrentFormatObjectList.add(repeatObj); if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { CurrentFormatObjectList.add(repeatObj); if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else { Log.warnln("Warning: cant add RepeatFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); ReadObj.put(readId, readObj); } DataIOStyleAttribs.clear();
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // must be formatted style, thats the only style that has // repeat formatted commands FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a repeat // command. DataIOStyleAttribs.clear(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); RepeatFormattedIOCmd repeatObj = new RepeatFormattedIOCmd(); repeatObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { CurrentFormatObjectList.add(repeatObj); if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { CurrentFormatObjectList.add(repeatObj); if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(repeatObj)) return repeatObj; } else { Log.warnln("Warning: cant add RepeatFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // If we see a skipChar command, then we must have Formatted data IO style FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a skipChar // command. DataIOStyleAttribs.clear(); // clear out table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); SkipCharFormattedIOCmd skipObj = new SkipCharFormattedIOCmd(); skipObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(skipObj) ) return skipObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(skipObj)) return skipObj; } else { Log.warnln("Warning: cant add SkipCharFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
if ( !DataIOStyleAttribs.isEmpty()) {
if ( CurrentArray.getXMLDataIOStyle() instanceof TaggedXMLDataIOStyle ) {
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // If we see a skipChar command, then we must have Formatted data IO style FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a skipChar // command. DataIOStyleAttribs.clear(); // clear out table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); SkipCharFormattedIOCmd skipObj = new SkipCharFormattedIOCmd(); skipObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(skipObj) ) return skipObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(skipObj)) return skipObj; } else { Log.warnln("Warning: cant add SkipCharFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs);
XMLDataIOStyle readObj = createFormattedReadObj(DataIOStyleAttribs);
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // If we see a skipChar command, then we must have Formatted data IO style FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a skipChar // command. DataIOStyleAttribs.clear(); // clear out table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); SkipCharFormattedIOCmd skipObj = new SkipCharFormattedIOCmd(); skipObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(skipObj) ) return skipObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(skipObj)) return skipObj; } else { Log.warnln("Warning: cant add SkipCharFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
String readId = readObj.getReadId(); if (readId != null) { if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); ReadObj.put(readId, readObj); } DataIOStyleAttribs.clear();
public Object action (SaxDocumentHandler handler, Attributes attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // If we see a skipChar command, then we must have Formatted data IO style FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of read objects ReadObj.put(readId, readObj); } // Note that we DONT need to check for IdRef here, it should be // impossible to have readIdRef on DataAttributes AND then hit a skipChar // command. DataIOStyleAttribs.clear(); // clear out table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); SkipCharFormattedIOCmd skipObj = new SkipCharFormattedIOCmd(); skipObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { if (((FormattedXMLDataIOStyle) formatObj).addFormatCommand(skipObj) ) return skipObj; } else if ( formatObj instanceof RepeatFormattedIOCmd ) { if (((RepeatFormattedIOCmd) formatObj).addFormatCommand(skipObj)) return skipObj; } else { Log.warnln("Warning: cant add SkipCharFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
/*
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") "); // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") "); // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") "); // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") "); // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private ArrayList splitStringIntoStringObjects ( String valueListString, String delimiter, String repeatable, String terminatingDelimiter ) { // the list we will return ArrayList values = new ArrayList(); // parameters int delimiterSize = delimiter.length(); char delimitChar0 = delimiter.charAt(0); int termDelimiterSize = 0; char termDelimitChar0; int valueListSize = valueListString.length(); boolean isNotRepeatable = repeatable.equals("yes") ? false : true; if(terminatingDelimiter != null) { termDelimiterSize = terminatingDelimiter.length(); termDelimitChar0 = terminatingDelimiter.charAt(0); } // loop over the valueListString and derive values int start = 0; while ( start < valueListSize ) { int stop = start + delimiterSize; // safety, can happen if(stop > valueListSize) stop = valueListSize; if ( valueListString.substring(start, stop).compareTo(delimiter) == 0 ) { // we hit a delimiter start += delimiterSize; if (isNotRepeatable) { // gather a value now.// Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } else if (termDelimiterSize > 0 && valueListString.substring(start, start + termDelimiterSize).compareTo(terminatingDelimiter) == 0 ) { // we hit record terminator(delimiter) start += termDelimiterSize; // we DONT repeat on record terminators (??)/* if (isNotRepeatable) { // gather values now.Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; }*/ } else { // we didnt hit a delimiter, gather values // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } return values; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private ArrayList splitStringIntoStringObjects ( String valueListString, String delimiter, String repeatable, String terminatingDelimiter ) { // the list we will return ArrayList values = new ArrayList(); // parameters int delimiterSize = delimiter.length(); char delimitChar0 = delimiter.charAt(0); int termDelimiterSize = 0; char termDelimitChar0; int valueListSize = valueListString.length(); boolean isNotRepeatable = repeatable.equals("yes") ? false : true; if(terminatingDelimiter != null) { termDelimiterSize = terminatingDelimiter.length(); termDelimitChar0 = terminatingDelimiter.charAt(0); } // loop over the valueListString and derive values int start = 0; while ( start < valueListSize ) { int stop = start + delimiterSize; // safety, can happen if(stop > valueListSize) stop = valueListSize; if ( valueListString.substring(start, stop).compareTo(delimiter) == 0 ) { // we hit a delimiter start += delimiterSize; if (isNotRepeatable) { // gather a value now.// Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } else if (termDelimiterSize > 0 && valueListString.substring(start, start + termDelimiterSize).compareTo(terminatingDelimiter) == 0 ) { // we hit record terminator(delimiter) start += termDelimiterSize; // we DONT repeat on record terminators (??)/* if (isNotRepeatable) { // gather values now.Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; }*/ } else { // we didnt hit a delimiter, gather values // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } return values; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private ArrayList splitStringIntoStringObjects ( String valueListString, String delimiter, String repeatable, String terminatingDelimiter ) { // the list we will return ArrayList values = new ArrayList(); // parameters int delimiterSize = delimiter.length(); char delimitChar0 = delimiter.charAt(0); int termDelimiterSize = 0; char termDelimitChar0; int valueListSize = valueListString.length(); boolean isNotRepeatable = repeatable.equals("yes") ? false : true; if(terminatingDelimiter != null) { termDelimiterSize = terminatingDelimiter.length(); termDelimitChar0 = terminatingDelimiter.charAt(0); } // loop over the valueListString and derive values int start = 0; while ( start < valueListSize ) { int stop = start + delimiterSize; // safety, can happen if(stop > valueListSize) stop = valueListSize; if ( valueListString.substring(start, stop).compareTo(delimiter) == 0 ) { // we hit a delimiter start += delimiterSize; if (isNotRepeatable) { // gather a value now.// Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } else if (termDelimiterSize > 0 && valueListString.substring(start, start + termDelimiterSize).compareTo(terminatingDelimiter) == 0 ) { // we hit record terminator(delimiter) start += termDelimiterSize; // we DONT repeat on record terminators (??)/* if (isNotRepeatable) { // gather values now.Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; }*/ } else { // we didnt hit a delimiter, gather values // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } return values; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private ArrayList splitStringIntoStringObjects ( String valueListString, String delimiter, String repeatable, String terminatingDelimiter ) { // the list we will return ArrayList values = new ArrayList(); // parameters int delimiterSize = delimiter.length(); char delimitChar0 = delimiter.charAt(0); int termDelimiterSize = 0; char termDelimitChar0; int valueListSize = valueListString.length(); boolean isNotRepeatable = repeatable.equals("yes") ? false : true; if(terminatingDelimiter != null) { termDelimiterSize = terminatingDelimiter.length(); termDelimitChar0 = terminatingDelimiter.charAt(0); } // loop over the valueListString and derive values int start = 0; while ( start < valueListSize ) { int stop = start + delimiterSize; // safety, can happen if(stop > valueListSize) stop = valueListSize; if ( valueListString.substring(start, stop).compareTo(delimiter) == 0 ) { // we hit a delimiter start += delimiterSize; if (isNotRepeatable) { // gather a value now.// Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } else if (termDelimiterSize > 0 && valueListString.substring(start, start + termDelimiterSize).compareTo(terminatingDelimiter) == 0 ) { // we hit record terminator(delimiter) start += termDelimiterSize; // we DONT repeat on record terminators (??)/* if (isNotRepeatable) { // gather values now.Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; }*/ } else { // we didnt hit a delimiter, gather values // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } return values; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private ArrayList splitStringIntoStringObjects ( String valueListString, String delimiter, String repeatable, String terminatingDelimiter ) { // the list we will return ArrayList values = new ArrayList(); // parameters int delimiterSize = delimiter.length(); char delimitChar0 = delimiter.charAt(0); int termDelimiterSize = 0; char termDelimitChar0; int valueListSize = valueListString.length(); boolean isNotRepeatable = repeatable.equals("yes") ? false : true; if(terminatingDelimiter != null) { termDelimiterSize = terminatingDelimiter.length(); termDelimitChar0 = terminatingDelimiter.charAt(0); } // loop over the valueListString and derive values int start = 0; while ( start < valueListSize ) { int stop = start + delimiterSize; // safety, can happen if(stop > valueListSize) stop = valueListSize; if ( valueListString.substring(start, stop).compareTo(delimiter) == 0 ) { // we hit a delimiter start += delimiterSize; if (isNotRepeatable) { // gather a value now.// Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } else if (termDelimiterSize > 0 && valueListString.substring(start, start + termDelimiterSize).compareTo(terminatingDelimiter) == 0 ) { // we hit record terminator(delimiter) start += termDelimiterSize; // we DONT repeat on record terminators (??)/* if (isNotRepeatable) { // gather values now.Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; }*/ } else { // we didnt hit a delimiter, gather values // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } return values; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private ArrayList splitStringIntoStringObjects ( String valueListString, String delimiter, String repeatable, String terminatingDelimiter ) { // the list we will return ArrayList values = new ArrayList(); // parameters int delimiterSize = delimiter.length(); char delimitChar0 = delimiter.charAt(0); int termDelimiterSize = 0; char termDelimitChar0; int valueListSize = valueListString.length(); boolean isNotRepeatable = repeatable.equals("yes") ? false : true; if(terminatingDelimiter != null) { termDelimiterSize = terminatingDelimiter.length(); termDelimitChar0 = terminatingDelimiter.charAt(0); } // loop over the valueListString and derive values int start = 0; while ( start < valueListSize ) { int stop = start + delimiterSize; // safety, can happen if(stop > valueListSize) stop = valueListSize; if ( valueListString.substring(start, stop).compareTo(delimiter) == 0 ) { // we hit a delimiter start += delimiterSize; if (isNotRepeatable) { // gather a value now.// Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } else if (termDelimiterSize > 0 && valueListString.substring(start, start + termDelimiterSize).compareTo(terminatingDelimiter) == 0 ) { // we hit record terminator(delimiter) start += termDelimiterSize; // we DONT repeat on record terminators (??)/* if (isNotRepeatable) { // gather values now.Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; }*/ } else { // we didnt hit a delimiter, gather values // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } return values; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
private ArrayList splitStringIntoStringObjects ( String valueListString, String delimiter, String repeatable, String terminatingDelimiter ) { // the list we will return ArrayList values = new ArrayList(); // parameters int delimiterSize = delimiter.length(); char delimitChar0 = delimiter.charAt(0); int termDelimiterSize = 0; char termDelimitChar0; int valueListSize = valueListString.length(); boolean isNotRepeatable = repeatable.equals("yes") ? false : true; if(terminatingDelimiter != null) { termDelimiterSize = terminatingDelimiter.length(); termDelimitChar0 = terminatingDelimiter.charAt(0); } // loop over the valueListString and derive values int start = 0; while ( start < valueListSize ) { int stop = start + delimiterSize; // safety, can happen if(stop > valueListSize) stop = valueListSize; if ( valueListString.substring(start, stop).compareTo(delimiter) == 0 ) { // we hit a delimiter start += delimiterSize; if (isNotRepeatable) { // gather a value now.// Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } else if (termDelimiterSize > 0 && valueListString.substring(start, start + termDelimiterSize).compareTo(terminatingDelimiter) == 0 ) { // we hit record terminator(delimiter) start += termDelimiterSize; // we DONT repeat on record terminators (??)/* if (isNotRepeatable) { // gather values now.Log.errorln("ISNOTREPEATABLE CHECK"); // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; }*/ } else { // we didnt hit a delimiter, gather values // find the end of this substring int end = valueListString.indexOf(delimitChar0, start); int termend = 0; if(terminatingDelimiter != null) termend = valueListString.indexOf(terminatingDelimiter.charAt(0), start);// Log.error("end:"+end+" termend:"+termend); String valueString; if(termend == 0 || end < termend) { // can happen if no terminating delimiter if (end < 0) end = valueListSize; // derive our value from string valueString = valueListString.substring(start, end); // add the value to arrayList values.add(valueString);// Log.errorln(" DValue:"+valueString); // this is the last value so terminate the while loop if ((end+delimiterSize) >= valueListSize ) break; start = end; } else { // if (termend < 0) termend = valueListSize; valueString = valueListString.substring(start, termend); // add the value to arrayList values.add(valueString);// Log.errorln(" TValue:"+valueString); // this is the last value so terminate the while loop if ((termend+termDelimiterSize) >= valueListSize ) break; start = termend; } } } return values; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/5c9f8a215d8e4bfb148f7e37982a5cea9056111f/SaxDocumentHandler.java/clean/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
Iterator<FSEntry> rootIterator;
Iterator<? extends FSEntry> rootIterator;
public void iterateRoot(FSDirectory root) { try { Iterator<FSEntry> rootIterator; rootIterator = root.iterator(); while(rootIterator.hasNext()) { FSEntry entry=rootIterator.next(); System.out.println(entry.getName()); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fecc2fef45cb4f4e084815cf6726a427f11c01f2/NTFSTest.java/buggy/fs/src/test/org/jnode/fs/ntfs/test/NTFSTest.java
for (Iterator<FSEntry> i = entry.getDirectory().iterator(); i.hasNext();) {
for (Iterator<? extends FSEntry> i = entry.getDirectory().iterator(); i.hasNext();) {
public String[] list(File directory, FilenameFilter filter) throws IOException { final FSEntry entry = NTFSfs.getRootEntry(); if (entry == null) { throw new FileNotFoundException(directory.getAbsolutePath()); } if (!entry.isDirectory()) { throw new IOException("Cannot list on non-directories " + directory); } final ArrayList<String> list = new ArrayList<String>(); for (Iterator<FSEntry> i = entry.getDirectory().iterator(); i.hasNext();) { final FSEntry child = i.next(); final String name = child.getName(); if ((filter == null) || (filter.accept(directory, name))) { list.add(name); } if(child.isDirectory()) child.getDirectory(); else child.getFile(); if(child.isFile()) System.out.println( "Name = \"" + name + "\" , Size = " + child.getFile().getLength() + ", IsDirectory = " + child.isDirectory()); else System.out.println( "Name = \"" + name + "\" , IsDirectory = " + child.isDirectory()); } return (String[])list.toArray(new String[list.size()]); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fecc2fef45cb4f4e084815cf6726a427f11c01f2/NTFSTest.java/buggy/fs/src/test/org/jnode/fs/ntfs/test/NTFSTest.java
this.hide();
this.setVisible(false);
public void canceled(WizardEvent e) {// System.out.println("It is canceled!"); if (workingThread != null) { workingThread.interrupt(); workingThread = null; } this.hide(); this.dispose(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d3f4f0d032e4305c6a78bdb863ee5599f3e41633/SpoolExportWizard.java/clean/tn5250j/src/org/tn5250j/spoolfile/SpoolExportWizard.java
public void add(int pc, int offset) { addressTable.add(pc, offset);
public final void add(VmMethod method, int pc, int offset) { addressTable.add(method, pc, offset);
public void add(int pc, int offset) { addressTable.add(pc, offset); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ed15438ffd2660dd945871e91d68689a27418753/CompiledMethod.java/clean/core/src/core/org/jnode/vm/compiler/CompiledMethod.java
}
}
public VmAddressMap() { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50e31eccd50a204db22831206646c58f95c4cc44/VmAddressMap.java/buggy/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
if (table != null) { throw new RuntimeException("Address table is locked"); } final AddressPcEntry entry = new AddressPcEntry(pc, offset); if (list == null) { list = entry; } else { AddressPcEntry p = list; while (p.next != null) { p = p.next; } p.next = entry; } }
if (table != null) { throw new RuntimeException( "Address table is locked"); } final AddressPcEntry entry = new AddressPcEntry(pc, offset); if (list == null) { list = entry; } else { if (offset < list.offset) { entry.next = list; list = entry; } else { AddressPcEntry p = list; while ((p.next != null) && (offset > p.next.offset)) { p = p.next; } entry.next = p.next; p.next = entry; } } }
public void add(int pc, int offset) { if (table != null) { throw new RuntimeException("Address table is locked"); } final AddressPcEntry entry = new AddressPcEntry(pc, offset); if (list == null) { list = entry; } else { AddressPcEntry p = list; while (p.next != null) { p = p.next; } p.next = entry; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50e31eccd50a204db22831206646c58f95c4cc44/VmAddressMap.java/buggy/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java
return media;
return mediaName;
public MediaSizeName getMediaSizeName() { return media; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/MediaSize.java/clean/core/src/classpath/javax/javax/print/attribute/standard/MediaSize.java
public boolean isConnected() { return vt.isConnected();// return connected; }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e95e8529e0583c40804063baff9fc99787c4f55b/Session.java/clean/tn5250j/src/org/tn5250j/Session.java
Connect sc = new Connect(frame,LangTool.getString("ss.title"),sessions);
Connect sc = new Connect(frame1,LangTool.getString("ss.title"),sessions);
private String getConnectSession () { Connect sc = new Connect(frame,LangTool.getString("ss.title"),sessions); // load the new session information from the session property file loadSessions(); return sc.getConnectKey(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
int width = m.frame.getWidth(); int height = m.frame.getHeight();
int width = m.frame1.getWidth(); int height = m.frame1.getHeight();
static public void main(String[] args) { if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame.getWidth(); int height = m.frame.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame.setSize(width,height); m.frame.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.frame.setVisible(true); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame.isVisible()) m.frame.setVisible(true); m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
m.frame.setSize(width,height); m.frame.centerFrame();
m.frame1.setSize(width,height); m.frame1.centerFrame();
static public void main(String[] args) { if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame.getWidth(); int height = m.frame.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame.setSize(width,height); m.frame.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.frame.setVisible(true); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame.isVisible()) m.frame.setVisible(true); m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
m.frame.setVisible(true);
m.frame1.setVisible(true);
static public void main(String[] args) { if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame.getWidth(); int height = m.frame.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame.setSize(width,height); m.frame.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.frame.setVisible(true); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame.isVisible()) m.frame.setVisible(true); m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
if (!m.frame.isVisible()) m.frame.setVisible(true);
if (!m.frame1.isVisible()) m.frame1.setVisible(true);
static public void main(String[] args) { if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame.getWidth(); int height = m.frame.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame.setSize(width,height); m.frame.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.frame.setVisible(true); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame.isVisible()) m.frame.setVisible(true); m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
if (!frame.isVisible()) frame.setVisible(true);
if (!frame1.isVisible()) frame1.setVisible(true);
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame.isVisible()) frame.setVisible(true); else { if (isSpecified("-noembed",args)) { newView(); frame.setVisible(true); } } if (isSpecified("-t",args)) frame.addSessionView(sel,s); else frame.addSessionView(session,s); s.connect(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
frame.setVisible(true);
frame1.setVisible(true);
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame.isVisible()) frame.setVisible(true); else { if (isSpecified("-noembed",args)) { newView(); frame.setVisible(true); } } if (isSpecified("-t",args)) frame.addSessionView(sel,s); else frame.addSessionView(session,s); s.connect(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
frame.addSessionView(sel,s);
frame1.addSessionView(sel,s);
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame.isVisible()) frame.setVisible(true); else { if (isSpecified("-noembed",args)) { newView(); frame.setVisible(true); } } if (isSpecified("-t",args)) frame.addSessionView(sel,s); else frame.addSessionView(session,s); s.connect(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
frame.addSessionView(session,s);
frame1.addSessionView(session,s);
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame.isVisible()) frame.setVisible(true); else { if (isSpecified("-noembed",args)) { newView(); frame.setVisible(true); } } if (isSpecified("-t",args)) frame.addSessionView(sel,s); else frame.addSessionView(session,s); s.connect(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
frame = new Gui5250Frame(this, frames.size()); frame.setSize(width,height); frame.centerFrame(); frame.setIconImage(tnicon.getImage()); frame.setIcons(focused,unfocused);
frame1 = new Gui5250Frame(this, frames.size()); frame1.setSize(width,height); frame1.centerFrame(); frame1.setIconImage(tnicon.getImage()); frame1.setIcons(focused,unfocused);
void newView() { int width = 600; int height = 500; if (sessions.containsKey("emul.width")) width = Integer.parseInt(sessions.getProperty("emul.width")); if (sessions.containsKey("emul.height")) height = Integer.parseInt(sessions.getProperty("emul.height")); frame = new Gui5250Frame(this, frames.size()); frame.setSize(width,height); frame.centerFrame(); frame.setIconImage(tnicon.getImage()); frame.setIcons(focused,unfocused); frames.add(frame); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
frames.add(frame);
frames.add(frame1);
void newView() { int width = 600; int height = 500; if (sessions.containsKey("emul.width")) width = Integer.parseInt(sessions.getProperty("emul.width")); if (sessions.containsKey("emul.height")) height = Integer.parseInt(sessions.getProperty("emul.height")); frame = new Gui5250Frame(this, frames.size()); frame.setSize(width,height); frame.centerFrame(); frame.setIconImage(tnicon.getImage()); frame.setIcons(focused,unfocused); frames.add(frame); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a61dbdd53c996e8a76dc4165e5010c2379355b80/My5250.java/buggy/tn5250j/src/org/tn5250j/My5250.java
public void closeSession(Session sessionObject) {
public void closeSession(String sessionName) {
public void closeSession(Session sessionObject) { sessionObject.closeDown(); sessions.removeSession((Session)sessionObject); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/379255347f37d0432228baaff23d41ccb4ad68bd/SessionManager.java/buggy/tn5250j/src/org/tn5250j/SessionManager.java
sessionObject.closeDown(); sessions.removeSession((Session)sessionObject);
Session session = (Session)sessions.item(sessionName); if (session != null) closeSession(session);
public void closeSession(Session sessionObject) { sessionObject.closeDown(); sessions.removeSession((Session)sessionObject); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/379255347f37d0432228baaff23d41ccb4ad68bd/SessionManager.java/buggy/tn5250j/src/org/tn5250j/SessionManager.java
return t_object;
return ObjectHelper.type();
public TypeCode _type() { return t_object; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/ObjectHolder.java/clean/core/src/classpath/org/org/omg/CORBA/ObjectHolder.java
if(!f.exists()) continue;
private void printList(File[] list, PrintStream out) { if (list != null) { for (int i = 0; i < list.length; i++) { File f = list[i]; if (f.isDirectory()) { out.print("[" + f.getName() + "]"); } else { out.print(f.getName() + " " + f.length()); } out.println(); } out.println(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c40ff122c496322a6f2152bb4ae62c57ffbdfa2e/DirCommand.java/clean/fs/src/fs/org/jnode/fs/command/DirCommand.java
int result = JOptionPane.showConfirmDialog(this,message);
int result = JOptionPane.showConfirmDialog(getParent(),message);
public void closeDown() { if (defaultProps.containsKey("saveme")) { defaultProps.remove("saveme"); Object[] args = {propFileName}; String message = MessageFormat.format( LangTool.getString("messages.saveSettings"), args); int result = JOptionPane.showConfirmDialog(this,message); if (result == JOptionPane.OK_OPTION) { try { FileOutputStream out = new FileOutputStream(propFileName); // save off the width and height to be restored later defaultProps.store(out,"------ Defaults --------"); } catch (FileNotFoundException fnfe) {} catch (IOException ioe) {} } } vt.disconnect(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
me.frame,
this.getParent(),
private void closeSession() { Object[] message = new Object[1]; message[0] = LangTool.getString("cs.message"); String[] options = {LangTool.getString("cs.optThis"), LangTool.getString("cs.optAll"), LangTool.getString("cs.optCancel")}; int result = JOptionPane.showOptionDialog( me.frame, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("cs.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); if (result == 0) { closeMe(); } if (result == 1) { me.closingDown(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
me.closingDown();
me.closingDown((Session)this);
private void closeSession() { Object[] message = new Object[1]; message[0] = LangTool.getString("cs.message"); String[] options = {LangTool.getString("cs.optThis"), LangTool.getString("cs.optAll"), LangTool.getString("cs.optCancel")}; int result = JOptionPane.showOptionDialog( me.frame, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("cs.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); if (result == 0) { closeMe(); } if (result == 1) { me.closingDown(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
me.frame);
(Frame)me.frame);
private void doAttributes() { SessionAttributes sa = new SessionAttributes(propFileName, defaultProps, me.frame); sa.addPropertyChangeListener(screen); sa.addPropertyChangeListener(this); sa.showIt(); defaultProps = sa.getProperties(); sa.removePropertyChangeListener(screen); sa.removePropertyChangeListener(this); getFocusForMe(); sa = null; }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
jumpEvent = new SessionJumpEvent(this);
private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); } public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); } public void keyReleased(KeyEvent e) { processVTKeyReleased(e); } }); keyMap = new KeyMapper(); keyMap.init(); /** * this is taken out right now look at the method for description */// initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
me.nextSession();
fireSessionJump(JUMP_NEXT);
protected void nextSession() { me.nextSession(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
me.prevSession();
fireSessionJump(JUMP_PREVIOUS);
protected void prevSession() { me.prevSession(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
me.frame,
this.getParent(),
private void sendScreenEMail() { JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt); Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")}; int result = 0; result = JOptionPane.showOptionDialog( me.frame, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("em.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Send it SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText()); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } sem.setMessage(sb.toString()); try { sem.send(); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sem.release(); sem = null; System.out.println("Message sent"); break; case 1: // Cancel // System.out.println("Cancel"); break; default: break; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
null,
me.frame,
private void showHexMap() { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); DefaultListModel listModel = new DefaultListModel(); StringBuffer sb = new StringBuffer(); // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = vt.ebcdic2uni(x); char ac = vt.getASCIIChar(x); if (!Character.isISOControl(ac)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); listModel.addElement(keyc.getSourceString()); } //Create the list and put it in a scroll pane JList hm = new JList(listModel); hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); hm.setSelectedIndex(0); JScrollPane listScrollPane = new JScrollPane(hm); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); listScrollPane.setSize(40,100); srp.add(listScrollPane,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {LangTool.getString("hm.optInsert"), LangTool.getString("hm.optCancel")}; int result = 0; result = JOptionPane.showOptionDialog( null, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("hm.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Insert character String k = ""; k += ((String)hm.getSelectedValue()).charAt(7); screen.sendKeys(k); break; case 1: // Cancel// System.out.println("Cancel"); break; default: break; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e480ddad6ac818533f9a417616e8a35aa7b9250c/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
URL url = getClass().getResource(image_location);
URL file=null; try { file = My5250.classLoader.getResource(image_location);
public TN5250jSplashScreen(String image_location) { // get the URL given the image location URL url = getClass().getResource(image_location); if (url == null) { throw new IllegalArgumentException("Image could not be found: " + image_location); } // convert URL to Image icon ImageIcon image = new ImageIcon(url); initialize(image); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e95e8529e0583c40804063baff9fc99787c4f55b/TN5250jSplashScreen.java/clean/tn5250j/src/org/tn5250j/gui/TN5250jSplashScreen.java
if (url == null) { throw new IllegalArgumentException("Image could not be found: " + image_location);
public TN5250jSplashScreen(String image_location) { // get the URL given the image location URL url = getClass().getResource(image_location); if (url == null) { throw new IllegalArgumentException("Image could not be found: " + image_location); } // convert URL to Image icon ImageIcon image = new ImageIcon(url); initialize(image); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e95e8529e0583c40804063baff9fc99787c4f55b/TN5250jSplashScreen.java/clean/tn5250j/src/org/tn5250j/gui/TN5250jSplashScreen.java
ImageIcon image = new ImageIcon(url);
catch (Exception e) { System.err.println(e); } ImageIcon image = new ImageIcon(file);
public TN5250jSplashScreen(String image_location) { // get the URL given the image location URL url = getClass().getResource(image_location); if (url == null) { throw new IllegalArgumentException("Image could not be found: " + image_location); } // convert URL to Image icon ImageIcon image = new ImageIcon(url); initialize(image); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/e95e8529e0583c40804063baff9fc99787c4f55b/TN5250jSplashScreen.java/clean/tn5250j/src/org/tn5250j/gui/TN5250jSplashScreen.java
public void onConfigChanged(SessionConfigEvent pce) { String pn = pce.getPropertyName(); if (pn.equals("keypad")) { if (((String)pce.getNewValue()).equals("Yes")) { keyPad.setVisible(true); } else { keyPad.setVisible(false); } this.validate(); } if (pn.equals("doubleClick")) { if (((String)pce.getNewValue()).equals("Yes")) { doubleClick = true; } else { doubleClick = false; } } if (pn.equals("mouseWheel")) { if (((String)pce.getNewValue()).equals("Yes")) { scroller.addMouseWheelListener((SessionGUI)this); } else { scroller.removeMouseWheelListener((SessionGUI)this); } }// screen.propertyChange(pce); resizeMe(); repaint(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/ab81b6cdf373299f99830eac067d8b5f89c79453/Gui5250.java/buggy/tn5250j/src/org/tn5250j/Gui5250.java
protected void paintComponent(Graphics g) { log.debug("paint from screen"); if (bi == null) { checkOffScreenImage(); }// screen.paintComponent3(g); Graphics2D g2 = (Graphics2D) g; //Rectangle r = g.getClipBounds(); g2.setColor(bi.colorBg); g2.fillRect(0, 0, getWidth(), getHeight()); bi.drawImageBuffer(g2); if (rubberband.isAreaSelected() && !rubberband.isDragging()) { rubberband.erase(); rubberband.draw(); } // this was a fix for a keypad drawing problem under JDK1.2/1.3 // but caused problems under Linux/JDK1.4 //keyPad.repaint(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/ab81b6cdf373299f99830eac067d8b5f89c79453/Gui5250.java/buggy/tn5250j/src/org/tn5250j/Gui5250.java
public final void writeTo(SocketBuffer skbuf, int skbufOffset) { skbuf.set(skbufOffset, address, 0, length);
public static void writeTo(SocketBuffer skbuf, int skbufOffset, Inet4Address address) { skbuf.set(skbufOffset, address.getAddress(), 0, length);
public final void writeTo(SocketBuffer skbuf, int skbufOffset) { skbuf.set(skbufOffset, address, 0, length); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/IPv4Address.java/buggy/net/src/net/org/jnode/net/ipv4/IPv4Address.java
if(dataModel instanceof MutableComboBoxModel) {
if (dataModel instanceof MutableComboBoxModel)
public void insertItemAt(Object element, int index) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).insertElementAt(element, index); } else { throw new RuntimeException("Unable to insert the item because the data model it is not an instance of MutableComboBoxModel."); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
} else { throw new RuntimeException("Unable to insert the item because the data model it is not an instance of MutableComboBoxModel."); }
else throw new RuntimeException("Unable to insert the item because the data " + "model it is not an instance of " + "MutableComboBoxModel.");
public void insertItemAt(Object element, int index) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).insertElementAt(element, index); } else { throw new RuntimeException("Unable to insert the item because the data model it is not an instance of MutableComboBoxModel."); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
if(dataModel instanceof MutableComboBoxModel) {
if (dataModel instanceof MutableComboBoxModel)
public void removeItem(Object element) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).removeElement(element); } else { throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel."); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
} else { throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel."); }
else throw new RuntimeException("Unable to remove the item because the data " + "model it is not an instance of " + "MutableComboBoxModel.");
public void removeItem(Object element) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).removeElement(element); } else { throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel."); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
if(dataModel instanceof MutableComboBoxModel) {
if (dataModel instanceof MutableComboBoxModel)
public void removeItemAt(int index) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).removeElementAt(index); } else { throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel."); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
} else { throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel."); }
else throw new RuntimeException("Unable to remove the item because the data " + "model it is not an instance of " + "MutableComboBoxModel.");
public void removeItemAt(int index) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).removeElementAt(index); } else { throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel."); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
firePropertyChange("maximumRowCount", oldMaximumRowCount, maximumRowCount);
firePropertyChange("maximumRowCount", oldMaximumRowCount, maximumRowCount);
public void setMaximumRowCount(int rowCount) { if (maximumRowCount != rowCount) { int oldMaximumRowCount = maximumRowCount; maximumRowCount = rowCount; firePropertyChange("maximumRowCount", oldMaximumRowCount, maximumRowCount); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
public void setModel(ComboBoxModel newDataModel) { // dataModel is null if it this method is called from inside the constructors. if(dataModel != null) { // Prevents unneccessary updates. if (dataModel == newDataModel) return; // Removes itself (as DataListener) from the to-be-replaced model. dataModel.removeListDataListener(this); } /* Adds itself as a DataListener to the new model. * It is intentioned that this operation will fail with a NullPointerException if the * caller delivered a null argument. */ newDataModel.addListDataListener(this); // Stores old data model for event notification. ComboBoxModel oldDataModel = dataModel; dataModel = newDataModel; // Notifies the listeners of the model change. firePropertyChange("model", oldDataModel, dataModel); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
if(dataModel != null) {
if (dataModel != null) {
public void setModel(ComboBoxModel newDataModel) { // dataModel is null if it this method is called from inside the constructors. if(dataModel != null) { // Prevents unneccessary updates. if (dataModel == newDataModel) return; // Removes itself (as DataListener) from the to-be-replaced model. dataModel.removeListDataListener(this); } /* Adds itself as a DataListener to the new model. * It is intentioned that this operation will fail with a NullPointerException if the * caller delivered a null argument. */ newDataModel.addListDataListener(this); // Stores old data model for event notification. ComboBoxModel oldDataModel = dataModel; dataModel = newDataModel; // Notifies the listeners of the model change. firePropertyChange("model", oldDataModel, dataModel); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
storeTargetName(target);
public Statement(Object target, String methodName, Object[] arguments) { this.target = target; this.methodName = methodName; this.arguments = (arguments != null) ? arguments : new Object[0]; storeTargetName(target); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/Statement.java/buggy/core/src/classpath/java/java/beans/Statement.java
if (args[i] == null) continue;
private boolean compatible(Class[] params, Class[] args) { for (int i = 0; i < params.length; i++) { // Treat Integer like int if appropriate Class nativeType = unwrap(args[i]); if (nativeType != null && params[i].isPrimitive() && params[i].isAssignableFrom(nativeType)) continue; if (params[i].isAssignableFrom(args[i])) continue; return false; } return true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/Statement.java/buggy/core/src/classpath/java/java/beans/Statement.java
argTypes[i] = args[i].getClass();
argTypes[i] = (args[i] != null) ? args[i].getClass() : null;
final Object doExecute() throws Exception { Class klazz = (target instanceof Class) ? (Class) target : target.getClass(); Object args[] = (arguments == null) ? new Object[0] : arguments; Class argTypes[] = new Class[args.length]; for (int i = 0; i < args.length; i++) argTypes[i] = args[i].getClass(); if (target.getClass().isArray()) { // FIXME: invoke may have to be used. For now, cast to Number // and hope for the best. If caller didn't behave, we go boom // and throw the exception. if (methodName.equals("get") && argTypes.length == 1) return Array.get(target, ((Number)args[0]).intValue()); if (methodName.equals("set") && argTypes.length == 2) { Object obj = Array.get(target, ((Number)args[0]).intValue()); Array.set(target, ((Number)args[0]).intValue(), args[1]); return obj; } throw new NoSuchMethodException("No matching method for statement " + toString()); } // If we already cached the method, just use it. if (method != null) return method.invoke(target, args); else if (ctor != null) return ctor.newInstance(args); // Find a matching method to call. JDK seems to go through all // this to find the method to call. // if method name or length don't match, skip // Need to go through each arg // If arg is wrapper - check if method arg is matchable builtin // or same type or super // - check that method arg is same or super if (methodName.equals("new") && target instanceof Class) { Constructor ctors[] = klazz.getConstructors(); for (int i = 0; i < ctors.length; i++) { // Skip methods with wrong number of args. Class ptypes[] = ctors[i].getParameterTypes(); if (ptypes.length != args.length) continue; // Check if method matches if (!compatible(ptypes, argTypes)) continue; // Use method[i] if it is more specific. // FIXME: should this check both directions and throw if // neither is more specific? if (ctor == null) { ctor = ctors[i]; continue; } Class mptypes[] = ctor.getParameterTypes(); if (moreSpecific(ptypes, mptypes)) ctor = ctors[i]; } if (ctor == null) throw new InstantiationException("No matching constructor for statement " + toString()); return ctor.newInstance(args); } Method methods[] = klazz.getMethods(); for (int i = 0; i < methods.length; i++) { // Skip methods with wrong name or number of args. if (!methods[i].getName().equals(methodName)) continue; Class ptypes[] = methods[i].getParameterTypes(); if (ptypes.length != args.length) continue; // Check if method matches if (!compatible(ptypes, argTypes)) continue; // Use method[i] if it is more specific. // FIXME: should this check both directions and throw if // neither is more specific? if (method == null) { method = methods[i]; continue; } Class mptypes[] = method.getParameterTypes(); if (moreSpecific(ptypes, mptypes)) method = methods[i]; } if (method == null) throw new NoSuchMethodException("No matching method for statement " + toString()); return method.invoke(target, args); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/Statement.java/buggy/core/src/classpath/java/java/beans/Statement.java
} catch(IllegalArgumentException iae){ System.err.println("method: " + method); for(int i=0;i<args.length;i++){ System.err.println("args[" + i + "]: " + args[i]); } throw iae; }
final Object doExecute() throws Exception { Class klazz = (target instanceof Class) ? (Class) target : target.getClass(); Object args[] = (arguments == null) ? new Object[0] : arguments; Class argTypes[] = new Class[args.length]; for (int i = 0; i < args.length; i++) argTypes[i] = args[i].getClass(); if (target.getClass().isArray()) { // FIXME: invoke may have to be used. For now, cast to Number // and hope for the best. If caller didn't behave, we go boom // and throw the exception. if (methodName.equals("get") && argTypes.length == 1) return Array.get(target, ((Number)args[0]).intValue()); if (methodName.equals("set") && argTypes.length == 2) { Object obj = Array.get(target, ((Number)args[0]).intValue()); Array.set(target, ((Number)args[0]).intValue(), args[1]); return obj; } throw new NoSuchMethodException("No matching method for statement " + toString()); } // If we already cached the method, just use it. if (method != null) return method.invoke(target, args); else if (ctor != null) return ctor.newInstance(args); // Find a matching method to call. JDK seems to go through all // this to find the method to call. // if method name or length don't match, skip // Need to go through each arg // If arg is wrapper - check if method arg is matchable builtin // or same type or super // - check that method arg is same or super if (methodName.equals("new") && target instanceof Class) { Constructor ctors[] = klazz.getConstructors(); for (int i = 0; i < ctors.length; i++) { // Skip methods with wrong number of args. Class ptypes[] = ctors[i].getParameterTypes(); if (ptypes.length != args.length) continue; // Check if method matches if (!compatible(ptypes, argTypes)) continue; // Use method[i] if it is more specific. // FIXME: should this check both directions and throw if // neither is more specific? if (ctor == null) { ctor = ctors[i]; continue; } Class mptypes[] = ctor.getParameterTypes(); if (moreSpecific(ptypes, mptypes)) ctor = ctors[i]; } if (ctor == null) throw new InstantiationException("No matching constructor for statement " + toString()); return ctor.newInstance(args); } Method methods[] = klazz.getMethods(); for (int i = 0; i < methods.length; i++) { // Skip methods with wrong name or number of args. if (!methods[i].getName().equals(methodName)) continue; Class ptypes[] = methods[i].getParameterTypes(); if (ptypes.length != args.length) continue; // Check if method matches if (!compatible(ptypes, argTypes)) continue; // Use method[i] if it is more specific. // FIXME: should this check both directions and throw if // neither is more specific? if (method == null) { method = methods[i]; continue; } Class mptypes[] = method.getParameterTypes(); if (moreSpecific(ptypes, mptypes)) method = methods[i]; } if (method == null) throw new NoSuchMethodException("No matching method for statement " + toString()); return method.invoke(target, args); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/Statement.java/buggy/core/src/classpath/java/java/beans/Statement.java
Class klass = target.getClass();
String targetName = target.getClass().getName(); if ( targetName.startsWith("java")) { targetName = targetName.substring(targetName.lastIndexOf('.') + 1); }
public String toString() { StringBuffer result = new StringBuffer(); Class klass = target.getClass(); result.append( ((WeakHashMap) classMaps.get(klass)).get(target)); result.append("."); result.append(methodName); result.append("("); String sep = ""; for (int i = 0; i < arguments.length; i++) { result.append(sep); result.append(arguments[i].getClass().getName()); sep = ", "; } result.append(")"); return result.toString(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/Statement.java/buggy/core/src/classpath/java/java/beans/Statement.java
result.append( ((WeakHashMap) classMaps.get(klass)).get(target));
result.append(targetName);
public String toString() { StringBuffer result = new StringBuffer(); Class klass = target.getClass(); result.append( ((WeakHashMap) classMaps.get(klass)).get(target)); result.append("."); result.append(methodName); result.append("("); String sep = ""; for (int i = 0; i < arguments.length; i++) { result.append(sep); result.append(arguments[i].getClass().getName()); sep = ", "; } result.append(")"); return result.toString(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/Statement.java/buggy/core/src/classpath/java/java/beans/Statement.java
result.append(arguments[i].getClass().getName());
result.append( ( arguments[i] == null ) ? "null" : ( arguments[i] instanceof String ) ? "\"" + arguments[i] + "\"" : arguments[i].getClass().getName());
public String toString() { StringBuffer result = new StringBuffer(); Class klass = target.getClass(); result.append( ((WeakHashMap) classMaps.get(klass)).get(target)); result.append("."); result.append(methodName); result.append("("); String sep = ""; for (int i = 0; i < arguments.length; i++) { result.append(sep); result.append(arguments[i].getClass().getName()); sep = ", "; } result.append(")"); return result.toString(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/Statement.java/buggy/core/src/classpath/java/java/beans/Statement.java
"ToolBar.border", new MetalBorders.ToolBarBorder(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new Insets(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", new Boolean(true), "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "DesktopIcon.border", MetalBorders.getDesktopIconBorder(), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(), "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(), "InternalFrame.paletteTitleHeight", new Integer(11), "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.background", getControl(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", getControlShadow(), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), "Table.selectionForeground", new ColorUIResource(0, 0, 0), "TableHeader.background", getControl(), "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getToggleButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", getFocusColor(), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/MetalLookAndFeel.java/clean/core/src/classpath/javax/javax/swing/plaf/metal/MetalLookAndFeel.java
new SecureRandom ().nextBytes(buffer);
getDefaultPRNG().nextBytes(buffer);
protected void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else if (irnd != null) { try { irnd.nextBytes(buffer, 0, buffer.length); } catch (LimitReachedException lre) { irnd = null; new SecureRandom ().nextBytes(buffer); } } else { new SecureRandom ().nextBytes(buffer); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BaseKeyAgreementParty.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/BaseKeyAgreementParty.java
{ new SecureRandom ().nextBytes(buffer);
getDefaultPRNG().nextBytes(buffer);
protected void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else if (irnd != null) { try { irnd.nextBytes(buffer, 0, buffer.length); } catch (LimitReachedException lre) { irnd = null; new SecureRandom ().nextBytes(buffer); } } else { new SecureRandom ().nextBytes(buffer); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BaseKeyAgreementParty.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/BaseKeyAgreementParty.java
}
protected void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else if (irnd != null) { try { irnd.nextBytes(buffer, 0, buffer.length); } catch (LimitReachedException lre) { irnd = null; new SecureRandom ().nextBytes(buffer); } } else { new SecureRandom ().nextBytes(buffer); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/BaseKeyAgreementParty.java/buggy/core/src/classpath/gnu/gnu/javax/crypto/key/BaseKeyAgreementParty.java
providers.remove(className);
FontProvider prv = providers.remove(className); if(firstProvider == prv) { firstProvider = null; }
public void extensionRemoved(ExtensionPoint point, Extension extension) { final ConfigurationElement[] elements = extension.getConfigurationElements(); for (int j = 0; j < elements.length; j++) { final String className = elements[j].getAttribute("class"); log.debug("Removed provider: class=" + className); if (className != null) { providers.remove(className); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27da370c3e05f80083e8c618351850b1d1d108b6/DefaultFontManager.java/clean/gui/src/awt/org/jnode/awt/font/def/DefaultFontManager.java
if(firstProviderName.equals(prv.getName())) continue;
private FontProvider getProvider(Font font) { log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27da370c3e05f80083e8c618351850b1d1d108b6/DefaultFontManager.java/clean/gui/src/awt/org/jnode/awt/font/def/DefaultFontManager.java
firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, oldIcon, newIcon);
firePropertyChange("disabledIcon", oldIcon, newIcon);
public void setDisabledIcon(Icon newIcon) { if (disabledIcon != newIcon) { Icon oldIcon = disabledIcon; disabledIcon = newIcon; firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, oldIcon, newIcon); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/JLabel.java/buggy/core/src/classpath/javax/javax/swing/JLabel.java
firePropertyChange(DISPLAYED_MNEMONIC_CHANGED_PROPERTY,
firePropertyChange("displayedMnemonic",
public void setDisplayedMnemonic(int mnemonic) { if (displayedMnemonic != mnemonic) { firePropertyChange(DISPLAYED_MNEMONIC_CHANGED_PROPERTY, displayedMnemonic, mnemonic); displayedMnemonic = mnemonic; if (text != null) setDisplayedMnemonicIndex(text.toUpperCase().indexOf(mnemonic)); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/JLabel.java/buggy/core/src/classpath/javax/javax/swing/JLabel.java
firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY,
firePropertyChange("displayedMnemonicIndex",
public void setDisplayedMnemonicIndex(int newIndex) throws IllegalArgumentException { if (newIndex < -1 || (text != null && newIndex >= text.length())) throw new IllegalArgumentException(); if (newIndex == -1 || text == null || text.charAt(newIndex) != displayedMnemonic) newIndex = -1; if (newIndex != displayedMnemonicIndex) { int oldIndex = displayedMnemonicIndex; displayedMnemonicIndex = newIndex; firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY, oldIndex, newIndex); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/JLabel.java/buggy/core/src/classpath/javax/javax/swing/JLabel.java
firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, oldAlignment,
firePropertyChange("horizontalAlignment", oldAlignment,
public void setHorizontalAlignment(int alignment) { if (horizontalAlignment == alignment) return; int oldAlignment = horizontalAlignment; horizontalAlignment = checkHorizontalKey(alignment, "horizontalAlignment"); firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, oldAlignment, horizontalAlignment); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/JLabel.java/buggy/core/src/classpath/javax/javax/swing/JLabel.java