From f442b836fe72c35f363fa16e4ed3366e7d1fcaa4 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 3 Feb 2017 16:59:31 +0100 Subject: [PATCH] use ExceptionUtil.rethrow to reduce stack trace --- .../src/com/intellij/util/ReflectionUtil.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/platform/util/src/com/intellij/util/ReflectionUtil.java b/platform/util/src/com/intellij/util/ReflectionUtil.java index aebeccede54d..f5283c052ab6 100644 --- a/platform/util/src/com/intellij/util/ReflectionUtil.java +++ b/platform/util/src/com/intellij/util/ReflectionUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,10 @@ import org.jetbrains.annotations.Nullable; import java.lang.annotation.Annotation; import java.lang.reflect.*; -import java.util.*; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; public class ReflectionUtil { private static final Logger LOG = Logger.getInstance("#com.intellij.util.ReflectionUtil"); @@ -445,12 +448,17 @@ public class ReflectionUtil { exception = e1; } } - throw new RuntimeException(exception); + + ExceptionUtil.rethrow(exception); } } - throw new RuntimeException(e); + ExceptionUtil.rethrow(e); } + + // error will be thrown + //noinspection ConstantConditions + return null; } @NotNull