jamesfredley commented on code in PR #15654:
URL: https://github.com/apache/grails-core/pull/15654#discussion_r3314872094


##########
grails-data-hibernate5/dbmigration/src/test/resources/logback.groovy:
##########
@@ -20,6 +20,7 @@
 def CONSOLE_LOG_PATTERN = '%d{HH:mm:ss.SSS} [%t] %highlight(%p) 
%cyan(\\(%logger{39}\\)) %m%n'
 
 appender('STDOUT', ConsoleAppender) {
+    follow = true

Review Comment:
   Resolved in 6fdd688ec3 - file deleted entirely. Logback removed Groovy 
configurator support in 1.2.9 (referenced in 
grails-doc/src/en/guide/conf/config/logging.adoc:27) so these files were dead. 
Marking resolved.



##########
grails-data-hibernate5/dbmigration/src/test/resources/logback.groovy:
##########
@@ -20,6 +20,7 @@
 def CONSOLE_LOG_PATTERN = '%d{HH:mm:ss.SSS} [%t] %highlight(%p) 
%cyan(\\(%logger{39}\\)) %m%n'
 
 appender('STDOUT', ConsoleAppender) {
+    follow = true

Review Comment:
   Answer is no - Logback dropped Groovy configurator support in 1.2.9 and this 
repo runs on Logback 1.5+ via Spring Boot 4. Deleted the file in 6fdd688ec3. 
Marking resolved.



##########
grails-data-hibernate7/dbmigration-core/src/test/resources/logback.groovy:
##########
@@ -0,0 +1,38 @@
+/*
+ * 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
+ *
+ *   https://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.
+ */
+// See http://logback.qos.ch/manual/groovy.html for details on configuration
+def CONSOLE_LOG_PATTERN = '%d{HH:mm:ss.SSS} [%t] %highlight(%p) 
%cyan(\\(%logger{39}\\)) %m%n'

Review Comment:
   Same answer as the h5 one - Groovy logback configurator has been dead since 
Logback 1.2.9. Deleted in 6fdd688ec3. Marking resolved.



##########
grails-async/core/src/main/groovy/grails/async/factory/AbstractPromiseFactory.groovy:
##########
@@ -84,6 +84,9 @@ abstract class AbstractPromiseFactory implements 
PromiseFactory {
      * @see PromiseFactory#createPromise(java.util.List, java.util.List)
      */
     <T> Promise<List<T>> createPromise(List<Closure<T>> closures, 
List<PromiseDecorator> decorators) {
+        if (closures == null) {
+            return new PromiseList<T>()
+        }

Review Comment:
   Extracted to #15682 (PR-B: Async project defensive coding cleanup) - the 
change was reverted from this PR in ba235da8f7 to keep PR-A focused on the 
hibernate clone. Will return to stage-hibernate7 via the next merge of 8.0.x 
once #15682 lands. Keeping this thread open until that PR is resolved.



##########
grails-async/core/src/main/groovy/org/grails/async/factory/future/FutureTaskPromise.groovy:
##########
@@ -84,19 +84,23 @@ class FutureTaskPromise<T> extends FutureTask<T> implements 
Promise<T> {
     @Override
     protected void set(T t) {
         super.set(t)
-        synchronized (successCallbacks) {
-            for (FutureTaskChildPromise callback : successCallbacks) {
-                callback.accept(t)
+        if (successCallbacks != null) {
+            synchronized (successCallbacks) {
+                for (FutureTaskChildPromise callback : successCallbacks) {
+                    callback.accept(t)
+                }

Review Comment:
   Extracted to #15682 (PR-B) and additionally rolled back per Copilot review - 
the null-check on `successCallbacks` was dead code (field is `final` + 
initialized at declaration). Reverted from PR-A in ba235da8f7. Keeping thread 
open until #15682 lands.



##########
grails-async/core/src/main/groovy/org/grails/async/factory/future/FutureTaskPromise.groovy:
##########
@@ -84,19 +84,23 @@ class FutureTaskPromise<T> extends FutureTask<T> implements 
Promise<T> {
     @Override
     protected void set(T t) {
         super.set(t)
-        synchronized (successCallbacks) {
-            for (FutureTaskChildPromise callback : successCallbacks) {
-                callback.accept(t)
+        if (successCallbacks != null) {
+            synchronized (successCallbacks) {
+                for (FutureTaskChildPromise callback : successCallbacks) {
+                    callback.accept(t)
+                }
             }
         }
     }
 
     @Override
     protected void setException(Throwable t) {
         super.setException(t)
-        synchronized (failureCallbacks) {
-            for (FutureTaskChildPromise callback : failureCallbacks) {
-                callback.accept(t)
+        if (failureCallbacks != null) {
+            synchronized (failureCallbacks) {
+                for (FutureTaskChildPromise callback : failureCallbacks) {
+                    callback.accept(t)
+                }

Review Comment:
   Same - extracted to #15682 (PR-B), and the null-check on `failureCallbacks` 
was also removed per Copilot's reasoning that the field can never be null. 
Reverted from PR-A in ba235da8f7.



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