strange stack trace in idea.log
Since a few eaps i'm seeing this in idea.log
2008-10-15 13:30:53,328 WARN - tellij.ide.HackyRepaintManager - Access to realized (ever shown) UI components should be done only from the AWT event dispatch thread, revalidate(), invalidate() & repaint() is ok from any thread
java.lang.Exception
at com.intellij.ide.IdeRepaintManager.a(IdeRepaintManager.java:32)
at com.intellij.ide.IdeRepaintManager.addDirtyRegion(IdeRepaintManager.java:2)
at javax.swing.JComponent.repaint(JComponent.java:4732)
at java.awt.Component.repaint(Component.java:2927)
at javax.swing.JLabel.setText(JLabel.java:326)
at org.intellij.vcs.mks.MKSChangeProvider.setStatusInfo(MKSChangeProvider.java:428)
at org.intellij.vcs.mks.MKSChangeProvider.getChanges(MKSChangeProvider.java:92)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.a(ChangeListManagerImpl.java:156)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.a(ChangeListManagerImpl.java:61)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.access$500(ChangeListManagerImpl.java:163)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl$ActualUpdater.consume(ChangeListManagerImpl.java:5)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl$ActualUpdater.consume(ChangeListManagerImpl.java:2)
at com.intellij.openapi.vcs.changes.UpdateRequestsQueue$MyRunnable.run(UpdateRequestsQueue.java:29)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
What's strange is that according to the stack trace, the method being called is indeed Component.repaint, thus, I don't understand the message. Is this just an information message ?
Please sign in to leave a comment.
Hello Thibaut,
No, this is not just an information message, this indicates a bug in your
plugin. You're calling JLabel.setText(), a Swing method, from a thread other
than the event dispatch thread. You need to wrap the call in invokeLater().
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
I can understand that, however
- I do not understand that part of hte message : "revalidate(), invalidate() & repaint() is ok from any thread"
- this is new right ? i had never seen this before 8890, and the text I was setting using that setText method has always been displayed correctly.
I'll modify this anyway but I'm trying to understand
edit : just to be sure, i just tested using IDEA 7, and indeed I can't see any message like this, nor is anything unexpected happening
Edited by: Thibaut on Oct 15, 2008 4:40 PM
Hello Thibaut,
If you're calling specifically these methods, you're allowed to call them
from any thread.
The rule has been there forever, and it's defined by Sun, not by us. The
check enforcing that rule in our code is indeed new.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
thanks for clarifying