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 bf431b1  Context API refactoring.
bf431b1 is described below

commit bf431b12291a7d64e7e7ac4810ea8fd61b8ac98b
Author: JamesBognar <[email protected]>
AuthorDate: Sun Aug 22 13:42:13 2021 -0400

    Context API refactoring.
---
 .../java/org/apache/juneau/AnnotationApplier.java  | 11 ++++
 .../apache/juneau/rest/RestOperationContext.java   | 72 +---------------------
 .../juneau/rest/RestOperationContextBuilder.java   | 53 ++++++++++++++--
 .../apache/juneau/rest/annotation/RestDelete.java  |  2 +-
 .../rest/annotation/RestDeleteAnnotation.java      |  6 +-
 .../org/apache/juneau/rest/annotation/RestGet.java |  2 +-
 .../juneau/rest/annotation/RestGetAnnotation.java  |  6 +-
 .../org/apache/juneau/rest/annotation/RestOp.java  |  2 +-
 .../juneau/rest/annotation/RestOpAnnotation.java   | 11 ++--
 .../apache/juneau/rest/annotation/RestPost.java    |  2 +-
 .../juneau/rest/annotation/RestPostAnnotation.java |  6 +-
 .../org/apache/juneau/rest/annotation/RestPut.java |  2 +-
 .../juneau/rest/annotation/RestPutAnnotation.java  |  6 +-
 13 files changed, 83 insertions(+), 98 deletions(-)

diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/AnnotationApplier.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/AnnotationApplier.java
index 8b0e4db..b9eae1b 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/AnnotationApplier.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/AnnotationApplier.java
@@ -97,6 +97,17 @@ public abstract class AnnotationApplier<A extends 
Annotation, B> {
        }
 
        /**
+        * Resolves the specified string.
+        *
+        * @param in The string containing variables to resolve.
+        * @return An optional containing the specified string if it exists, or 
{@link Optional#empty()} if it does not.
+        */
+       protected Optional<String> string2(String in) {
+               in = vr.resolve(in);
+               return isEmpty(in) ? Optional.empty() : Optional.of(in);
+       }
+
+       /**
         * Resolves the specified strings in the string array.
         *
         * @param in The string array containing variables to resolve.
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
index d983e83..53f3db9 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
@@ -54,7 +54,6 @@ import org.apache.juneau.oapi.*;
 import org.apache.juneau.parser.*;
 import org.apache.juneau.reflect.*;
 import org.apache.juneau.rest.annotation.*;
-import org.apache.juneau.http.remote.*;
 import org.apache.juneau.http.response.*;
 import org.apache.juneau.rest.guards.*;
 import org.apache.juneau.rest.logging.*;
@@ -487,75 +486,6 @@ public class RestOperationContext extends BeanContext 
implements Comparable<Rest
        public static final String RESTOP_defaultResponseHeaders = PREFIX + 
".defaultResponseHeaders.lo";
 
        /**
-        * Configuration property:  HTTP method name.
-        *
-        * <h5 class='section'>Property:</h5>
-        * <ul class='spaced-list'>
-        *      <li><b>ID:</b>  {@link 
org.apache.juneau.rest.RestOperationContext#RESTOP_httpMethod RESTOP_httpMethod}
-        *      <li><b>Name:</b>  <js>"RestOperationContext.httpMethod.s"</js>
-        *      <li><b>Data type:</b>  <c>String</c>
-        *      <li><b>System property:</b>  
<c>RestOperationContext.httpMethod</c>
-        *      <li><b>Environment variable:</b>  
<c>RESTOPERATIONCONTEXT_HTTPMETHOD</c>
-        *      <li><b>Default:</b>  <jk>null</jk>
-        *      <li><b>Session property:</b>  <jk>false</jk>
-        *      <li><b>Annotations:</b>
-        *              <ul>
-        *                      <li class='ja'>{@link 
org.apache.juneau.rest.annotation.RestOp#method()}
-        *              </ul>
-        *      <li><b>Methods:</b>
-        *              <ul>
-        *                      <li class='jm'>{@link 
org.apache.juneau.rest.RestOperationContextBuilder#httpMethod(String)}
-        *              </ul>
-        * </ul>
-        *
-        * <h5 class='section'>Description:</h5>
-        * <p>
-        * REST method name.
-        *
-        * <p>
-        * Typically <js>"GET"</js>, <js>"PUT"</js>, <js>"POST"</js>, 
<js>"DELETE"</js>, or <js>"OPTIONS"</js>.
-        *
-        * <p>
-        * Method names are case-insensitive (always folded to upper-case).
-        *
-        * <p>
-        * Note that you can use {@link org.apache.juneau.http.HttpMethod} for 
constant values.
-        *
-        * <p>
-        * Besides the standard HTTP method names, the following can also be 
specified:
-        * <ul class='spaced-list'>
-        *      <li>
-        *              <js>"*"</js>
-        *              - Denotes any method.
-        *              <br>Use this if you want to capture any HTTP methods in 
a single Java method.
-        *              <br>The {@link org.apache.juneau.rest.annotation.Method 
@Method} annotation and/or {@link RestRequest#getMethod()} method can be used to
-        *              distinguish the actual HTTP method name.
-        *      <li>
-        *              <js>""</js>
-        *              - Auto-detect.
-        *              <br>The method name is determined based on the Java 
method name.
-        *              <br>For example, if the method is <c>doPost(...)</c>, 
then the method name is automatically detected
-        *              as <js>"POST"</js>.
-        *              <br>Otherwise, defaults to <js>"GET"</js>.
-        *      <li>
-        *              <js>"RRPC"</js>
-        *              - Remote-proxy interface.
-        *              <br>This denotes a Java method that returns an object 
(usually an interface, often annotated with the
-        *              {@link Remote @Remote} annotation) to be used as a 
remote proxy using
-        *              <c>RestClient.getRemoteInterface(Class&lt;T&gt; 
interfaceClass, String url)</c>.
-        *              <br>This allows you to construct client-side interface 
proxies using REST as a transport medium.
-        *              <br>Conceptually, this is simply a fancy <c>POST</c> 
against the url <js>"/{path}/{javaMethodName}"</js>
-        *              where the arguments are marshalled from the client to 
the server as an HTTP body containing an array of
-        *              objects, passed to the method as arguments, and then 
the resulting object is marshalled back to the client.
-        *      <li>
-        *              Anything else
-        *              - Overloaded non-HTTP-standard names that are passed in 
through a <c>&amp;method=methodName</c> URL
-        *              parameter.
-        * </ul>
-        */
-       public static final String RESTOP_httpMethod = PREFIX + ".httpMethod.s";
-
-       /**
         * Configuration property:  Method-level matchers.
         *
         * <h5 class='section'>Property:</h5>
@@ -761,7 +691,7 @@ public class RestOperationContext extends BeanContext 
implements Comparable<Rest
                        }
                        hierarchyDepth = _hierarchyDepth;
 
-                       String _httpMethod = cp.get(RESTOP_httpMethod, 
String.class).orElse(null);
+                       String _httpMethod = builder.httpMethod;
                        if (_httpMethod == null)
                                _httpMethod = 
HttpUtils.detectHttpMethod(method, true, "GET");
                        if ("METHOD".equals(_httpMethod))
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContextBuilder.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContextBuilder.java
index 64dfa4f..9ff50c2 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContextBuilder.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContextBuilder.java
@@ -26,9 +26,11 @@ import org.apache.http.*;
 import org.apache.juneau.*;
 import org.apache.juneau.cp.*;
 import org.apache.juneau.http.header.*;
+import org.apache.juneau.http.remote.*;
 import org.apache.juneau.http.response.*;
 import org.apache.juneau.internal.*;
 import org.apache.juneau.reflect.*;
+import org.apache.juneau.rest.annotation.*;
 import org.apache.juneau.svl.*;
 import java.lang.reflect.Method;
 
@@ -40,6 +42,7 @@ public class RestOperationContextBuilder extends 
BeanContextBuilder {
 
        RestContext restContext;
        Method restMethod;
+       String httpMethod;
 
        private BeanStore beanStore;
 
@@ -447,16 +450,55 @@ public class RestOperationContextBuilder extends 
BeanContextBuilder {
        }
 
        /**
-        * Configuration property:  HTTP method name.
+        * HTTP method name.
         *
         * <p>
-        * REST method name.
+        * Typically <js>"GET"</js>, <js>"PUT"</js>, <js>"POST"</js>, 
<js>"DELETE"</js>, or <js>"OPTIONS"</js>.
         *
         * <p>
-        * Typically <js>"GET"</js>, <js>"PUT"</js>, <js>"POST"</js>, 
<js>"DELETE"</js>, or <js>"OPTIONS"</js>.
+        * Method names are case-insensitive (always folded to upper-case).
+        *
+        * <p>
+        * Note that you can use {@link org.apache.juneau.http.HttpMethod} for 
constant values.
+        *
+        * <p>
+        * Besides the standard HTTP method names, the following can also be 
specified:
+        * <ul class='spaced-list'>
+        *      <li>
+        *              <js>"*"</js>
+        *              - Denotes any method.
+        *              <br>Use this if you want to capture any HTTP methods in 
a single Java method.
+        *              <br>The {@link org.apache.juneau.rest.annotation.Method 
@Method} annotation and/or {@link RestRequest#getMethod()} method can be used to
+        *              distinguish the actual HTTP method name.
+        *      <li>
+        *              <js>""</js>
+        *              - Auto-detect.
+        *              <br>The method name is determined based on the Java 
method name.
+        *              <br>For example, if the method is <c>doPost(...)</c>, 
then the method name is automatically detected
+        *              as <js>"POST"</js>.
+        *              <br>Otherwise, defaults to <js>"GET"</js>.
+        *      <li>
+        *              <js>"RRPC"</js>
+        *              - Remote-proxy interface.
+        *              <br>This denotes a Java method that returns an object 
(usually an interface, often annotated with the
+        *              {@link Remote @Remote} annotation) to be used as a 
remote proxy using
+        *              <c>RestClient.getRemoteInterface(Class&lt;T&gt; 
interfaceClass, String url)</c>.
+        *              <br>This allows you to construct client-side interface 
proxies using REST as a transport medium.
+        *              <br>Conceptually, this is simply a fancy <c>POST</c> 
against the url <js>"/{path}/{javaMethodName}"</js>
+        *              where the arguments are marshalled from the client to 
the server as an HTTP body containing an array of
+        *              objects, passed to the method as arguments, and then 
the resulting object is marshalled back to the client.
+        *      <li>
+        *              Anything else
+        *              - Overloaded non-HTTP-standard names that are passed in 
through a <c>&amp;method=methodName</c> URL
+        *              parameter.
+        * </ul>
         *
         * <ul class='seealso'>
-        *      <li class='jf'>{@link RestOperationContext#RESTOP_httpMethod}
+        *      <li class='ja'>{@link RestOp#method()}
+        *      <li class='ja'>{@link RestGet}
+        *      <li class='ja'>{@link RestPut}
+        *      <li class='ja'>{@link RestPost}
+        *      <li class='ja'>{@link RestDelete}
         * </ul>
         *
         * @param value The new value for this setting.
@@ -464,7 +506,8 @@ public class RestOperationContextBuilder extends 
BeanContextBuilder {
         */
        @FluentSetter
        public RestOperationContextBuilder httpMethod(String value) {
-               return set(RESTOP_httpMethod, value);
+               this.httpMethod = value;
+               return this;
        }
 
        /**
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDelete.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDelete.java
index 01ec71c..6744bf7 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDelete.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDelete.java
@@ -35,7 +35,7 @@ import org.apache.juneau.dto.swagger.*;
 @Target(METHOD)
 @Retention(RUNTIME)
 @Inherited
-@ContextApply(RestDeleteAnnotation.Apply.class)
+@ContextApply(RestDeleteAnnotation.RestOperationContextApply.class)
 @AnnotationGroup(RestOp.class)
 public @interface RestDelete {
 
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation.java
index e22c496..f02e1fa 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation.java
@@ -439,14 +439,14 @@ public class RestDeleteAnnotation {
        /**
         * Applies {@link RestDelete} annotations to a {@link 
RestOperationContextBuilder}.
         */
