NPE in com.mysema.query.apt.ElementHandler.handleNormalType

Bug #720105 reported by Brian Topping
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

While upgrading to 2.1.1, I accidentally deleted a domain source class referenced by association and got the following:

[INFO] [apt:process {execution: default}]
java.lang.NullPointerException
 at com.mysema.query.apt.ElementHandler.handleNormalType(ElementHandler.java:139)
 at com.mysema.query.apt.Processor.mergeTypes(Processor.java:319)
 at com.mysema.query.apt.Processor.process(Processor.java:367)
 at com.mysema.query.apt.Processor.processEntities(Processor.java:538)
 at com.mysema.query.apt.Processor.processAnnotations(Processor.java:167)
 at com.mysema.query.apt.Processor.process(Processor.java:132)
 at com.mysema.query.apt.jpa.JPAAnnotationProcessor.process(JPAAnnotationProcessor.java:47)
 at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:625)
 at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:554)
 at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:699)
 at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:981)
 at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
 at com.sun.tools.javac.main.Main.compile(Main.java:353)
 at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
 at com.mysema.maven.apt.AbstractProcessorMojo.execute(AbstractProcessorMojo.java:156)
 at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
 at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Changed in querydsl:
status: New → In Progress
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Thanks for the bug report. A better Exception is thrown like this :

    TypeElement typeElement = env.getElementUtils().getTypeElement(superType.getFullName());
    if (typeElement == null){
        throw new IllegalStateException("Found no type for " + superType.getFullName());
    }

Changed in querydsl:
status: In Progress → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.1.2

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.