8153414: (fs) Internal sun/nio/fs exceptions should be stackless
Override fillInStackTrace() to be a no-op in UnixException and WindowsException. Reviewed-by: alanb
This commit is contained in:
parent
f9295881a8
commit
1da051c21c
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -70,6 +70,12 @@ class UnixException extends Exception {
|
|||||||
return errorString();
|
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
|
* Map well known errors to specific exceptions where possible; otherwise
|
||||||
* return more general FileSystemException.
|
* return more general FileSystemException.
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -69,6 +69,12 @@ class WindowsException extends Exception {
|
|||||||
return errorString();
|
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) {
|
private IOException translateToIOException(String file, String other) {
|
||||||
// not created with last error
|
// not created with last error
|
||||||
if (lastError() == 0)
|
if (lastError() == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user