| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 82 | 2 | 1 | 0.957 | class_body_declarations[16] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 82 | 27 | plugins/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpPacket.java |
| 2 | 82 | 30 | plugins/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpPacket.java |
| ||||
/** General JDWP constants. */
public static final byte FLAG_REPLY_PACKET = (byte) 0x80;
protected static final int MIN_PACKET_LENGTH = 11;
/** Map with Strings for flag bits. */
private static String[] fgFlagStrings = null;
/** Header fields. */
protected int fId = 0;
protected byte fFlags = 0;
protected byte[] fDataBuf = null;
/**
* Set Id.
*/
/*package*/
void setId(int id) {
fId = id;
}
/**
* @return Returns Id.
*/
public int getId() {
return fId;
}
/**
* Set Flags.
*/
/*package*/
void setFlags(byte flags) {
fFlags = flags;
}
/**
* @return Returns Flags.
*/
public byte getFlags() {
return fFlags;
}
/**
* @return Returns total length of packet.
*/
public int getLength() {
return MIN_PACKET_LENGTH + getDataLength();
}
/**
* @return Returns length of data in packet.
*/
public int getDataLength() {
return fDataBuf == null ? 0: fDataBuf.length;
}
/**
* @return Returns data of packet.
*/
public byte[] data() {
return fDataBuf;
}
/**
* @return Returns DataInputStream with reply data, or an empty stream if there is none.
*/
public DataInputStream dataInStream() {
if (fDataBuf != null) {
return new DataInputStream(new ByteArrayInputStream(fDataBuf));
}
return new DataInputStream(new ByteArrayInputStream(new byte[0]));
}
/**
* Assigns data to packet.
*/
public void setData(byte[] data) {
fDataBuf = data;
}
/**
* Reads header fields that are specific for a type of packet.
*/
protected abstract int readSpecificHeaderFields(byte[] bytes, int index)
throws IOException;
|
| ||||
/** General JDWP constants. */
public static final byte FLAG_REPLY_PACKET = (byte) 0x80;
protected static final int MIN_PACKET_LENGTH = 11;
/** Map with Strings for flag bits. */
private static String[] fgFlagStrings = null;
/** Header fields. */
protected int fId = 0;
protected byte fFlags = 0;
protected byte[] fDataBuf = null;
/**
* Set Id.
*/
/*package*/
void setId(int id) {
fId = id;
}
/**
* @return Returns Id.
*/
public int getId() {
return fId;
}
/**
* Set Flags.
*/
/*package*/
void setFlags(byte flags) {
fFlags = flags;
}
/**
* @return Returns Flags.
*/
public byte getFlags() {
return fFlags;
}
/**
* @return Returns total length of packet.
*/
public int getLength() {
return MIN_PACKET_LENGTH + getDataLength();
}
/**
* @return Returns length of data in packet.
*/
public int getDataLength() {
return fDataBuf == null ? 0: fDataBuf.length;
}
/**
* @return Returns data of packet.
*/
public byte[] data() {
return fDataBuf;
}
/**
* @return Returns DataInputStream with reply data, or an empty stream if there is none.
*/
public DataInputStream dataInStream() {
if (fDataBuf != null) {
return new DataInputStream(new ByteArrayInputStream(fDataBuf));
}
return new DataInputStream(new ByteArrayInputStream(new byte[0]));
}
/**
* Assigns data to packet.
*/
public void setData(byte[] data) {
fDataBuf = data;
}
/**
* Reads header fields that are specific for a type of packet.
*/
protected abstract void readSpecificHeaderFields(DataInputStream dataInStream)
throws IOException;
|
| |||
/** General JDWP constants. */
public static final byte FLAG_REPLY_PACKET = (byte) 0x80;
protected static final int MIN_PACKET_LENGTH = 11;
/** Map with Strings for flag bits. */
private static String[] fgFlagStrings = null;
/** Header fields. */
protected int fId = 0;
protected byte fFlags = 0;
protected byte[] fDataBuf = null;
/**
* Set Id.
*/
/*package*/
void setId(int id) {
fId = id;
}
/**
* @return Returns Id.
*/
public int getId() {
return fId;
}
/**
* Set Flags.
*/
/*package*/
void setFlags(byte flags) {
fFlags = flags;
}
/**
* @return Returns Flags.
*/
public byte getFlags() {
return fFlags;
}
/**
* @return Returns total length of packet.
*/
public int getLength() {
return MIN_PACKET_LENGTH + getDataLength();
}
/**
* @return Returns length of data in packet.
*/
public int getDataLength() {
return fDataBuf == null ? 0: fDataBuf.length;
}
/**
* @return Returns data of packet.
*/
public byte[] data() {
return fDataBuf;
}
/**
* @return Returns DataInputStream with reply data, or an empty stream if there is none.
*/
public DataInputStream dataInStream() {
if (fDataBuf != null) {
return new DataInputStream(new ByteArrayInputStream(fDataBuf));
}
return new DataInputStream(new ByteArrayInputStream(new byte[0]));
}
/**
* Assigns data to packet.
*/
public void setData(byte[] data) {
fDataBuf = data;
}
[[#variablebaee1ae0]]
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#baee1ae0]] | /** * Reads header fields that are specific for a type of packet. */ protected abstract int readSpecificHeaderFields(byte[] bytes, int index) throws IOException; |
| 1 | 2 | [[#baee1ae0]] | /** * Reads header fields that are specific for a type of packet. */ protected abstract void readSpecificHeaderFields(DataInputStream dataInStream) throws IOException; |