Adding PsiClass to the PsiFile

Hello all,

Every time I try to add created PsiClass to the existing PsiFile I got
following error (built 876):

java.lang.NullPointerException
at com.intellij.psi.impl.source.f.m.b(m.java:32)
at com.intellij.psi.impl.source.f.m.a(m.java:234)
at com.intellij.psi.impl.source.f.m.a(m.java:76)
at com.intellij.psi.impl.source.f.s.a(s.java:9)
at com.intellij.psi.impl.source.f.h.a(h.java:52)
at com.intellij.psi.impl.source.b.r.a(r.java:117)
at com.intellij.psi.impl.source.b.a.bu.a(bu.java:17)
at com.intellij.psi.impl.source.bg.add(bg.java:25)

Following action was done:
- created new PsiFile with PsiDirectory.createFile("name.java")
- created PsiClass with
PsiManager.getElementFactory().createClass("name")
- PsiFile.add(PsiClass)

Perhaps, anybody experienced similar problem and could help?

Thank you,
--
Egidijus Vaisnora



1 comment
Comment actions Permalink

It appeared to be a bug in PSI implementation and it's fixed in the build
#883.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Egidijus Vaisnora" <Egidijus.Vaisnora@nomagic.com> wrote in message
news:bgaf4f$tm4$1@is.intellij.net...

Hello all,

>

Every time I try to add created PsiClass to the existing PsiFile I got
following error (built 876):

>

java.lang.NullPointerException
at com.intellij.psi.impl.source.f.m.b(m.java:32)
at com.intellij.psi.impl.source.f.m.a(m.java:234)
at com.intellij.psi.impl.source.f.m.a(m.java:76)
at com.intellij.psi.impl.source.f.s.a(s.java:9)
at com.intellij.psi.impl.source.f.h.a(h.java:52)
at com.intellij.psi.impl.source.b.r.a(r.java:117)
at com.intellij.psi.impl.source.b.a.bu.a(bu.java:17)
at com.intellij.psi.impl.source.bg.add(bg.java:25)

>

Following action was done:
- created new PsiFile with PsiDirectory.createFile("name.java")
- created PsiClass with
PsiManager.getElementFactory().createClass("name")
- PsiFile.add(PsiClass)

>

Perhaps, anybody experienced similar problem and could help?

>

Thank you,
--
Egidijus Vaisnora

>
>
>


0

Please sign in to leave a comment.