mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
simplify as now allowNonPublicClasses is true by default
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.io.jsonRpc;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -39,7 +40,7 @@ public class JsonRpcDomainBean extends AbstractExtensionPointBean {
|
||||
try {
|
||||
if (service == null) {
|
||||
Class<Object> aClass = findClass(implementation);
|
||||
return asInstance ? instantiate(aClass, ApplicationManager.getApplication().getPicoContainer(), true) : aClass;
|
||||
return asInstance ? instantiate(aClass, ApplicationManager.getApplication().getPicoContainer()) : aClass;
|
||||
}
|
||||
else {
|
||||
return ServiceManager.getService(findClass(service));
|
||||
|
||||
+1
@@ -64,6 +64,7 @@ public abstract class AbstractExtensionPointBean implements PluginAware {
|
||||
public static <T> T instantiate(@NotNull final Class<T> aClass,
|
||||
@NotNull final PicoContainer container,
|
||||
final boolean allowNonPublicClasses) {
|
||||
//noinspection unchecked
|
||||
return (T)new CachingConstructorInjectionComponentAdapter(aClass.getName(), aClass, null, allowNonPublicClasses).getComponentInstance(container);
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ public class ConfigurableEP<T extends UnnamedConfigurable> extends AbstractExten
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return instantiate(findClass(treeRendererClass), myPicoContainer, true);
|
||||
return instantiate(findClass(treeRendererClass), myPicoContainer);
|
||||
}
|
||||
catch (ProcessCanceledException exception) {
|
||||
throw exception;
|
||||
@@ -350,7 +350,7 @@ public class ConfigurableEP<T extends UnnamedConfigurable> extends AbstractExten
|
||||
@Override
|
||||
protected Object createElement() {
|
||||
try {
|
||||
return instantiate(myType, myContainer, true);
|
||||
return instantiate(myType, myContainer);
|
||||
}
|
||||
catch (ProcessCanceledException exception) {
|
||||
throw exception;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.util.xml.impl;
|
||||
|
||||
import com.intellij.diagnostic.PluginException;
|
||||
@@ -61,7 +61,7 @@ public class DomFileMetaData extends AbstractExtensionPointBean {
|
||||
DomFileDescription instance = lazyInstance;
|
||||
if (instance == null) {
|
||||
try {
|
||||
instance = instantiate(findClass(implementation), ApplicationManager.getApplication().getPicoContainer(), true);
|
||||
instance = instantiate(findClass(implementation), ApplicationManager.getApplication().getPicoContainer());
|
||||
if (StringUtil.isEmpty(rootTagName)) {
|
||||
if (!instance.acceptsOtherRootTagNames()) {
|
||||
throw new PluginException(implementation + " should either specify a root tag name in XML, or return true from 'acceptsOtherRootTagNames'", getPluginId());
|
||||
|
||||
Reference in New Issue
Block a user