New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct processing for constructors #56

Closed
denis-zhdanov opened this Issue Nov 18, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@denis-zhdanov
Owner

denis-zhdanov commented Nov 18, 2017

There is an NPE on attempt to check if we should instrument method return type during constructors processing (resulting AST has null as a return type for constructors):

java.lang.NullPointerException
at tech.harmonysoft.oss.traute.javac.common.InstrumentationApplianceFinder.mayBeInstrumentReturnType(InstrumentationApplianceFinder.java:197)
at tech.harmonysoft.oss.traute.javac.common.InstrumentationApplianceFinder.shouldInstrumentReturnExpression(InstrumentationApplianceFinder.java:112)
at tech.harmonysoft.oss.traute.javac.common.InstrumentationApplianceFinder.visitMethod(InstrumentationApplianceFinder.java:89)
at tech.harmonysoft.oss.traute.javac.common.InstrumentationApplianceFinder.visitMethod(InstrumentationApplianceFinder.java:28)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:800)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:77)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:81)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:91)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:99)
at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:133)
at tech.harmonysoft.oss.traute.javac.common.InstrumentationApplianceFinder.visitClass(InstrumentationApplianceFinder.java:72)
at tech.harmonysoft.oss.traute.javac.common.InstrumentationApplianceFinder.visitClass(InstrumentationApplianceFinder.java:28)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:720)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:77)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:91)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:99)
at com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:120)
at tech.harmonysoft.oss.traute.javac.common.InstrumentationApplianceFinder.visitCompilationUnit(InstrumentationApplianceFinder.java:57)
at tech.harmonysoft.oss.traute.javac.common.InstrumentationApplianceFinder.visitCompilationUnit(InstrumentationApplianceFinder.java:28)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:550)
at tech.harmonysoft.oss.traute.javac.TrauteJavacPlugin$1.finished(TrauteJavacPlugin.java:150)
at com.sun.tools.javac.api.ClientCodeWrapper$WrappedTaskListener.finished(ClientCodeWrapper.java:681)
at com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:111)
at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:638)

@denis-zhdanov denis-zhdanov self-assigned this Nov 18, 2017

denis-zhdanov added a commit that referenced this issue Nov 18, 2017

@denis-zhdanov

This comment has been minimized.

Owner

denis-zhdanov commented Nov 18, 2017

Fixed

denis-zhdanov added a commit that referenced this issue Nov 18, 2017

Issue #56: Correct processing for constructors
Updated version after release

denis-zhdanov added a commit that referenced this issue Nov 18, 2017

denis-zhdanov added a commit that referenced this issue Nov 18, 2017

denis-zhdanov added a commit that referenced this issue Nov 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment