changeset 14105:8aab9eb6dd72

8153414: (fs) Internal sun/nio/fs exceptions should be stackless Summary: Override fillInStackTrace() to be a no-op in UnixException and WindowsException. Reviewed-by: alanb Contributed-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
author bpb
date Fri, 08 Apr 2016 09:36:11 -0700
parents dea3115d8e8e
children 818192f0e1ea
files src/java.base/unix/classes/sun/nio/fs/UnixException.java src/java.base/windows/classes/sun/nio/fs/WindowsException.java
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/unix/classes/sun/nio/fs/UnixException.java	Fri Apr 08 16:38:37 2016 +0100
+++ b/src/java.base/unix/classes/sun/nio/fs/UnixException.java	Fri Apr 08 09:36:11 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,6 +70,12 @@
         return errorString();
     }
 
+    @Override
+    public Throwable fillInStackTrace() {
+        // This is an internal exception; the stack trace is irrelevant.
+        return this;
+    }
+
     /**
      * Map well known errors to specific exceptions where possible; otherwise
      * return more general FileSystemException.
--- a/src/java.base/windows/classes/sun/nio/fs/WindowsException.java	Fri Apr 08 16:38:37 2016 +0100
+++ b/src/java.base/windows/classes/sun/nio/fs/WindowsException.java	Fri Apr 08 09:36:11 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,6 +69,12 @@
         return errorString();
     }
 
+    @Override
+    public Throwable fillInStackTrace() {
+        // This is an internal exception; the stack trace is irrelevant.
+        return this;
+    }
+
     private IOException translateToIOException(String file, String other) {
         // not created with last error
         if (lastError() == 0)