rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
} | } | public Object getValue() { return value; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JOptionPane.java/buggy/core/src/classpath/javax/javax/swing/JOptionPane.java |
System.out.println(fnfe.getMessage()); | log.warn(fnfe.getMessage()); | protected final void toggleDebug (CodePage cp) { if (codePage == null) codePage = cp; dumpBytes = !dumpBytes; if (dumpBytes) { try { if (fw == null) { fw = new FileOutputStream("log.txt"); dw = new BufferedOutputStream(fw); } } catch (FileNotFoundException fnfe) { System.out.println(fnfe.getMessage()); } } else { try { if (dw != null) dw.close(); if (fw != null) fw.close(); dw = null; fw = null; codePage = null; } catch(IOException ioe) { System.out.println(ioe.getMessage()); } } System.out.println("Data Stream output is now " + dumpBytes); } | 1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/379255347f37d0432228baaff23d41ccb4ad68bd/DataStreamProducer.java/buggy/tn5250j/src/org/tn5250j/DataStreamProducer.java |
System.out.println(ioe.getMessage()); | log.warn(ioe.getMessage()); | protected final void toggleDebug (CodePage cp) { if (codePage == null) codePage = cp; dumpBytes = !dumpBytes; if (dumpBytes) { try { if (fw == null) { fw = new FileOutputStream("log.txt"); dw = new BufferedOutputStream(fw); } } catch (FileNotFoundException fnfe) { System.out.println(fnfe.getMessage()); } } else { try { if (dw != null) dw.close(); if (fw != null) fw.close(); dw = null; fw = null; codePage = null; } catch(IOException ioe) { System.out.println(ioe.getMessage()); } } System.out.println("Data Stream output is now " + dumpBytes); } | 1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/379255347f37d0432228baaff23d41ccb4ad68bd/DataStreamProducer.java/buggy/tn5250j/src/org/tn5250j/DataStreamProducer.java |
System.out.println("Data Stream output is now " + dumpBytes); | log.info("Data Stream output is now " + dumpBytes); | protected final void toggleDebug (CodePage cp) { if (codePage == null) codePage = cp; dumpBytes = !dumpBytes; if (dumpBytes) { try { if (fw == null) { fw = new FileOutputStream("log.txt"); dw = new BufferedOutputStream(fw); } } catch (FileNotFoundException fnfe) { System.out.println(fnfe.getMessage()); } } else { try { if (dw != null) dw.close(); if (fw != null) fw.close(); dw = null; fw = null; codePage = null; } catch(IOException ioe) { System.out.println(ioe.getMessage()); } } System.out.println("Data Stream output is now " + dumpBytes); } | 1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/379255347f37d0432228baaff23d41ccb4ad68bd/DataStreamProducer.java/buggy/tn5250j/src/org/tn5250j/DataStreamProducer.java |
final VmType[] compSuperClasses = componentType.getSuperClassesArray(); final int compLength = compSuperClasses.length; | final VmType[] compSuperClasses; final int compLength; if (componentType.isPrimitive()) { compSuperClasses = null; compLength = 0; } else { compSuperClasses = componentType.getSuperClassesArray(); compLength = compSuperClasses.length; } | protected VmType<?>[] createSuperClassesArray(HashSet<VmInterfaceClass<?>> allInterfaces) { final VmType[] compSuperClasses = componentType.getSuperClassesArray(); final int compLength = compSuperClasses.length; final int length = compLength + 2 + allInterfaces.size(); final VmType<?>[] array = new VmType[length]; array[0] = this; array[1] = this.getSuperClass(); for (int i = 0; i < compLength; i++) { array[2 + i] = compSuperClasses[i].getArrayClass(false); } int index = compLength + 2; for (VmInterfaceClass intfClass : allInterfaces) { array[index++] = intfClass; } if (false) { System.out.println("SuperClassesArray for " + getName() + ": " + getSuperClassDepth()); for (int i = 0; i < length; i++) { System.out.println("[" + i + "]\t" + array[i].getName()); } } return array; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c6baaa75acb3b88d0c9b8d6cc7a331f27e5db196/VmArrayClass.java/buggy/core/src/core/org/jnode/vm/classmgr/VmArrayClass.java |
VmNormalClass superClass, | String superClassName, | public VmClassType( String name, VmNormalClass superClass, VmClassLoader loader, int typeSize, ProtectionDomain protectionDomain) { super(name, superClass, loader, typeSize, protectionDomain); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/VmClassType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmClassType.java |
int typeSize, ProtectionDomain protectionDomain) { super(name, superClass, loader, typeSize, protectionDomain); | int accessFlags, ProtectionDomain protectionDomain) { super(name, superClassName, loader, accessFlags, protectionDomain); | public VmClassType( String name, VmNormalClass superClass, VmClassLoader loader, int typeSize, ProtectionDomain protectionDomain) { super(name, superClass, loader, typeSize, protectionDomain); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/VmClassType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmClassType.java |
final VmArrayClass getArrayClass(boolean link) { | final VmArrayClass getArrayClass(String arrayClassName) { | final VmArrayClass getArrayClass(boolean link) { if (arrayClass == null) { arrayClass = createArrayClass(link, null); } return arrayClass; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java |
arrayClass = createArrayClass(link, null); | arrayClass = createArrayClass(true, arrayClassName); } else { arrayClass.link(); | final VmArrayClass getArrayClass(boolean link) { if (arrayClass == null) { arrayClass = createArrayClass(link, null); } return arrayClass; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java |
list.add(object); fireIntervalAdded(this, list.size() - 1, list.size()); | if (list.size() == 0) { list.add(object); selectedItem = object; fireContentsChanged(this, -1, -1); } else { list.add(object); fireIntervalAdded(this, list.size() - 1, list.size() - 1); } | public void addElement(Object object) { list.add(object); fireIntervalAdded(this, list.size() - 1, list.size()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/DefaultComboBoxModel.java/clean/core/src/classpath/javax/javax/swing/DefaultComboBoxModel.java |
if (index < 0 || index >= list.size()) return null; | public Object getElementAt(int index) { return list.elementAt(index); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/DefaultComboBoxModel.java/clean/core/src/classpath/javax/javax/swing/DefaultComboBoxModel.java |
|
list.clear(); int listSize = getSize(); fireIntervalAdded(this, 0, listSize); | selectedItem = null; int size = getSize(); if (size > 0) { list.clear(); fireIntervalRemoved(this, 0, size - 1); } | public void removeAllElements() { list.clear(); int listSize = getSize(); fireIntervalAdded(this, 0, listSize); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/DefaultComboBoxModel.java/clean/core/src/classpath/javax/javax/swing/DefaultComboBoxModel.java |
if (selected == index) { if (selected > 0) selectedItem = getElementAt(selected - 1); else selectedItem = getElementAt(selected); } | public void removeElementAt(int index) { list.remove(index); fireIntervalRemoved(this, index, index); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/DefaultComboBoxModel.java/clean/core/src/classpath/javax/javax/swing/DefaultComboBoxModel.java |
|
if(object == null || list.contains(object)) { | public void setSelectedItem(Object object) { // Updates the selected item only if the given object // is null or in the list (this is how the JDK behaves). if(object == null || list.contains(object)) { selectedItem = object; fireContentsChanged(this, -1, -1); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/DefaultComboBoxModel.java/clean/core/src/classpath/javax/javax/swing/DefaultComboBoxModel.java |
|
fireContentsChanged(this, -1, -1); } | if(object == null || list.contains(object)) fireContentsChanged(this, -1, -1); | public void setSelectedItem(Object object) { // Updates the selected item only if the given object // is null or in the list (this is how the JDK behaves). if(object == null || list.contains(object)) { selectedItem = object; fireContentsChanged(this, -1, -1); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/DefaultComboBoxModel.java/clean/core/src/classpath/javax/javax/swing/DefaultComboBoxModel.java |
public abstract MemoryResource claimChildResource(int offset, int size, boolean allowOverlaps) | public abstract MemoryResource claimChildResource(Extent size, int align) | public abstract MemoryResource claimChildResource(int offset, int size, boolean allowOverlaps) throws IndexOutOfBoundsException, ResourceNotFreeException; | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/MemoryResource.java/clean/core/src/core/org/jnode/system/MemoryResource.java |
public abstract void setByte(int memPtr, byte value, int count); | public abstract void setByte(int memPtr, byte value); | public abstract void setByte(int memPtr, byte value, int count); | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/MemoryResource.java/clean/core/src/core/org/jnode/system/MemoryResource.java |
public abstract void setShort(int memPtr, short value, int count); | public abstract void setShort(int memPtr, short value); | public abstract void setShort(int memPtr, short value, int count); | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/MemoryResource.java/clean/core/src/core/org/jnode/system/MemoryResource.java |
public IllegalStateException(String s) | public IllegalStateException() | public IllegalStateException(String s) { super(s); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/IllegalStateException.java/buggy/core/src/classpath/java/java/lang/IllegalStateException.java |
super(s); | public IllegalStateException(String s) { super(s); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/IllegalStateException.java/buggy/core/src/classpath/java/java/lang/IllegalStateException.java |
|
public IncompatibleClassChangeError(String s) { super(s); | public IncompatibleClassChangeError() { | public IncompatibleClassChangeError(String s) { super(s); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/IncompatibleClassChangeError.java/buggy/core/src/classpath/java/java/lang/IncompatibleClassChangeError.java |
public final VmMethod getMethod(String name, String signature) { return getMethod(name, signature, false, true, VmMember.calcHashCode( name, signature)); | final VmMethod getMethod(String name, String signature, boolean onlyThisClass, boolean searchInterfaces, int hashCode) { /* Search in my own method table */ final VmMethod[] mt = this.methodTable; if (mt != null) { final int count = mt.length; for (int i = 0; i < count; i++) { final VmMethod mts = mt[i]; /** * Use the hascode as first match, to make this as fast as * possible */ int mtsHashCode = mts.getMemberHashCode(); if (mtsHashCode == hashCode) { if (mts.nameEquals(name) && mts.signatureEquals(signature)) { return mts; } } else if (mtsHashCode > hashCode) { /** * The methods are sorted on hashcode, so we can stop * searching here */ break; } } } if (isAbstract()) { final VmMethod method = getSyntheticAbstractMethod(name, signature, hashCode); if (method != null) { return method; } } if ((superClass != null) && (!onlyThisClass)) { final VmMethod method = superClass.getMethod(name, signature, false, false, hashCode); if (method != null) { return method; } } if (isInterface() || searchInterfaces) { final VmInterfaceClass[] ait = allInterfaceTable; if (ait != null) { final int count = ait.length; for (int i = 0; i < count; i++) { final VmInterfaceClass intf = ait[i]; final VmMethod method = intf.getMethod(name, signature, true, false, hashCode); if (method != null) { return method; } } } } return null; | public final VmMethod getMethod(String name, String signature) { return getMethod(name, signature, false, true, VmMember.calcHashCode( name, signature)); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java |
public NoSuchMethodError(String s) { super(s); | public NoSuchMethodError() { | public NoSuchMethodError(String s) { super(s); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/NoSuchMethodError.java/buggy/core/src/classpath/java/java/lang/NoSuchMethodError.java |
public AbstractMethodError(String s) { super(s); | public AbstractMethodError() { | public AbstractMethodError(String s) { super(s); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/AbstractMethodError.java/buggy/core/src/classpath/java/java/lang/AbstractMethodError.java |
public NotResolvedYetException(String s) { super(s); | public NotResolvedYetException() { super(); | public NotResolvedYetException(String s) { super(s); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/NotResolvedYetException.java/buggy/core/src/core/org/jnode/vm/classmgr/NotResolvedYetException.java |
Item pop(int type) { | Item pop() { | Item pop(int type) { // if (tos == 0) { // // the item requested in not on the virtual stack // // but already on the operand stack (it was pushed // // outside the current basic block) // // thus create a new stack item // Item it = createStack(type); // if (checkOperandStack) { // // insert at the begin of stack // // even if the vstack is empty, there // // may still be items popped from vstack // // that are not popped from operand stack // prependToOperandStack(it); // } // return it; // // pushStack(type); // } tos--; Item i = stack[tos]; stack[tos] = null; if (i.getType() != type) throw new VerifyError("Expected:" + Integer.toString(type) + " Actual:" + Integer.toString(i.getType())); return i; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/VirtualStack.java/buggy/core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java |
if (i.getType() != type) throw new VerifyError("Expected:" + Integer.toString(type) + " Actual:" + Integer.toString(i.getType())); | Item pop(int type) { // if (tos == 0) { // // the item requested in not on the virtual stack // // but already on the operand stack (it was pushed // // outside the current basic block) // // thus create a new stack item // Item it = createStack(type); // if (checkOperandStack) { // // insert at the begin of stack // // even if the vstack is empty, there // // may still be items popped from vstack // // that are not popped from operand stack // prependToOperandStack(it); // } // return it; // // pushStack(type); // } tos--; Item i = stack[tos]; stack[tos] = null; if (i.getType() != type) throw new VerifyError("Expected:" + Integer.toString(type) + " Actual:" + Integer.toString(i.getType())); return i; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/VirtualStack.java/buggy/core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java |
|
public boolean request(Register register) { return request(register, null); | public Register request(int type, Object owner) { return request(type, owner, false); | public boolean request(Register register) { return request(register, null); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/X86RegisterPool.java/buggy/core/src/core/org/jnode/vm/x86/compiler/l1a/X86RegisterPool.java |
public StackException(String s) { super(s); | public StackException() { super(); | public StackException(String s) { super(s); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/StackException.java/buggy/core/src/core/org/jnode/vm/bytecode/StackException.java |
os86.setObjectRef(new Label("$$jmp-introCode")); | protected void initImageHeader(NativeStream os, Label clInitCaller, Vm vm, PluginRegistry pluginRegistry) throws BuildException { try { int startLength = os.getLength(); VmType vmCodeClass = loadClass(VmMethodCode.class); final X86Stream.ObjectInfo initObject = os.startObject(vmCodeClass); final int offset = os.getLength() - startLength; if (offset != JUMP_MAIN_OFFSET) { throw new BuildException("JUMP_MAIN_OFFSET is incorrect [" + offset + "] (set to Object headersize)"); } final X86Stream os86 = (X86Stream) os; final Label introCode = new Label("$$introCode"); os86.writeJMP(introCode); initObject.markEnd(); // The loading of class can emit object in between, so first load // all required classes here. loadClass(Main.class); loadClass(MathSupport.class); loadClass(MonitorManager.class); loadClass(SoftByteCodes.class); loadClass(Vm.class); loadClass(VmMethod.class); loadClass(VmProcessor.class); loadClass(VmThread.class); loadClass(VmType.class); loadClass(VmSystem.class); loadClass(VmSystemObject.class); final X86Stream.ObjectInfo initCodeObject = os.startObject(vmCodeClass); os86.setObjectRef(introCode); initMain(os86, pluginRegistry); initVm(os86, vm); //initHeapManager(os86, vm); initVmThread(os86); os.setObjectRef(new Label("$$Initial call to clInitCaller")); os86.writeCALL(clInitCaller); initCallMain(os86); initCodeObject.markEnd(); } catch (ClassNotFoundException ex) { throw new BuildException(ex); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/BootImageBuilder.java/buggy/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java |
|
VmType mainClass = loadClass(Main.class); VmStaticField registryField = (VmStaticField) mainClass.getField(Main.REGISTRY_FIELD_NAME); | final VmType mainClass = loadClass(Main.class); final VmStaticField registryField = (VmStaticField) mainClass.getField(Main.REGISTRY_FIELD_NAME); | protected void initMain(X86Stream os, PluginRegistry registry) throws BuildException, ClassNotFoundException { os.setObjectRef(new Label("$$Initialize Main")); VmType mainClass = loadClass(Main.class); VmStaticField registryField = (VmStaticField) mainClass.getField(Main.REGISTRY_FIELD_NAME); // Setup STATICS register (EDI) os.writeMOV_Const(Register.EDI, statics.getTable()); /* Set Main.pluginRegistry */ os.writeMOV_Const(Register.EBX, registry); final int rfOffset = (VmArray.DATA_OFFSET + registryField.getStaticsIndex()) << 2; os.writeMOV(INTSIZE, Register.EDI, rfOffset, Register.EBX); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/BootImageBuilder.java/buggy/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java |
System.out.println("rfOffset " + NumberUtils.hex(rfOffset)); | protected void initMain(X86Stream os, PluginRegistry registry) throws BuildException, ClassNotFoundException { os.setObjectRef(new Label("$$Initialize Main")); VmType mainClass = loadClass(Main.class); VmStaticField registryField = (VmStaticField) mainClass.getField(Main.REGISTRY_FIELD_NAME); // Setup STATICS register (EDI) os.writeMOV_Const(Register.EDI, statics.getTable()); /* Set Main.pluginRegistry */ os.writeMOV_Const(Register.EBX, registry); final int rfOffset = (VmArray.DATA_OFFSET + registryField.getStaticsIndex()) << 2; os.writeMOV(INTSIZE, Register.EDI, rfOffset, Register.EBX); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/BootImageBuilder.java/buggy/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java |
|
System.out.println("vmOffset " + NumberUtils.hex(vmOffset)); | protected void initVm(X86Stream os, Vm vm) throws BuildException, ClassNotFoundException { os.setObjectRef(new Label("$$Initialize Vm")); VmType vmClass = loadClass(Vm.class); VmStaticField vmField = (VmStaticField) vmClass.getField("instance"); // Setup STATICS register (EDI) os.writeMOV_Const(Register.EDI, statics.getTable()); /* Set Vm.instance */ os.writeMOV_Const(Register.EBX, vm); final int vmOffset = (VmArray.DATA_OFFSET + vmField.getStaticsIndex()) << 2; os.writeMOV(INTSIZE, Register.EDI, vmOffset, Register.EBX); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/6c51b2252b587e401cd3a2b2e553206263541af7/BootImageBuilder.java/buggy/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java |
|
public final VmField getField(String name) { return getField(name, null); | public final VmField getField(String name, String signature) { VmField f = getDeclaredField(name, signature); if (f != null) { return f; } if (superClass != null) { f = superClass.getField(name, signature); if (f != null) { return f; } } final int cnt = getNoInterfaces(); for (int i = 0; i < cnt; i++) { f = allInterfaceTable[i].getField(name, signature); if (f != null) { return f; } } return null; | public final VmField getField(String name) { return getField(name, null); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/10b9028253f5fe6331eb3ee3c17eb137e07633c9/VmType.java/buggy/core/src/core/org/jnode/vm/classmgr/VmType.java |
public ServerSocket() throws IOException | ServerSocket(SocketImpl impl) throws IOException | public ServerSocket() throws IOException { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); impl.create(true); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/ServerSocket.java/buggy/core/src/classpath/java/java/net/ServerSocket.java |
if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); | if (impl == null) throw new NullPointerException("impl may not be null"); | public ServerSocket() throws IOException { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); impl.create(true); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/ServerSocket.java/buggy/core/src/classpath/java/java/net/ServerSocket.java |
impl.create(true); | this.impl = impl; this.impl.create(true); | public ServerSocket() throws IOException { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); impl.create(true); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/fd7e81b5c6d5963539719dfde9d197c68890c201/ServerSocket.java/buggy/core/src/classpath/java/java/net/ServerSocket.java |
n = quads.size(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (!quad.isDeadCode()) { quad.generateCode(x86cg); } } os.flush(); | public static void main(String args[]) throws SecurityException, IOException, ClassNotFoundException { X86CpuID cpuId = X86CpuID.createID("p5"); TextX86Stream os = new TextX86Stream(new OutputStreamWriter(System.out), cpuId); X86CodeGenerator x86cg = new X86CodeGenerator(os); VmByteCode code = loadByteCode(args); IRControlFlowGraph cfg = new IRControlFlowGraph(code); IRGenerator irg = new IRGenerator(cfg); BytecodeParser.parse(code, irg); BootableArrayList quads = irg.getQuadList(); int n = quads.size(); BootableHashMap liveVariables = new BootableHashMap(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); quad.doPass2(liveVariables); } Collection lv = liveVariables.values(); n = lv.size(); LiveRange[] liveRanges = new LiveRange[n]; Iterator it = lv.iterator(); for (int i=0; i<n; i+=1) { Variable v = (Variable) it.next(); liveRanges[i] = new LiveRange(v); } Arrays.sort(liveRanges); LinearScanAllocator lsa = new LinearScanAllocator(liveRanges); lsa.allocate(); x86cg.setArgumentVariables(irg.getVariables(), irg.getNoArgs()); x86cg.setSpilledVariables(lsa.getSpilledVariables()); x86cg.emitHeader(); n = quads.size(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (!quad.isDeadCode()) { quad.generateCode(x86cg); } } os.flush();/* BytecodeViewer bv = new BytecodeViewer(); BytecodeParser.parse(code, bv); // System.out.println(cfg.toString()); // System.out.println(); boolean printDeadCode = false; boolean printDetail = false; IRBasicBlock currentBlock = null; for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (currentBlock != quad.getBasicBlock()) { currentBlock = quad.getBasicBlock(); System.out.println(); System.out.println(currentBlock); } if (printDeadCode && quad.isDeadCode()) { if (printDetail) { printQuadDetail(quad); } System.out.println(quad); } if (!quad.isDeadCode()) { if (printDetail) { printQuadDetail(quad); } System.out.println(quad); } } System.out.println(); System.out.println("Live ranges:"); n = lv.size(); for (int i=0; i<n; i+=1) { System.out.println(liveRanges[i]); }*/ } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d18e9a04e790dda0051cb1f66d02c6027be23f2e/IRTest.java/buggy/core/src/core/org/jnode/vm/compiler/ir/IRTest.java |
|
n = quads.size(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (!quad.isDeadCode()) { quad.generateCode(x86cg); } } os.flush(); | public static void main(String args[]) throws SecurityException, IOException, ClassNotFoundException { X86CpuID cpuId = X86CpuID.createID("p5"); TextX86Stream os = new TextX86Stream(new OutputStreamWriter(System.out), cpuId); X86CodeGenerator x86cg = new X86CodeGenerator(os); VmByteCode code = loadByteCode(args); IRControlFlowGraph cfg = new IRControlFlowGraph(code); IRGenerator irg = new IRGenerator(cfg); BytecodeParser.parse(code, irg); BootableArrayList quads = irg.getQuadList(); int n = quads.size(); BootableHashMap liveVariables = new BootableHashMap(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); quad.doPass2(liveVariables); } Collection lv = liveVariables.values(); n = lv.size(); LiveRange[] liveRanges = new LiveRange[n]; Iterator it = lv.iterator(); for (int i=0; i<n; i+=1) { Variable v = (Variable) it.next(); liveRanges[i] = new LiveRange(v); } Arrays.sort(liveRanges); LinearScanAllocator lsa = new LinearScanAllocator(liveRanges); lsa.allocate(); x86cg.setArgumentVariables(irg.getVariables(), irg.getNoArgs()); x86cg.setSpilledVariables(lsa.getSpilledVariables()); x86cg.emitHeader(); n = quads.size(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (!quad.isDeadCode()) { quad.generateCode(x86cg); } } os.flush();/* BytecodeViewer bv = new BytecodeViewer(); BytecodeParser.parse(code, bv); // System.out.println(cfg.toString()); // System.out.println(); boolean printDeadCode = false; boolean printDetail = false; IRBasicBlock currentBlock = null; for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (currentBlock != quad.getBasicBlock()) { currentBlock = quad.getBasicBlock(); System.out.println(); System.out.println(currentBlock); } if (printDeadCode && quad.isDeadCode()) { if (printDetail) { printQuadDetail(quad); } System.out.println(quad); } if (!quad.isDeadCode()) { if (printDetail) { printQuadDetail(quad); } System.out.println(quad); } } System.out.println(); System.out.println("Live ranges:"); n = lv.size(); for (int i=0; i<n; i+=1) { System.out.println(liveRanges[i]); }*/ } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d18e9a04e790dda0051cb1f66d02c6027be23f2e/IRTest.java/buggy/core/src/core/org/jnode/vm/compiler/ir/IRTest.java |
|
return -10; | int l0 = a1; return -l0; | public static int simple(int a0, int a1) { return -10; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d18e9a04e790dda0051cb1f66d02c6027be23f2e/IRTest.java/buggy/core/src/core/org/jnode/vm/compiler/ir/IRTest.java |
session.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); | public PrinterThread (ScreenChar[] sc, Font font, int cols, int rows, Color colorBg, boolean toDefaultPrinter, Session ses) { setPriority(1); session = ses; screen = new ScreenChar[sc.length]; toDefault = toDefaultPrinter; int len = sc.length; for (int x = 0; x < len; x++) { screen[x] = new ScreenChar(sc[x].s); screen[x].setCharAndAttr(sc[x].getChar(),sc[x].getCharAttr(),sc[x].isAttributePlace()); } numCols = cols; numRows = rows; this.colorBg = colorBg; this.font = font; } | 1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/faa8d92c8f5c5791bee47c93e3aa6be063950489/PrinterThread.java/clean/tn5250j/src/org/tn5250j/PrinterThread.java |
|
session.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); | public void run () {// Toolkit tk = Toolkit.getDefaultToolkit();//int [][] range = new int[][] {//new int[] { 1, 1 }//};// JobAttributes jobAttributes = new JobAttributes(1, JobAttributes.DefaultSelectionType.ALL, JobAttributes.DestinationType.PRINTER, JobAttributes.DialogType.NONE, "file", 1, 1, JobAttributes.MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES, range, "HP LaserJet", JobAttributes.SidesType.ONE_SIDED);//PrintJob job = tk.getPrintJob(null, "Print", jobAttributes, null);//if (job != null) { //--- Create a printerJob object PrinterJob printJob = PrinterJob.getPrinterJob (); printJob.setJobName("tn5250j"); //--- Set the printable class to this one since we //--- are implementing the Printable interface printJob.setPrintable (this); //--- Show a print dialog to the user. If the user //--- clicks the print button, then print, otherwise //--- cancel the print job if (printJob.printDialog()) { try { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); printJob.print(); } catch (Exception PrintException) { PrintException.printStackTrace(); } } else { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); } session = null; int len = screen.length; for (int x = 0; x < len; x++) { screen[x] = null; } screen = null; } | 1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/faa8d92c8f5c5791bee47c93e3aa6be063950489/PrinterThread.java/clean/tn5250j/src/org/tn5250j/PrinterThread.java |
|
public Font deriveFont (float size) { return peer.deriveFont (this, size); } | public Font deriveFont(int style, float size) { return peer.deriveFont(this, style, size); } | public Font deriveFont (float size){ return peer.deriveFont (this, size);} | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Font.java/buggy/core/src/classpath/java/java/awt/Font.java |
public AffineTransform getTransform () { return peer.getTransform (this); } | public AffineTransform getTransform() { return peer.getTransform(this); } | public AffineTransform getTransform (){ return peer.getTransform (this);} | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Font.java/buggy/core/src/classpath/java/java/awt/Font.java |
public LineMetrics getLineMetrics(String str, FontRenderContext frc) | public LineMetrics getLineMetrics(String text, int begin, int limit, FontRenderContext rc) | public LineMetrics getLineMetrics(String str, FontRenderContext frc) { return getLineMetrics (str, 0, str.length () - 1, frc); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Font.java/buggy/core/src/classpath/java/java/awt/Font.java |
return getLineMetrics (str, 0, str.length () - 1, frc); } | return peer.getLineMetrics(this, new StringCharacterIterator(text), begin, limit, rc); } | public LineMetrics getLineMetrics(String str, FontRenderContext frc) { return getLineMetrics (str, 0, str.length () - 1, frc); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Font.java/buggy/core/src/classpath/java/java/awt/Font.java |
public Rectangle2D getStringBounds (String str, FontRenderContext frc) { return getStringBounds (str, 0, str.length () - 1, frc); } | public Rectangle2D getStringBounds(String str, FontRenderContext frc) { return getStringBounds(str, 0, str.length() - 1, frc); } | public Rectangle2D getStringBounds (String str, FontRenderContext frc){ return getStringBounds (str, 0, str.length () - 1, frc);} | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Font.java/buggy/core/src/classpath/java/java/awt/Font.java |
throws NotImplementedException | public void stateChanged(ChangeEvent event) throws NotImplementedException { // TODO: What should be done here, if anything? } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JMenuItem.java/clean/core/src/classpath/javax/javax/swing/JMenuItem.java |
|
firePropertyChange(AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY, Boolean.FALSE, Boolean.TRUE); ButtonModel model = getModel(); if (model.isArmed()) { if (! armed) { armed = true; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.ARMED, null); } } else { if (armed) { armed = false; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.ARMED); } } if (model.isPressed()) { if (! pressed) { pressed = true; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.PRESSED, null); } } else { if (pressed) { pressed = false; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.PRESSED); } } if (model.isSelected()) { if (! selected) { selected = true; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.SELECTED, null); } } else { if (selected) { selected = false; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.SELECTED); } } if (isFocusOwner()) { if (! focusOwner) { focusOwner = true; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.FOCUSED, null); } } else { if (focusOwner) { focusOwner = false; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.FOCUSED); } } | public void stateChanged(ChangeEvent event) throws NotImplementedException { // TODO: What should be done here, if anything? } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JMenuItem.java/clean/core/src/classpath/javax/javax/swing/JMenuItem.java |
|
accessibleContext = new AccessibleJMenuItem(); | { AccessibleJMenuItem ctx = new AccessibleJMenuItem(); addChangeListener(ctx); accessibleContext = ctx; } | public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJMenuItem(); return accessibleContext; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JMenuItem.java/clean/core/src/classpath/javax/javax/swing/JMenuItem.java |
public void setMnemonic(int mne) | public void setMnemonic(char mne) | public void setMnemonic(int mne) { int old = getModel().getMnemonic(); if (old != mne) { getModel().setMnemonic(mne); if (text != null && ! text.equals("")) { // Since lower case char = upper case char for // mnemonic, we will convert both text and mnemonic // to upper case before checking if mnemonic character occurs // in the menu item text. int upperCaseMne = Character.toUpperCase((char) mne); String upperCaseText = text.toUpperCase(); setDisplayedMnemonicIndex(upperCaseText.indexOf(upperCaseMne)); } firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne); revalidate(); repaint(); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
int old = getModel().getMnemonic(); if (old != mne) { getModel().setMnemonic(mne); if (text != null && ! text.equals("")) { int upperCaseMne = Character.toUpperCase((char) mne); String upperCaseText = text.toUpperCase(); setDisplayedMnemonicIndex(upperCaseText.indexOf(upperCaseMne)); } firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne); revalidate(); repaint(); } | setMnemonic((int) mne); | public void setMnemonic(int mne) { int old = getModel().getMnemonic(); if (old != mne) { getModel().setMnemonic(mne); if (text != null && ! text.equals("")) { // Since lower case char = upper case char for // mnemonic, we will convert both text and mnemonic // to upper case before checking if mnemonic character occurs // in the menu item text. int upperCaseMne = Character.toUpperCase((char) mne); String upperCaseText = text.toUpperCase(); setDisplayedMnemonicIndex(upperCaseText.indexOf(upperCaseMne)); } firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne); revalidate(); repaint(); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
setText((String)(a.getValue(Action.NAME))); setIcon((Icon)(a.getValue(Action.SMALL_ICON))); | setText((String) (a.getValue(Action.NAME))); setIcon((Icon) (a.getValue(Action.SMALL_ICON))); | protected void configurePropertiesFromAction(Action a) { if (a == null) { setText(null); setIcon(null); setEnabled(true); setToolTipText(null); } else { setText((String)(a.getValue(Action.NAME))); setIcon((Icon)(a.getValue(Action.SMALL_ICON))); setEnabled(a.isEnabled()); setToolTipText((String)(a.getValue(Action.SHORT_DESCRIPTION))); if (a.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(a.getValue(Action.MNEMONIC_KEY))).intValue()); String actionCommand = (String)(a.getValue(Action.ACTION_COMMAND_KEY)); // Set actionCommand to button's text by default if it is not specified if (actionCommand != null) setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY))); else setActionCommand(getText()); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
setToolTipText((String)(a.getValue(Action.SHORT_DESCRIPTION))); | setToolTipText((String) (a.getValue(Action.SHORT_DESCRIPTION))); | protected void configurePropertiesFromAction(Action a) { if (a == null) { setText(null); setIcon(null); setEnabled(true); setToolTipText(null); } else { setText((String)(a.getValue(Action.NAME))); setIcon((Icon)(a.getValue(Action.SMALL_ICON))); setEnabled(a.isEnabled()); setToolTipText((String)(a.getValue(Action.SHORT_DESCRIPTION))); if (a.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(a.getValue(Action.MNEMONIC_KEY))).intValue()); String actionCommand = (String)(a.getValue(Action.ACTION_COMMAND_KEY)); // Set actionCommand to button's text by default if it is not specified if (actionCommand != null) setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY))); else setActionCommand(getText()); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
setMnemonic(((Integer)(a.getValue(Action.MNEMONIC_KEY))).intValue()); String actionCommand = (String)(a.getValue(Action.ACTION_COMMAND_KEY)); | setMnemonic(((Integer) (a.getValue(Action.MNEMONIC_KEY))).intValue()); String actionCommand = (String) (a.getValue(Action.ACTION_COMMAND_KEY)); | protected void configurePropertiesFromAction(Action a) { if (a == null) { setText(null); setIcon(null); setEnabled(true); setToolTipText(null); } else { setText((String)(a.getValue(Action.NAME))); setIcon((Icon)(a.getValue(Action.SMALL_ICON))); setEnabled(a.isEnabled()); setToolTipText((String)(a.getValue(Action.SHORT_DESCRIPTION))); if (a.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(a.getValue(Action.MNEMONIC_KEY))).intValue()); String actionCommand = (String)(a.getValue(Action.ACTION_COMMAND_KEY)); // Set actionCommand to button's text by default if it is not specified if (actionCommand != null) setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY))); else setActionCommand(getText()); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY))); | setActionCommand((String) (a.getValue(Action.ACTION_COMMAND_KEY))); | protected void configurePropertiesFromAction(Action a) { if (a == null) { setText(null); setIcon(null); setEnabled(true); setToolTipText(null); } else { setText((String)(a.getValue(Action.NAME))); setIcon((Icon)(a.getValue(Action.SMALL_ICON))); setEnabled(a.isEnabled()); setToolTipText((String)(a.getValue(Action.SHORT_DESCRIPTION))); if (a.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(a.getValue(Action.MNEMONIC_KEY))).intValue()); String actionCommand = (String)(a.getValue(Action.ACTION_COMMAND_KEY)); // Set actionCommand to button's text by default if it is not specified if (actionCommand != null) setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY))); else setActionCommand(getText()); } } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
setText((String)(act.getValue(Action.NAME))); | setText((String) (act.getValue(Action.NAME))); | protected PropertyChangeListener createActionPropertyChangeListener(Action a) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); } }; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
setIcon((Icon)(act.getValue(Action.SMALL_ICON))); | setIcon((Icon) (act.getValue(Action.SMALL_ICON))); | protected PropertyChangeListener createActionPropertyChangeListener(Action a) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); } }; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); | setToolTipText((String) (act.getValue(Action.SHORT_DESCRIPTION))); | protected PropertyChangeListener createActionPropertyChangeListener(Action a) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); } }; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); | setMnemonic(((Integer) (act.getValue(Action.MNEMONIC_KEY))) .intValue()); | protected PropertyChangeListener createActionPropertyChangeListener(Action a) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); } }; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); | setActionCommand((String) (act.getValue(Action.ACTION_COMMAND_KEY))); | protected PropertyChangeListener createActionPropertyChangeListener(Action a) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); } }; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/AbstractButton.java/buggy/core/src/classpath/javax/javax/swing/AbstractButton.java |
MenuElement[] path, MenuSelectionManager manager) { | MenuElement[] path, MenuSelectionManager manager) { | public MenuDragMouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, MenuElement[] path, MenuSelectionManager manager) { super(source, id, when, modifiers, x, y, clickCount, popupTrigger); this.path = path; this.manager = manager; } // MenuDragMouseEvent() | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/MenuDragMouseEvent.java/buggy/core/src/classpath/javax/javax/swing/event/MenuDragMouseEvent.java |
} | } | public MenuDragMouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, MenuElement[] path, MenuSelectionManager manager) { super(source, id, when, modifiers, x, y, clickCount, popupTrigger); this.path = path; this.manager = manager; } // MenuDragMouseEvent() | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/MenuDragMouseEvent.java/buggy/core/src/classpath/javax/javax/swing/event/MenuDragMouseEvent.java |
void processKeyEvent(KeyEvent event, MenuElement[] path, MenuSelectionManager manager); | void processKeyEvent(KeyEvent event, MenuElement[] path, MenuSelectionManager manager); | void processKeyEvent(KeyEvent event, MenuElement[] path, MenuSelectionManager manager); | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuElement.java/buggy/core/src/classpath/javax/javax/swing/MenuElement.java |
MenuSelectionManager manager) { | MenuSelectionManager manager) { | public MenuKeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar, MenuElement[] path, MenuSelectionManager manager) { super(source, id, when, modifiers, keyCode, keyChar); this.path = path; this.manager = manager; } // MenuKeyEvent() | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/MenuKeyEvent.java/buggy/core/src/classpath/javax/javax/swing/event/MenuKeyEvent.java |
} | } | public MenuKeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar, MenuElement[] path, MenuSelectionManager manager) { super(source, id, when, modifiers, keyCode, keyChar); this.path = path; this.manager = manager; } // MenuKeyEvent() | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/MenuKeyEvent.java/buggy/core/src/classpath/javax/javax/swing/event/MenuKeyEvent.java |
public String getHref() | public Href getHref() | public String getHref() { return (String) ((XMLAttribute) attribHash.get("href")).getAttribValue(); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
return (String) ((XMLAttribute) attribHash.get("href")).getAttribValue(); | return (Href) ((XMLAttribute) attribHash.get("href")).getAttribValue(); | public String getHref() { return (String) ((XMLAttribute) attribHash.get("href")).getAttribValue(); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
attribOrder.add(0,"compression"); | attribOrder.add(0, "compression"); | private void init() { classXDFNodeName = "data"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"compression"); attribOrder.add(0, "encoding"); attribOrder.add(0,"checksum"); attribOrder.add(0,"href"); //set up the attribute hashtable key with the default initial value attribHash.put("compression", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("encoding", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("checksum", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("href", new XMLAttribute(null, Constants.STRING_TYPE)); }; | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
attribOrder.add(0,"checksum"); attribOrder.add(0,"href"); | attribOrder.add(0, "checksum"); attribOrder.add(0, "href"); | private void init() { classXDFNodeName = "data"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"compression"); attribOrder.add(0, "encoding"); attribOrder.add(0,"checksum"); attribOrder.add(0,"href"); //set up the attribute hashtable key with the default initial value attribHash.put("compression", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("encoding", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("checksum", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("href", new XMLAttribute(null, Constants.STRING_TYPE)); }; | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
attribHash.put("href", new XMLAttribute(null, Constants.STRING_TYPE)); | attribHash.put("href", new XMLAttribute(null, Constants.OBJECT_TYPE)); | private void init() { classXDFNodeName = "data"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"compression"); attribOrder.add(0, "encoding"); attribOrder.add(0,"checksum"); attribOrder.add(0,"href"); //set up the attribute hashtable key with the default initial value attribHash.put("compression", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("encoding", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("checksum", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("href", new XMLAttribute(null, Constants.STRING_TYPE)); }; | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
public void setHref (String strHref) | public void setHref (Href hrefObj) | public void setHref (String strHref) { ((XMLAttribute) attribHash.get("href")).setAttribValue(strHref); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
((XMLAttribute) attribHash.get("href")).setAttribValue(strHref); | ((XMLAttribute) attribHash.get("href")).setAttribValue(hrefObj); | public void setHref (String strHref) { ((XMLAttribute) attribHash.get("href")).setAttribValue(strHref); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
String nodeName = getClassXDFNodeName(); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
|
String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); | Href hrefObj = getHref(); XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream = outputstream; if (hrefObj !=null) { String fileName = hrefObj.getSysId(); String hrefName = hrefObj.getName(); if(hrefName == null) { Log.errorln("Error: href object in dataCube lacks name. Data being written into metadata instead.\n"); } else if (fileName != null) { writeHrefAttribute = true; try { dataOutputStream = new FileOutputStream(hrefObj.getSysId()); } catch (IOException e) { Log.warnln("Error: cannot open file:"+fileName+" for writing. Data being written into metadata.\n"); writeHrefAttribute = false; } } else { Log.warnln("Error: href:"+hrefName+" lacks systemId, cannot write data to a separate file."); Log.warnln("Data are being written into metadata instead.\n"); writeHrefAttribute = false; } } else { } if (writeHrefAttribute) { writeOut(outputstream, " href=\""); writeOutAttribute(outputstream, hrefObj.getName()); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
if (checksum != null) { writeOut(outputstream, " checksum = \""); | if (checksum != null) { writeOut(outputstream, " checksum=\""); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
writeOut(outputstream, ">"); XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { dataOutputStream = outputstream; } } else { dataOutputStream = outputstream; } | if (writeHrefAttribute) writeOut(outputstream, "/>"); else writeOut(outputstream, ">"); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
fastestAxis, NoDataValues ); | fastestAxis, NoDataValues, writeHrefAttribute ? false : true ); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); | writeFormattedData( dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues, writeHrefAttribute ? false : true ); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
if (niceOutput) { | if (!writeHrefAttribute && niceOutput) { | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
writeOut(outputstream, "</" + nodeName + ">"); | if (!writeHrefAttribute) writeOut(outputstream, "</" + nodeName + ">"); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
private void writeDelimitedData(OutputStream outputstream, | private void writeDelimitedData( OutputStream outputstream, | private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
AxisInterface fastestAxis, String[] noDataValues) { | AxisInterface fastestAxis, String[] noDataValues, boolean writeCDATAStatement ) { | private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
writeOut(outputstream, "<![CDATA["); | if(writeCDATAStatement) writeOut(outputstream, "<![CDATA["); | private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
writeOut(outputstream, "]]>"); | if (writeCDATAStatement) writeOut(outputstream, "]]>"); | private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
String[] noDataValues ) | String[] noDataValues, boolean writeCDATAStatement ) | private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues ) { // print opening CDATA statement writeOut(outputstream, "<![CDATA["); // print out the data as appropriate for the format // QUESTION: don't we need to syncronize on readObj too? synchronized (data) { List commands = readObj.getCommands(); // returns expanded list (no repeat cmds) int nrofCommands = commands.size(); int currentCommand = 0; DataFormat dataFormats[] = parentArray.getDataFormatList(); int nrofDataFormats = dataFormats.length; int currentDataFormat = 0; // loop thru all of the dataCube until finished with all data and commands boolean atEndOfDataCube = false; boolean backToStartOfDataCube = false; while (!backToStartOfDataCube) { FormattedIOCmd command = (FormattedIOCmd) commands.get(currentCommand); if(atEndOfDataCube && locator.getAxisLocation(fastestAxis) == 0) backToStartOfDataCube = true; if (command instanceof ReadCellFormattedIOCmd) { if (backToStartOfDataCube) break; // dont bother, we'd be re-printing data try { doReadCellFormattedIOCmdOutput( outputstream, dataFormats[currentDataFormat], locator ); } catch (NoDataException e) { // no data here, hurm. Print the noDataValue. // Is this always appropriate, seems questionable? -b.t. String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) writeOut(outputstream, noData); else Log.errorln("Cant print out null data: noDataValue NOT defined."); } // advance the data location locator.next(); // advance the DataFormat to be used if(nrofDataFormats > 1) { currentDataFormat++; if ( currentDataFormat == nrofDataFormats) currentDataFormat = 0; } } else if (command instanceof SkipCharFormattedIOCmd) { doSkipCharFormattedIOCmdOutput ( outputstream, (SkipCharFormattedIOCmd) command); } else { Log.errorln("DataCube cannot write out, unimplemented format command:"+ command.toString()); System.exit(-1); } if(nrofCommands > 1) { currentCommand++; if ( currentCommand == nrofCommands) { currentCommand = 0; } } if(!atEndOfDataCube && !locator.hasNext()) atEndOfDataCube = true; } // end of while loop } // end of sync loop // print closing CDATA statement writeOut(outputstream, "]]>"); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
writeOut(outputstream, "<![CDATA["); | if (writeCDATAStatement) writeOut(outputstream, "<![CDATA["); | private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues ) { // print opening CDATA statement writeOut(outputstream, "<![CDATA["); // print out the data as appropriate for the format // QUESTION: don't we need to syncronize on readObj too? synchronized (data) { List commands = readObj.getCommands(); // returns expanded list (no repeat cmds) int nrofCommands = commands.size(); int currentCommand = 0; DataFormat dataFormats[] = parentArray.getDataFormatList(); int nrofDataFormats = dataFormats.length; int currentDataFormat = 0; // loop thru all of the dataCube until finished with all data and commands boolean atEndOfDataCube = false; boolean backToStartOfDataCube = false; while (!backToStartOfDataCube) { FormattedIOCmd command = (FormattedIOCmd) commands.get(currentCommand); if(atEndOfDataCube && locator.getAxisLocation(fastestAxis) == 0) backToStartOfDataCube = true; if (command instanceof ReadCellFormattedIOCmd) { if (backToStartOfDataCube) break; // dont bother, we'd be re-printing data try { doReadCellFormattedIOCmdOutput( outputstream, dataFormats[currentDataFormat], locator ); } catch (NoDataException e) { // no data here, hurm. Print the noDataValue. // Is this always appropriate, seems questionable? -b.t. String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) writeOut(outputstream, noData); else Log.errorln("Cant print out null data: noDataValue NOT defined."); } // advance the data location locator.next(); // advance the DataFormat to be used if(nrofDataFormats > 1) { currentDataFormat++; if ( currentDataFormat == nrofDataFormats) currentDataFormat = 0; } } else if (command instanceof SkipCharFormattedIOCmd) { doSkipCharFormattedIOCmdOutput ( outputstream, (SkipCharFormattedIOCmd) command); } else { Log.errorln("DataCube cannot write out, unimplemented format command:"+ command.toString()); System.exit(-1); } if(nrofCommands > 1) { currentCommand++; if ( currentCommand == nrofCommands) { currentCommand = 0; } } if(!atEndOfDataCube && !locator.hasNext()) atEndOfDataCube = true; } // end of while loop } // end of sync loop // print closing CDATA statement writeOut(outputstream, "]]>"); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
writeOut(outputstream, "]]>"); | if (writeCDATAStatement) writeOut(outputstream, "]]>"); | private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues ) { // print opening CDATA statement writeOut(outputstream, "<![CDATA["); // print out the data as appropriate for the format // QUESTION: don't we need to syncronize on readObj too? synchronized (data) { List commands = readObj.getCommands(); // returns expanded list (no repeat cmds) int nrofCommands = commands.size(); int currentCommand = 0; DataFormat dataFormats[] = parentArray.getDataFormatList(); int nrofDataFormats = dataFormats.length; int currentDataFormat = 0; // loop thru all of the dataCube until finished with all data and commands boolean atEndOfDataCube = false; boolean backToStartOfDataCube = false; while (!backToStartOfDataCube) { FormattedIOCmd command = (FormattedIOCmd) commands.get(currentCommand); if(atEndOfDataCube && locator.getAxisLocation(fastestAxis) == 0) backToStartOfDataCube = true; if (command instanceof ReadCellFormattedIOCmd) { if (backToStartOfDataCube) break; // dont bother, we'd be re-printing data try { doReadCellFormattedIOCmdOutput( outputstream, dataFormats[currentDataFormat], locator ); } catch (NoDataException e) { // no data here, hurm. Print the noDataValue. // Is this always appropriate, seems questionable? -b.t. String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) writeOut(outputstream, noData); else Log.errorln("Cant print out null data: noDataValue NOT defined."); } // advance the data location locator.next(); // advance the DataFormat to be used if(nrofDataFormats > 1) { currentDataFormat++; if ( currentDataFormat == nrofDataFormats) currentDataFormat = 0; } } else if (command instanceof SkipCharFormattedIOCmd) { doSkipCharFormattedIOCmdOutput ( outputstream, (SkipCharFormattedIOCmd) command); } else { Log.errorln("DataCube cannot write out, unimplemented format command:"+ command.toString()); System.exit(-1); } if(nrofCommands > 1) { currentCommand++; if ( currentCommand == nrofCommands) { currentCommand = 0; } } if(!atEndOfDataCube && !locator.hasNext()) atEndOfDataCube = true; } // end of while loop } // end of sync loop // print closing CDATA statement writeOut(outputstream, "]]>"); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/bb6a38a0d879c7469562613add9462da0e53471b/DataCube.java/clean/src/gov/nasa/gsfc/adc/xdf/DataCube.java |
public DecimalFormat (String pattern) | public DecimalFormat () | public DecimalFormat (String pattern) { this (pattern, new DecimalFormatSymbols ()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8b7bd34f9c789e32b3e30b7431e945f2f0ff17f5/DecimalFormat.java/buggy/core/src/classpath/java/java/text/DecimalFormat.java |
this (pattern, new DecimalFormatSymbols ()); | this ("#,##0.###"); | public DecimalFormat (String pattern) { this (pattern, new DecimalFormatSymbols ()); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8b7bd34f9c789e32b3e30b7431e945f2f0ff17f5/DecimalFormat.java/buggy/core/src/classpath/java/java/text/DecimalFormat.java |
if (msg == null) { return ; } | protected void writeOut ( OutputStream outputstream, String msg ) { if (msg == null) { return ; } try { outputstream.write(msg.getBytes()); } catch (IOException e) { Log.error("Error: couldnt open OutputStream for writing"); } } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/161a6723e174f89f58248382a4c2cc6e342e6bb2/BaseObject.java/buggy/src/gov/nasa/gsfc/adc/xdf/BaseObject.java |
|
public int getAxisLocation (Axis axisObj) { | public int getAxisLocation (AxisInterface axisObj) { | public int getAxisLocation (Axis axisObj) { if ((!parentArray.getAxisList().contains(axisObj)) ) { Log.error("axisObj is not an Axis ref contained in Locator's parentArray"); Log.error("regnore request"); return -1; } Integer loc = (Integer) locations.get(axisObj); if (loc !=null) return loc.intValue(); else { Log.error("error, parentArray constains the axisObj, but Location doens't"); return -1; } } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/0950ad0997b40745a607d8255ec06c73b7ca2296/Locator.java/buggy/src/gov/nasa/gsfc/adc/xdf/Locator.java |
public static void warnln (String msg) { // check priority if (priority > Priority.WARN) return; // print msg warn(msg); // print newline printNewline(); } | 4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java |
||
public OptionArgument(String name, String description, Option o1) { this(name, description, new Option[] { o1}, SINGLE); | public OptionArgument(String name, String description, Option[] options, boolean multi) { super(name, description, multi); this.options = options; | public OptionArgument(String name, String description, Option o1) { this(name, description, new Option[] { o1}, SINGLE); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/OptionArgument.java/buggy/shell/src/shell/org/jnode/shell/help/OptionArgument.java |
public DeviceArgument(String name, String description) { super(name, description); | public DeviceArgument(String name, String description, boolean multi) { super(name, description, multi); | public DeviceArgument(String name, String description) { super(name, description); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/DeviceArgument.java/buggy/shell/src/shell/org/jnode/shell/help/DeviceArgument.java |
public IntegerArgument(String name, String description) { super(name, description); | public IntegerArgument(String name, String description, boolean multi) { super(name, description, multi); | public IntegerArgument(String name, String description) { super(name, description); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/IntegerArgument.java/buggy/shell/src/shell/org/jnode/shell/help/IntegerArgument.java |
public Parameter(Argument argument, boolean optional) { this(ANONYMOUS, NO_DESCRIPTION, argument, optional); | public Parameter(String name, String description, Argument argument, boolean optional) { super(name, description); this.argument = argument; this.optional = optional; | public Parameter(Argument argument, boolean optional) { this(ANONYMOUS, NO_DESCRIPTION, argument, optional); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/Parameter.java/buggy/shell/src/shell/org/jnode/shell/help/Parameter.java |
public Syntax(String description, Parameter p1) { this(description, new Parameter[] { p1}); | public Syntax(String description, Parameter[] params) { this.description = description; this.params = params; | public Syntax(String description, Parameter p1) { this(description, new Parameter[] { p1}); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/Syntax.java/buggy/shell/src/shell/org/jnode/shell/help/Syntax.java |
setCursorOff(); | setCursorActive(false); | protected void crossHair() { setCursorOff(); crossHair++; if (crossHair > 3) crossHair = 0; setCursorOn(); } | 1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/Screen5250.java/buggy/tn5250j/src/org/tn5250j/Screen5250.java |
setCursorOn(); | setCursorActive(true); | protected void crossHair() { setCursorOff(); crossHair++; if (crossHair > 3) crossHair = 0; setCursorOn(); } | 1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/Screen5250.java/buggy/tn5250j/src/org/tn5250j/Screen5250.java |