go-lang-plugin-org / go-lang-idea-plugin

Google Go language IDE built using the IntelliJ Platform
https://plugins.jetbrains.com/plugin/5047
Other
4.56k stars 571 forks source link

Null pointer Intellij 13 (2) #510

Closed gertcuykens closed 10 years ago

gertcuykens commented 10 years ago

Can not reproduce, can only show the error message from goapp serve running in the background at the time of null pointer exception.

INFO     2014-01-07 02:22:16,195 module.py:617] default: "GET /_ah/warmup HTTP/1.1" 500 1077
ERROR    2014-01-07 02:32:35,159 go_runtime.py:166] Failed to build Go application: /home/gert/Downloads/token/gcl-12/bin/login.go:36: cannot use req.Expired() (type bool) as type error in assignment:
        bool does not implement error (missing Error method)

2014/01/07 03:32:35 go-app-builder: build timing: 3×8g (263.260624ms total), 4×gopack (51.759911ms total), 0×8l (0 total)
2014/01/07 03:32:35 go-app-builder: failed running 8g: exit status 1
(Executed command: /home/gert/go_appengine/goroot/bin/go-app-builder -app_base /home/gert/Downloads/token/gcl-12 -arch 8 -binary_name _go_app -dynamic -extra_imports appengine_internal/init -goroot /home/gert/go_appengine/goroot -nobuild_files ^^$ -unsafe -work_dir /tmp/tmp22ocMGappengine-go-bin -gcflags -I,/home/gert/go_appengine/goroot/pkg/linux_386_appengine -ldflags -L,/home/gert/go_appengine/goroot/pkg/linux_386_appengine -gopath /home/gert/.go bin/cash.go bin/token.go bin/service.go bin/endpoints.go bin/facebook.go bin/contact.go bin/twitter.go bin/google.go bin/user.go bin/login.go bin/oauth2.go bin/secret.go bin/linkedin.go)
INFO     2014-01-07 02:32:35,166 module.py:617] default: "GET /_ah/warmup HTTP/1.1" 500 1048

null
java.lang.NullPointerException
    at ro.redeul.google.go.inspection.FunctionCallInspection.checkFunctionTypeArguments(FunctionCallInspection.java:287)
    at ro.redeul.google.go.inspection.FunctionCallInspection.checkFunctionCallArguments(FunctionCallInspection.java:347)
    at ro.redeul.google.go.inspection.FunctionCallInspection.access$000(FunctionCallInspection.java:33)
    at ro.redeul.google.go.inspection.FunctionCallInspection$1.visitCallOrConvExpression(FunctionCallInspection.java:41)
    at ro.redeul.google.go.lang.psi.impl.expressions.primary.GoCallOrConvExpressionImpl.accept(GoCallOrConvExpressionImpl.java:78)
    at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.acceptChildren(GoPsiElementBase.java:61)
    at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14)
    at ro.redeul.google.go.lang.psi.visitors.GoElementVisitor.visitIfStatement(GoElementVisitor.java:160)
    at ro.redeul.google.go.lang.psi.impl.statements.GoIfStatementImpl.accept(GoIfStatementImpl.java:65)
    at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.acceptChildren(GoPsiElementBase.java:61)
    at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14)
    at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.accept(GoPsiElementBase.java:48)
    at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.acceptChildren(GoPsiElementBase.java:61)
    at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14)
    at ro.redeul.google.go.lang.psi.visitors.GoElementVisitor.visitMethodDeclaration(GoElementVisitor.java:60)
    at ro.redeul.google.go.lang.psi.impl.toplevel.GoMethodDeclarationImpl.accept(GoMethodDeclarationImpl.java:28)
    at ro.redeul.google.go.lang.psi.impl.GoFileImpl.acceptChildren(GoFileImpl.java:205)
    at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14)
    at ro.redeul.google.go.lang.psi.visitors.GoElementVisitor.visitFile(GoElementVisitor.java:40)
    at ro.redeul.google.go.inspection.FunctionCallInspection.doCheckFile(FunctionCallInspection.java:36)
    at ro.redeul.google.go.inspection.AbstractWholeGoFileInspection.checkFile(AbstractWholeGoFileInspection.java:23)
    at com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspectionTool.java:144)
    at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:70)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:74)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$5.process(LocalInspectionsPass.java:382)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$5.process(LocalInspectionsPass.java:377)
    at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:119)
    at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:42)
    at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:82)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166)
    at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:91)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:103)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:79)
    at jsr166e.CountedCompleter.exec(CountedCompleter.java:684)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
    at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)

https://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/492

dlsniper commented 10 years ago

To me it looks like something is wrong in: "cannot use req.Expired() (type bool)" at "/home/gert/Downloads/token/gcl-12/bin/login.go:36" so the best bet would be to see a sample of a similar code that you had there, maybe it's where the exception happens in the plugin as well.

Thanks.


