From 0681545ce57c55b8c35af8189a0f2bfe27256fd7 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 11 Mar 2013 12:40:04 +0100 Subject: [PATCH] Fix MPLUGIN-242 This fixes upstream bug MPLUGIN-242: NullPointerException in MojoClassVisitor.visit() See: http://jira.codehaus.org/browse/MPLUGIN-242 --- .../plugin/annotations/scanner/visitors/MojoClassVisitor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoClassVisitor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoClassVisitor.java index be0e70b..c381cf9 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoClassVisitor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoClassVisitor.java @@ -105,8 +105,11 @@ public class MojoClassVisitor public void visit( int version, int access, String name, String signature, String superName, String[] interfaces ) { mojoAnnotatedClass = new MojoAnnotatedClass(); - mojoAnnotatedClass.setClassName( Type.getObjectType( name ).getClassName() ).setParentClassName( - Type.getObjectType( superName ).getClassName() ); + mojoAnnotatedClass.setClassName( Type.getObjectType( name ).getClassName() ); + if ( superName != null) + { + mojoAnnotatedClass.setParentClassName( Type.getObjectType( superName ).getClassName() ); + } logger.debug( "MojoClassVisitor#visit" ); } -- 1.8.1.2