Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 6165cffe8 -> 21102ea5d


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/21102ea5
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/21102ea5
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/21102ea5

Branch: refs/heads/GROOVY_2_6_X
Commit: 21102ea5d2337b21e16c1a79c7400e3059955922
Parents: c2e11c0
Author: paulk <pa...@asert.com.au>
Authored: Thu Feb 8 20:46:47 2018 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu Feb 8 20:48:36 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/21102ea5/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);

Reply via email to