groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: tweak error messages
Date Thu, 08 Feb 2018 10:46:56 GMT
Repository: groovy
Updated Branches:
  refs/heads/master f8e294a1c -> 8f881115e


tweak error messages


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/8f881115
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/8f881115
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/8f881115

Branch: refs/heads/master
Commit: 8f881115ea98144c45d7f334e57599326f070a0c
Parents: f8e294a
Author: paulk <paulk@asert.com.au>
Authored: Thu Feb 8 20:46:47 2018 +1000
Committer: paulk <paulk@asert.com.au>
Committed: Thu Feb 8 20:46:47 2018 +1000

----------------------------------------------------------------------
 .../java/org/codehaus/groovy/classgen/AsmClassGenerator.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/8f881115/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java b/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java
index 1144b6e..0977934 100644
--- a/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java
+++ b/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java
@@ -923,7 +923,7 @@ public class AsmClassGenerator extends ClassGenerator {
         if (Modifier.isProtected(fn.getModifiers()) && (samePackages || accessingNode.isDerivedFrom(declaringClass)))
{
             return true;
         }
-        if (!Modifier.isPrivate(fn.getModifiers())) {
+        if (!fn.isPrivate()) {
             // package private is the only modifier left. It means  same package is allowed,
subclass not, same class is
             return samePackages;
         }
@@ -973,7 +973,7 @@ public class AsmClassGenerator extends ClassGenerator {
                             while (outer!=null) {
                                 outerClassField = outer.getDeclaredField(name);
                                 if (outerClassField!=null && outerClassField.isStatic()
&& outerClassField.isFinal()) {
-                                    if (outer!=classNode.getOuterClass() && Modifier.isPrivate(outerClassField.getModifiers()))
{
+                                    if (outer!=classNode.getOuterClass() && outerClassField.isPrivate())
{
                                         throw new GroovyBugError("Trying to access private
constant field ["+outerClassField.getDeclaringClass()+"#"+outerClassField.getName()+"] from
inner class");
                                     }
                                     PropertyExpression pexp = new PropertyExpression(
@@ -1094,13 +1094,13 @@ public class AsmClassGenerator extends ClassGenerator {
         }
 
         if (fieldNode.isFinal()) {
-            throw new RuntimeParserException("Can not modify final field[" + fieldName +
"] of " + classNode.getName() + "'s super class", expression);
+            throw new RuntimeParserException("Cannot modify final field[" + fieldName + "]
of " + classNode.getName() + "'s super class", expression);
         }
 
         MethodNode setter = findSetter(classNode, fieldNode);
 
         if (fieldNode.isPrivate() && null == setter) {
-            throw new RuntimeParserException("Can not access private field[" + fieldName
+ "] of " + classNode.getName() + "'s super class", expression);
+            throw new RuntimeParserException("Cannot access private field[" + fieldName +
"] of " + classNode.getName() + "'s super class", expression);
         }
 
         mv.visitVarInsn(ALOAD, 0);


Mime
View raw message