Permalink
Browse files

Ensure that Struts interceptors are populated even if they are create…

…d after the injector, github #1075

Closes #1081

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152278067
  • Loading branch information...
ThrawnCA authored and ronshapiro committed Apr 5, 2017
1 parent 0d2a5d1 commit 4c59c057f5f09c0d0875e5b3dd41974e9cc8bd45
Showing with 7 additions and 0 deletions.
  1. +7 −0 extensions/struts2/src/com/google/inject/struts2/Struts2Factory.java
@@ -164,6 +164,13 @@ public Interceptor buildInterceptor(InterceptorConfig interceptorConfig, Map int
ProvidedInterceptor providedInterceptor =
new ProvidedInterceptor(interceptorConfig, interceptorRefParams, interceptorClass);
interceptors.add(providedInterceptor);
if (strutsInjector != null) {
synchronized (this) {
if (strutsInjector != null) {
providedInterceptor.inject();
}
}
}
return providedInterceptor;
}

0 comments on commit 4c59c05

Please sign in to comment.