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

NPE in SecureASTCustomizer for interface method declarations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.4, 2.3.11, 2.4.3
    • 2.4.4
    • Compiler
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: