I dev a plugin that imported same class of properties, but it throw ClassCastException
I dev a plugin, and import plugin properties's lib (properties.jar) as a dependency. In my codes where used properties.jar's class listed belowe:
| codes |
|---|
PsiFile[] psiFiles = PsiShortNamesCache.getInstance(myPsiManager.getProject()).getFilesByName("messages_zh_CN.properties"); |
console's errors info:
| errors |
|---|
java.lang.ClassCastException: com.intellij.lang.properties.psi.impl.PropertiesFileImpl |
I'm completely lost, can somebody give some hint of why this could be happening?
Thanks in advanced !
请先登录再写评论。
Make sure to add dependencies to IDEA plugins to your IDEA JDK, not as "normal" library dependencies of your plugin module
It works by add attr <depends>com.intellij.properties</depends> to pulgin.xml, thx a lot for your post!