[groovy] branch danielsun/address-github-actions-errors updated: Try to fix the failing build

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[groovy] branch danielsun/address-github-actions-errors updated: Try to fix the failing build

Daniel.Sun
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch danielsun/address-github-actions-errors
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/danielsun/address-github-actions-errors by this push:
     new 6bbfbc8  Try to fix the failing build
6bbfbc8 is described below

commit 6bbfbc8794d2223c09779aa7a92b8c2014fd8f27
Author: Daniel Sun <[hidden email]>
AuthorDate: Thu Mar 26 13:34:19 2020 +0800

    Try to fix the failing build
---
 src/main/java/groovy/lang/MetaClassImpl.java | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/main/java/groovy/lang/MetaClassImpl.java b/src/main/java/groovy/lang/MetaClassImpl.java
index 141deab..0d37ec2 100644
--- a/src/main/java/groovy/lang/MetaClassImpl.java
+++ b/src/main/java/groovy/lang/MetaClassImpl.java
@@ -1689,14 +1689,19 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
      * @throws IllegalStateException if the initialisation is incomplete yet
      */
     protected void checkInitalised() {
-        if (!isInitialized())
-            throw new IllegalStateException(
-                    "initialize must be called for meta " +
-                            "class of " + theClass +
-                            "(" + this.getClass() + ") " +
-                            "to complete initialisation process " +
-                            "before any invocation or field/property " +
-                            "access can be done");
+        if (!isInitialized()) {
+            try {
+                initialize();
+            } catch (Throwable t) {
+                throw new IllegalStateException(
+                        "initialize must be called for meta " +
+                                "class of " + theClass +
+                                "(" + this.getClass() + ") " +
+                                "to complete initialisation process " +
+                                "before any invocation or field/property " +
+                                "access can be done", t);
+            }
+        }
     }
 
     /**

Apache Groovy committer & PMC member

Blog: http://blog.sunlan.me
Twitter: @daniel_sun