File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
cucumber-picocontainer/src/main/java/io/cucumber/picocontainer Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -117,14 +117,17 @@ private static boolean hasDefaultConstructor(Class<?> clazz) {
117117
118118 @ SuppressWarnings ("unchecked" )
119119 private static Class <Provider > checkProperPicoProvider (Class <?> clazz ) {
120- if (!isProvider (clazz ) || !hasDefaultConstructor (clazz )) {
120+ if (!isProvider (clazz ) || !isInstantiable ( clazz ) || ! hasDefaultConstructor (clazz )) {
121121 throw new CucumberBackendException (String .format ("" +
122122 "Glue class %1$s was annotated with @CucumberPicoProvider; marking it as a candidate for declaring a"
123123 +
124- "PicoContainer Provider instance. Please ensure that all the following requirements are satisfied:\n "
124+ "PicoContainer Provider instance. Please ensure that all of the following requirements are satisfied:\n "
125125 +
126126 "1) the class implements org.picocontainer.injectors.Provider\n " +
127- "2) the class provides a default constructor." ,
127+ "2) the class is public\n " +
128+ "3) the class is not abstract\n " +
129+ "4) the class provides a default constructor\n " +
130+ "5) if nested, the class is static." ,
128131 clazz .getName ()));
129132 }
130133 return (Class <Provider >) clazz ;
You can’t perform that action at this time.
0 commit comments