当前位置: 首页>>代码示例>>Java>>正文


Java InternalException类代码示例

本文整理汇总了Java中com.sun.jdi.InternalException的典型用法代码示例。如果您正苦于以下问题:Java InternalException类的具体用法?Java InternalException怎么用?Java InternalException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InternalException类属于com.sun.jdi包,在下文中一共展示了InternalException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isInstanceOf

import com.sun.jdi.InternalException; //导入依赖的package包/类
@Override
public boolean isInstanceOf(String className) {
    List<ReferenceType> classTypes;
    try {
        classTypes = VirtualMachineWrapper.classesByName(MirrorWrapper.virtualMachine(classType), className);
    } catch (InternalExceptionWrapper | VMDisconnectedExceptionWrapper ex) {
        return false;
    }
    for (ReferenceType rt : classTypes) {
        try {
            if (EvaluatorVisitor.instanceOf(classType, rt)) {
                return true;
            }
        } catch (VMDisconnectedException vmdex) {
            return false;
        } catch (InternalException iex) {
            // procceed
        }
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:JPDAClassTypeImpl.java

示例2: writeLocation

import com.sun.jdi.InternalException; //导入依赖的package包/类
void writeLocation(Location location) {
    ReferenceTypeImpl refType = (ReferenceTypeImpl)location.declaringType();
    byte tag;
    if (refType instanceof ClassType) {
        tag = JDWP.TypeTag.CLASS;
    } else if (refType instanceof InterfaceType) {
        // It's possible to have executable code in an interface
        tag = JDWP.TypeTag.INTERFACE;
    } else {
        throw new InternalException("Invalid Location");
    }
    writeByte(tag);
    writeClassRef(refType.ref());
    writeMethodRef(((MethodImpl)location.method()).ref());
    writeLong(location.codeIndex());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:PacketStream.java

示例3: resume

import com.sun.jdi.InternalException; //导入依赖的package包/类
public void resume() {
    switch (suspendPolicy()) {
        case EventRequest.SUSPEND_ALL:
            vm.resume();
            break;
        case EventRequest.SUSPEND_EVENT_THREAD:
            ThreadReference thread = eventThread();
            if (thread == null) {
                throw new InternalException("Inconsistent suspend policy");
            }
            thread.resume();
            break;
        case EventRequest.SUSPEND_NONE:
            // Do nothing
            break;
        default:
            throw new InternalException("Invalid suspend policy");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:EventSetImpl.java

示例4: convertForAssignmentTo

import com.sun.jdi.InternalException; //导入依赖的package包/类
ValueImpl convertForAssignmentTo(ValueContainer destination)
    throws InvalidTypeException
{
    /*
     * TO DO: Centralize JNI signature knowledge
     */
    if (destination.signature().length() > 1) {
        throw new InvalidTypeException("Can't assign primitive value to object");
    }

    if ((destination.signature().charAt(0) == 'Z') &&
        (type().signature().charAt(0) != 'Z')) {
        throw new InvalidTypeException("Can't assign non-boolean value to a boolean");
    }

    if ((destination.signature().charAt(0) != 'Z') &&
        (type().signature().charAt(0) == 'Z')) {
        throw new InvalidTypeException("Can't assign boolean value to an non-boolean");
    }

    if ("void".equals(destination.typeName())) {
        throw new InvalidTypeException("Can't assign primitive value to a void");
    }

    try {
        PrimitiveTypeImpl primitiveType = (PrimitiveTypeImpl)destination.type();
        return (ValueImpl)(primitiveType.convert(this));
    } catch (ClassNotLoadedException e) {
        throw new InternalException("Signature and type inconsistent for: " +
                                    destination.typeName());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:PrimitiveValueImpl.java

示例5: removeObjectMirror

import com.sun.jdi.InternalException; //导入依赖的package包/类
synchronized void removeObjectMirror(ObjectReferenceImpl object) {
    // Handle any queue elements that are not strongly reachable
    processQueue();

    SoftObjectReference ref = objectsByID.remove(object.ref());
    if (ref != null) {
        batchForDispose(ref);
    } else {
        /*
         * If there's a live ObjectReference about, it better be part
         * of the cache.
         */
        throw new InternalException("ObjectReference " + object.ref() +
                                    " not found in object cache");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:VirtualMachineImpl.java

示例6: clone

import com.sun.jdi.InternalException; //导入依赖的package包/类
public Object clone() {
    try {
        return super.clone();
    } catch (CloneNotSupportedException e) {
        // Object should always support clone
        throw new InternalException();
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:9,代码来源:ConnectorImpl.java

示例7: getEventText

import com.sun.jdi.InternalException; //导入依赖的package包/类
public String getEventText(Pair<Breakpoint, Event> descriptor) {
  String text = "";
  final Event event = descriptor.getSecond();
  final Breakpoint breakpoint = descriptor.getFirst();
  if (event instanceof LocatableEvent) {
    if (breakpoint instanceof LineBreakpoint && !((LineBreakpoint)breakpoint).isVisible()) {
      text = DebuggerBundle.message("status.stopped.at.cursor");
    }
    else {
      try {
        text = breakpoint != null? breakpoint.getEventMessage(((LocatableEvent)event)) : DebuggerBundle.message("status.generic.breakpoint.reached");
      }
      catch (InternalException e) {
        text = DebuggerBundle.message("status.generic.breakpoint.reached");
      }
    }
  }
  else if (event instanceof VMStartEvent) {
    text = DebuggerBundle.message("status.process.started");
  }
  else if (event instanceof VMDeathEvent) {
    text = DebuggerBundle.message("status.process.terminated");
  }
  else if (event instanceof VMDisconnectEvent) {
    final RemoteConnection connection = getConnection();
    final String addressDisplayName = DebuggerBundle.getAddressDisplayName(connection);
    final String transportName = DebuggerBundle.getTransportName(connection);
    text = DebuggerBundle.message("status.disconnected", addressDisplayName, transportName);
  }
  return text;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:DebugProcessEvents.java

示例8: clone

import com.sun.jdi.InternalException; //导入依赖的package包/类
public Object clone() {
    try {
        return super.clone();
    } catch (CloneNotSupportedException e) {
        // Object should always support clone
        throw (InternalException) new InternalException().initCause(e);
    }
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:9,代码来源:ConnectorImpl.java

示例9: threadResumable

import com.sun.jdi.InternalException; //导入依赖的package包/类
public boolean threadResumable(ThreadAction action) {
    synchronized (vm.state()) {
        if (isValid) {
            isValid = false;
            return false;   /* remove this stack frame as a listener */
        } else {
            throw new InternalException(
                              "Invalid stack frame thread listener");
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:MonitorInfoImpl.java

示例10: isArgument

import com.sun.jdi.InternalException; //导入依赖的package包/类
public boolean isArgument() {
    try {
        MethodImpl method = (MethodImpl)scopeStart.method();
        return (slot < method.argSlotCount());
    } catch (AbsentInformationException e) {
        // If this variable object exists, there shouldn't be absent info
        throw new InternalException();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:LocalVariableImpl.java

示例11: waitForReply

import com.sun.jdi.InternalException; //导入依赖的package包/类
void waitForReply() throws JDWPException {
    if (!isCommitted) {
        throw new InternalException("waitForReply without send");
    }

    vm.waitForTargetReply(pkt);

    if (pkt.errorCode != Packet.ReplyNoError) {
        throw new JDWPException(pkt.errorCode);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:PacketStream.java

示例12: writeString

import com.sun.jdi.InternalException; //导入依赖的package包/类
void writeString(String string) {
    try {
        byte[] stringBytes = string.getBytes("UTF8");
        writeInt(stringBytes.length);
        writeByteArray(stringBytes);
    } catch (java.io.UnsupportedEncodingException e) {
        throw new InternalException("Cannot convert string to UTF8 bytes");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:PacketStream.java

示例13: toJDIException

import com.sun.jdi.InternalException; //导入依赖的package包/类
RuntimeException toJDIException() {
    switch (errorCode) {
        case JDWP.Error.INVALID_OBJECT:
            return new ObjectCollectedException();
        case JDWP.Error.INVALID_MODULE:
            return new InvalidModuleException();
        case JDWP.Error.VM_DEAD:
            return new VMDisconnectedException();
        case JDWP.Error.OUT_OF_MEMORY:
            return new VMOutOfMemoryException();
        case JDWP.Error.CLASS_NOT_PREPARED:
            return new ClassNotPreparedException();
        case JDWP.Error.INVALID_FRAMEID:
        case JDWP.Error.NOT_CURRENT_FRAME:
            return new InvalidStackFrameException();
        case JDWP.Error.NOT_IMPLEMENTED:
            return new UnsupportedOperationException();
        case JDWP.Error.INVALID_INDEX:
        case JDWP.Error.INVALID_LENGTH:
            return new IndexOutOfBoundsException();
        case JDWP.Error.TYPE_MISMATCH:
            return new InconsistentDebugInfoException();
        case JDWP.Error.INVALID_THREAD:
            return new IllegalThreadStateException();
        default:
            return new InternalException("Unexpected JDWP Error: " + errorCode, errorCode);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:JDWPException.java

示例14: EventSetImpl

import com.sun.jdi.InternalException; //导入依赖的package包/类
/**
 * Constructor for special events like VM disconnected
 */
EventSetImpl(VirtualMachine aVm, byte eventCmd) {
    this(aVm, null);
    suspendPolicy = JDWP.SuspendPolicy.NONE;
    switch (eventCmd) {
        case JDWP.EventKind.VM_DISCONNECTED:
            addEvent(new VMDisconnectEventImpl());
            break;

        default:
            throw new InternalException("Bad singleton event code");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:EventSetImpl.java

示例15: privateFrames

import com.sun.jdi.InternalException; //导入依赖的package包/类
/**
 * Private version of frames() allows "-1" to specify all
 * remaining frames.
 */
synchronized private List<StackFrame> privateFrames(int start, int length)
                          throws IncompatibleThreadStateException  {

    // Lock must be held while creating stack frames so if that two threads
    // do this at the same time, one won't clobber the subset created by the other.
    LocalCache snapshot = localCache;
    try {
        if (snapshot.frames == null || !isSubrange(snapshot, start, length)) {
            JDWP.ThreadReference.Frames.Frame[] jdwpFrames
                = JDWP.ThreadReference.Frames.
                process(vm, this, start, length).frames;
            int count = jdwpFrames.length;
            snapshot.frames = new ArrayList<>(count);

            for (int i = 0; i<count; i++) {
                if (jdwpFrames[i].location == null) {
                    throw new InternalException("Invalid frame location");
                }
                StackFrame frame = new StackFrameImpl(vm, this,
                                                      jdwpFrames[i].frameID,
                                                      jdwpFrames[i].location);
                // Add to the frame list
                snapshot.frames.add(frame);
            }
            snapshot.framesStart = start;
            snapshot.framesLength = length;
            return Collections.unmodifiableList(snapshot.frames);
        } else {
            int fromIndex = start - snapshot.framesStart;
            int toIndex;
            if (length == -1) {
                toIndex = snapshot.frames.size() - fromIndex;
            } else {
                toIndex = fromIndex + length;
            }
            return Collections.unmodifiableList(snapshot.frames.subList(fromIndex, toIndex));
        }
    } catch (JDWPException exc) {
        switch (exc.errorCode()) {
        case JDWP.Error.THREAD_NOT_SUSPENDED:
        case JDWP.Error.INVALID_THREAD:   /* zombie */
            throw new IncompatibleThreadStateException();
        default:
            throw exc.toJDIException();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:52,代码来源:ThreadReferenceImpl.java


注:本文中的com.sun.jdi.InternalException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。