From 2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 17 Jan 2006 18:09:40 +0000 Subject: Imported GNU Classpath 0.20 * Makefile.am (AM_CPPFLAGS): Add classpath/include. * java/nio/charset/spi/CharsetProvider.java: New override file. * java/security/Security.java: Likewise. * sources.am: Regenerated. * Makefile.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109831 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/java/lang/StackTraceElement.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'libjava/classpath/java/lang/StackTraceElement.java') diff --git a/libjava/classpath/java/lang/StackTraceElement.java b/libjava/classpath/java/lang/StackTraceElement.java index 6dd4d8532e8..cf4d1c76f4d 100644 --- a/libjava/classpath/java/lang/StackTraceElement.java +++ b/libjava/classpath/java/lang/StackTraceElement.java @@ -49,7 +49,7 @@ import java.io.Serializable; * @author Mark Wielaard (mark@klomp.org) * @author Eric Blake (ebb9@email.byu.edu) * @since 1.4 - * @status updated to 1.4 + * @status updated to 1.5 */ public final class StackTraceElement implements Serializable { @@ -111,6 +111,26 @@ public final class StackTraceElement implements Serializable this.isNative = isNative; } + /** + * Create a new StackTraceElement representing a given source location. + * + * @param className the fully qualified name of the class + * @param methodName the name of the method + * @param fileName the name of the file, null if unknown + * @param lineNumber the line in the file, negative if unknown, or -2 + * if this method is native + * + * @since 1.5 + */ + public StackTraceElement(String className, String methodName, String fileName, + int lineNumber) + { + this(fileName, lineNumber, className, methodName, lineNumber == -2); + // The public constructor doesn't allow certain values to be null. + if (className == null || methodName == null) + throw new NullPointerException("invalid argument to constructor"); + } + /** * Returns the name of the file, or null if unknown. This is usually * obtained from the SourceFile attribute of the class file -- cgit v1.2.3