vidakovic commented on code in PR #6387:
URL: https://github.com/apache/fineract/pull/6387#discussion_r3979719064


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/FineractApplicationLifecycleLogger.java:
##########
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.infrastructure.core.boot;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.context.event.ApplicationReadyEvent;
+import org.springframework.boot.web.context.WebServerApplicationContext;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.event.ContextClosedEvent;
+import org.springframework.context.event.EventListener;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+@Slf4j
+public class FineractApplicationLifecycleLogger {
+
+    private volatile ConfigurableApplicationContext readyApplicationContext;

Review Comment:
   `volatile`... why? why `ConfigurableApplicationContext`? why not just:
   
   ```
   // NOTE: dependency injection via constructors
   private final ApplicationContext context;
   ```
   
   The even literally says "application is ready"... that means the dependency 
injection is also ready. There are very few cases that would need this kind of 
indirect referencing, e.g. if you'd do something concerning the display of the 
console banner... actually that's the only case that comes to mind, there might 
be others, but I'm pretty sure printing a warning message on startup is not one 
of them.



-- 
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]

Reply via email to