Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7424

NPE in SecureASTCustomizer for interface method declarations

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.3.11, 2.4.3
    • Fix Version/s: 2.4.4
    • Component/s: Compiler
    • Labels:
      None

      Description

      if you apply the SecureASTCustomizer to code that contains an interface method declaration, you get a NullPointerException at SecureASTCustomizer, Row 558 (Groovy 2.4.3)

              final SecuringCodeVisitor visitor = new SecuringCodeVisitor();
              ast.getStatementBlock().visit(visitor);
              for (ClassNode clNode : ast.getClasses()) {
                  if (clNode!=classNode) {
                      checkMethodDefinitionAllowed(clNode);
                      for (MethodNode methodNode : clNode.getMethods()) {
                          if (!methodNode.isSynthetic()) {
      =>                      methodNode.getCode().visit(visitor);
                          }
                      }
                  }
              }
      

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              cmjartan Carsten Mjartan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: