IntelliJ highlights errors that don't exist

已回答

These last days, IntelliJ is not working properly. For instance:

http://i.imgur.com/gtVwi.png

The method receives a String as parameter but it shows an error there. Compilation works fine, but it's annoying to have error markers on my code everywhere. Sometimes restarting the IDE makes it work (closing the file and reopening does not help)... so, is there a way to fix this problem?

评论操作 固定链接

try to recreate project jdk, then invalidate caches. Also make sure you didn't configure classpath with different version of the same class.

regards, Alex

0
评论操作 固定链接

Thanks... I tried that but it didn't have any effect :(

0
评论操作 固定链接

My co-worker and I have noticed the same issue with IntelliJ 10.5.1 since recently upgrading to this version that bogus highlighted errors are occuring. I have seen the bad error highlights go away after doing control+alt+L to reformat the code which seems to refresh the file, or Invalidating Caches or restarting IDEA - but this should not be necessary - certainly on a regular basis. I haven't seen IDEA have this issue in the past. Our projects are auto created by importing a top level Maven pom.xml so we do not modify the classpath directly.

0
评论操作 固定链接

I've been seeing this issue on and off for a while now. There doesn't seem to be much of a pattern around when it comes and goes.. restarting, clearing the cache... luckily it's been pretty solid for a few days... fingers crossed.

0
评论操作 固定链接

Hello,

Looks very similar to IDEA-72043. Feel free to track its progress.

Denis

0
评论操作 固定链接

Two of my coworkers and I have seen the same problem since updating to IDEA 10.5.1, on both Windows 7 and Mac OS X 10.6.  When I wrote in to JetBrains support, they responded "File | Invalidate Caches should help, if it doesn't help, please
provide ~/Library/Logs/IntelliJIdea10/idea.log ."  I invalidated my caches, and that solved the problem for me for a few days, but the problem subsequently returned (once good imports marked as gray, another time good code marked red).  I haven't submitted my log files yet, but will try to do so the next time I see the error.  Invalidating caches + rebuilding my project takes over 15 minutes, so it's not that useful as a workaround if I have to keep doing it.  My coworkers and I never saw this problem before 10.5.1, but we restructured our IMLs about the same time and weren't sure what was causing the problem.  Since we have seen others with the same problem, maybe it is related to IDEA itself and not our new configuration.

1
评论操作 固定链接

Hello,

I also have this problem. I'm pretty sure I first saw it in 10.5.1. I'm on a Mac if it matters, using Java 1.6.0_26 on 10.6.8 with all the latest of everything.

I really really wish that you fix this for 10.5.2 since it's driving me nuts.

I get it after 5-60 minutes and when it starts it marks maybe 10% of the lines I edit as errors. Compile shows no errors though.

Invalidate caches fixes it but that's not a good solution since it takes a while to restart. Timewise maybe not a super big problem, but what's worse is that it throws my out of my mental coding zone.. ;)

I tried to get a hold of 10.5.0 but was unable to get it from the download page. Maybe it's hidden somewhere but I would very much appreciate it if you made it available until this is fixed.

Cheers,
Mikael Grev

0
评论操作 固定链接

I also can confirm this bug with 10.5.1 (Windows 7).

Tom

0
评论操作 固定链接

Trying to find similar issues to track this.

IDEA-71782 Code remains invalid after correction [severe]
http://youtrack.jetbrains.net/issue/IDEA-71782?projectKey=IDEA&query=cache


IDEA-71905 Code highlighting/inspections stop working
http://youtrack.jetbrains.net/issue/IDEA-71905?projectKey=IDEA&query=cache


IDEA-71793 Code analysis sometimes gets out of sync
http://youtrack.jetbrains.net/issue/IDEA-71793?projectKey=IDEA&query=cache

Seems like there is a pattern here with people experiencing invalid error highlighting in 10.5.1. Would like to see a fix in 10.5.2 soon. I will likely need to revert to 10.5 because of this.

0
评论操作 固定链接

I rolled back to IDEA 10.5 #IU-107.105 and haven't seen the problem for  several days, so it seems like the problem was introduced between 10.5  and 10.5.1.

Good luck!
Sam

0
评论操作 固定链接

Happen to know where we can download 10.5.0?

Daniel

0
评论操作 固定链接

I downloaded a copy from this link:
http://download-ln.jetbrains.com/idea/ideaIU-10.5.exe

I'm not sure where to find the link for community edition.

Good luck!
Sam

0
评论操作 固定链接

Wonderful!  Thanks!  

Changing the extension to dmg works for mac if anyone else needs to rollback.

Daniel

0
评论操作 固定链接

This problem makes IDEA 10.5.1 impossible to work with.
Our entire team has rolled back to IDEA 10.5.0.
When can we expect a fix?

Chris Malley
www.pixelzoom.com

0
评论操作 固定链接

Hello Chris,

This problem makes IDEA 10.5.1 impossible to work with.
Our entire team has rolled back to IDEA 10.5.0.
When can we expect a fix?


No sooner than we can find the root cause for the problem. Unfortunately
we do not know it yet.

The new 10.5.2 EAP build has additional diagnostics that will help us diagnose
the problem,

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
评论操作 固定链接

my guess:
those of you having these problems are running idea under a non standard jdk/jre. i and my coworker have an almost identical configuration - only our jres differ. once i switched from random eap 1.7.0 back to 1.6.0_24, the problems were gone. he never had them (and was never using java 7)

