IG exception (build 1120)

I was editing a very long string. I tried to break it up with quotes and +
sign. I hit ", then +, then exception.

Error message: Exception happened in local inspection tool: Hardcoded file
separator
java.lang.NullPointerException
at
com.siyeh.ig.portability.HardcodedFileSeparatorsInspection.isHardcodedFilena
meString(HardcodedFileSeparatorsInspection.java:62)
at
com.siyeh.ig.portability.HardcodedFileSeparatorsInspection.access$100(Hardco
dedFileSeparatorsInspection.java:16)
at
com.siyeh.ig.portability.HardcodedFileSeparatorsInspection$HardcodedFileSepa
ratorsVisitor.visitLiteralExpression(HardcodedFileSeparatorsInspection.java:
169)
at com.intellij.psi.impl.source.e.a.x.accept(x.java:61)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitExpression(JavaElementVisitor.java:
34)
at
com.intellij.psi.JavaElementVisitor.visitBinaryExpression(JavaElementVisitor
.java:88)
at com.intellij.psi.impl.source.e.a.f.accept(f.java:31)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitExpression(JavaElementVisitor.java:
34)
at
com.intellij.psi.JavaElementVisitor.visitBinaryExpression(JavaElementVisitor
.java:88)
at com.intellij.psi.impl.source.e.a.f.accept(f.java:31)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitExpression(JavaElementVisitor.java:
34)
at
com.intellij.psi.JavaElementVisitor.visitBinaryExpression(JavaElementVisitor
.java:88)
at com.intellij.psi.impl.source.e.a.f.accept(f.java:31)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitExpression(JavaElementVisitor.java:
34)
at
com.intellij.psi.JavaElementVisitor.visitBinaryExpression(JavaElementVisitor
.java:88)
at com.intellij.psi.impl.source.e.a.f.accept(f.java:31)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitExpression(JavaElementVisitor.java:
34)
at
com.intellij.psi.JavaElementVisitor.visitBinaryExpression(JavaElementVisitor
.java:88)
at com.intellij.psi.impl.source.e.a.f.accept(f.java:31)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitExpression(JavaElementVisitor.java:
34)
at
com.intellij.psi.JavaElementVisitor.visitBinaryExpression(JavaElementVisitor
.java:88)
at com.intellij.psi.impl.source.e.a.f.accept(f.java:31)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitExpressionList(JavaElementVisitor.j
ava:173)
at com.intellij.psi.impl.source.e.a.p.accept(p.java:38)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitStatement(JavaElementVisitor.java:1
50)
at
com.intellij.psi.JavaElementVisitor.visitExpressionListStatement(JavaElement
Visitor.java:163)
at com.intellij.psi.impl.source.e.a.q.accept(q.java:3)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:4
0)
at com.intellij.psi.impl.source.e.a.br.accept(br.java:19)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitStatement(JavaElementVisitor.java:1
50)
at
com.intellij.psi.JavaElementVisitor.visitBlockStatement(JavaElementVisitor.j
ava:22)
at com.intellij.psi.impl.source.e.a.g.accept(g.java:8)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitStatement(JavaElementVisitor.java:1
50)
at
com.intellij.psi.JavaElementVisitor.visitIfStatement(JavaElementVisitor.java
:140)
at com.intellij.psi.impl.source.e.a.t.accept(t.java:37)
at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:4
0)
at com.intellij.psi.impl.source.e.a.br.accept(br.java:19)
at com.intellij.psi.impl.source.q.acceptChildren(q.java:56)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElement
Visitor.java:2)
at
com.intellij.psi.JavaElementVisitor.visitMethod(JavaElementVisitor.java:167)
at com.intellij.psi.impl.source.be.accept(be.java:32)
at
com.siyeh.ig.ExpressionInspection.checkMethod(ExpressionInspection.java:50)
at com.intellij.codeInsight.g.a.i.b(i.java:31)
at com.intellij.codeInsight.g.a.bk$1.run(bk$1.java:6)
at com.intellij.openapi.application.a.b.runReadAction(b.java:152)
at com.intellij.codeInsight.g.a.bk.b(bk.java:3)
at com.intellij.codeInsight.g.a.bk.access$100(bk.java:18)
at com.intellij.codeInsight.g.a.bk$0.run(bk$0.java:2)
at
com.intellij.progress.ProgressManager.runProcess(ProgressManager.java:21)
at com.intellij.codeInsight.g.a.bk.run(bk.java:9)


