summaryrefslogtreecommitdiff
path: root/platform/lang-api/src/com/intellij/psi/WeigherExtensionPoint.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/lang-api/src/com/intellij/psi/WeigherExtensionPoint.java')
-rw-r--r--platform/lang-api/src/com/intellij/psi/WeigherExtensionPoint.java18
1 files changed, 3 insertions, 15 deletions
diff --git a/platform/lang-api/src/com/intellij/psi/WeigherExtensionPoint.java b/platform/lang-api/src/com/intellij/psi/WeigherExtensionPoint.java
index 2c38cd057b2b..11bf87e7a2cd 100644
--- a/platform/lang-api/src/com/intellij/psi/WeigherExtensionPoint.java
+++ b/platform/lang-api/src/com/intellij/psi/WeigherExtensionPoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -18,11 +18,10 @@ package com.intellij.psi;
import com.intellij.openapi.extensions.AbstractExtensionPointBean;
import com.intellij.openapi.util.NotNullLazyValue;
import com.intellij.util.KeyedLazyInstance;
+import com.intellij.util.ReflectionUtil;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.NotNull;
-import java.lang.reflect.Constructor;
-
/**
* @author peter
*/
@@ -44,24 +43,13 @@ public class WeigherExtensionPoint extends AbstractExtensionPointBean implements
protected final Weigher compute() {
try {
Class<Weigher> tClass = findClass(implementationClass);
- Constructor<Weigher> constructor = tClass.getConstructor();
- constructor.setAccessible(true);
- final Weigher weigher = tClass.newInstance();
+ final Weigher weigher = ReflectionUtil.newInstance(tClass);
weigher.setDebugName(id);
return weigher;
}
- catch (InstantiationException e) {
- throw new RuntimeException(e);
- }
- catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
- catch (NoSuchMethodException e) {
- throw new RuntimeException(e);
- }
}
};