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 41c31eb02d Clean up juneau-rest-server
41c31eb02d is described below

commit 41c31eb02d09e1ea362871b585798538feeda5c8
Author: James Bognar <[email protected]>
AuthorDate: Mon Jan 5 11:59:29 2026 -0500

    Clean up juneau-rest-server
---
 .../java/org/apache/juneau/cp/BasicBeanStore.java  | 18 ------
 .../java/org/apache/juneau/rest/RestContext.java   | 64 +++++++++++-----------
 .../java/org/apache/juneau/rest/RestOpContext.java |  6 +-
 .../java/org/apache/juneau/cp/BeanStore_Test.java  |  2 +-
 4 files changed, 36 insertions(+), 54 deletions(-)

diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BasicBeanStore.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BasicBeanStore.java
index 3f6885be5e..eb7ca0c469 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BasicBeanStore.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BasicBeanStore.java
@@ -392,24 +392,6 @@ public class BasicBeanStore {
         * </ul>
         *
 
-       /**
-        * Create a method finder for finding bean creation methods.
-        *
-        * <p>
-        * Same as {@link #createMethodFinder(Class,Object)} but uses {@link 
Builder#outer(Object)} as the resource bean.
-        *
-        * <h5 class='section'>See Also:</h5><ul>
-        *      <li class='jc'>{@link BeanCreateMethodFinder} for usage.
-        * </ul>
-        *
-        * @param <T> The bean type to create.
-        * @param beanType The bean type to create.
-        * @return The method finder.  Never <jk>null</jk>.
-        */
-       public <T> BeanCreateMethodFinder<T> createMethodFinder(Class<T> 
beanType) {
-               return new BeanCreateMethodFinder<>(beanType, 
outer.orElseThrow(() -> new IllegalArgumentException("Method cannot be used 
without outer bean definition.")), this);
-       }
-
        /**
         * Create a method finder for finding bean creation methods.
         *
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index dfa58e7e89..27d19aa7eb 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -1807,7 +1807,7 @@ public class RestContext extends Context {
                                if (! (DELAYED_INJECTION.contains(rt) || 
DELAYED_INJECTION_NAMES.contains(name))) {
                                        // @formatter:off
                                        beanStore
-                                               .createMethodFinder(rt)
+                                               .createMethodFinder(rt, 
resource.get())
                                                
.find(Builder::isRestInjectMethod)
                                                .run(y -> beanStore.add(rt, y, 
name));
                                        // @formatter:on
@@ -3878,7 +3878,7 @@ public class RestContext extends Context {
                        // Replace with bean from:  @RestInject public [static] 
BasicBeanStore xxx(<args>)
                        // @formatter:off
                        v.get().build()
-                               .createMethodFinder(BasicBeanStore.class)
+                               .createMethodFinder(BasicBeanStore.class, 
resource.get())
                                .find(Builder::isRestInjectMethod)
                                .run(x -> v.get().impl(x));
                        // @formatter:on
@@ -3909,7 +3909,7 @@ public class RestContext extends Context {
                        beanStore.getBean(CallLogger.class).ifPresent(x -> 
creator.impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
CallLogger xxx(<args>)
-                       
beanStore.createMethodFinder(CallLogger.class).find(Builder::isRestInjectMethod).run(x
 -> creator.impl(x));
+                       beanStore.createMethodFinder(CallLogger.class, 
resource.get()).find(Builder::isRestInjectMethod).run(x -> creator.impl(x));
 
                        return creator;
                }
@@ -3956,7 +3956,7 @@ public class RestContext extends Context {
                        beanStore.getBean(Config.class).ifPresent(x -> 
v.set(x));
 
                        // Replace with bean from:  @RestInject public [static] 
Config xxx(<args>)
-                       
beanStore.createMethodFinder(Config.class).addBean(Config.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.set(x));
+                       beanStore.createMethodFinder(Config.class, 
resource.get()).addBean(Config.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -3980,7 +3980,7 @@ public class RestContext extends Context {
                        beanStore.getBean(DebugEnablement.class).ifPresent(x -> 
creator.impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
DebugEnablement xxx(<args>)
-                       
beanStore.createMethodFinder(DebugEnablement.class).find(Builder::isRestInjectMethod).run(x
 -> creator.impl(x));
+                       beanStore.createMethodFinder(DebugEnablement.class, 
resource.get()).find(Builder::isRestInjectMethod).run(x -> creator.impl(x));
 
                        return creator;
                }
@@ -4002,7 +4002,7 @@ public class RestContext extends Context {
                        beanStore.getBean(NamedAttributeMap.class, 
"defaultRequestAttributes").ifPresent(x -> v.set(x));
 
                        // Replace with bean from:  
@RestInject(name="defaultRequestAttributes") public [static] NamedAttributeMap 
xxx(<args>)
-                       
beanStore.createMethodFinder(NamedAttributeMap.class).addBean(NamedAttributeMap.class,
 v.get()).find(x -> isRestInjectMethod(x, "defaultRequestAttributes")).run(x -> 
v.set(x));
+                       beanStore.createMethodFinder(NamedAttributeMap.class, 
resource.get()).addBean(NamedAttributeMap.class, v.get()).find(x -> 
isRestInjectMethod(x, "defaultRequestAttributes")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4025,7 +4025,7 @@ public class RestContext extends Context {
                        beanStore.getBean(HeaderList.class, 
"defaultRequestHeaders").ifPresent(x -> v.set(x));
 
                        // Replace with bean from:  
@RestInject(name="defaultRequestHeaders") public [static] HeaderList xxx(<args>)
-                       
beanStore.createMethodFinder(HeaderList.class).addBean(HeaderList.class, 
v.get()).find(x -> isRestInjectMethod(x, "defaultRequestHeaders")).run(x -> 
v.set(x));
+                       beanStore.createMethodFinder(HeaderList.class, 
resource.get()).addBean(HeaderList.class, v.get()).find(x -> 
isRestInjectMethod(x, "defaultRequestHeaders")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4048,7 +4048,7 @@ public class RestContext extends Context {
                        beanStore.getBean(HeaderList.class, 
"defaultResponseHeaders").ifPresent(x -> v.set(x));
 
                        // Replace with bean from:  
@RestInject(name="defaultResponseHeaders") public [static] HeaderList 
xxx(<args>)
-                       
beanStore.createMethodFinder(HeaderList.class).addBean(HeaderList.class, 
v.get()).find(x -> isRestInjectMethod(x, "defaultResponseHeaders")).run(x -> 
v.set(x));
+                       beanStore.createMethodFinder(HeaderList.class, 
resource.get()).addBean(HeaderList.class, v.get()).find(x -> 
isRestInjectMethod(x, "defaultResponseHeaders")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4068,7 +4068,7 @@ public class RestContext extends Context {
                        var v = 
Value.of(MethodList.of(getAnnotatedMethods(resource, 
RestDestroy.class).collect(Collectors.toList())));
 
                        // Replace with bean from:  
@RestInject(name="destroyMethods") public [static] MethodList xxx(<args>)
-                       
beanStore.createMethodFinder(MethodList.class).addBean(MethodList.class, 
v.get()).find(x -> isRestInjectMethod(x, "destroyMethods")).run(x -> v.set(x));
+                       beanStore.createMethodFinder(MethodList.class, 
resource.get()).addBean(MethodList.class, v.get()).find(x -> 
isRestInjectMethod(x, "destroyMethods")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4100,7 +4100,7 @@ public class RestContext extends Context {
                        beanStore.getBean(EncoderSet.class).ifPresent(x -> 
v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
EncoderSet xxx(<args>)
-                       
beanStore.createMethodFinder(EncoderSet.class).addBean(EncoderSet.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(EncoderSet.class, 
resource.get()).addBean(EncoderSet.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4120,7 +4120,7 @@ public class RestContext extends Context {
                        Value<MethodList> v = 
Value.of(MethodList.of(getAnnotatedMethods(resource, 
RestEndCall.class).collect(Collectors.toList())));
 
                        // Replace with bean from:  
@RestInject(name="endCallMethods") public [static] MethodList xxx(<args>)
-                       
beanStore.createMethodFinder(MethodList.class).addBean(MethodList.class, 
v.get()).find(x -> isRestInjectMethod(x, "endCallMethods")).run(x -> v.set(x));
+                       beanStore.createMethodFinder(MethodList.class, 
resource.get()).addBean(MethodList.class, v.get()).find(x -> 
isRestInjectMethod(x, "endCallMethods")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4150,7 +4150,7 @@ public class RestContext extends Context {
                        
beanStore.getBean(JsonSchemaGenerator.class).ifPresent(x -> v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
JsonSchemaGenerator xxx(<args>)
-                       
beanStore.createMethodFinder(JsonSchemaGenerator.class).addBean(JsonSchemaGenerator.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(JsonSchemaGenerator.class, 
resource.get()).addBean(JsonSchemaGenerator.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4180,7 +4180,7 @@ public class RestContext extends Context {
                        beanStore.getBean(Logger.class).ifPresent(x -> 
v.set(x));
 
                        // Replace with bean from:  @RestInject public [static] 
Logger xxx(<args>)
-                       
beanStore.createMethodFinder(Logger.class).addBean(Logger.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.set(x));
+                       beanStore.createMethodFinder(Logger.class, 
resource.get()).addBean(Logger.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4207,7 +4207,7 @@ public class RestContext extends Context {
                        beanStore.getBean(Messages.class).ifPresent(x -> 
v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
Messages xxx(<args>)
-                       
beanStore.createMethodFinder(Messages.class).addBean(Messages.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(Messages.class, 
resource.get()).addBean(Messages.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4237,7 +4237,7 @@ public class RestContext extends Context {
                        beanStore.getBean(MethodExecStore.class).ifPresent(x -> 
v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
MethodExecStore xxx(<args>)
-                       
beanStore.createMethodFinder(MethodExecStore.class).addBean(MethodExecStore.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(MethodExecStore.class, 
resource.get()).addBean(MethodExecStore.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4268,7 +4268,7 @@ public class RestContext extends Context {
                        beanStore.getBean(ParserSet.class).ifPresent(x -> 
v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
ParserSet xxx(<args>)
-                       
beanStore.createMethodFinder(ParserSet.class).addBean(ParserSet.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(ParserSet.class, 
resource.get()).addBean(ParserSet.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4304,7 +4304,7 @@ public class RestContext extends Context {
                        defaultClasses().get(HttpPartParser.class).ifPresent(x 
-> v.get().type(x));
 
                        // Replace with bean from:  @RestInject public [static] 
HttpPartParser xxx(<args>)
-                       
beanStore.createMethodFinder(HttpPartParser.class).addBean(HttpPartParser.Creator.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(HttpPartParser.class, 
resource.get()).addBean(HttpPartParser.Creator.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4340,7 +4340,7 @@ public class RestContext extends Context {
                        
defaultClasses().get(HttpPartSerializer.class).ifPresent(x -> v.get().type(x));
 
                        // Replace with bean from:  @RestInject public [static] 
HttpPartSerializer xxx(<args>)
-                       
beanStore.createMethodFinder(HttpPartSerializer.class).addBean(HttpPartSerializer.Creator.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(HttpPartSerializer.class, 
resource.get()).addBean(HttpPartSerializer.Creator.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4360,7 +4360,7 @@ public class RestContext extends Context {
                        Value<MethodList> v = 
Value.of(MethodList.of(getAnnotatedMethods(resource, 
RestPostCall.class).collect(Collectors.toList())));
 
                        // Replace with bean from:  
@RestInject(name="postCallMethods") public [static] MethodList xxx(<args>)
-                       
beanStore.createMethodFinder(MethodList.class).addBean(MethodList.class, 
v.get()).find(x -> isRestInjectMethod(x, "postCallMethods")).run(x -> v.set(x));
+                       beanStore.createMethodFinder(MethodList.class, 
resource.get()).addBean(MethodList.class, v.get()).find(x -> 
isRestInjectMethod(x, "postCallMethods")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4388,7 +4388,7 @@ public class RestContext extends Context {
                                .collect(Collectors.toList())));
 
                        // Replace with bean from:  
@RestInject(name="postInitChildFirstMethods") public [static] MethodList 
xxx(<args>)
-                       
beanStore.createMethodFinder(MethodList.class).addBean(MethodList.class, 
v.get()).find(x -> isRestInjectMethod(x, "postInitChildFirstMethods")).run(x -> 
v.set(x));
+                       beanStore.createMethodFinder(MethodList.class, 
resource.get()).addBean(MethodList.class, v.get()).find(x -> 
isRestInjectMethod(x, "postInitChildFirstMethods")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4416,7 +4416,7 @@ public class RestContext extends Context {
                                .collect(Collectors.toList())));
 
                        // Replace with bean from:  
@RestInject(name="postInitMethods") public [static] MethodList xxx(<args>)
-                       
beanStore.createMethodFinder(MethodList.class).addBean(MethodList.class, 
v.get()).find(x -> isRestInjectMethod(x, "postInitMethods")).run(x -> v.set(x));
+                       beanStore.createMethodFinder(MethodList.class, 
resource.get()).addBean(MethodList.class, v.get()).find(x -> 
isRestInjectMethod(x, "postInitMethods")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4436,7 +4436,7 @@ public class RestContext extends Context {
                        Value<MethodList> v = 
Value.of(MethodList.of(getAnnotatedMethods(resource, 
RestPreCall.class).collect(Collectors.toList())));
 
                        // Replace with bean from:  
@RestInject(name="preCallMethods") public [static] MethodList xxx(<args>)
-                       
beanStore.createMethodFinder(MethodList.class).addBean(MethodList.class, 
v.get()).find(x -> isRestInjectMethod(x, "preCallMethods")).run(x -> v.set(x));
+                       beanStore.createMethodFinder(MethodList.class, 
resource.get()).addBean(MethodList.class, v.get()).find(x -> 
isRestInjectMethod(x, "preCallMethods")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4479,7 +4479,7 @@ public class RestContext extends Context {
                        
beanStore.getBean(ResponseProcessorList.class).ifPresent(x -> v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
ResponseProcessorList xxx(<args>)
-                       
beanStore.createMethodFinder(ResponseProcessorList.class).addBean(ResponseProcessorList.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       
beanStore.createMethodFinder(ResponseProcessorList.class, 
resource.get()).addBean(ResponseProcessorList.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4542,7 +4542,7 @@ public class RestContext extends Context {
                        }
 
                        // Replace with bean from:  @RestInject public [static] 
RestChildren xxx(<args>)
-                       
beanStore.createMethodFinder(RestChildren.class).addBean(RestChildren.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(RestChildren.class, 
resource.get()).addBean(RestChildren.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4581,7 +4581,7 @@ public class RestContext extends Context {
                        beanStore.getBean(RestOpArgList.class).ifPresent(x -> 
v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
RestOpArgList xxx(<args>)
-                       
beanStore.createMethodFinder(RestOpArgList.class).addBean(RestOpArgList.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(RestOpArgList.class, 
resource.get()).addBean(RestOpArgList.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4680,7 +4680,7 @@ public class RestContext extends Context {
                        }
 
                        // Replace with bean from:  @RestInject public [static] 
RestOperations xxx(<args>)
-                       
beanStore.createMethodFinder(RestOperations.class).addBean(RestOperations.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(RestOperations.class, 
resource.get()).addBean(RestOperations.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4711,7 +4711,7 @@ public class RestContext extends Context {
                        beanStore.getBean(SerializerSet.class).ifPresent(x -> 
v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
SerializerSet xxx(<args>)
-                       
beanStore.createMethodFinder(SerializerSet.class).addBean(SerializerSet.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(SerializerSet.class, 
resource.get()).addBean(SerializerSet.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4731,7 +4731,7 @@ public class RestContext extends Context {
                        Value<MethodList> v = 
Value.of(MethodList.of(getAnnotatedMethods(resource, 
RestStartCall.class).collect(Collectors.toList())));
 
                        // Replace with bean from:  
@RestInject(name="startCallMethods") public [static] MethodList xxx(<args>)
-                       
beanStore.createMethodFinder(MethodList.class).addBean(MethodList.class, 
v.get()).find(x -> isRestInjectMethod(x, "startCallMethods")).run(x -> 
v.set(x));
+                       beanStore.createMethodFinder(MethodList.class, 
resource.get()).addBean(MethodList.class, v.get()).find(x -> 
isRestInjectMethod(x, "startCallMethods")).run(x -> v.set(x));
 
                        return v.get();
                }
@@ -4759,7 +4759,7 @@ public class RestContext extends Context {
                        beanStore.getBean(StaticFiles.class).ifPresent(x -> 
creator.impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
StaticFiles xxx(<args>)
-                       
beanStore.createMethodFinder(StaticFiles.class).find(Builder::isRestInjectMethod).run(x
 -> creator.impl(x));
+                       beanStore.createMethodFinder(StaticFiles.class, 
resource.get()).find(Builder::isRestInjectMethod).run(x -> creator.impl(x));
 
                        return creator;
                }
@@ -4808,7 +4808,7 @@ public class RestContext extends Context {
                        beanStore.getBean(SwaggerProvider.class).ifPresent(x -> 
creator.impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
SwaggerProvider xxx(<args>)
-                       
beanStore.createMethodFinder(SwaggerProvider.class).find(Builder::isRestInjectMethod).run(x
 -> creator.impl(x));
+                       beanStore.createMethodFinder(SwaggerProvider.class, 
resource.get()).find(Builder::isRestInjectMethod).run(x -> creator.impl(x));
 
                        return creator;
                }
@@ -4842,7 +4842,7 @@ public class RestContext extends Context {
                        beanStore.getBean(ThrownStore.class).ifPresent(x -> 
v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
ThrownStore xxx(<args>)
-                       
beanStore.createMethodFinder(ThrownStore.class).addBean(ThrownStore.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(ThrownStore.class, 
resource.get()).addBean(ThrownStore.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -4899,7 +4899,7 @@ public class RestContext extends Context {
                        beanStore.getBean(VarResolver.class).ifPresent(x -> 
v.get().impl(x));
 
                        // Replace with bean from:  @RestInject public [static] 
VarResolver xxx(<args>)
-                       
beanStore.createMethodFinder(VarResolver.class).addBean(VarResolver.Builder.class,
 v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(VarResolver.class, 
resource.get()).addBean(VarResolver.Builder.class, 
v.get()).find(Builder::isRestInjectMethod).run(x -> v.get().impl(x));
 
                        return v.get();
                }
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContext.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContext.java
index 4669447ac9..aaeb3c0d2e 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContext.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContext.java
@@ -1519,7 +1519,7 @@ public class RestOpContext extends Context implements 
Comparable<RestOpContext>
                        beanStore.getBean(RestConverterList.class).ifPresent(x 
-> v.get().impl(x));
 
                        // Replace with bean from:  
@RestInject(methodScope="foo") public [static] RestConverterList xxx(<args>)
-                       
beanStore.createMethodFinder(RestConverterList.class).addBean(RestConverterList.Builder.class,
 v.get()).find(this::matches).run(x -> v.get().impl(x));
+                       beanStore.createMethodFinder(RestConverterList.class, 
resource.get()).addBean(RestConverterList.Builder.class, 
v.get()).find(this::matches).run(x -> v.get().impl(x));
 
                        return v.get();
                }
@@ -1737,7 +1737,7 @@ public class RestOpContext extends Context implements 
Comparable<RestOpContext>
                        // Replace with bean from:  
@RestInject(methodScope="foo") public [static] RestGuardList xxx(<args>)
                        // @formatter:off
                        beanStore
-                               .createMethodFinder(RestGuardList.class)
+                               .createMethodFinder(RestGuardList.class, 
resource.get())
                                .addBean(RestGuardList.Builder.class, v.get())
                                .find(m -> this.matches(m))
                                .run(x -> v.get().impl(x));
@@ -1845,7 +1845,7 @@ public class RestOpContext extends Context implements 
Comparable<RestOpContext>
                        // Replace with bean from:  
@RestInject(methodScope="foo") public [static] RestMatcherList xxx(<args>)
                        // @formatter:off
                        beanStore
-                               .createMethodFinder(RestMatcherList.class)
+                               .createMethodFinder(RestMatcherList.class, 
resource.get())
                                .addBean(RestMatcherList.Builder.class, v.get())
                                .find(this::matches)
                                .run(x -> v.get().impl(x));
diff --git 
a/juneau-utest/src/test/java/org/apache/juneau/cp/BeanStore_Test.java 
b/juneau-utest/src/test/java/org/apache/juneau/cp/BeanStore_Test.java
index 3b64f919b6..9eb6078bd7 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/cp/BeanStore_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/cp/BeanStore_Test.java
@@ -490,7 +490,7 @@ class BeanStore_Test extends TestBase {
 
        @Test void c00_createMethodFinder_invalidArgs() {
                var b = BasicBeanStore.create().build();
-               assertThrowsWithMessage(IllegalArgumentException.class, "Method 
cannot be used without outer bean definition.", ()->b.createMethodFinder(null));
+//             assertThrowsWithMessage(IllegalArgumentException.class, "Method 
cannot be used without outer bean definition.", ()->b.createMethodFinder(null));
                assertThrowsWithMessage(IllegalArgumentException.class, 
"Argument 'beanType' cannot be null.", 
()->b.createMethodFinder((Class<?>)null,""));
                assertThrowsWithMessage(IllegalArgumentException.class, 
"Argument 'resourceClass' cannot be null.", 
()->b.createMethodFinder(String.class,null));
        }

Reply via email to