Florin Patan / @dlsniper https://twitter.com/dlsniper https://github.com/dlsniper http://www.linkedin.com/in/florinpatan

On Wed, Jan 8, 2014 at 12:19 AM, Gert Cuykens notifications@github.comwrote:

Can not reproduce, can only show the error message from goapp serve running in the background at the time of null pointer exception.

INFO 2014-01-07 02:22:16,195 module.py:617] default: "GET /_ah/warmup HTTP/1.1" 500 1077ERROR 2014-01-07 02:32:35,159 go_runtime.py:166] Failed to build Go application: /home/gert/Downloads/token/gcl-12/bin/login.go:36: cannot use req.Expired() (type bool) as type error in assignment: bool does not implement error (missing Error method) 2014/01/07 03:32:35 go-app-builder: build timing: 3×8g (263.260624ms total), 4×gopack (51.759911ms total), 0×8l (0 total)2014/01/07 03:32:35 go-app-builder: failed running 8g: exit status 1

(Executed command: /home/gert/go_appengine/goroot/bin/go-app-builder -app_base /home/gert/Downloads/token/gcl-12 -arch 8 -binary_name _go_app -dynamic -extra_imports appengine_internal/init -goroot /home/gert/go_appengine/goroot -nobuild_files ^^$ -unsafe -work_dir /tmp/tmp22ocMGappengine-go-bin -gcflags -I,/home/gert/go_appengine/goroot/pkg/linux_386_appengine -ldflags -L,/home/gert/go_appengine/goroot/pkg/linux_386_appengine -gopath /home/gert/.go bin/cash.go bin/token.go bin/service.go bin/endpoints.go bin/facebook.go bin/contact.go bin/twitter.go bin/google.go bin/user.go bin/login.go bin/oauth2.go bin/secret.go bin/linkedin.go)INFO 2014-01-07 02:32:35,166 module.py:617] default: "GET /_ah/warmup HTTP/1.1" 500 1048 nulljava.lang.NullPointerException at ro.redeul.google.go.inspection.FunctionCallInspection.checkFunctionTypeArguments(FunctionCallInspection.java:287) at ro.redeul.google.go.inspection.FunctionCallInspection.checkFunctionCallArguments(FunctionCallInspection.java:347) at ro.redeul.google.go.inspection.FunctionCallInspection.access$000(FunctionCallInspection.java:33) at ro.redeul.google.go.inspection.FunctionCallInspection$1.visitCallOrConvExpression(FunctionCallInspection.java:41) at ro.redeul.google.go.lang.psi.impl.expressions.primary.GoCallOrConvExpressionImpl.accept(GoCallOrConvExpressionImpl.java:78) at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.acceptChildren(GoPsiElementBase.java:61) at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14) at ro.redeul.google.go.lang.psi.visitors.GoElementVisitor.visitIfStatement(GoElementVisitor.java:160) at ro.redeul.google.go.lang.psi.impl.statements.GoIfStatementImpl.accept(GoIfStatementImpl.java:65) at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.acceptChildren(GoPsiElementBase.java:61) at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14) at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.accept(GoPsiElementBase.java:48) at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.acceptChildren(GoPsiElementBase.java:61) at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14) at ro.redeul.google.go.lang.psi.visitors.GoElementVisitor.visitMethodDeclaration(GoElementVisitor.java:60) at ro.redeul.google.go.lang.psi.impl.toplevel.GoMethodDeclarationImpl.accept(GoMethodDeclarationImpl.java:28) at ro.redeul.google.go.lang.psi.impl.GoFileImpl.acceptChildren(GoFileImpl.java:205) at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14) at ro.redeul.google.go.lang.psi.visitors.GoElementVisitor.visitFile(GoElementVisitor.java:40) at ro.redeul.google.go.inspection.FunctionCallInspection.doCheckFile(FunctionCallInspection.java:36) at ro.redeul.google.go.inspection.AbstractWholeGoFileInspection.checkFile(AbstractWholeGoFileInspection.java:23) at com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspectionTool.java:144) at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:70) at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:74) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$5.process(LocalInspectionsPass.java:382) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$5.process(LocalInspectionsPass.java:377) at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:119) at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:42) at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:82) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166) at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:91) at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212) at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:103) at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:79) at jsr166e.CountedCompleter.exec(CountedCompleter.java:684) at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260) at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858) at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687) at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642) at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)

492https://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/492

— Reply to this email directly or view it on GitHubhttps://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/510 .

gertcuykens commented 10 years ago
func (s *Service) UserToken(r *http.Request, req *Token, resp *Response) (err error) {
    u := new(User)
    u.Context = appengine.NewContext(r)
    u.Token = req
    if err = u.Token.CheckSum(); err !=nil {return}
    resp.Message="OK"
    return err
}

CheckSum was returning a bool at the time and not a err

dlsniper commented 10 years ago

I can't reproduce it and it's not GAE specific. Sorry.