This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new 7f50808  Context API refactoring.
7f50808 is described below

commit 7f5080886c59b17d45528a0a38dc965a97192a82
Author: JamesBognar <[email protected]>
AuthorDate: Tue Sep 14 10:23:34 2021 -0400

    Context API refactoring.
---
 .../src/main/java/org/apache/juneau/rest/RestContextBuilder.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
index 4d27c85..33c07bb 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
@@ -115,6 +115,8 @@ public class RestContextBuilder extends ContextBuilder 
implements ServletConfig
        // Read-only snapshots of these will be made in RestServletContext.
        
//-----------------------------------------------------------------------------------------------------------------
 
+       private boolean initialized;
+
        Supplier<?> resource;
        ServletContext servletContext;
 
@@ -224,6 +226,11 @@ public class RestContextBuilder extends ContextBuilder 
implements ServletConfig
         * @throws ServletException If hook method calls failed.
         */
        public RestContextBuilder init(Supplier<?> resource) throws 
ServletException {
+
+               if (initialized)
+                       return this;
+               initialized = true;
+
                this.resource = resource;
                Supplier<?> r = this.resource;
                Class<?> rc = resourceClass;

Reply via email to