219 }
220 return list;
221 }
222
223 @Override
224 final List<ReferenceType> inheritedTypes() {
225 List<ReferenceType> inherited = new ArrayList<>();
226 if (superclass() != null) {
227 inherited.add(0, superclass()); /* insert at front */
228 }
229 for (ReferenceType rt : interfaces()) {
230 inherited.add(rt);
231 }
232 return inherited;
233 }
234
235 private PacketStream sendInvokeCommand(final ThreadReferenceImpl thread,
236 final MethodImpl method,
237 final ValueImpl[] args,
238 final int options) {
239 /*
240 * Cache the values of args when TRACE_SENDS is enabled, for later printing.
241 * If not cached, printing causes a remote call while synchronized, and deadlock.
242 */
243 if ((vm.traceFlags & VirtualMachine.TRACE_SENDS) != 0) {
244 for (ValueImpl arg: args) {
245 arg.toString();
246 }
247 }
248 CommandSender sender = getInvokeMethodSender(thread, method, args, options);
249 PacketStream stream;
250 if ((options & ClassType.INVOKE_SINGLE_THREADED) != 0) {
251 stream = thread.sendResumingCommand(sender);
252 } else {
253 stream = vm.sendResumingCommand(sender);
254 }
255 return stream;
256 }
257
258 private void validateMethodInvocation(Method method)
259 throws InvalidTypeException,
260 InvocationException {
261 if (!canInvoke(method)) {
262 throw new IllegalArgumentException("Invalid method");
263 }
264 /*
265 * Method must be a static and not a static initializer
266 */
267 if (!method.isStatic()) {
|
219 }
220 return list;
221 }
222
223 @Override
224 final List<ReferenceType> inheritedTypes() {
225 List<ReferenceType> inherited = new ArrayList<>();
226 if (superclass() != null) {
227 inherited.add(0, superclass()); /* insert at front */
228 }
229 for (ReferenceType rt : interfaces()) {
230 inherited.add(rt);
231 }
232 return inherited;
233 }
234
235 private PacketStream sendInvokeCommand(final ThreadReferenceImpl thread,
236 final MethodImpl method,
237 final ValueImpl[] args,
238 final int options) {
239
240 CommandSender sender = getInvokeMethodSender(thread, method, args, options);
241 PacketStream stream;
242 if ((options & ClassType.INVOKE_SINGLE_THREADED) != 0) {
243 stream = thread.sendResumingCommand(sender);
244 } else {
245 stream = vm.sendResumingCommand(sender);
246 }
247 return stream;
248 }
249
250 private void validateMethodInvocation(Method method)
251 throws InvalidTypeException,
252 InvocationException {
253 if (!canInvoke(method)) {
254 throw new IllegalArgumentException("Invalid method");
255 }
256 /*
257 * Method must be a static and not a static initializer
258 */
259 if (!method.isStatic()) {
|