Repository: incubator-juneau Updated Branches: refs/heads/master 07843d641 -> 1174420cf
Fix compilation error in Java 1.7 Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/1174420c Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/1174420c Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/1174420c Branch: refs/heads/master Commit: 1174420cf0800274c2b5d2e7b59f4428ed448503 Parents: 07843d6 Author: JamesBognar <[email protected]> Authored: Fri Mar 17 09:38:23 2017 -0400 Committer: JamesBognar <[email protected]> Committed: Fri Mar 17 09:38:23 2017 -0400 ---------------------------------------------------------------------- .../src/main/java/org/apache/juneau/rest/RestContext.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/1174420c/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java ---------------------------------------------------------------------- diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java index 243afee..29113f4 100644 --- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java +++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java @@ -341,6 +341,7 @@ public final class RestContext extends Context { @SuppressWarnings("unchecked") public RestContext(Object resource, RestConfig config) throws Exception { super(null); + RestException _initException = null; try { this.resource = resource; this.config = config; @@ -473,13 +474,14 @@ public final class RestContext extends Context { infoProvider = config.infoProvider == null ? new RestInfoProvider(this) : resolve(RestInfoProvider.class, config.infoProvider, this); } catch (RestException e) { - initException = e; + _initException = e; throw e; } catch (Exception e) { - initException = new RestException(SC_INTERNAL_SERVER_ERROR, e); + _initException = new RestException(SC_INTERNAL_SERVER_ERROR, e); throw e; + } finally { + initException = _initException; } - initException = null; } private static class Builder {