--
Norris Shelton
Web Developer
Sun Certified Java Programmer




3 comments
Comment actions Permalink

Another exception (Norris, I hope you wont mind reusing your topic :)) :

It happened in code below with cursor in position marked by '|' :

Calendar earliestStarterMoverDate = null;
Calendar earliestStarterDate = null;
Calendar[] joinerRow = new Calendar[5];

/*
lots of bizarre ifs
*/

if (earliestStarterDate != null && earliestStarterMoverDate != null) {
if (earliestStarterDate.before(earliestStarterMoverDate)) {
joinerRow[0] = |;
} else {

}
}


Error message: Exception happened in local inspection tool: Unnecessary 'if' statement
java.lang.NullPointerException

at com.siyeh.ig.verbose.TrivialIfInspection.isAssignment(TrivialIfInspection.java:198)

at com.siyeh.ig.verbose.TrivialIfInspection.access$400(TrivialIfInspection.java:12)

at com.siyeh.ig.verbose.TrivialIfInspection$TrivialIfVisitor.visitIfStatement(TrivialIfInspection.java:146)

at com.intellij.psi.impl.source.e.a.t.accept(t.java:37)

at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)

at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:2)

at com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:40)

at com.intellij.psi.impl.source.e.a.br.accept(br.java:19)

at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)

at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:2)

at com.intellij.psi.JavaElementVisitor.visitStatement(JavaElementVisitor.java:150)

at com.intellij.psi.JavaElementVisitor.visitBlockStatement(JavaElementVisitor.java:22)

at com.intellij.psi.impl.source.e.a.g.accept(g.java:8)

at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)

at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:2)

at com.intellij.psi.JavaElementVisitor.visitStatement(JavaElementVisitor.java:150)

at com.intellij.psi.JavaElementVisitor.visitIfStatement(JavaElementVisitor.java:140)

at com.siyeh.ig.verbose.TrivialIfInspection$TrivialIfVisitor.visitIfStatement(TrivialIfInspection.java:117)

at com.intellij.psi.impl.source.e.a.t.accept(t.java:37)

at com.intellij.psi.impl.source.e.s.acceptChildren(s.java:39)

at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:2)

at com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:40)

at com.intellij.psi.impl.source.e.a.br.accept(br.java:19)

at com.intellij.psi.impl.source.q.acceptChildren(q.java:56)

at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:2)

at com.intellij.psi.JavaElementVisitor.visitMethod(JavaElementVisitor.java:167)

at com.intellij.psi.impl.source.be.accept(be.java:32)

at com.siyeh.ig.ExpressionInspection.checkMethod(ExpressionInspection.java:50)

at com.intellij.codeInsight.g.a.i.b(i.java:31)

at com.intellij.codeInsight.g.a.bk$1.run(bk$1.java:6)

at com.intellij.openapi.application.a.b.runReadAction(b.java:152)

at com.intellij.codeInsight.g.a.bk.b(bk.java:3)

at com.intellij.codeInsight.g.a.bk.access$100(bk.java:18)

at com.intellij.codeInsight.g.a.bk$0.run(bk$0.java:2)

at com.intellij.progress.ProgressManager.runProcess(ProgressManager.java:21)

at com.intellij.codeInsight.g.a.bk.run(bk.java:9)

0
Comment actions Permalink

Another exception

On such ugly code:
if ((role.is(AuthConstants.RoleID_HR_USER)) ||
(role.is(AuthConstants.RoleID_SML_USER)) ||
(role.is(AuthConstants.RoleID_HR_MANAGER))
) {
return "something complex";
}

