From fc0b6309b8eb3953b1abc6a658d37f89a4e45472 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 12 Jun 2019 12:53:03 +0200 Subject: [PATCH] Cleanup (typos; formatting) GitOrigin-RevId: 78006976246264c7ac4693870651f190197833d2 --- .../ide/BootstrapClassLoaderUtil.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/platform/bootstrap/src/com/intellij/ide/BootstrapClassLoaderUtil.java b/platform/bootstrap/src/com/intellij/ide/BootstrapClassLoaderUtil.java index 1cf650ca6286..fe66620f0d8b 100644 --- a/platform/bootstrap/src/com/intellij/ide/BootstrapClassLoaderUtil.java +++ b/platform/bootstrap/src/com/intellij/ide/BootstrapClassLoaderUtil.java @@ -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.ide; import com.intellij.idea.Main; @@ -30,12 +30,13 @@ import java.util.regex.Pattern; /** * @author max */ -public class BootstrapClassLoaderUtil extends ClassUtilCore { +public class BootstrapClassLoaderUtil { + public static final String CLASSPATH_ORDER_FILE = "classpath-order.txt"; + private static final String PROPERTY_IGNORE_CLASSPATH = "ignore.classpath"; private static final String PROPERTY_ALLOW_BOOTSTRAP_RESOURCES = "idea.allow.bootstrap.resources"; private static final String PROPERTY_ADDITIONAL_CLASSPATH = "idea.additional.classpath"; - public static final String CLASSPATH_ORDER_FILE = "classpath-order.txt"; - private static final String MARKETPLACE_PLUGIN_NAME = "marketplace"; + private static final String MARKETPLACE_PLUGIN_DIR = "marketplace"; private BootstrapClassLoaderUtil() { } @@ -53,10 +54,10 @@ public class BootstrapClassLoaderUtil extends ClassUtilCore { addAdditionalClassPath(classpath); addParentClasspath(classpath, true); - final File mpBoot = new File(PathManager.getPluginsPath(), MARKETPLACE_PLUGIN_NAME + "/lib/boot/marketplace-bootstrap.jar"); - final boolean installMarketplace = mpBoot.exists(); + File mpBoot = new File(PathManager.getPluginsPath(), MARKETPLACE_PLUGIN_DIR + "/lib/boot/marketplace-bootstrap.jar"); + boolean installMarketplace = mpBoot.exists(); if (installMarketplace) { - final File marketplaceImpl = new File(PathManager.getPluginsPath(), MARKETPLACE_PLUGIN_NAME + "/lib/boot/marketplace-impl.jar"); + File marketplaceImpl = new File(PathManager.getPluginsPath(), MARKETPLACE_PLUGIN_DIR + "/lib/boot/marketplace-impl.jar"); if (marketplaceImpl.exists()) { classpath.add(marketplaceImpl.toURI().toURL()); } @@ -77,8 +78,8 @@ public class BootstrapClassLoaderUtil extends ClassUtilCore { if (installMarketplace) { try { List transformers = new SmartList<>(); - UrlClassLoader mpBootloader = UrlClassLoader.build().urls(mpBoot.toURI().toURL()).parent(BootstrapClassLoaderUtil.class.getClassLoader()).get(); - for (BytecodeTransformer transformer : ServiceLoader.load(BytecodeTransformer.class, mpBootloader)) { + UrlClassLoader spiLoader = UrlClassLoader.build().urls(mpBoot.toURI().toURL()).parent(BootstrapClassLoaderUtil.class.getClassLoader()).get(); + for (BytecodeTransformer transformer : ServiceLoader.load(BytecodeTransformer.class, spiLoader)) { transformers.add(transformer); } if (!transformers.isEmpty()) { @@ -87,8 +88,8 @@ public class BootstrapClassLoaderUtil extends ClassUtilCore { } catch (Throwable e) { // at this point logging is not initialized yet, so reporting the error directly - final String message = "As a workaround you may uninstall or update JetBrains Marketplace Support plugin at " + - new File(PathManager.getPluginsPath(), MARKETPLACE_PLUGIN_NAME).getAbsolutePath(); + String path = new File(PathManager.getPluginsPath(), MARKETPLACE_PLUGIN_DIR).getAbsolutePath(); + String message = "As a workaround, you may uninstall or update JetBrains Marketplace Support plugin at " + path; Main.showMessage("JetBrains Marketplace boot failure", new Exception(message, e)); } } @@ -277,7 +278,7 @@ public class BootstrapClassLoaderUtil extends ClassUtilCore { private byte[] doTransform(String name, ProtectionDomain protectionDomain, byte[] bytes) { byte[] b = bytes; for (BytecodeTransformer transformer : myTransformers) { - final byte[] result = transformer.transform(this, name, protectionDomain, b); + byte[] result = transformer.transform(this, name, protectionDomain, b); if (result != null) { b = result; }