{"action":"created","issue":{"url":"https://api.github.com/repos/DemonWav/MinecraftDevIntelliJ/issues/34","repository_url":"https://api.github.com/repos/DemonWav/MinecraftDevIntelliJ","labels_url":"https://api.github.com/repos/DemonWav/MinecraftDevIntelliJ/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/DemonWav/MinecraftDevIntelliJ/issues/34/comments","events_url":"https://api.github.com/repos/DemonWav/MinecraftDevIntelliJ/issues/34/events","html_url":"https://github.com/DemonWav/MinecraftDevIntelliJ/issues/34","id":167042648,"number":34,"title":"java.lang.ClassCastException: (various PSI elements) cannot be cast to com.intellij.psi.PsiReferenceExpression","user":{"login":"JBYoshi","id":12983479,"avatar_url":"https://avatars.githubusercontent.com/u/12983479?v=3","gravatar_id":"","url":"https://api.github.com/users/JBYoshi","html_url":"https://github.com/JBYoshi","followers_url":"https://api.github.com/users/JBYoshi/followers","following_url":"https://api.github.com/users/JBYoshi/following{/other_user}","gists_url":"https://api.github.com/users/JBYoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/JBYoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JBYoshi/subscriptions","organizations_url":"https://api.github.com/users/JBYoshi/orgs","repos_url":"https://api.github.com/users/JBYoshi/repos","events_url":"https://api.github.com/users/JBYoshi/events{/privacy}","received_events_url":"https://api.github.com/users/JBYoshi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-22T13:14:22Z","updated_at":"2016-07-22T13:23:09Z","closed_at":null,"body":"```\r\njava.lang.ClassCastException: com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl cannot be cast to com.intellij.psi.PsiReferenceExpression\r\n\tat com.demonwav.mcdev.platform.sponge.color.SpongeColorUtil.findColorFromElement(SpongeColorUtil.java:49)\r\n\tat com.demonwav.mcdev.platform.sponge.color.SpongeColorLineMarkerProvider.getLineMarkerInfo(SpongeColorLineMarkerProvider.java:39)\r\n\tat com.intellij.codeInsight.daemon.impl.LineMarkersPass.addLineMarkers(LineMarkersPass.java:178)\r\n\tat com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:111)\r\n\tat com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$0(PassExecutorService.java:432)\r\n\tat com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1033)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:425)\r\n\tat com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)\r\n\tat com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)\r\n\tat com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:424)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:400)\r\n\tat com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:154)\r\n\tat java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)\r\n\tat java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)\r\n\tat java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)\r\n\tat java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)\r\n\r\n\r\njava.lang.ClassCastException: com.intellij.psi.impl.source.tree.java.PsiMethodCallExpressionImpl cannot be cast to com.intellij.psi.PsiReferenceExpression\r\n\tat com.demonwav.mcdev.platform.sponge.color.SpongeColorUtil.findColorFromElement(SpongeColorUtil.java:49)\r\n\tat com.demonwav.mcdev.platform.sponge.color.SpongeColorLineMarkerProvider.getLineMarkerInfo(SpongeColorLineMarkerProvider.java:39)\r\n\tat com.intellij.codeInsight.daemon.impl.LineMarkersPass.addLineMarkers(LineMarkersPass.java:178)\r\n\tat com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:111)\r\n\tat com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$0(PassExecutorService.java:432)\r\n\tat com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1033)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:425)\r\n\tat com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)\r\n\tat com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)\r\n\tat com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:424)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:400)\r\n\tat com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:154)\r\n\tat java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)\r\n\tat java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)\r\n\tat java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)\r\n\tat java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)\r\n\r\n\r\njava.lang.ClassCastException: com.intellij.psi.impl.source.tree.java.PsiMethodCallExpressionImpl cannot be cast to com.intellij.psi.PsiReferenceExpression\r\n\tat com.demonwav.mcdev.platform.sponge.color.SpongeColorUtil.findColorFromElement(SpongeColorUtil.java:49)\r\n\tat com.demonwav.mcdev.platform.sponge.color.SpongeColorLineMarkerProvider.getLineMarkerInfo(SpongeColorLineMarkerProvider.java:39)\r\n\tat com.intellij.codeInsight.daemon.impl.LineMarkersPass.addLineMarkers(LineMarkersPass.java:178)\r\n\tat com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:111)\r\n\tat com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$0(PassExecutorService.java:432)\r\n\tat com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1033)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:425)\r\n\tat com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)\r\n\tat com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)\r\n\tat com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:424)\r\n\tat com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:400)\r\n\tat com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:154)\r\n\tat java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)\r\n\tat java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)\r\n\tat java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)\r\n\tat java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)\r\n```"},"comment":{"url":"https://api.github.com/repos/DemonWav/MinecraftDevIntelliJ/issues/comments/234542332","html_url":"https://github.com/DemonWav/MinecraftDevIntelliJ/issues/34#issuecomment-234542332","issue_url":"https://api.github.com/repos/DemonWav/MinecraftDevIntelliJ/issues/34","id":234542332,"user":{"login":"JBYoshi","id":12983479,"avatar_url":"https://avatars.githubusercontent.com/u/12983479?v=3","gravatar_id":"","url":"https://api.github.com/users/JBYoshi","html_url":"https://github.com/JBYoshi","followers_url":"https://api.github.com/users/JBYoshi/followers","following_url":"https://api.github.com/users/JBYoshi/following{/other_user}","gists_url":"https://api.github.com/users/JBYoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/JBYoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JBYoshi/subscriptions","organizations_url":"https://api.github.com/users/JBYoshi/orgs","repos_url":"https://api.github.com/users/JBYoshi/repos","events_url":"https://api.github.com/users/JBYoshi/events{/privacy}","received_events_url":"https://api.github.com/users/JBYoshi/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T13:23:09Z","updated_at":"2016-07-22T13:23:09Z","body":"Some classes that can cause the error, when part of a Sponge module:\r\n```java\r\npublic class Test1 {\r\n    private static int i = \"\".length(); // PsiLiteralExpressionImpl cannot be cast to PsiReferenceExpression\r\n}\r\npublic class Test2 {\r\n    private static int i = get().length(); // PsiMethodCallExpressionImpl cannot be cast to PsiReferenceExpression\r\n    private static String get() {return \"\";}\r\n}\r\npublic class Test3 {\r\n    private static Object obj = new Test3().go(); // PsiNewExpressionImpl cannot be cast to PsiReferenceExpression\r\n    private Object go() {return null;}\r\n}\r\n```"}}
{"actor":{"display_login":"JBYoshi"}}