I get warnings that "Parentheses around(every line) are unnecessary, when I clicked on quick fix "Remove unnecessary parentheses" I got:
2004-01-27 14:16:44,075 ERROR - mand.impl.CommandProcessorImpl -
2004-01-27 14:16:44,075 ERROR - mand.impl.CommandProcessorImpl - IntelliJ IDEA 4.0 Build #1122
2004-01-27 14:16:44,075 ERROR - mand.impl.CommandProcessorImpl - JDK: 1.4.2_03
2004-01-27 14:16:44,075 ERROR - mand.impl.CommandProcessorImpl - VM: Java HotSpot(TM) Client VM
2004-01-27 14:16:44,075 ERROR - mand.impl.CommandProcessorImpl - Vendor: Sun Microsystems Inc.
2004-01-27 14:16:44,075 ERROR - mand.impl.CommandProcessorImpl - OS: Windows 2000
2004-01-27 14:16:44,075 ERROR - mand.impl.CommandProcessorImpl - Last Action: ShowIntentionActions
2004-01-27 14:16:44,075 ERROR - mand.impl.CommandProcessorImpl - Current Command: Remove unnecessary parentheses
2004-01-27 14:16:44,075 ERROR - mand.impl.CommandProcessorImpl -
java.lang.NullPointerException
at com.intellij.psi.impl.source.a.e.c(e.java:118)
at com.intellij.psi.impl.source.c.r.a(r.java:41)
at com.intellij.psi.impl.source.c.s.replace(s.java:59)
at com.siyeh.ig.InspectionGadgetsFix.replaceExpression(InspectionGadgetsFix.java:20)
at com.siyeh.ig.verbose.UnnecessaryParenthesesInspection$UnnecessaryParenthesesFix.applyFix(UnnecessaryParenthesesInspection.java:59)
at com.intellij.codeInspection.y.n.invoke(n.java:3)
at com.intellij.codeInsight.intention.a.u$8.run(u$8.java:2)
at com.intellij.openapi.application.a.b.runWriteAction(b.java:90)
at com.intellij.codeInsight.intention.a.u$11.run(u$11.java:1)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:54)
at com.intellij.codeInsight.intention.a.u$0.run(u$0.java:1)
at com.intellij.util.LaterInvocator$FlushQueue.run(LaterInvocator.java:10)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at com.intellij.ide.q.b(q.java:42)
at com.intellij.ide.q.a(q.java:26)
at com.intellij.ide.q.dispatchEvent(q.java:79)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

0
Comment actions Permalink

Another one, this time against IDEA 1122
Dave - are you reading this or should I stop bothering with reports?


I got warning "C-style declaration" on code:
public static final String VIEW_TYPE_NAMES[] = {"TEAM", "INDIVIDUAL", "EXCEPTIONS", "TALENT"};

pressed Alt-Enter, invoked "Replace with Java style declaration"

and bang:



java.lang.NullPointerException

at com.intellij.psi.impl.source.q.isWritable(q.java:28)

at com.intellij.psi.impl.l.a(l.java:14)

at com.intellij.psi.impl.source.w.normalizeDeclaration(w.java:161)

at com.siyeh.ig.style.CStyleArrayDeclarationInspection$CStyleArrayDeclarationFix.applyFix(CStyleArrayDeclarationInspection.java:56)

at com.intellij.codeInspection.y.n.invoke(n.java:3)

at com.intellij.codeInsight.intention.a.u$8.run(u$8.java:2)

at com.intellij.openapi.application.a.b.runWriteAction(b.java:90)

at com.intellij.codeInsight.intention.a.u$11.run(u$11.java:1)

at com.intellij.openapi.command.impl.a.executeCommand(a.java:54)

at com.intellij.codeInsight.intention.a.u$0.run(u$0.java:1)

at com.intellij.util.LaterInvocator$FlushQueue.run(LaterInvocator.java:10)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)

at com.intellij.ide.q.b(q.java:42)

at com.intellij.ide.q.a(q.java:26)

at com.intellij.ide.q.dispatchEvent(q.java:79)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

0

Please sign in to leave a comment.