-       public static class Apply extends 
AnnotationApplier<RestDelete,RestOperationContextBuilder> {
+       public static class RestOperationContextApply extends 
AnnotationApplier<RestDelete,RestOperationContextBuilder> {
 
                /**
                 * Constructor.
                 *
                 * @param vr The resolver for resolving values in annotations.
                 */
-               public Apply(VarResolverSession vr) {
+               public RestOperationContextApply(VarResolverSession vr) {
                        super(RestDelete.class, 
RestOperationContextBuilder.class, vr);
                }
 
@@ -454,7 +454,7 @@ public class RestDeleteAnnotation {
                public void apply(AnnotationInfo<RestDelete> ai, 
RestOperationContextBuilder b) {
                        RestDelete a = ai.getAnnotation();
 
-                       b.setIfNotEmpty(RESTOP_httpMethod, "delete");
+                       b.httpMethod("delete");
 
                        b.set(REST_encoders, 
merge(ConverterUtils.toType(b.peek(REST_encoders), Object[].class), 
a.encoders()));
                        b.setIf(a.contextClass() != 
RestOperationContext.Null.class, RESTOP_contextClass, a.contextClass());
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGet.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGet.java
index 0d66bb5..cecdf0e 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGet.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGet.java
@@ -35,7 +35,7 @@ import org.apache.juneau.dto.swagger.*;
 @Target(METHOD)
 @Retention(RUNTIME)
 @Inherited
-@ContextApply(RestGetAnnotation.Apply.class)
+@ContextApply(RestGetAnnotation.RestOperationContextApply.class)
 @AnnotationGroup(RestOp.class)
 public @interface RestGet {
 
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGetAnnotation.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGetAnnotation.java
index 549745b..5ac1463 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGetAnnotation.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGetAnnotation.java
@@ -492,14 +492,14 @@ public class RestGetAnnotation {
        /**
         * Applies {@link RestGet} annotations to a {@link 
RestOperationContextBuilder}.
         */
-       public static class Apply extends 
AnnotationApplier<RestGet,RestOperationContextBuilder> {
+       public static class RestOperationContextApply extends 
AnnotationApplier<RestGet,RestOperationContextBuilder> {
 
                /**
                 * Constructor.
                 *
                 * @param vr The resolver for resolving values in annotations.
                 */
-               public Apply(VarResolverSession vr) {
+               public RestOperationContextApply(VarResolverSession vr) {
                        super(RestGet.class, RestOperationContextBuilder.class, 
vr);
                }
 
@@ -507,7 +507,7 @@ public class RestGetAnnotation {
                public void apply(AnnotationInfo<RestGet> ai, 
RestOperationContextBuilder b) {
                        RestGet a = ai.getAnnotation();
 
-                       b.setIfNotEmpty(RESTOP_httpMethod, "get");
+                       b.httpMethod("get");
 
                        b.set(REST_serializers, 
merge(ConverterUtils.toType(b.peek(REST_serializers), Object[].class), 
a.serializers()));
                        b.set(REST_encoders, 
merge(ConverterUtils.toType(b.peek(REST_encoders), Object[].class), 
a.encoders()));
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOp.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOp.java
index 363b0ef..36de67e 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOp.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOp.java
@@ -33,7 +33,7 @@ import org.apache.juneau.dto.swagger.*;
 @Target(METHOD)
 @Retention(RUNTIME)
 @Inherited
-@ContextApply(RestOpAnnotation.Apply.class)
+@ContextApply(RestOpAnnotation.RestOperationContextApply.class)
 @AnnotationGroup(RestOp.class)
 public @interface RestOp {
 
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOpAnnotation.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOpAnnotation.java
index 6445b30..e7a6e48 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOpAnnotation.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOpAnnotation.java
@@ -594,14 +594,14 @@ public class RestOpAnnotation {
        /**
         * Applies {@link RestOp} annotations to a {@link 
RestOperationContextBuilder}.
         */
-       public static class Apply extends 
AnnotationApplier<RestOp,RestOperationContextBuilder> {
+       public static class RestOperationContextApply extends 
AnnotationApplier<RestOp,RestOperationContextBuilder> {
 
                /**
                 * Constructor.
                 *
                 * @param vr The resolver for resolving values in annotations.
                 */
-               public Apply(VarResolverSession vr) {
+               public RestOperationContextApply(VarResolverSession vr) {
                        super(RestOp.class, RestOperationContextBuilder.class, 
vr);
                }
 
@@ -631,16 +631,17 @@ public class RestOpAnnotation {
                        stringStream(a.path()).forEach(x -> 
b.prependTo(RESTOP_path, x));
                        cdStream(a.rolesDeclared()).forEach(x -> 
b.addTo(REST_rolesDeclared, x));
                        b.addToIfNotEmpty(REST_roleGuard, 
string(a.roleGuard()));
-                       b.setIfNotEmpty(RESTOP_httpMethod, string(a.method()));
+
+                       string2(a.method()).ifPresent(x -> b.httpMethod(x));
                        b.setIfNotEmpty(RESTOP_debug, string(a.debug()));
 
                        String v = StringUtils.trim(string(a.value()));
                        if (v != null) {
                                int i = v.indexOf(' ');
                                if (i == -1) {
-                                       b.set(RESTOP_httpMethod, v);
+                                       b.httpMethod(v);
                                } else {
-                                       b.set(RESTOP_httpMethod, v.substring(0, 
i).trim());
+                                       b.httpMethod(v.substring(0, i).trim());
                                        b.prependTo(RESTOP_path,  
v.substring(i).trim());
                                }
                        }
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPost.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPost.java
index cef6f75..80dff49 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPost.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPost.java
@@ -35,7 +35,7 @@ import org.apache.juneau.dto.swagger.*;
 @Target(METHOD)
 @Retention(RUNTIME)
 @Inherited
-@ContextApply(RestPostAnnotation.Apply.class)
+@ContextApply(RestPostAnnotation.RestOperationContextApply.class)
 @AnnotationGroup(RestOp.class)
 public @interface RestPost {
 
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPostAnnotation.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPostAnnotation.java
index b496d2c..4f026be 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPostAnnotation.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPostAnnotation.java
@@ -577,14 +577,14 @@ public class RestPostAnnotation {
        /**
         * Applies {@link RestPost} annotations to a {@link 
RestOperationContextBuilder}.
         */
-       public static class Apply extends 
AnnotationApplier<RestPost,RestOperationContextBuilder> {
+       public static class RestOperationContextApply extends 
AnnotationApplier<RestPost,RestOperationContextBuilder> {
 
                /**
                 * Constructor.
                 *
                 * @param vr The resolver for resolving values in annotations.
                 */
-               public Apply(VarResolverSession vr) {
+               public RestOperationContextApply(VarResolverSession vr) {
                        super(RestPost.class, 
RestOperationContextBuilder.class, vr);
                }
 
@@ -592,7 +592,7 @@ public class RestPostAnnotation {
                public void apply(AnnotationInfo<RestPost> ai, 
RestOperationContextBuilder b) {
                        RestPost a = ai.getAnnotation();
 
-                       b.setIfNotEmpty(RESTOP_httpMethod, "post");
+                       b.httpMethod("post");
 
                        b.set(REST_serializers, 
merge(ConverterUtils.toType(b.peek(REST_serializers), Object[].class), 
a.serializers()));
                        b.set(REST_parsers, 
merge(ConverterUtils.toType(b.peek(REST_parsers), Object[].class), 
a.parsers()));
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPut.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPut.java
index 0af4b49..8db605f 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPut.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPut.java
@@ -35,7 +35,7 @@ import org.apache.juneau.dto.swagger.*;
 @Target(METHOD)
 @Retention(RUNTIME)
 @Inherited
-@ContextApply(RestPutAnnotation.Apply.class)
+@ContextApply(RestPutAnnotation.RestOperationContextApply.class)
 @AnnotationGroup(RestOp.class)
 public @interface RestPut {
 
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPutAnnotation.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPutAnnotation.java
index c9cbb2f..5751843 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPutAnnotation.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPutAnnotation.java
@@ -577,14 +577,14 @@ public class RestPutAnnotation {
        /**
         * Applies {@link RestPut} annotations to a {@link 
RestOperationContextBuilder}.
         */
-       public static class Apply extends 
AnnotationApplier<RestPut,RestOperationContextBuilder> {
+       public static class RestOperationContextApply extends 
AnnotationApplier<RestPut,RestOperationContextBuilder> {
 
                /**
                 * Constructor.
                 *
                 * @param vr The resolver for resolving values in annotations.
                 */
-               public Apply(VarResolverSession vr) {
+               public RestOperationContextApply(VarResolverSession vr) {
                        super(RestPut.class, RestOperationContextBuilder.class, 
vr);
                }
 
@@ -592,7 +592,7 @@ public class RestPutAnnotation {
                public void apply(AnnotationInfo<RestPut> ai, 
RestOperationContextBuilder b) {
                        RestPut a = ai.getAnnotation();
 
-                       b.setIfNotEmpty(RESTOP_httpMethod, "put");
+                       b.httpMethod("put");
 
                        b.set(REST_serializers, 
merge(ConverterUtils.toType(b.peek(REST_serializers), Object[].class), 
a.serializers()));
                        b.set(REST_parsers, 
merge(ConverterUtils.toType(b.peek(REST_parsers), Object[].class), 
a.parsers()));

Reply via email to