From 3c97e2381f0dcbe9ea598daaa1c80fd9e6b9f39b Mon Sep 17 00:00:00 2001 From: Oleg Sukhodolsky Date: Mon, 23 Feb 2015 09:06:22 +0300 Subject: [PATCH 1/8] temporary reverting fix for IDEA-136763 Need to provide at least one implementation for the ext point to avoid IAE --- .../sm/runner/ui/SMTRunnerNotificationsHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerNotificationsHandler.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerNotificationsHandler.java index 7b4a539a4721..b8e276354945 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerNotificationsHandler.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerNotificationsHandler.java @@ -99,7 +99,8 @@ public class SMTRunnerNotificationsHandler extends SMTRunnerEventsAdapter { type = null; } - TestStatusListener.notifySuiteFinished(testsRoot, myConsoleProperties.getProject()); + // todo: need to provide default implementation before notifying test status listeners to avoid IAE + //TestStatusListener.notifySuiteFinished(testsRoot, myConsoleProperties.getProject()); if (msg != null) { notify(msg, type, testsRoot); From dde5c62b039c6a10d1ae07f4efde0c880f2cf82a Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 23 Feb 2015 07:25:07 +0100 Subject: [PATCH 2/8] should be trimTrailingSlashes --- .../debugger/sourcemap/SourceMapDecoder.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java index 397e04ef9f59..cf4d40ab9eb7 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.jetbrains.debugger.sourcemap; import com.google.gson.stream.JsonToken; @@ -98,7 +113,7 @@ public final class SourceMapDecoder { else if (propertyName.equals("sourceRoot")) { sourceRoot = readSourcePath(reader); if (sourceRoot != null) { - sourceRoot = UriUtil.trimLeadingSlashes(sourceRoot); + sourceRoot = UriUtil.trimTrailingSlashes(sourceRoot); } } else if (propertyName.equals("sources")) { From 81cc78393f8efee915b579474addbf4f01217da6 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 23 Feb 2015 07:41:06 +0100 Subject: [PATCH 3/8] load defaults for LanguageInjectionConfiguration --- .../openapi/components/impl/stores/ComponentStoreImpl.java | 5 +++++ .../src/org/intellij/plugins/intelliLang/Configuration.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java index 5e78e340a581..fef8f4f8bac6 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java @@ -281,6 +281,11 @@ public abstract class ComponentStoreImpl implements IComponentStore.Reloadable { } Class stateClass = ComponentSerializationUtil.getStateClass(component.getClass()); + // todo remove assert before last EAP + if (!stateSpec.defaultStateAsResource() && getDefaultState(component, name, stateClass) != null) { + LOG.error(name + " has default state, but not marked to load it"); + } + T state = stateSpec.defaultStateAsResource() ? getDefaultState(component, name, stateClass) : null; Storage[] storageSpecs = getComponentStorageSpecs(component, stateSpec, StateStorageOperation.READ); for (Storage storageSpec : storageSpecs) { diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java index b2bfefce47e6..a2d910570ae5 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java @@ -76,6 +76,7 @@ public class Configuration extends SimpleModificationTracker implements Persiste @State( name = Configuration.COMPONENT_NAME, + defaultStateAsResource = true, storages = {@Storage(file = StoragePathMacros.APP_CONFIG + "/IntelliLang.xml", scheme = StorageScheme.DIRECTORY_BASED)}) public static class App extends Configuration { @@ -110,6 +111,7 @@ public class Configuration extends SimpleModificationTracker implements Persiste return getState(element); } } + @State( name = Configuration.COMPONENT_NAME, storages = { From 9856395be237181b62bd7a1bcdfb861d37e775e5 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 23 Feb 2015 09:22:44 +0100 Subject: [PATCH 4/8] cleanup --- .../codeInsight/template/impl/TemplateSettings.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSettings.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSettings.java index c7c05dc68d74..3f644c04fd39 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSettings.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSettings.java @@ -452,12 +452,10 @@ public class TemplateSettings implements PersistentStateComponent Date: Mon, 23 Feb 2015 09:29:48 +0100 Subject: [PATCH 5/8] Prj requires defaults --- .../src/org/intellij/plugins/intelliLang/Configuration.java | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java index a2d910570ae5..8db552b12ee6 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java @@ -114,6 +114,7 @@ public class Configuration extends SimpleModificationTracker implements Persiste @State( name = Configuration.COMPONENT_NAME, + defaultStateAsResource = true, storages = { @Storage(file = StoragePathMacros.PROJECT_FILE), @Storage(file = StoragePathMacros.PROJECT_CONFIG_DIR + "/IntelliLang.xml", scheme = StorageScheme.DIRECTORY_BASED) From bcf9306f1b82bef76372c171581a23fee41d9161 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 23 Feb 2015 09:32:50 +0100 Subject: [PATCH 6/8] Palette2 defaults --- .../ui-designer/src/com/intellij/uiDesigner/palette/Palette.java | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/palette/Palette.java b/plugins/ui-designer/src/com/intellij/uiDesigner/palette/Palette.java index abe744594ca7..4627efd195f0 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/palette/Palette.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/palette/Palette.java @@ -65,6 +65,7 @@ import java.util.Map; */ @State( name = "Palette2", + defaultStateAsResource = true, storages = { @Storage(file = StoragePathMacros.PROJECT_FILE), @Storage(file = StoragePathMacros.PROJECT_CONFIG_DIR + "/uiDesigner.xml", scheme = StorageScheme.DIRECTORY_BASED) From e3d0a83c8cecf7076a7d5bc889dbf79a116fbf87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Mon, 23 Feb 2015 10:51:21 +0100 Subject: [PATCH 7/8] InspectionValidator#getProcessingItems: make sure to run in smart mode (EA-63972) [r=peter] --- .../util/InspectionValidatorWrapper.java | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/openapi/compiler/util/InspectionValidatorWrapper.java b/java/compiler/impl/src/com/intellij/openapi/compiler/util/InspectionValidatorWrapper.java index 4868321f9ca2..9d34478d9e53 100644 --- a/java/compiler/impl/src/com/intellij/openapi/compiler/util/InspectionValidatorWrapper.java +++ b/java/compiler/impl/src/com/intellij/openapi/compiler/util/InspectionValidatorWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -29,13 +29,11 @@ import com.intellij.lang.annotation.AnnotationSession; import com.intellij.lang.annotation.ExternalAnnotator; import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.application.ReadAction; -import com.intellij.openapi.application.ReadActionProcessor; -import com.intellij.openapi.application.Result; import com.intellij.openapi.compiler.*; import com.intellij.openapi.compiler.options.ExcludesConfiguration; import com.intellij.openapi.editor.Document; import com.intellij.openapi.module.Module; +import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Computable; import com.intellij.openapi.vfs.VirtualFile; @@ -143,41 +141,41 @@ public class InspectionValidatorWrapper implements Validator { return ProcessingItem.EMPTY_ARRAY; } final ExcludesConfiguration excludesConfiguration = ValidationConfiguration.getExcludedEntriesConfiguration(project); - final List items = new ReadAction>() { - @Override - protected void run(final Result> result) { - final CompileScope compileScope = context.getCompileScope(); - if (!myValidator.isAvailableOnScope(compileScope)) return; + final List items = + DumbService.getInstance(project).runReadActionInSmartMode(new Computable>() { + @Override + public List compute() { + final CompileScope compileScope = context.getCompileScope(); + if (!myValidator.isAvailableOnScope(compileScope)) return null; - final ArrayList items = new ArrayList(); + final ArrayList items = new ArrayList(); - final Processor processor = new ReadActionProcessor() { - @Override - public boolean processInReadAction(VirtualFile file) { - if (!file.isValid()) { - return true; - } - - if (myCompilerManager.isExcludedFromCompilation(file) || - excludesConfiguration.isExcluded(file)) { - return true; - } - - final Module module = context.getModuleByFile(file); - if (module != null) { - final PsiFile psiFile = myPsiManager.findFile(file); - if (psiFile != null) { - items.add(new MyValidatorProcessingItem(psiFile)); + final Processor processor = new Processor() { + @Override + public boolean process(VirtualFile file) { + if (!file.isValid()) { + return true; } - } - return true; - } - }; - ContainerUtil.process(myValidator.getFilesToProcess(myPsiManager.getProject(), context), processor); - result.setResult(items); - } - }.execute().getResultObject(); + if (myCompilerManager.isExcludedFromCompilation(file) || + excludesConfiguration.isExcluded(file)) { + return true; + } + + final Module module = context.getModuleByFile(file); + if (module != null) { + final PsiFile psiFile = myPsiManager.findFile(file); + if (psiFile != null) { + items.add(new MyValidatorProcessingItem(psiFile)); + } + } + return true; + } + }; + ContainerUtil.process(myValidator.getFilesToProcess(myPsiManager.getProject(), context), processor); + return items; + } + }); if (items == null) return ProcessingItem.EMPTY_ARRAY; return items.toArray(new ProcessingItem[items.size()]); From f64efe9dcc2634d05173890caac6dc257d218390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Mon, 23 Feb 2015 11:05:37 +0100 Subject: [PATCH 8/8] PatternPackageReferenceSet: cleanup, copyright, linked Set --- .../providers/PatternPackageReferenceSet.java | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PatternPackageReferenceSet.java b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PatternPackageReferenceSet.java index 392cacfb2ac9..ef1085f32bb6 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PatternPackageReferenceSet.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PatternPackageReferenceSet.java @@ -1,19 +1,35 @@ +/* + * Copyright 2000-2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.psi.impl.source.resolve.reference.impl.providers; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiPackage; -import com.intellij.psi.impl.source.resolve.reference.impl.providers.PackageReferenceSet; import com.intellij.util.PatternUtil; import com.intellij.util.Processor; +import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.Set; import java.util.regex.Pattern; public class PatternPackageReferenceSet extends PackageReferenceSet { + public PatternPackageReferenceSet(String packageName, PsiElement element, int startInElement) { super(packageName, element, startInElement); } @@ -24,7 +40,7 @@ public class PatternPackageReferenceSet extends PackageReferenceSet { if (packageName.contains("*")) { final Pattern pattern = PatternUtil.fromMask(packageName); - final Set packages = new HashSet(); + final Set packages = new LinkedHashSet(); processSubPackages(context, new Processor() { @Override @@ -39,16 +55,13 @@ public class PatternPackageReferenceSet extends PackageReferenceSet { return packages; } - else { - return super.resolvePackageName(context, packageName); - } + + return super.resolvePackageName(context, packageName); } - protected static boolean processSubPackages(final PsiPackage pkg, final Processor processor) { + protected static boolean processSubPackages(final PsiPackage pkg, final Processor processor) { if (!processor.process(pkg)) return false; - for (final PsiPackage aPackage : pkg.getSubPackages()) { - if (!processSubPackages(aPackage, processor)) return false; - } - return true; + + return ContainerUtil.process(pkg.getSubPackages(), processor); } }