本文整理汇总了Java中com.sun.jdi.ArrayReference.uniqueID方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayReference.uniqueID方法的具体用法?Java ArrayReference.uniqueID怎么用?Java ArrayReference.uniqueID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jdi.ArrayReference
的用法示例。
在下文中一共展示了ArrayReference.uniqueID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doEffect
import com.sun.jdi.ArrayReference; //导入方法依赖的package包/类
public void doEffect(RVal preVal, RVal postVal) throws InvalidTypeException, ClassNotLoadedException {
if (postVal instanceof ArrayValue) {
ArrayValue postArrVal = ((ArrayValue)postVal);
if (preVal.getValue() instanceof ArrayReference) {
ArrayReference preArrVal = (ArrayReference)preVal.getValue();
if (postArrVal.getValue() instanceof ArrayReference && ((ArrayReference)postArrVal.getValue()).uniqueID() == preArrVal.uniqueID()) {
// If it's the same array just with different values, we can reset the values directly.
postArrVal.resetTo(preArrVal);
return;
}
}
// We must reset the original array's values and reset to it.
postArrVal.resetTo((ArrayReference)postArrVal.getValue());
}
lval.setValue(postVal.getValue());
}
示例2: processArrayCellWrite
import com.sun.jdi.ArrayReference; //导入方法依赖的package包/类
private void processArrayCellWrite(final Location location, final StackFrame frame,
final IObjectContour oc)
{
if (!manager().generateArrayEvents() || oc == null)
{
return;
}
final Object jvm = owner.getJVM();
if (jvm != null)
{
final VirtualMachine vm = (VirtualMachine) jvm;
// traverse loaded classes to find the array
for (final Object c : vm.allClasses())
{
// skip non-arrays
if (!(c instanceof ArrayType))
{
continue;
}
// array type
final ArrayType refType = (ArrayType) c;
final ITypeNodeRef type = staticModelFactory().lookupTypeNode(refType.signature());
// skip if not the same type as the array contour
if (type == null || type.node() != oc.schema())
{
continue;
}
// create all instances but do not assign field values
for (final Object o : refType.instances(0))
{
if (o instanceof ArrayReference)
{
final ArrayReference ar = (ArrayReference) o;
if (ar.uniqueID() == oc.oid())
{
if (visitArrayCells(location, frame, ar, oc))
{
System.err
.println("Processed cell assginment to array: returned from method or invisible local variable.");
}
}
}
}
}
}
}
示例3: getArrayFromArrayReference
import com.sun.jdi.ArrayReference; //导入方法依赖的package包/类
private Data getArrayFromArrayReference(boolean forceWriteContent, String name,ArrayReference value, List<Long> objectsProcessed) {
Data object = null;
long arrayID = value.uniqueID();
if (forceWriteContent || !isExcludedClass(value)){
if (objectsProcessed.contains(arrayID)){
object = new ObjectData(name,value.uniqueID(),null,null,null,getClass(value.referenceType())+ "[]");
} else {
List<Data> elements = new ArrayList<>();
List<Value> values = value.getValues();
objectsProcessed.add(arrayID);
for (int i=0;i<values.size();i++){
Value v = values.get(i);
elements.add(getObj("["+i+"]",v,objectsProcessed));
}
object = new ArrayData(name,arrayID,elements,value.length(),getClass(value.referenceType()));
}
} else {
object = new IgnoredData(getClass(value.referenceType()),name);
}
return object;
}