You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2019/08/16 02:47:39 UTC

[GitHub] [groovy] danielsun1106 commented on a change in pull request #994: GROOVY-9075: The exception message should be more clear when a Groovy…

danielsun1106 commented on a change in pull request #994: GROOVY-9075: The exception message should be more clear when a Groovy…
URL: https://github.com/apache/groovy/pull/994#discussion_r314567178
 
 

 ##########
 File path: src/main/java/org/codehaus/groovy/runtime/MetaClassHelper.java
 ##########
 @@ -1016,4 +1018,21 @@ public static String convertPropertyName(String prop) {
         }
         return BeanUtils.decapitalize(prop);
     }
+
+    // GROOVY-9075
+    public static void checkMetaClassProperty(MetaClass oldValue, Object newValue) {
+        if (null == newValue) return;
+
+        if (!(newValue instanceof MetaClass)) {
+            throw new IllegalArgumentException("the new metaClass[" + newValue.getClass() + "] is not an instance of " + MetaClass.class);
 
 Review comment:
   OK. I will refine the message later.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services