summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/lang/StackTraceElement.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/lang/StackTraceElement.java')
-rw-r--r--libjava/classpath/java/lang/StackTraceElement.java22
1 files changed, 21 insertions, 1 deletions
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
{
@@ -112,6 +112,26 @@ public final class StackTraceElement implements Serializable
}
/**
+ * 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 <code>SourceFile</code> attribute of the class file
* format, if present.
OpenPOWER on IntegriCloud