| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 32 | 2 | 2 | 0.988 | class_body_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 32 | 284 | plugins/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassTypeImpl.java |
| 2 | 32 | 449 | plugins/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ObjectReferenceImpl.java |
| ||||
/**
* Assigns a value to a static field. .
*/
public void setValue(Field field, Value value) throws InvalidTypeException, ClassNotLoadedException {
// Note that this information should not be cached.
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
writeInt(1, "size", outData); // We only set one field //$NON-NLS-1$
checkVM(field);
((FieldImpl) field).write(this, outData);
// check the type and the vm of the value. Convert the value if needed
ValueImpl checkedValue = ValueImpl.checkValue(value, field.type(), virtualMachineImpl());
if (checkedValue != null) {
checkedValue.write(this, outData);
}
else {
ValueImpl.writeNull(this, outData);
}
JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.CT_SET_VALUES, outBytes);
switch (replyPacket.errorCode()) {
case JdwpReplyPacket.TYPE_MISMATCH:
throw new InvalidTypeException();
case JdwpReplyPacket.INVALID_CLASS:
throw new ClassNotLoadedException(name());
}
defaultReplyErrorHandler(replyPacket.errorCode());
} catch (IOException e) {
defaultIOExceptionHandler(e);
}
finally {
handledJdwpRequest();
}
}
|
| ||||
/**
* Sets the value of a given instance or static field in this object.
*/
public void setValue(Field field, Value value) throws InvalidTypeException, ClassNotLoadedException {
// Note that this information should not be cached.
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
writeInt(1, "size", outData); // We only set one field //$NON-NLS-1$
checkVM(field);
((FieldImpl) field).write(this, outData);
// check the type and the vm of the value. Convert the value if needed
ValueImpl checkedValue = ValueImpl.checkValue(value, field.type(), virtualMachineImpl());
if (checkedValue != null) {
checkedValue.write(this, outData);
}
else {
ValueImpl.writeNull(this, outData);
}
JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_SET_VALUES, outBytes);
switch (replyPacket.errorCode()) {
case JdwpReplyPacket.TYPE_MISMATCH:
throw new InvalidTypeException();
case JdwpReplyPacket.INVALID_CLASS:
throw new ClassNotLoadedException(referenceType().name());
}
defaultReplyErrorHandler(replyPacket.errorCode());
} catch (IOException e) {
defaultIOExceptionHandler(e);
}
finally {
handledJdwpRequest();
}
}
|
| |||
/**
* Sets the value of a given instance or static field in this object.
*/
/**
* Assigns a value to a static field. .
*/
public void setValue(Field field, Value value) throws InvalidTypeException, ClassNotLoadedException {
// Note that this information should not be cached.
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
writeInt(1, "size", outData); // We only set one field //$NON-NLS-1$
checkVM(field);
((FieldImpl) field).write(this, outData);
// check the type and the vm of the value. Convert the value if needed
ValueImpl checkedValue = ValueImpl.checkValue(value, field.type(), virtualMachineImpl());
if (checkedValue != null) {
checkedValue.write(this, outData);
}
else {
ValueImpl.writeNull(this, outData);
}
JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket. [[#variablec3408760]], outBytes);
switch (replyPacket.errorCode()) {
case JdwpReplyPacket.TYPE_MISMATCH:
throw new InvalidTypeException();
case JdwpReplyPacket.INVALID_CLASS:
throw new ClassNotLoadedException( [[#variablec3408660]]);
}
defaultReplyErrorHandler(replyPacket.errorCode());
}
catch (IOException e) {
defaultIOExceptionHandler(e);
}
finally {
handledJdwpRequest();
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#c3408760]] | OR_SET_VALUES |
| 1 | 2 | [[#c3408760]] | CT_SET_VALUES |
| 2 | 1 | [[#c3408660]] | referenceType().name() |
| 2 | 2 | [[#c3408660]] | name() |