mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+6
-1
@@ -178,6 +178,9 @@ public class CompilerReferenceServiceImpl extends CompilerReferenceService imple
|
||||
PsiModificationTracker.MODIFICATION_COUNT,
|
||||
this));
|
||||
}
|
||||
catch (ProcessCanceledException e) {
|
||||
throw e;
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOG.error("an exception during scope without code references calculation", e);
|
||||
return null;
|
||||
@@ -211,7 +214,6 @@ public class CompilerReferenceServiceImpl extends CompilerReferenceService imple
|
||||
if (!isServiceEnabledFor(aClass) || searchScope == LibraryScopeCache.getInstance(myProject).getLibrariesOnlyScope()) return null;
|
||||
|
||||
try {
|
||||
|
||||
Map<VirtualFile, Object[]> candidatesPerFile = ReadAction.compute(() -> {
|
||||
if (myProject.isDisposed()) throw new ProcessCanceledException();
|
||||
return CachedValuesManager.getCachedValue(aClass, () -> CachedValueProvider.Result.create(
|
||||
@@ -234,6 +236,9 @@ public class CompilerReferenceServiceImpl extends CompilerReferenceService imple
|
||||
}
|
||||
return new CompilerHierarchyInfoImpl(candidatesPerFile, aClass, dirtyScope, searchScope, myProject, searchFileType, searchType);
|
||||
}
|
||||
catch (ProcessCanceledException e) {
|
||||
throw e;
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOG.error("an exception during hierarchy calculation", e);
|
||||
return null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -43,7 +43,6 @@ import java.util.Collection;
|
||||
|
||||
public class RemoteConfiguration extends ModuleBasedConfiguration<JavaRunConfigurationModule>
|
||||
implements RunConfigurationWithSuppressedDefaultRunAction, RemoteRunProfile {
|
||||
|
||||
@Override
|
||||
public void writeExternal(final Element element) throws WriteExternalException {
|
||||
super.writeExternal(element);
|
||||
@@ -100,6 +99,4 @@ public class RemoteConfiguration extends ModuleBasedConfiguration<JavaRunConfigu
|
||||
public Collection<Module> getValidModules() {
|
||||
return getAllModules();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -20,6 +20,8 @@ import com.intellij.execution.application.ApplicationConfiguration;
|
||||
import com.intellij.execution.application.ApplicationConfigurationType;
|
||||
import com.intellij.execution.configurations.*;
|
||||
import com.intellij.execution.executors.DefaultRunExecutor;
|
||||
import com.intellij.execution.impl.RunManagerImpl;
|
||||
import com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl;
|
||||
import com.intellij.execution.junit.*;
|
||||
import com.intellij.execution.junit2.configuration.JUnitConfigurable;
|
||||
import com.intellij.execution.junit2.configuration.JUnitConfigurationModel;
|
||||
@@ -27,6 +29,7 @@ import com.intellij.execution.runners.ExecutionEnvironmentBuilder;
|
||||
import com.intellij.execution.testframework.SearchForTestsTask;
|
||||
import com.intellij.execution.testframework.TestSearchScope;
|
||||
import com.intellij.execution.ui.CommonJavaParametersPanel;
|
||||
import com.intellij.ide.util.AppPropertiesComponentImpl;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.options.Configurable;
|
||||
@@ -37,10 +40,7 @@ import com.intellij.openapi.roots.ContentEntry;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.roots.ModuleRootModificationUtil;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
@@ -67,6 +67,8 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class ConfigurationsTest extends BaseConfigurationTestCase {
|
||||
private final Assertion CHECK = new Assertion();
|
||||
|
||||
@@ -253,17 +255,22 @@ public class ConfigurationsTest extends BaseConfigurationTestCase {
|
||||
CHECK.singleOccurence(classPath, getFSPath(findFile(MOCK_JUNIT)));
|
||||
}
|
||||
|
||||
public void testExternalizeJUnitConfiguration() throws WriteExternalException, InvalidDataException {
|
||||
JUnitConfiguration configuration = createConfiguration(findTestA(getModule1()));
|
||||
Element element = new Element("cfg");
|
||||
configuration.writeExternal(element);
|
||||
JUnitConfiguration newCfg =
|
||||
new JUnitConfiguration(null, myProject, JUnitConfigurationType.getInstance().getConfigurationFactories()[0]);
|
||||
public void testExternalizeJUnitConfiguration() {
|
||||
Module module = getModule1();
|
||||
JUnitConfiguration oldRc = createConfiguration(findTestA(module));
|
||||
oldRc.setWorkingDirectory(module.getModuleFilePath());
|
||||
|
||||
newCfg.readExternal(element);
|
||||
checkTestObject(configuration.getPersistentData().TEST_OBJECT, newCfg);
|
||||
assertEquals(Collections.singleton(getModule1()), ContainerUtilRt.newHashSet(newCfg.getModules()));
|
||||
checkClassName(configuration.getPersistentData().getMainClassName(), newCfg);
|
||||
RunManagerImpl runManager = new RunManagerImpl(myProject, new AppPropertiesComponentImpl());
|
||||
Element element = new Element("configuration");
|
||||
new RunnerAndConfigurationSettingsImpl(runManager, oldRc, false).writeExternal(element);
|
||||
|
||||
RunnerAndConfigurationSettingsImpl settings = new RunnerAndConfigurationSettingsImpl(runManager);
|
||||
settings.readExternal(element);
|
||||
JUnitConfiguration newRc = (JUnitConfiguration)settings.getConfiguration();
|
||||
|
||||
checkTestObject(oldRc.getPersistentData().TEST_OBJECT, newRc);
|
||||
assertThat(newRc.getModules()).containsOnly(module);
|
||||
checkClassName(oldRc.getPersistentData().getMainClassName(), newRc);
|
||||
}
|
||||
|
||||
public void testTestClassPathWhenRunningConfigurations() throws IOException, ExecutionException {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -21,7 +21,6 @@ import com.intellij.execution.configurations.UnknownConfigurationType;
|
||||
import com.intellij.execution.junit.JUnitConfigurationType;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
import com.intellij.openapi.util.Trinity;
|
||||
import com.intellij.testFramework.LightIdeaTestCase;
|
||||
@@ -196,7 +195,7 @@ public class RunConfigurableTest extends LightIdeaTestCase {
|
||||
assertEquals(expected, myConfigurable.getAvailableDropPosition(direction));
|
||||
}
|
||||
|
||||
private static RunManagerImpl createRunManager(Element element) throws InvalidDataException {
|
||||
private static RunManagerImpl createRunManager(Element element) {
|
||||
Project project = getProject();
|
||||
RunManagerImpl runManager = new RunManagerImpl(project, PropertiesComponent.getInstance(project));
|
||||
runManager.initializeConfigurationTypes(new ConfigurationType[]{ApplicationConfigurationType.getInstance(),
|
||||
|
||||
@@ -31,6 +31,12 @@ public abstract class PathMacroMap {
|
||||
|
||||
public abstract String substitute(String text, boolean caseSensitive);
|
||||
|
||||
public final String substitute(String text, boolean caseSensitive, boolean recursively) {
|
||||
return recursively
|
||||
? substituteRecursively(text, caseSensitive)
|
||||
: substitute(text, caseSensitive);
|
||||
}
|
||||
|
||||
public final void substitute(@NotNull Element e, boolean caseSensitive) {
|
||||
substitute(e, caseSensitive, false);
|
||||
}
|
||||
|
||||
@@ -34,8 +34,6 @@ import java.util.List;
|
||||
* Date: Dec 7, 2004
|
||||
*/
|
||||
public interface InspectionProfile extends Comparable {
|
||||
void setName(@NotNull String name);
|
||||
|
||||
@NotNull
|
||||
String getName();
|
||||
|
||||
@@ -56,8 +54,7 @@ public interface InspectionProfile extends Comparable {
|
||||
InspectionProfileEntry getUnwrappedTool(@NotNull String shortName, @NotNull PsiElement element);
|
||||
|
||||
/** Returns (unwrapped) inspection */
|
||||
<T extends InspectionProfileEntry>
|
||||
T getUnwrappedTool(@NotNull Key<T> shortNameKey, @NotNull PsiElement element);
|
||||
<T extends InspectionProfileEntry> T getUnwrappedTool(@NotNull Key<T> shortNameKey, @NotNull PsiElement element);
|
||||
|
||||
/**
|
||||
* Allows a plugin to modify the settings of the inspection tool with the specified ID programmatically, without going through
|
||||
|
||||
@@ -13,42 +13,21 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.intellij.codeInspection;
|
||||
|
||||
import com.intellij.codeHighlighting.HighlightDisplayLevel;
|
||||
import com.intellij.codeInsight.daemon.HighlightDisplayKey;
|
||||
import com.intellij.codeInspection.ex.InspectionToolWrapper;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScope;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 15-Feb-2006
|
||||
*/
|
||||
public interface ModifiableModel extends InspectionProfile {
|
||||
void enableTool(@NotNull String inspectionTool, NamedScope namedScope, Project project);
|
||||
|
||||
void setErrorLevel(HighlightDisplayKey key, @NotNull HighlightDisplayLevel level, Project project);
|
||||
|
||||
@Override
|
||||
HighlightDisplayLevel getErrorLevel(HighlightDisplayKey inspectionToolKey, PsiElement element);
|
||||
|
||||
@Override
|
||||
boolean isToolEnabled(HighlightDisplayKey key);
|
||||
|
||||
@Override
|
||||
boolean isToolEnabled(@Nullable HighlightDisplayKey key, @Nullable PsiElement element);
|
||||
|
||||
@Override
|
||||
InspectionProfileEntry getUnwrappedTool(@NotNull String shortName, @NotNull PsiElement element);
|
||||
|
||||
@Override
|
||||
InspectionToolWrapper[] getInspectionTools(PsiElement element);
|
||||
|
||||
/**
|
||||
* @see InspectionProfile#getSingleTool()
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,7 @@ open class StateStorageManagerImpl(private val rootTagName: String,
|
||||
var streamProvider: StreamProvider?
|
||||
get() = streamWrapper
|
||||
set (value) {
|
||||
streamWrapper.setStreamProvider(value)
|
||||
streamWrapper.streamProvider = value
|
||||
}
|
||||
|
||||
// access under storageLock
|
||||
|
||||
@@ -22,6 +22,10 @@ public class StreamProviderWrapper implements StreamProvider {
|
||||
return null;
|
||||
}
|
||||
|
||||
public StreamProvider getStreamProvider() {
|
||||
return myStreamProvider;
|
||||
}
|
||||
|
||||
public void setStreamProvider(@Nullable StreamProvider streamProvider) {
|
||||
myStreamProvider = streamProvider;
|
||||
}
|
||||
|
||||
+19
-20
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -25,13 +25,13 @@ import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.util.xmlb.annotations.Property;
|
||||
import gnu.trove.THashSet;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -68,11 +68,11 @@ public abstract class ModuleBasedConfiguration<ConfigurationModule extends RunCo
|
||||
myModule.setModule(module);
|
||||
}
|
||||
|
||||
protected void readModule(final Element element) throws InvalidDataException {
|
||||
protected void readModule(final Element element) {
|
||||
myModule.readExternal(element);
|
||||
}
|
||||
|
||||
protected void writeModule(final Element element) throws WriteExternalException {
|
||||
protected void writeModule(final Element element) {
|
||||
myModule.writeExternal(element);
|
||||
}
|
||||
|
||||
@@ -99,12 +99,13 @@ public abstract class ModuleBasedConfiguration<ConfigurationModule extends RunCo
|
||||
RunConfiguration configuration = getFactory().createTemplateConfiguration(getProject());
|
||||
configuration.setName(getName());
|
||||
configuration.readExternal(element);
|
||||
|
||||
return (ModuleBasedConfiguration)configuration;
|
||||
} catch (InvalidDataException e) {
|
||||
}
|
||||
catch (InvalidDataException e) {
|
||||
LOG.error(e);
|
||||
return null;
|
||||
} catch (WriteExternalException e) {
|
||||
}
|
||||
catch (WriteExternalException e) {
|
||||
LOG.error(e);
|
||||
return null;
|
||||
}
|
||||
@@ -113,24 +114,22 @@ public abstract class ModuleBasedConfiguration<ConfigurationModule extends RunCo
|
||||
@Override
|
||||
@NotNull
|
||||
public Module[] getModules() {
|
||||
return ApplicationManager.getApplication().runReadAction(new Computable<Module[]>() {
|
||||
@Override
|
||||
@SuppressWarnings({"ConstantConditions"})
|
||||
public Module[] compute() {
|
||||
final Module module = getConfigurationModule().getModule();
|
||||
return module == null ? Module.EMPTY_ARRAY : new Module[] {module};
|
||||
}
|
||||
});
|
||||
Module module = ApplicationManager.getApplication().runReadAction((Computable<Module>)() -> getConfigurationModule().getModule());
|
||||
return module == null ? Module.EMPTY_ARRAY : new Module[] {module};
|
||||
}
|
||||
|
||||
public void restoreOriginalModule(final Module originalModule) {
|
||||
if (originalModule == null) return;
|
||||
final Module[] classModules = getModules();
|
||||
final Set<Module> modules = new HashSet<>();
|
||||
for (Module classModule : classModules) {
|
||||
if (originalModule == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Set<Module> modules = new THashSet<>();
|
||||
for (Module classModule : getModules()) {
|
||||
ModuleUtilCore.collectModulesDependsOn(classModule, modules);
|
||||
}
|
||||
if (modules.contains(originalModule)) setModule(originalModule);
|
||||
if (modules.contains(originalModule)) {
|
||||
setModule(originalModule);
|
||||
}
|
||||
}
|
||||
|
||||
public void onNewConfigurationCreated() {
|
||||
|
||||
+5
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -33,7 +33,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Standard base class for run configuration implementations.
|
||||
@@ -196,16 +195,15 @@ public abstract class RunConfigurationBase extends UserDataHolderBase implements
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
myLogFiles.clear();
|
||||
for (final Object o : element.getChildren(LOG_FILE)) {
|
||||
for (Element o : element.getChildren(LOG_FILE)) {
|
||||
LogFileOptions logFileOptions = new LogFileOptions();
|
||||
logFileOptions.readExternal((Element)o);
|
||||
logFileOptions.readExternal(o);
|
||||
myLogFiles.add(logFileOptions);
|
||||
}
|
||||
myPredefinedLogFiles.clear();
|
||||
final List list = element.getChildren(PREDEFINED_LOG_FILE_ELEMENT);
|
||||
for (Object fileElement : list) {
|
||||
for (Element fileElement : element.getChildren(PREDEFINED_LOG_FILE_ELEMENT)) {
|
||||
final PredefinedLogFile logFile = new PredefinedLogFile();
|
||||
logFile.readExternal((Element)fileElement);
|
||||
logFile.readExternal(fileElement);
|
||||
myPredefinedLogFiles.add(logFile);
|
||||
}
|
||||
final Element fileOutputElement = element.getChild(FILE_OUTPUT);
|
||||
|
||||
+5
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -55,7 +55,6 @@ public class RunConfigurationModule implements JDOMExternalizable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void readExternal(@NotNull Element element) {
|
||||
List<Element> modules = element.getChildren(ELEMENT);
|
||||
if (!modules.isEmpty()) {
|
||||
@@ -97,7 +96,8 @@ public class RunConfigurationModule implements JDOMExternalizable {
|
||||
@Nullable
|
||||
@Transient
|
||||
public Module getModule() {
|
||||
if (myModuleName != null) { //caching
|
||||
//caching
|
||||
if (myModuleName != null) {
|
||||
myModule = findModule(myModuleName);
|
||||
}
|
||||
if (myModule != null && myModule.isDisposed()) {
|
||||
@@ -107,18 +107,11 @@ public class RunConfigurationModule implements JDOMExternalizable {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Module findModule(final String moduleName) {
|
||||
public Module findModule(@NotNull String moduleName) {
|
||||
if (myProject.isDisposed()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ApplicationManager.getApplication().runReadAction(new Computable<Module>() {
|
||||
@Nullable
|
||||
@Override
|
||||
public Module compute() {
|
||||
return getModuleManager().findModuleByName(moduleName);
|
||||
}
|
||||
});
|
||||
return ApplicationManager.getApplication().runReadAction((Computable<Module>)() -> getModuleManager().findModuleByName(moduleName));
|
||||
}
|
||||
|
||||
public void setModule(final Module module) {
|
||||
|
||||
@@ -22,8 +22,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
* alignment object instance from the <code>getAlignment</code> method
|
||||
* are aligned with each other.
|
||||
*
|
||||
* @see com.intellij.formatting.Block#getAlignment()
|
||||
* @see com.intellij.formatting.ChildAttributes#getAlignment()
|
||||
* @see Block#getAlignment()
|
||||
* @see ChildAttributes#getAlignment()
|
||||
*/
|
||||
|
||||
public abstract class Alignment {
|
||||
@@ -36,23 +36,10 @@ public abstract class Alignment {
|
||||
myFactory = factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shorthand for calling {@link #createAlignment(boolean)} with <code>'false'</code>.
|
||||
*
|
||||
* @return alignment object with default settings
|
||||
*/
|
||||
public static Alignment createAlignment() {
|
||||
return createAlignment(false, Anchor.LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delegates the processing to {@link #createAlignment(boolean, Anchor)} with given <code>'allow backward shift'</code> value
|
||||
* and {@link Anchor#LEFT}.
|
||||
*
|
||||
* @param allowBackwardShift flag that specifies if former aligned block may be shifted to right in order to align to subsequent
|
||||
* aligned block
|
||||
* @return alignment object with the given <code>'allow backward shift'</code> setting
|
||||
*/
|
||||
public static Alignment createAlignment(boolean allowBackwardShift) {
|
||||
return createAlignment(allowBackwardShift, Anchor.LEFT);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -22,7 +22,7 @@ import org.jdom.Element;
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class RunConfigurationPathMacroFilter extends PathMacroFilter {
|
||||
class RunConfigurationPathMacroFilter extends PathMacroFilter {
|
||||
@Override
|
||||
public boolean skipPathMacros(Attribute attribute) {
|
||||
final Element parent = attribute.getParent();
|
||||
|
||||
@@ -20,12 +20,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Gof Template Method for {@link BlockAlignmentProcessor}.
|
||||
*
|
||||
* @author Denis Zhdanov
|
||||
* @since 4/29/11 11:52 AM
|
||||
*/
|
||||
public abstract class AbstractBlockAlignmentProcessor implements BlockAlignmentProcessor {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,20 +33,10 @@ public class AlignmentImpl extends Alignment {
|
||||
private AlignmentImpl myParentAlignment;
|
||||
private ProbablyIncreasingLowerboundAlgorithm<LeafBlockWrapper> myOffsetRespBlocksCalculator;
|
||||
|
||||
/**
|
||||
* Creates new <code>AlignmentImpl</code> object with <code>'false'</code> as <code>'allows backward shift'</code> argument flag.
|
||||
*/
|
||||
AlignmentImpl() {
|
||||
this(false, Anchor.LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new <code>AlignmentImpl</code> object with the given <code>'allows backward shift'</code> argument flag.
|
||||
*
|
||||
* @param allowBackwardShift flag that indicates if it should be possible to shift former aligned block to right
|
||||
* in order to align to subsequent aligned block (see {@link Alignment#createAlignment(boolean, Anchor)})
|
||||
* @param anchor alignment anchor (see {@link Alignment#createAlignment(boolean, Anchor)})
|
||||
*/
|
||||
AlignmentImpl(boolean allowBackwardShift, @NotNull Anchor anchor) {
|
||||
myAllowBackwardShift = allowBackwardShift;
|
||||
myAnchor = anchor;
|
||||
|
||||
@@ -263,6 +263,10 @@ public class Notification {
|
||||
}
|
||||
|
||||
public void expire() {
|
||||
if (myExpired) {
|
||||
return;
|
||||
}
|
||||
|
||||
NotificationsManager.getNotificationsManager().expire(this);
|
||||
hideBalloon();
|
||||
myExpired = true;
|
||||
|
||||
+2
-1
@@ -265,12 +265,13 @@ public class NotificationsManagerImpl extends NotificationsManager {
|
||||
}
|
||||
final Balloon balloon = createBalloon((IdeFrame)window, notification, false, false, layoutDataRef,
|
||||
project != null ? project : ApplicationManager.getApplication());
|
||||
((BalloonImpl)balloon).traceDispose(true);
|
||||
|
||||
if (notification.isExpired()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
((BalloonImpl)balloon).traceDispose(true);
|
||||
|
||||
layout.add(balloon, layoutDataRef == null ? null : layoutDataRef.get());
|
||||
if (layoutDataRef != null && layoutDataRef.get() instanceof BalloonLayoutData) {
|
||||
((BalloonLayoutData)layoutDataRef.get()).project = project;
|
||||
|
||||
@@ -157,8 +157,10 @@ public class ModuleUtilCore {
|
||||
* @param result resulted set
|
||||
*/
|
||||
public static void collectModulesDependsOn(@NotNull final Module module, @NotNull Set<Module> result) {
|
||||
if (result.contains(module)) return;
|
||||
result.add(module);
|
||||
if (!result.add(module)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final ModuleManager moduleManager = ModuleManager.getInstance(module.getProject());
|
||||
final List<Module> dependentModules = moduleManager.getModuleDependentModules(module);
|
||||
for (final Module dependentModule : dependentModules) {
|
||||
@@ -169,7 +171,8 @@ public class ModuleUtilCore {
|
||||
if (orderEntry.getModule() == module) {
|
||||
if (orderEntry.isExported()) {
|
||||
collectModulesDependsOn(dependentModule, result);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
result.add(dependentModule);
|
||||
}
|
||||
break;
|
||||
|
||||
+1
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -19,7 +19,6 @@ import com.intellij.openapi.components.PathMacroMap;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.ContainerUtilRt;
|
||||
import gnu.trove.TObjectIntHashMap;
|
||||
@@ -28,7 +27,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
+4
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -15,20 +15,13 @@
|
||||
*/
|
||||
package com.intellij.openapi.components;
|
||||
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class PathMacroManager implements PathMacroSubstitutor {
|
||||
public static PathMacroManager getInstance(@NotNull ComponentManager componentManager) {
|
||||
final PathMacroManager component = (PathMacroManager)componentManager.getPicoContainer().getComponentInstance(PathMacroManager.class);
|
||||
assert component != null;
|
||||
return component;
|
||||
}
|
||||
|
||||
public abstract void collapsePathsRecursively(@NotNull Element element);
|
||||
|
||||
@NotNull
|
||||
public abstract String collapsePathsRecursively(@NotNull String text);
|
||||
public static PathMacroManager getInstance(@NotNull ComponentManager componentManager) {
|
||||
return (PathMacroManager)componentManager.getPicoContainer().getComponentInstance(PathMacroManager.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public abstract TrackingPathMacroSubstitutor createTrackingSubstitutor();
|
||||
|
||||
+28
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -17,14 +17,38 @@ package com.intellij.openapi.components;
|
||||
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface PathMacroSubstitutor {
|
||||
String expandPath(String path);
|
||||
|
||||
String collapsePath(@Nullable String path);
|
||||
@NotNull
|
||||
default String collapsePath(@NotNull String text) {
|
||||
return collapsePath(text, false);
|
||||
}
|
||||
|
||||
String collapsePath(@NotNull String text, boolean recursively);
|
||||
|
||||
void expandPaths(@NotNull Element element);
|
||||
|
||||
void collapsePaths(@NotNull Element element);
|
||||
/**
|
||||
* Path will be collapsed only if the entire content of an attribute (tag text) is a path, if a path is a substring of an attribute value it won't be collapsed.
|
||||
* @param element
|
||||
*/
|
||||
default void collapsePaths(@NotNull Element element) {
|
||||
collapsePaths(element, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Path will be collapsed even if a path is a substring of an attribute value.
|
||||
* @param element
|
||||
*/
|
||||
default void collapsePathsRecursively(@NotNull Element element) {
|
||||
collapsePaths(element, true);
|
||||
}
|
||||
|
||||
void collapsePaths(@NotNull Element element, boolean recursively);
|
||||
|
||||
default String collapsePathsRecursively(@NotNull String string) {
|
||||
return collapsePath(string, true);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-18
@@ -131,20 +131,10 @@ public class BasePathMacroManager extends PathMacroManager {
|
||||
return getExpandMacroMap().substitute(path, SystemInfo.isFileSystemCaseSensitive);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String collapsePath(@Nullable String path) {
|
||||
return getReplacePathMap().substitute(path, SystemInfo.isFileSystemCaseSensitive);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collapsePathsRecursively(@NotNull final Element element) {
|
||||
getReplacePathMap().substitute(element, SystemInfo.isFileSystemCaseSensitive, true);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String collapsePathsRecursively(@NotNull final String text) {
|
||||
return getReplacePathMap().substituteRecursively(text, SystemInfo.isFileSystemCaseSensitive);
|
||||
public String collapsePath(@NotNull final String text, boolean recursively) {
|
||||
return getReplacePathMap().substitute(text, SystemInfo.isFileSystemCaseSensitive, recursively);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -153,8 +143,8 @@ public class BasePathMacroManager extends PathMacroManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collapsePaths(@NotNull final Element element) {
|
||||
getReplacePathMap().substitute(element, SystemInfo.isFileSystemCaseSensitive);
|
||||
public void collapsePaths(@NotNull final Element element, boolean recursively) {
|
||||
getReplacePathMap().substitute(element, SystemInfo.isFileSystemCaseSensitive, recursively);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -185,8 +175,8 @@ public class BasePathMacroManager extends PathMacroManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String collapsePath(@Nullable String path) {
|
||||
return getReplacePathMap().substitute(path, SystemInfo.isFileSystemCaseSensitive);
|
||||
public String collapsePath(@Nullable String path, boolean recursively) {
|
||||
return getReplacePathMap().substitute(path, SystemInfo.isFileSystemCaseSensitive, recursively);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,8 +185,8 @@ public class BasePathMacroManager extends PathMacroManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collapsePaths(@NotNull final Element element) {
|
||||
getReplacePathMap().substitute(element, SystemInfo.isFileSystemCaseSensitive, false, Holder.FILTER);
|
||||
public void collapsePaths(@NotNull final Element element, boolean recursively) {
|
||||
getReplacePathMap().substitute(element, SystemInfo.isFileSystemCaseSensitive, recursively, Holder.FILTER);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
|
||||
@@ -351,8 +351,7 @@ public class JUnitConfiguration extends JavaTestConfigurationBase {
|
||||
final Element patternsElement = element.getChild(PATTERNS_EL_NAME);
|
||||
if (patternsElement != null) {
|
||||
final LinkedHashSet<String> tests = new LinkedHashSet<>();
|
||||
for (Object o : patternsElement.getChildren(PATTERN_EL_NAME)) {
|
||||
Element patternElement = (Element)o;
|
||||
for (Element patternElement : patternsElement.getChildren(PATTERN_EL_NAME)) {
|
||||
tests.add(patternElement.getAttributeValue(TEST_CLASS_ATT_NAME));
|
||||
}
|
||||
myData.setPatterns(tests);
|
||||
|
||||
+3
-1
@@ -46,7 +46,9 @@ public final class DataBindingWizardAction extends AnAction{
|
||||
final Project project;
|
||||
final VirtualFile formFile;
|
||||
GuiEditor editor = FormEditingUtil.getActiveEditor(e.getDataContext());
|
||||
assert editor != null;
|
||||
if (editor == null) {
|
||||
return;
|
||||
}
|
||||
project = editor.getProject();
|
||||
formFile = editor.getFile();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user