stacktraceframe.java

来自「一个开源的JAVA虚拟机」· Java 代码 · 共 38 行

JAVA
38
字号
/* * This class records a frame in a stack trace. */package aegis;class StackTraceFrame {    /* The Aegis VM assumes that a frame has exactly 4 reference fields        (char[]) and exactly 1 primitive field (int).    */    private char[] className;    private char[] methodName;    private char[] methodSignature;    private char[] fileName;    private int lineNumber;    private StackTraceFrame() { }    public String toString() {	String msg = "" + new String(className) + "." +	    new String(methodName) + new String(methodSignature);	/* fileName or lineNumber may not be present for one of the	   following reasons:	   (1) The SourceFile and LineNumberTable attributes are optional	   attributes: a class file may not have them.	   (2) The VM may be built with the processing of the two attributes	   turned off.	*/	if (fileName != null) {	    msg += " (" + new String(fileName);	    if (lineNumber >= 0)		msg += ": " + Integer.toString(lineNumber);	    msg += ")";	}	return msg;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?