rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
value = initial_value; typecode.setLength(value.length);
public BooleanSeqHolder(boolean[] initial_value) { value = initial_value; typecode.setLength(value.length); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9b55eb78411ab1a82da7ba097b7b93a8cd80865/BooleanSeqHolder.java/buggy/core/src/classpath/org/org/omg/CORBA/BooleanSeqHolder.java
attributes = StyleContext.this.addAttribute(attributes, ResolveAttribute, parent);
if (parent != null) { attributes = StyleContext.this.addAttribute (attributes, ResolveAttribute, parent); }
public void setResolveParent(AttributeSet parent) { attributes = StyleContext.this.addAttribute(attributes, ResolveAttribute, parent); fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4d952c1ff48838834c7dcd3b56acf7f236a00079/StyleContext.java/clean/core/src/classpath/javax/javax/swing/text/StyleContext.java
public SimpleAttributeSet(AttributeSet a)
public SimpleAttributeSet()
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); if (a != null) addAttributes(a); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/SimpleAttributeSet.java/buggy/core/src/classpath/javax/javax/swing/text/SimpleAttributeSet.java
tab = new Hashtable(); if (a != null) addAttributes(a);
this(null);
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); if (a != null) addAttributes(a); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/SimpleAttributeSet.java/buggy/core/src/classpath/javax/javax/swing/text/SimpleAttributeSet.java
return Color.BLACK;
return Color.WHITE;
public static Color getBackground(AttributeSet a) { if (a.isDefined(Background)) return (Color) a.getAttribute(Background); else return Color.BLACK; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/StyleConstants.java/buggy/core/src/classpath/javax/javax/swing/text/StyleConstants.java
public JIFSFile(String name, FSEntry parent) { this(name); this.parent = parent; refresh();
public JIFSFile(String name) { this.name = name;
public JIFSFile(String name, FSEntry parent) { this(name); this.parent = parent; refresh(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/9c3472330aa95bcd943c9bb671adfa672f3ef7f7/JIFSFile.java/buggy/fs/src/fs/org/jnode/fs/jifs/JIFSFile.java
public void store(int value) {
public void store(ObjectReference ref) {
public void store(int value) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/Address.java/buggy/core/src/vmmagic/org/vmmagic/unboxed/Address.java
static StringBuffer toString(int mod, StringBuffer r)
public static String toString(int mod)
static StringBuffer toString(int mod, StringBuffer r) { if (isPublic(mod)) r.append("public "); if (isProtected(mod)) r.append("protected "); if (isPrivate(mod)) r.append("private "); if (isAbstract(mod)) r.append("abstract "); if (isStatic(mod)) r.append("static "); if (isFinal(mod)) r.append("final "); if (isTransient(mod)) r.append("transient "); if (isVolatile(mod)) r.append("volatile "); if (isSynchronized(mod)) r.append("synchronized "); if (isNative(mod)) r.append("native "); if (isStrict(mod)) r.append("strictfp "); if (isInterface(mod)) r.append("interface "); // Trim trailing space. if ((mod & ALL_FLAGS) != 0) r.setLength(r.length() - 1); return r; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7c463aa3bd840a934d101c434976bb7b25d5b975/Modifier.java/buggy/core/src/classpath/java/java/lang/reflect/Modifier.java
if (isPublic(mod)) r.append("public "); if (isProtected(mod)) r.append("protected "); if (isPrivate(mod)) r.append("private "); if (isAbstract(mod)) r.append("abstract "); if (isStatic(mod)) r.append("static "); if (isFinal(mod)) r.append("final "); if (isTransient(mod)) r.append("transient "); if (isVolatile(mod)) r.append("volatile "); if (isSynchronized(mod)) r.append("synchronized "); if (isNative(mod)) r.append("native "); if (isStrict(mod)) r.append("strictfp "); if (isInterface(mod)) r.append("interface "); if ((mod & ALL_FLAGS) != 0) r.setLength(r.length() - 1); return r;
return toString(mod, new StringBuffer()).toString();
static StringBuffer toString(int mod, StringBuffer r) { if (isPublic(mod)) r.append("public "); if (isProtected(mod)) r.append("protected "); if (isPrivate(mod)) r.append("private "); if (isAbstract(mod)) r.append("abstract "); if (isStatic(mod)) r.append("static "); if (isFinal(mod)) r.append("final "); if (isTransient(mod)) r.append("transient "); if (isVolatile(mod)) r.append("volatile "); if (isSynchronized(mod)) r.append("synchronized "); if (isNative(mod)) r.append("native "); if (isStrict(mod)) r.append("strictfp "); if (isInterface(mod)) r.append("interface "); // Trim trailing space. if ((mod & ALL_FLAGS) != 0) r.setLength(r.length() - 1); return r; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7c463aa3bd840a934d101c434976bb7b25d5b975/Modifier.java/buggy/core/src/classpath/java/java/lang/reflect/Modifier.java
if (configurationResource == null || configurationResource == "") configurationResource = "TN5250JDefaults.props";
boolean loadDefaults = false; if (configurationResource == null || configurationResource == "") { loadDefaults = true; }
private void loadConfigurationResource() { sesProps = new Properties(); if (configurationResource == null || configurationResource == "") configurationResource = "TN5250JDefaults.props"; try {// FileInputStream in = new FileInputStream(((GlobalConfigure)ConfigureFactory.getInstance()).settingsDirectory()// + configurationResource); FileInputStream in = new FileInputStream(configurationResource); //InputStream in = getClass().getClassLoader().getResourceAsStream(propFileName); sesProps.load(in); } catch (IOException ioe) { System.out.println("Information Message: Properties file is being " + "created for first time use: File name " + configurationResource); } catch (SecurityException se) { System.out.println(se.getMessage()); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/30f98b37d145e16ed4c5e314b8cf6d272bab1023/SessionConfig.java/clean/tn5250j/src/org/tn5250j/SessionConfig.java
FileInputStream in = new FileInputStream(configurationResource); sesProps.load(in);
if (loadDefaults) { Properties schemaProps = new Properties(); java.net.URL file=null; ClassLoader cl = this.getClass().getClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); file = cl.getResource("tn5250jSchemas.properties"); schemaProps.load(file.openStream()); String prefix = schemaProps.getProperty("schemaDefault"); sesProps.setProperty("colorBg",schemaProps.getProperty(prefix + ".colorBg")); sesProps.setProperty("colorRed",schemaProps.getProperty(prefix + ".colorRed")); sesProps.setProperty("colorTurq",schemaProps.getProperty(prefix + ".colorTurq")); sesProps.setProperty("colorCursor",schemaProps.getProperty(prefix + ".colorCursor")); sesProps.setProperty("colorGUIField",schemaProps.getProperty(prefix + ".colorGUIField")); sesProps.setProperty("colorWhite",schemaProps.getProperty(prefix + ".colorWhite")); sesProps.setProperty("colorYellow",schemaProps.getProperty(prefix + ".colorYellow")); sesProps.setProperty("colorGreen",schemaProps.getProperty(prefix + ".colorGreen")); sesProps.setProperty("colorPink",schemaProps.getProperty(prefix + ".colorPink")); sesProps.setProperty("colorBlue",schemaProps.getProperty(prefix + ".colorBlue")); sesProps.setProperty("colorSep",schemaProps.getProperty(prefix + ".colorSep")); sesProps.setProperty("colorHexAttr",schemaProps.getProperty(prefix + ".colorHexAttr")); } else { FileInputStream in = new FileInputStream(configurationResource); sesProps.load(in); }
private void loadConfigurationResource() { sesProps = new Properties(); if (configurationResource == null || configurationResource == "") configurationResource = "TN5250JDefaults.props"; try {// FileInputStream in = new FileInputStream(((GlobalConfigure)ConfigureFactory.getInstance()).settingsDirectory()// + configurationResource); FileInputStream in = new FileInputStream(configurationResource); //InputStream in = getClass().getClassLoader().getResourceAsStream(propFileName); sesProps.load(in); } catch (IOException ioe) { System.out.println("Information Message: Properties file is being " + "created for first time use: File name " + configurationResource); } catch (SecurityException se) { System.out.println(se.getMessage()); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/30f98b37d145e16ed4c5e314b8cf6d272bab1023/SessionConfig.java/clean/tn5250j/src/org/tn5250j/SessionConfig.java
public void processMouseEvent(JMenuItem item, MouseEvent e, MenuElement[] path, MenuSelectionManager manager) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/BasicCheckBoxMenuItemUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
else g.setColor(disabledColor);
protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException { g.setColor(unselectedColor); Segment segment = new Segment(); getDocument().getText(p0, p1 - p0, segment); return Utilities.drawTabbedText(segment, x, y, g, this, segment.offset); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/PlainView.java/clean/core/src/classpath/javax/javax/swing/text/PlainView.java
disabledColor = textComponent.getDisabledTextColor();
public void paint(Graphics g, Shape s) { // Ensure metrics are up-to-date. updateMetrics(); JTextComponent textComponent = (JTextComponent) getContainer(); g.setFont(textComponent.getFont()); selectedColor = textComponent.getSelectedTextColor(); unselectedColor = textComponent.getForeground(); Rectangle rect = s.getBounds(); // FIXME: Text may be scrolled. Document document = textComponent.getDocument(); Element root = document.getDefaultRootElement(); int y = rect.y; for (int i = 0; i < root.getElementCount(); i++) { drawLine(i, g, rect.x, y); y += metrics.getHeight(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/PlainView.java/clean/core/src/classpath/javax/javax/swing/text/PlainView.java
{
{
public FontMetrics getFontMetrics(){ return getFontMetrics(getFont());}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Graphics.java/buggy/core/src/classpath/java/java/awt/Graphics.java
}
}
public FontMetrics getFontMetrics(){ return getFontMetrics(getFont());}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Graphics.java/buggy/core/src/classpath/java/java/awt/Graphics.java
{
{
public Element getElement() { return elt; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/View.java/buggy/core/src/classpath/javax/javax/swing/text/View.java
}
}
public Element getElement() { return elt; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/View.java/buggy/core/src/classpath/javax/javax/swing/text/View.java
{
{
public Document getDocument() { return getElement().getDocument(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/View.java/buggy/core/src/classpath/javax/javax/swing/text/View.java
}
}
public Document getDocument() { return getElement().getDocument(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/View.java/buggy/core/src/classpath/javax/javax/swing/text/View.java
g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0;
g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0;
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); int pixelWidth = 0; int pos = s.offset; int len = 0; for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/Utilities.java/buggy/core/src/classpath/javax/javax/swing/text/Utilities.java
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); int pixelWidth = 0; int pos = s.offset; int len = 0; for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/Utilities.java/buggy/core/src/classpath/javax/javax/swing/text/Utilities.java
public int charWidth(char ch)
public int charWidth(int ch)
public int charWidth(char ch) { return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/FontMetrics.java/buggy/core/src/classpath/java/java/awt/FontMetrics.java
return 1;
char[] chars = Character.toChars(ch); return charsWidth(chars, 0, chars.length);
public int charWidth(char ch) { return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/FontMetrics.java/buggy/core/src/classpath/java/java/awt/FontMetrics.java
case MESSAGE_PING: DataOutputStream out = conn.getDataOutputStream(); out.writeByte(MESSAGE_PING_ACK); out.flush(); break;
public static void dispatch(UnicastConnection conn) throws Exception { switch (conn.getDataInputStream().readUnsignedByte()) { case MESSAGE_CALL: incomingMessageCall(conn); break; default: throw new Exception("bad method type"); }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/UnicastServer.java/buggy/core/src/classpath/gnu/gnu/java/rmi/server/UnicastServer.java
ObjectInputStream in = conn.getObjectInputStream();
ObjectInputStream in = conn.startObjectInputStream();
private static void incomingMessageCall(UnicastConnection conn) throws IOException { ObjectInputStream in = conn.getObjectInputStream(); ObjID objid = ObjID.read(in); int method = in.readInt(); long hash = in.readLong();//System.out.println("ObjID: " + objid + ", method: " + method + ", hash: " + hash); // Use the objid to locate the relevant UnicastServerRef UnicastServerRef uref = (UnicastServerRef)objects.get(objid); Object returnval; int returncode = RETURN_ACK; // returnval is from Method.invoke(), so we must check the return class to see // if it's primitive type Class returncls = null; if (uref != null) { try { // Dispatch the call to it. returnval = uref.incomingMessageCall(conn, method, hash); returncls = uref.getMethodReturnType(method, hash); } catch (Exception e) { returnval = e; returncode = RETURN_NACK; } } else { returnval = new NoSuchObjectException(""); returncode = RETURN_NACK; } conn.getDataOutputStream().writeByte(MESSAGE_CALL_ACK); ObjectOutputStream out = conn.getObjectOutputStream(); out.writeByte(returncode); (new UID()).write(out); if(returnval != null && returncls != null) ((RMIObjectOutputStream)out).writeValue(returnval, returncls); else if (!(returnval instanceof RMIVoidValue)) out.writeObject(returnval); out.flush();}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/UnicastServer.java/buggy/core/src/classpath/gnu/gnu/java/rmi/server/UnicastServer.java
ObjectOutputStream out = conn.getObjectOutputStream();
ObjectOutputStream out = conn.startObjectOutputStream();
private static void incomingMessageCall(UnicastConnection conn) throws IOException { ObjectInputStream in = conn.getObjectInputStream(); ObjID objid = ObjID.read(in); int method = in.readInt(); long hash = in.readLong();//System.out.println("ObjID: " + objid + ", method: " + method + ", hash: " + hash); // Use the objid to locate the relevant UnicastServerRef UnicastServerRef uref = (UnicastServerRef)objects.get(objid); Object returnval; int returncode = RETURN_ACK; // returnval is from Method.invoke(), so we must check the return class to see // if it's primitive type Class returncls = null; if (uref != null) { try { // Dispatch the call to it. returnval = uref.incomingMessageCall(conn, method, hash); returncls = uref.getMethodReturnType(method, hash); } catch (Exception e) { returnval = e; returncode = RETURN_NACK; } } else { returnval = new NoSuchObjectException(""); returncode = RETURN_NACK; } conn.getDataOutputStream().writeByte(MESSAGE_CALL_ACK); ObjectOutputStream out = conn.getObjectOutputStream(); out.writeByte(returncode); (new UID()).write(out); if(returnval != null && returncls != null) ((RMIObjectOutputStream)out).writeValue(returnval, returncls); else if (!(returnval instanceof RMIVoidValue)) out.writeObject(returnval); out.flush();}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/UnicastServer.java/buggy/core/src/classpath/gnu/gnu/java/rmi/server/UnicastServer.java
else if (!(returnval instanceof RMIVoidValue))
else if (!(returnval instanceof RMIVoidValue || returncls == Void.TYPE))
private static void incomingMessageCall(UnicastConnection conn) throws IOException { ObjectInputStream in = conn.getObjectInputStream(); ObjID objid = ObjID.read(in); int method = in.readInt(); long hash = in.readLong();//System.out.println("ObjID: " + objid + ", method: " + method + ", hash: " + hash); // Use the objid to locate the relevant UnicastServerRef UnicastServerRef uref = (UnicastServerRef)objects.get(objid); Object returnval; int returncode = RETURN_ACK; // returnval is from Method.invoke(), so we must check the return class to see // if it's primitive type Class returncls = null; if (uref != null) { try { // Dispatch the call to it. returnval = uref.incomingMessageCall(conn, method, hash); returncls = uref.getMethodReturnType(method, hash); } catch (Exception e) { returnval = e; returncode = RETURN_NACK; } } else { returnval = new NoSuchObjectException(""); returncode = RETURN_NACK; } conn.getDataOutputStream().writeByte(MESSAGE_CALL_ACK); ObjectOutputStream out = conn.getObjectOutputStream(); out.writeByte(returncode); (new UID()).write(out); if(returnval != null && returncls != null) ((RMIObjectOutputStream)out).writeValue(returnval, returncls); else if (!(returnval instanceof RMIVoidValue)) out.writeObject(returnval); out.flush();}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/UnicastServer.java/buggy/core/src/classpath/gnu/gnu/java/rmi/server/UnicastServer.java
oin = new RMIObjectInputStream(din);
throw new IOException("no ObjectInputtream for reading more objects");
ObjectInputStream getObjectInputStream() throws IOException { if (oin == null) { oin = new RMIObjectInputStream(din); } return (oin);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/UnicastConnection.java/buggy/core/src/classpath/gnu/gnu/java/rmi/server/UnicastConnection.java
public static ObjID read(ObjectInput in) throws IOException { DataInput din = (DataInput)in;
public static ObjID read(ObjectInput in) throws IOException { DataInput din = (DataInput) in;
public static ObjID read(ObjectInput in) throws IOException { DataInput din = (DataInput)in; ObjID id = new ObjID(); id.objNum = din.readLong(); id.space = UID.read(din); return (id);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ObjID.java/buggy/core/src/classpath/java/java/rmi/server/ObjID.java
}
}
public static ObjID read(ObjectInput in) throws IOException { DataInput din = (DataInput)in; ObjID id = new ObjID(); id.objNum = din.readLong(); id.space = UID.read(din); return (id);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ObjID.java/buggy/core/src/classpath/java/java/rmi/server/ObjID.java
oout = new RMIObjectOutputStream(dout);
throw new IOException("no ObjectOutputStream for sending more objects");
ObjectOutputStream getObjectOutputStream() throws IOException { if (oout == null) { oout = new RMIObjectOutputStream(dout); } return (oout);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/UnicastConnection.java/buggy/core/src/classpath/gnu/gnu/java/rmi/server/UnicastConnection.java
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { }
public UID() { time = System.currentTimeMillis(); unique = machineId; if (time > last) { last = time; count = uidCounter = Short.MIN_VALUE; } else { synchronized (UID.class) { if (uidCounter == Short.MAX_VALUE) { try { Thread.sleep(2); } catch (InterruptedException e) { } uidCounter = Short.MIN_VALUE; time = last = System.currentTimeMillis(); } count = uidCounter++;
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { } } baseTime = newtime; nextCount = Short.MIN_VALUE; } count = nextCount++; unique = uniqueNr; time = baseTime; }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/UID.java/buggy/core/src/classpath/java/java/rmi/server/UID.java
baseTime = newtime; nextCount = Short.MIN_VALUE;
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { } } baseTime = newtime; nextCount = Short.MIN_VALUE; } count = nextCount++; unique = uniqueNr; time = baseTime; }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/UID.java/buggy/core/src/classpath/java/java/rmi/server/UID.java
count = nextCount++; unique = uniqueNr; time = baseTime;
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { } } baseTime = newtime; nextCount = Short.MIN_VALUE; } count = nextCount++; unique = uniqueNr; time = baseTime; }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/UID.java/buggy/core/src/classpath/java/java/rmi/server/UID.java
}
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { } } baseTime = newtime; nextCount = Short.MIN_VALUE; } count = nextCount++; unique = uniqueNr; time = baseTime; }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/UID.java/buggy/core/src/classpath/java/java/rmi/server/UID.java
public void write(DataOutput out) throws IOException {
public void write(DataOutput out) throws IOException {
public void write(DataOutput out) throws IOException { out.writeInt(unique); out.writeLong(time); out.writeShort(count);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/UID.java/buggy/core/src/classpath/java/java/rmi/server/UID.java
}
}
public void write(DataOutput out) throws IOException { out.writeInt(unique); out.writeLong(time); out.writeShort(count);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/UID.java/buggy/core/src/classpath/java/java/rmi/server/UID.java
if (array == null) { Log.warn("in Structure.addArray(), Array passed in is null"); return null; }
public Array addArray(Array array) { if (array == null) { Log.warn("in Structure.addArray(), Array passed in is null"); return null; } getArrayList().add(array); return array; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Structure.java/buggy/src/gov/nasa/gsfc/adc/xdf/Structure.java
if (n == null) { Log.warn("in Structure.addNote(), the Note passed in is null"); return null; }
public Note addNote(Note n) { if (n == null) { Log.warn("in Structure.addNote(), the Note passed in is null"); return null; } getNoteList().add(n); return n; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Structure.java/buggy/src/gov/nasa/gsfc/adc/xdf/Structure.java
if (group !=null) { paramGroupOwnedHash.add(group); return group; } else { Log.warn("in Structure.addParamGroup(). ParameterGroup passed in is null"); return null; }
paramGroupOwnedHash.add(group); return group;
public ParameterGroup addParamGroup (ParameterGroup group) { if (group !=null) { //add the group to the groupOwnedHash paramGroupOwnedHash.add(group); return group; } else { Log.warn("in Structure.addParamGroup(). ParameterGroup passed in is null"); return null; } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Structure.java/buggy/src/gov/nasa/gsfc/adc/xdf/Structure.java
if (p == null) { Log.warn("in Structure.addParameter, Parameter passed in is null"); return null; }
public Parameter addParameter(Parameter p) { if (p == null) { Log.warn("in Structure.addParameter, Parameter passed in is null"); return null; } getParamList().add(p); return p; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Structure.java/buggy/src/gov/nasa/gsfc/adc/xdf/Structure.java
if (s == null) { Log.warn("in Structure.addStructure(), Structure passed in is null"); return null; }
public Structure addStructure(Structure s) { if (s == null) { Log.warn("in Structure.addStructure(), Structure passed in is null"); return null; } getStructList().add(s); return s; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Structure.java/buggy/src/gov/nasa/gsfc/adc/xdf/Structure.java
cloneObj.paramGroupOwnedHash.add(iter.next());
cloneObj.paramGroupOwnedHash.add(((Group)iter.next()).clone());
public Object clone() throws CloneNotSupportedException{ Structure cloneObj = (Structure) super.clone(); //deep copy of the paramGroupOwnedHash synchronized (this.paramGroupOwnedHash) { synchronized(cloneObj.paramGroupOwnedHash) { cloneObj.paramGroupOwnedHash = Collections.synchronizedSet(new HashSet(this.paramGroupOwnedHash.size())); Iterator iter = this.paramGroupOwnedHash.iterator(); while (iter.hasNext()) { cloneObj.paramGroupOwnedHash.add(iter.next()); } } } return cloneObj; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Structure.java/buggy/src/gov/nasa/gsfc/adc/xdf/Structure.java
if (group == null) { Log.warn("in Structure.removeParamGroup(). ParameterGroup passed in is null"); return false; }
public boolean removeParamGroup(ParameterGroup group) { if (group == null) { Log.warn("in Structure.removeParamGroup(). ParameterGroup passed in is null"); return false; } return paramGroupOwnedHash.remove(group); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Structure.java/buggy/src/gov/nasa/gsfc/adc/xdf/Structure.java
public Object clone () throws CloneNotSupportedException{
protected Object clone () throws CloneNotSupportedException{
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
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
cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i)));
synchronized (this.attribOrder) { synchronized (cloneObj.attribOrder) { cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); }
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
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
cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys();
}
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
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
for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone());
synchronized (cloneObj.attribHash) { cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); }
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
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
/** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj;
return cloneObj;
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
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
String charString, keyCodeString, modString, tmpString,isString;
String charString, keyCodeString, modString, tmpString,isString,locString;
protected void displayInfo(KeyEvent e, String s){ String charString, keyCodeString, modString, tmpString,isString; char c = e.getKeyChar(); int keyCode = e.getKeyCode(); int modifiers = e.getModifiers(); if (Character.isISOControl(c)) { charString = "key character = " + "(an unprintable control character)"; } else { charString = "key character = '" + c + "'"; } keyCodeString = "key code = " + keyCode + " (" + KeyEvent.getKeyText(keyCode) + ")"; if(keyCode == KeyEvent.VK_PREVIOUS_CANDIDATE) { keyCodeString += " previous candidate "; } if(keyCode == KeyEvent.VK_DEAD_ABOVEDOT || keyCode == KeyEvent.VK_DEAD_ABOVERING || keyCode == KeyEvent.VK_DEAD_ACUTE || keyCode == KeyEvent.VK_DEAD_BREVE || keyCode == KeyEvent.VK_DEAD_CIRCUMFLEX ) { keyCodeString += " dead key "; } modString = "modifiers = " + modifiers; tmpString = KeyEvent.getKeyModifiersText(modifiers); if (tmpString.length() > 0) { modString += " (" + tmpString + ")"; } else { modString += " (no modifiers)"; } isString = "isKeys = isActionKey (" + e.isActionKey() + ")" + " isAltDown (" + e.isAltDown() + ")" + " isAltGraphDown (" + e.isAltGraphDown() + ")" + " isAltGraphDownLinux (" + isAltGr + ")" + " isControlDown (" + e.isControlDown() + ")" + " isMetaDown (" + e.isMetaDown() + ")" + " isShiftDown (" + e.isShiftDown() + ")"; String newline = "\n"; System.out.println(s + newline + " " + charString + newline + " " + keyCodeString + newline + " " + modString + newline + " " + isString + newline); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d4104819203aa6b5361aa997d2cd29a076f417a7/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
+ " " + locString + newline
protected void displayInfo(KeyEvent e, String s){ String charString, keyCodeString, modString, tmpString,isString; char c = e.getKeyChar(); int keyCode = e.getKeyCode(); int modifiers = e.getModifiers(); if (Character.isISOControl(c)) { charString = "key character = " + "(an unprintable control character)"; } else { charString = "key character = '" + c + "'"; } keyCodeString = "key code = " + keyCode + " (" + KeyEvent.getKeyText(keyCode) + ")"; if(keyCode == KeyEvent.VK_PREVIOUS_CANDIDATE) { keyCodeString += " previous candidate "; } if(keyCode == KeyEvent.VK_DEAD_ABOVEDOT || keyCode == KeyEvent.VK_DEAD_ABOVERING || keyCode == KeyEvent.VK_DEAD_ACUTE || keyCode == KeyEvent.VK_DEAD_BREVE || keyCode == KeyEvent.VK_DEAD_CIRCUMFLEX ) { keyCodeString += " dead key "; } modString = "modifiers = " + modifiers; tmpString = KeyEvent.getKeyModifiersText(modifiers); if (tmpString.length() > 0) { modString += " (" + tmpString + ")"; } else { modString += " (no modifiers)"; } isString = "isKeys = isActionKey (" + e.isActionKey() + ")" + " isAltDown (" + e.isAltDown() + ")" + " isAltGraphDown (" + e.isAltGraphDown() + ")" + " isAltGraphDownLinux (" + isAltGr + ")" + " isControlDown (" + e.isControlDown() + ")" + " isMetaDown (" + e.isMetaDown() + ")" + " isShiftDown (" + e.isShiftDown() + ")"; String newline = "\n"; System.out.println(s + newline + " " + charString + newline + " " + keyCodeString + newline + " " + modString + newline + " " + isString + newline); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d4104819203aa6b5361aa997d2cd29a076f417a7/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
displayInfo(e,"Pressed ");
private void processVTKeyPressed(KeyEvent e){// displayInfo(e,"Pressed "); int keyCode = e.getKeyCode(); if (isLinux && keyCode == e.VK_ALT_GRAPH) { isAltGr = true; } // be careful with the control key if (keyCode == e.VK_UNDEFINED || keyCode == e.VK_CAPS_LOCK || keyCode == e.VK_SHIFT || keyCode == e.VK_ALT || keyCode == e.VK_ALT_GRAPH || keyCode == e.VK_CONTROL ) { return; } // be careful with the control key !!!!!! if (!e.isAltDown() || !e.isShiftDown() || !e.isControlDown() || keyCode != KeyEvent.VK_CONTROL && // be careful about removing this line !e.isActionKey()) {// if (keyCode == KeyEvent.VK_ESCAPE ||// keyCode == KeyEvent.VK_CONTROL ||// keyCode == KeyEvent.VK_BACK_SPACE) {// displayInfo(e,"Pressed added"); keyevent = e; dialog.setVisible(false); dialog.dispose();// } } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d4104819203aa6b5361aa997d2cd29a076f417a7/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
displayInfo(e,"Released ");
private void processVTKeyReleased(KeyEvent e){// displayInfo(e,"Released "); if (isLinux && e.getKeyCode() == e.VK_ALT_GRAPH) { isAltGr = false; } int keycode = e.getKeyCode(); if (e.isAltDown() || e.isShiftDown() || e.isControlDown() || e.isActionKey() || keycode == KeyEvent.VK_CONTROL) { keyevent = e;// displayInfo(e,"Released added"); dialog.setVisible(false); dialog.dispose(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d4104819203aa6b5361aa997d2cd29a076f417a7/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
displayInfo(e,"Typed ");
private void processVTKeyTyped(KeyEvent e){// displayInfo(e,"Typed "); int keycode = e.getKeyCode(); if (e.isAltDown() || e.isShiftDown() || e.isControlDown() || e.isActionKey() || keycode == KeyEvent.VK_CONTROL) { keyevent = e;// displayInfo(e,"Released added "); dialog.setVisible(false); dialog.dispose(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d4104819203aa6b5361aa997d2cd29a076f417a7/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
char ac = codePage.getASCIIChar(x);
char ac = codePage.ebcdic2uni(x);
private void loadList(String which) { lm.clear(); lm.removeAllElements(); if (which.equals(LangTool.getString("key.labelKeys"))) { Vector lk = new Vector(mnemonicData.length); for (int x = 0; x < mnemonicData.length; x++) { lk.addElement(new KeyDescription(LangTool.getString("key."+mnemonicData[x]),x)); } Collections.sort(lk,new KeyDescriptionCompare()); for (int x = 0; x < mnemonicData.length; x++) { lm.addElement(lk.get(x)); } macros = false; special = false; } else { if (which.equals(LangTool.getString("key.labelMacros"))) { Vector macrosVector = new Vector(); if (macrosList != null) for (int x = 0; x < macrosList.length; x++) { macrosVector.add(macrosList[x]); } scriptDir("scripts",macrosVector); loadListModel(lm,macrosVector,null,0); macros = true; special = false; } else { // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; StringBuffer sb = new StringBuffer(); Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = codePage.ebcdic2uni(x); char ac = codePage.getASCIIChar(x); if (!Character.isISOControl(c)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c + " - " + getUnicodeString(c)); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); lm.addElement(keyc.getSourceString()); } macros = false; special = true; } } if (!lm.isEmpty()) functions.setSelectedIndex(0); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/d4104819203aa6b5361aa997d2cd29a076f417a7/KeyConfigure.java/buggy/tn5250j/src/org/tn5250j/tools/KeyConfigure.java
public JButton(String text)
public JButton()
public JButton(String text) { this(text, null); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JButton.java/buggy/core/src/classpath/javax/javax/swing/JButton.java
this(text, null);
this(null, null);
public JButton(String text) { this(text, null); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JButton.java/buggy/core/src/classpath/javax/javax/swing/JButton.java
public JComboBox()
public JComboBox(ComboBoxModel model)
public JComboBox() { this(new DefaultComboBoxModel()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
this(new DefaultComboBoxModel());
setEditable(false); setEnabled(true); setMaximumRowCount(DEFAULT_MAXIMUM_ROW_COUNT); setModel(model); setActionCommand("comboBoxChanged"); lightWeightPopupEnabled = true; isEditable = false; updateUI();
public JComboBox() { this(new DefaultComboBoxModel()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
if(dataModel instanceof MutableComboBoxModel) {
if (dataModel instanceof MutableComboBoxModel)
public void addItem(Object element) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).addElement(element); } else { throw new RuntimeException("Unable to add the item because the data model it is not an instance of MutableComboBoxModel."); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
} else { throw new RuntimeException("Unable to add the item because the data model it is not an instance of MutableComboBoxModel."); }
else throw new RuntimeException("Unable to add the item because the data " + "model it is not an instance of " + "MutableComboBoxModel.");
public void addItem(Object element) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).addElement(element); } else { throw new RuntimeException("Unable to add the item because the data model it is not an instance of MutableComboBoxModel."); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JComboBox.java/buggy/core/src/classpath/javax/javax/swing/JComboBox.java
this.columns = columns;
if (columns != this.columns) { this.columns = columns; revalidate(); }
public void setColumns(int columns) { if (columns < 0) throw new IllegalArgumentException(); this.columns = columns; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTextArea.java/buggy/core/src/classpath/javax/javax/swing/JTextArea.java
public JOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue)
public JOptionPane()
public JOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue) { this.message = message; if (! validMessageType(messageType)) throw new IllegalArgumentException("Message Type not legal value."); this.messageType = messageType; if (! validOptionType(optionType)) throw new IllegalArgumentException("Option Type not legal value."); this.optionType = optionType; this.icon = icon; this.options = options; this.initialValue = initialValue; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); updateUI(); invalidate(); repaint(); }
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
this.message = message; if (! validMessageType(messageType)) throw new IllegalArgumentException("Message Type not legal value."); this.messageType = messageType; if (! validOptionType(optionType)) throw new IllegalArgumentException("Option Type not legal value."); this.optionType = optionType; this.icon = icon; this.options = options; this.initialValue = initialValue; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); updateUI(); invalidate(); repaint();
this("JOptionPane message", PLAIN_MESSAGE, DEFAULT_OPTION, null, null, null);
public JOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue) { this.message = message; if (! validMessageType(messageType)) throw new IllegalArgumentException("Message Type not legal value."); this.messageType = messageType; if (! validOptionType(optionType)) throw new IllegalArgumentException("Option Type not legal value."); this.optionType = optionType; this.icon = icon; this.options = options; this.initialValue = initialValue; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); updateUI(); invalidate(); repaint(); }
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
public final static void setKeyStroke(String which, KeyEvent ke, boolean isAltGr) {
public final static void setKeyStroke(String which, KeyEvent ke) {
public final static void setKeyStroke(String which, KeyEvent ke, boolean isAltGr) { if (ke == null) return; Collection v = mappedKeys.values(); Set o = mappedKeys.keySet(); Iterator k = o.iterator(); Iterator i = v.iterator(); while (k.hasNext()) { KeyStroker ks = (KeyStroker)k.next(); String keyVal = (String)i.next(); if (keyVal.equals(which)) { mappedKeys.remove(ks); mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),keyVal); return; } } // if we got here it was a dead key and we need to add it. mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),which); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/69e4ad8b79244d7a9ead6ae9be5f21d5cf302742/KeyMapper.java/buggy/tn5250j/src/org/tn5250j/tools/KeyMapper.java
isAltGr),keyVal);
ke.isAltGraphDown()),keyVal);
public final static void setKeyStroke(String which, KeyEvent ke, boolean isAltGr) { if (ke == null) return; Collection v = mappedKeys.values(); Set o = mappedKeys.keySet(); Iterator k = o.iterator(); Iterator i = v.iterator(); while (k.hasNext()) { KeyStroker ks = (KeyStroker)k.next(); String keyVal = (String)i.next(); if (keyVal.equals(which)) { mappedKeys.remove(ks); mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),keyVal); return; } } // if we got here it was a dead key and we need to add it. mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),which); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/69e4ad8b79244d7a9ead6ae9be5f21d5cf302742/KeyMapper.java/buggy/tn5250j/src/org/tn5250j/tools/KeyMapper.java
isAltGr),which);
ke.isAltGraphDown()),which);
public final static void setKeyStroke(String which, KeyEvent ke, boolean isAltGr) { if (ke == null) return; Collection v = mappedKeys.values(); Set o = mappedKeys.keySet(); Iterator k = o.iterator(); Iterator i = v.iterator(); while (k.hasNext()) { KeyStroker ks = (KeyStroker)k.next(); String keyVal = (String)i.next(); if (keyVal.equals(which)) { mappedKeys.remove(ks); mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),keyVal); return; } } // if we got here it was a dead key and we need to add it. mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),which); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/69e4ad8b79244d7a9ead6ae9be5f21d5cf302742/KeyMapper.java/buggy/tn5250j/src/org/tn5250j/tools/KeyMapper.java
public void installListeners(AbstractButton b)
protected void installListeners(AbstractButton b)
public void installListeners(AbstractButton b) { listener = createButtonListener(b); b.addChangeListener(listener); b.addPropertyChangeListener(listener); b.addFocusListener(listener); b.addMouseListener(listener); b.addMouseMotionListener(listener); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/BasicButtonUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicButtonUI.java
public void uninstallListeners(AbstractButton b)
protected void uninstallListeners(AbstractButton b)
public void uninstallListeners(AbstractButton b) { b.removeChangeListener(listener); b.removePropertyChangeListener(listener); b.removeFocusListener(listener); b.removeMouseListener(listener); b.removeMouseMotionListener(listener); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53b78dd1e4587254262f4618d2aa7551de8e0cbf/BasicButtonUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicButtonUI.java
if (disabeldIcon == null && default_icon instanceof ImageIcon) disabeldIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon) default_icon).getImage()));
if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); }
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) disabeldIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon) default_icon).getImage())); return disabeldIcon; }
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
public JScrollBar(int orientation)
public JScrollBar()
public JScrollBar(int orientation) { this(orientation, 0, 10, 0, 100); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/JScrollBar.java/buggy/core/src/classpath/javax/javax/swing/JScrollBar.java
this(orientation, 0, 10, 0, 100);
this(SwingConstants.VERTICAL, 0, 10, 0, 100);
public JScrollBar(int orientation) { this(orientation, 0, 10, 0, 100); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/JScrollBar.java/buggy/core/src/classpath/javax/javax/swing/JScrollBar.java
if (valueSpecialList.equals(valueSpecialList[i]))
if (strValueSpecial.equals(valueSpecialList[i]))
public static boolean isValidValueSpecial(String strValueSpecial) { if (strValueSpecial == null) return true; String[] valueSpecialList = Constants.VALUE_SPECIAL_LIST; int stop = valueSpecialList.length; for (int i = 0; i < stop; i++) { if (valueSpecialList.equals(valueSpecialList[i])) return true; } return false; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/e0ca1b83a88a628b74cc5e38de05973a108e165e/Utility.java/buggy/src/gov/nasa/gsfc/adc/xdf/Utility.java
sessionPane.remove(index); tabs--;
public void removeSessionView(SessionGUI targetSession) { if (hideTabBar && sessionPane.getTabCount() == 0) { for (int x=0; x < getContentPane().getComponentCount(); x++) { if (getContentPane().getComponent(x) instanceof SessionGUI) { getContentPane().remove(x); } } } else { int index = sessionPane.indexOfComponent(targetSession); log.info("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (tabs > 0 && index <= tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(focused,index); ((SessionGUI)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(focused,0); ((SessionGUI)sessionPane.getComponentAt(0)).requestFocus(); } } } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/09150e0755fef9c6ce71ba9d7a972e5d91360263/Gui5250Frame.java/clean/tn5250j/src/org/tn5250j/Gui5250Frame.java
if (tabs > 0 && index <= tabs) {
if (tabs > 0 && index < tabs) {
public void removeSessionView(SessionGUI targetSession) { if (hideTabBar && sessionPane.getTabCount() == 0) { for (int x=0; x < getContentPane().getComponentCount(); x++) { if (getContentPane().getComponent(x) instanceof SessionGUI) { getContentPane().remove(x); } } } else { int index = sessionPane.indexOfComponent(targetSession); log.info("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (tabs > 0 && index <= tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(focused,index); ((SessionGUI)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(focused,0); ((SessionGUI)sessionPane.getComponentAt(0)).requestFocus(); } } } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/09150e0755fef9c6ce71ba9d7a972e5d91360263/Gui5250Frame.java/clean/tn5250j/src/org/tn5250j/Gui5250Frame.java
{ return tabs.size(); }
{ return tabs.size(); }
public int getTabCount() { return tabs.size(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
}
}
public void setForegroundAt(int index, Color foreground) { checkIndex(index, 0, tabs.size()); ((Page) tabs.elementAt(index)).setForeground(foreground); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
model.setSelectedIndex(index);
model.setSelectedIndex(index); }
public void setSelectedIndex(int index) { checkIndex(index, -1, tabs.size()); if (index != getSelectedIndex()) { if (getSelectedIndex() != -1 && getSelectedComponent() != null) getSelectedComponent().hide(); if (index != -1 && getComponentAt(index) != null) getComponentAt(index).show(); model.setSelectedIndex(index); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
}
public void setSelectedIndex(int index) { checkIndex(index, -1, tabs.size()); if (index != getSelectedIndex()) { if (getSelectedIndex() != -1 && getSelectedComponent() != null) getSelectedComponent().hide(); if (index != -1 && getComponentAt(index) != null) getComponentAt(index).show(); model.setSelectedIndex(index); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
public void remove(int index)
public void remove(Component component)
public void remove(int index) { removeTabAt(index); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
removeTabAt(index);
int index = indexOfComponent(component); super.remove(component); component.show(); setComponentAt(index, null);
public void remove(int index) { removeTabAt(index); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
if (abyte0[i] == IAC) {
if(abyte0[i] == IAC) {
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
while (i < abyte0.length && abyte0[i++] == -1) switch (abyte0[i++]) {
while(i < abyte0.length && abyte0[i++] == -1) switch(abyte0[i++]) {
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
switch (abyte0[i]) {
if (i < abyte0.length) { switch(abyte0[i]) {
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
} else {
} else {
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
switch (abyte0[i]) {
switch(abyte0[i]) {
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) {
if(abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) {
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
while (++i < abyte0.length && abyte0[i + 1] != IAC) ;
while (++i < abyte0.length && abyte0[i + 1] != IAC);
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) {
if(abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) {
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
if (!support132)
if(!support132)
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
} else {
} else {
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/f8bbcf3d0c0f6b720f52a411edeba50f36e6fc11/tnvt.java/clean/tn5250j/src/org/tn5250j/tnvt.java
Class c = this.getClass().forName("org.tn5250j.transport.SSL.SSLImplementation");
Class c = Class.forName("org.tn5250j.transport.SSL.SSLImplementation");
public Socket createSocket(String destination, int port) { try { if (sslType.equals(SSLConstants.SSL_TYPE_NONE)) { System.out.println("Creating Socket"); // for jdk 1.4// return SocketFactory.getDefault().createSocket(destination,port); return new Socket(destination,port); } //Using SSL Socket SSLInterface o = null; try { Class c = this.getClass().forName("org.tn5250j.transport.SSL.SSLImplementation"); o = (SSLInterface)c.newInstance(); o.setSSLType(sslType); return o.createSSLSocket(destination,port); } catch (Exception e) { System.err.println(e); } } catch (Exception e) { System.err.println("SocketConnector: createSocket: " + e.getMessage()); } return null; }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/a214bcb897ee9098f3737a95f7be3c969f3651cb/SocketConnector.java/buggy/tn5250j/src/org/tn5250j/transport/SocketConnector.java
public void goto_XY(int pos) { updateCursorLoc(); lastPos = pos; updateCursorLoc();
public void goto_XY(int row,int col) { goto_XY(((row - 1) * numCols) + (col-1));
public void goto_XY(int pos) {// setCursorOff(); updateCursorLoc(); lastPos = pos;// setCursorOn(); updateCursorLoc(); }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/0166767548ad2224376eff5004531d67a0ff55d6/Screen5250.java/buggy/tn5250j/src/org/tn5250j/Screen5250.java
log.info("Received event: " + e.getClass().toString());
log.debug("Received event: " + e.getClass().toString());
public void handleEvent(Tn5250jEvent e) { log.info("Received event: " + e.getClass().toString()); if (e instanceof Tn5250jKeyEvents) { log.info("Keys: " + ((Tn5250jKeyEvents) e).getKeystrokes()); } eventList.add(e); synchronized (eventList) { eventList.notify(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/9bb2f4b68dc90c0c3e961a3f5027ebeaa3759649/Tn5250jController.java/buggy/tn5250j/src/org/tn5250j/framework/Tn5250jController.java
log.info("Keys: " + ((Tn5250jKeyEvents) e).getKeystrokes());
log.debug("Keys: " + ((Tn5250jKeyEvents) e).getKeystrokes());
public void handleEvent(Tn5250jEvent e) { log.info("Received event: " + e.getClass().toString()); if (e instanceof Tn5250jKeyEvents) { log.info("Keys: " + ((Tn5250jKeyEvents) e).getKeystrokes()); } eventList.add(e); synchronized (eventList) { eventList.notify(); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/9bb2f4b68dc90c0c3e961a3f5027ebeaa3759649/Tn5250jController.java/buggy/tn5250j/src/org/tn5250j/framework/Tn5250jController.java
public void setPendingInsert(boolean flag) { if (homePos != -1) pendingInsert = flag;
public void setPendingInsert(boolean flag, int icX, int icY) { pendingInsert = flag; if (pendingInsert) { homePos = getPos(icX,icY); } if (!isStatusErrorCode()) { goto_XY(icX,icY); }
public void setPendingInsert(boolean flag) { if (homePos != -1) pendingInsert = flag; }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/0166767548ad2224376eff5004531d67a0ff55d6/Screen5250.java/buggy/tn5250j/src/org/tn5250j/Screen5250.java
if (!sf.isBypassField()) sf.setFieldId(++fieldIds);
sf.setFieldId(++fieldIds);
public ScreenField setField(int attr, int row, int col, int len, int ffw1, int ffw2, int fcw1, int fcw2) { ScreenField sf = null; screenFields[nextField] = new ScreenField(screen); screenFields[nextField].setField(attr,row,col,len,ffw1,ffw2,fcw1,fcw2); sf = screenFields[nextField++]; sizeFields++; // set the field id if it is not a bypass field // this is used for cursor progression if (!sf.isBypassField()) sf.setFieldId(++fieldIds); // check if the cursor progression field flag should be set.// if ((fcw1 & 0x88) == 0x88) if (fcw1 == 0x88) cpfExists = true; if (currentField != null) { currentField.next = sf; sf.prev = currentField; } currentField = sf; // check if the Modified Data Tag was set while creating the field if (!masterMDT) masterMDT = currentField.mdt; return currentField; }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/1a742d0be10805d0a2d3a610bd78c953d227d26f/ScreenFields.java/buggy/tn5250j/src/org/tn5250j/ScreenFields.java
if (vector.size() >= 5) {
if (vector.size() >= 10) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0);
public Object get() throws InterruptedException { synchronized (lock) { // wait until there is something to read while (isEmpty()) lock.wait(); // just something here to try. if (vector.size() >= 5) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); } // we have the lock and state we're seeking return vector.remove(0); } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/99debc0e39981c309029bd7389a7d7c50837d87b/DataStreamQueue.java/buggy/tn5250j/src/org/tn5250j/DataStreamQueue.java