Shoothzj commented on code in PR #2799:
URL:
https://github.com/apache/servicecomb-java-chassis/pull/2799#discussion_r857414360
##########
governance/src/main/java/org/apache/servicecomb/router/cache/RouterRuleCache.java:
##########
@@ -49,20 +49,17 @@ public class RouterRuleCache {
private Environment environment;
- @Autowired
- public RouterRuleCache(Environment environment) {
- this.environment = environment;
- }
-
private final ConcurrentHashMap<String, ServiceInfoCache>
serviceInfoCacheMap = new ConcurrentHashMap<>();
private final Object lock = new Object();
private final Representer representer = new Representer();
- public RouterRuleCache() {
+ @Autowired
+ public RouterRuleCache(Environment environment) {
representer.getPropertyUtils().setSkipMissingProperties(true);
GovernanceEventManager.register(this);
+ this.environment = environment;
Review Comment:
maybe we should put this line to the first line of consturctor
##########
governance/src/main/java/org/apache/servicecomb/router/cache/RouterRuleCache.java:
##########
@@ -49,20 +49,17 @@ public class RouterRuleCache {
private Environment environment;
- @Autowired
- public RouterRuleCache(Environment environment) {
- this.environment = environment;
- }
-
private final ConcurrentHashMap<String, ServiceInfoCache>
serviceInfoCacheMap = new ConcurrentHashMap<>();
private final Object lock = new Object();
private final Representer representer = new Representer();
- public RouterRuleCache() {
+ @Autowired
+ public RouterRuleCache(Environment environment) {
Review Comment:
can we mark environment final?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]