/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
implements ObjectReference, VMListener {
protected long ref;
boolean addedListener = false;
// This is cached only while the VM is suspended
protected static class Cache {
}
private void disableCache() {
}
}
private void enableCache() {
cache = markerCache;
}
}
// Override in subclasses
return new Cache();
}
if (cache == noInitCache) {
// Set cache now, otherwise newly created objects are
// not cached until resuspend
enableCache();
} else {
disableCache();
}
}
if (cache == markerCache) {
}
return cache;
}
}
// Return the ClassTypeImpl upon which to invoke a method.
// By default it is our very own referenceType() but subclasses
// can override.
return (ClassTypeImpl)referenceType();
}
super(aVm);
}
return "ObjectReference " + uniqueID();
}
/*
* VMListener implementation
*/
enableCache();
return true;
}
// make sure that cache and listener management are synchronized
}
disableCache();
if (addedListener) {
/*
* If a listener was added (i.e. this is not a
* ObjectReference that adds a listener on startup),
* remove it here.
*/
addedListener = false;
return false; // false says remove
} else {
return true;
}
}
}
} else {
return false;
}
}
public int hashCode() {
return(int)ref();
}
return referenceType();
}
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
}
return type;
}
}
for (int i=0; i<size; i++) {
// Make sure the field is valid
// FIX ME! We need to do some sanity checking
// here; make sure the field belongs to this
// object.
else {
}
}
} else {
}
for (int i=0; i<size; i++) {
}
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
throw new InternalException(
"Wrong number of values returned from target VM");
}
for (int i=0; i<size; i++) {
}
return map;
}
throws InvalidTypeException, ClassNotLoadedException {
// Make sure the field is valid
return;
} else {
throw new IllegalArgumentException(
"Invalid type for static field set");
}
}
try {
// Validate and convert if necessary
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
} catch (ClassNotLoadedException e) {
/*
* Since we got this exception,
* the field type must be a reference type. The value
* we're trying to set is null, but if the field's
* class has not yet been loaded through the enclosing
* class loader, then setting to null is essentially a
* no-op, and we should allow it without an exception.
*/
throw e;
}
}
}
throws InvalidTypeException,
/*
* Method must be in this object's class, a superclass, or
* implemented interface
*/
if (!declType.isAssignableFrom(this)) {
throw new IllegalArgumentException("Invalid method");
}
/*
* Method must be a non-constructor
*/
if (method.isConstructor()) {
throw new IllegalArgumentException("Cannot invoke constructor");
}
/*
* For nonvirtual invokes, method must have a body
*/
throw new IllegalArgumentException("Interface method");
} else if (method.isAbstract()) {
throw new IllegalArgumentException("Abstract method");
}
}
/*
* Get the class containing the method that will be invoked.
* This class is needed only for proper validation of the
* method argument types.
*/
// No overrides in non-virtual invokes
} else {
/*
* For virtual invokes, find any override of the method.
* Since we are looking for a method with a real body, we
* don't need to bother with interfaces/abstract methods.
*/
// isAssignableFrom check above guarantees non-null
}
/* The above code is left over from previous versions.
* We haven't had time to divine the intent. jjh, 7/31/2003
*/
}
final ClassTypeImpl refType,
final MethodImpl method,
final int options) {
new CommandSender() {
public PacketStream send() {
vm, ObjectReferenceImpl.this,
}
};
} else {
}
return stream;
}
throws InvalidTypeException,
if (referenceType() instanceof ClassType) {
} else {
throw new IllegalArgumentException("Invalid type for static method invocation");
}
}
try {
} catch (JDWPException exc) {
throw new IncompatibleThreadStateException();
} else {
throw exc.toJDIException();
}
}
/*
* There is an implict VM-wide suspend at the conclusion
* of a normal (non-single-threaded) method invoke
*/
vm.notifySuspend();
}
} else {
return ret.returnValue;
}
}
/* leave synchronized to keep count accurate */
public synchronized void disableCollection() {
if (gcDisableCount == 0) {
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
}
}
/* leave synchronized to keep count accurate */
public synchronized void enableCollection() {
if (gcDisableCount == 0) {
try {
} catch (JDWPException exc) {
// If already collected, no harm done, no exception
throw exc.toJDIException();
}
return;
}
}
}
public boolean isCollected() {
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
}
public long uniqueID() {
return ref();
}
throws IncompatibleThreadStateException {
try {
// getCache() and addlistener() must be synchronized
// so that no events are lost.
// Check if there will be something to cache
// and there is not already a listener
/* For other, less numerous objects, this is done
* in the constructor. Since there can be many
* ObjectReferences, the VM listener is installed
* and removed as needed.
* Listener must be installed before process()
*/
addedListener = true;
}
}
}
" temporarily caching monitor info");
}
}
}
} catch (JDWPException exc) {
throw new IncompatibleThreadStateException();
} else {
throw exc.toJDIException();
}
}
return info;
}
}
return jdwpMonitorInfo().owner;
}
return jdwpMonitorInfo().entryCount;
}
if (!vm.canGetInstanceInfo()) {
throw new UnsupportedOperationException(
"target does not support getting referring objects");
}
if (maxReferrers < 0) {
throw new IllegalArgumentException("maxReferrers is less than zero: "
+ maxReferrers);
}
// JDWP can't currently handle more than this (in mustang)
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
}
long ref() {
return ref;
}
boolean isClassObject() {
/*
* Don't need to worry about subclasses since java.lang.Class is final.
*/
}
throws InvalidTypeException,
return this; // conversion never necessary
}
throws InvalidTypeException, ClassNotLoadedException {
/*
* Do these simpler checks before attempting a query of the destination's
* type which might cause a confusing ClassNotLoadedException if
* the destination is primitive or an array.
*/
/*
* TO DO: Centralize JNI signature knowledge
*/
throw new InvalidTypeException("Can't assign object value to primitive");
}
throw new InvalidTypeException("Can't assign non-array value to an array");
}
throw new InvalidTypeException("Can't assign object value to a void");
}
// Validate assignment
throw new InvalidTypeException("Can't assign " +
" to " + destTypeName);
}
}
}
byte typeValueKey() {
}
}