0
评论操作 固定链接

A "non standard jdk/jre" is not the case in my team's experience. I'm using Java 1.6.0_26 on Mac OS 10.6.8.  Others on my team are using a standard 1.6 release on Windows 7 and XP.  All of us were experiencing identical issues. After weeks of trying various workaround, we reverted to IDEA 10.5.0.

Chris
www.pixelzoom.com

0
评论操作 固定链接

EXACTLY the same here.

Though this smells like a concurrency problem to me and I do have a 4 core processor, not that it should matter. But the likelyhood of concurrency problems might be higher on multi core?

0
评论操作 固定链接

I've been using the bundled JRE with IDEA ultimate versions, not a non-standard version.

I also tried the EAP 107.481 since Dmitry said it had additional diagnostics to help diagnose the problem.  After about 5 hours of problem-free usage, the highlight error occurred and the "IDE fatal error" red icon started blinking.  I submitted a report using the built-in facility, but noticed that Mikael Grev suggested it might be related to concurrency earlier in this thread.  Good guess!  The stack trace contained java.util.concurrent, com.intellij.concurrency and com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass, so this might be the culprit (though I don't know if all IDEA stack traces start with these concurrency calls).  Here's one of the stack traces I reported:

com.intellij.psi.PsiInvalidElementAccessException: Element: class com.intellij.psi.impl.source.tree.java.PsiLocalVariableImpl
 at com.intellij.psi.impl.source.tree.CompositePsiElement.getContainingFile(CompositePsiElement.java:88)
 at com.intellij.codeInsight.daemon.impl.RefCountHolder.registerReference(RefCountHolder.java:86)
 at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitReferenceElement(HighlightVisitorImpl.java:761)
 at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitReferenceExpression(HighlightVisitorImpl.java:805)
 at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.accept(PsiReferenceExpressionImpl.java:599)
 at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:113)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$8.run(GeneralHighlightingPass.java:585)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:629)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$3200(GeneralHighlightingPass.java:75)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$9.run(GeneralHighlightingPass.java:635)
 at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:84)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:632)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$3200(GeneralHighlightingPass.java:75)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$9.run(GeneralHighlightingPass.java:635)
 at com.intellij.codeInsight.daemon.impl.RefCountHolder.analyze(RefCountHolder.java:238)
 at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.analyze(HighlightVisitorImpl.java:136)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:632)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:624)
 at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:198)
 at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:57)
 at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:58)
 at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:348)
 at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1013)
 at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:340)
 at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:209)
 at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:338)
 at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:314)
 at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:133)
 at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:130)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31)
 at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70)
 at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:113)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:662)

0
评论操作 固定链接

Now I am seeing a highlighting error in 107.481 but IDEA reports "no new IDE fatal errors".  I didn't invalidate my caches since the last run, but this is all new code AFAIK.  I'll try "invalidate and restart" and see what happens.

0
评论操作 固定链接

Haven't seen this problem after using 10.5.2 for about 2 weeks, thanks JetBrains!

0
评论操作 固定链接

Same error here, but it's 2018...

0
评论操作 固定链接

Try disabling all 3rd plugins, then File | Invalidate Caches/Restart.. | Invalidate and Restart and full project rebuild. If issue remains, please file an issue at https://youtrack.jetbrains.com/issues/IDEA with an isolated reproducible sample.

0
评论操作 固定链接

There are already a lot of plugins disabled...

File | Invalidate Caches/Restart: already tried

Full project rebuild: already tried

Issue: opened before comment here.

0
评论操作 固定链接

Have the same problem with version 2018.1.2. Restart works, but very annoying problem.

0
评论操作 固定链接

Hi. Could you please provide a code example to reproduce the problem?

0
评论操作 固定链接

I have to right now with version 17.2.5

1. add is hightlisted as "canno't reslove symbol add"

upustyDenne.add(new UpustZasowa(int 0, int 10));

2. ? : seems to bother idea, the tip is "expected ';' Pure nonsense at both.

position.equals(null) ? return verticalPosition.doubleValue() : return verticalPosition- 0.5*hight + position;
0
评论操作 固定链接

Please file a bug at https://youtrack.jetbrains.com/issues/IDEA and attach a sample project to reproduce.

File | Invalidate Caches | Invalidate and Restart may help.

2
评论操作 固定链接

Invalidate cache and restart helpped. thanks :) Didn't what was the exact name of option, now I googled it and it's all back to normal.

 

update.

I was to eager. After a while problem came back.

Update to 2018.1also dosne't help.

This is big issue then, to work furhter I may rollback.

Rolback to 2016 doesn't help. Intelij has to solve it. It's critical! I'll stop using it for some simplier editor if simple spell check disabled my work for entire freaking evening!

 

findal update day later:

It worked, but not alone. Standard only core, non apache application totaly solved the problem + generated packege info I was missing, what Idea compiler totaly missed. Now I finnaly have litle green arrow and my sorrow is throught with it. Finall compiled without compiler or any runtime error.

So seteps to victory:

1.Go to https://start.spring.io/

2. Switch to full version

3.Checked DevTools, Lombock(optional)

4. Compiler errors solved, finally simple green arrow run works without (Unknown)

5. Happy ever after with correct strucuter and Maven happy to work in good environment.

1
评论操作 固定链接

I sadly find that IntelliJ often changes settings on its own

0

请先登录再写评论。