mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
WEB-77003 PolySymbolPropertyGetter: catch InvocationTargetException and rethrow the original exception
(cherry picked from commit 83cae280ad05016dbf590f6a9219d4b210c66a58) IJ-CR-193424 GitOrigin-RevId: 951d0171c4976a0d443adacd91dc409c0b470bf5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a128acc83e
commit
eb2d11eff4
@@ -8,6 +8,7 @@ import com.intellij.polySymbols.PolySymbolProperty
|
||||
import com.intellij.util.asSafely
|
||||
import com.intellij.util.containers.ContainerUtil
|
||||
import java.lang.reflect.Field
|
||||
import java.lang.reflect.InvocationTargetException
|
||||
import java.lang.reflect.Method
|
||||
|
||||
object PolySymbolPropertyGetter {
|
||||
@@ -95,7 +96,14 @@ object PolySymbolPropertyGetter {
|
||||
}
|
||||
else if (property.type.objectType.isAssignableFrom(actualMethod.returnType.objectType)) {
|
||||
actualMethod.isAccessible = true
|
||||
result[property] = { actualMethod.invoke(it) }
|
||||
result[property] = {
|
||||
try {
|
||||
actualMethod.invoke(it)
|
||||
}
|
||||
catch (e: InvocationTargetException) {
|
||||
throw e.cause ?: e
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
thisLogger().error("PolySymbol property ${property.name} of type ${property.type} is not assignable from return type ${actualMethod.returnType} of ${clazz.name}.${actualMethod.name}()")
|
||||
|
||||
Reference in New Issue
Block a user