Replaces annotation scopes with instance scopes using the Injector's annotation-to-instance map. If the scope annotation has no corresponding instance, an error will be added and unscoped will be returned.
(Scoping scoping, InjectorImpl injector, Errors errors)
| 307 | * will be returned. |
| 308 | */ |
| 309 | static Scoping makeInjectable(Scoping scoping, InjectorImpl injector, Errors errors) { |
| 310 | Class<? extends Annotation> scopeAnnotation = scoping.getScopeAnnotation(); |
| 311 | if (scopeAnnotation == null) { |
| 312 | return scoping; |
| 313 | } |
| 314 | |
| 315 | ScopeBinding scope = injector.getBindingData().getScopeBinding(scopeAnnotation); |
| 316 | if (scope != null) { |
| 317 | return forInstance(scope.getScope()); |
| 318 | } |
| 319 | |
| 320 | errors.scopeNotFound(scopeAnnotation); |
| 321 | return UNSCOPED; |
| 322 | } |
| 323 | } |
no test coverage detected