diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/elements/PackagingElementFactoryImpl.java b/java/compiler/impl/src/com/intellij/packaging/impl/elements/PackagingElementFactoryImpl.java index 5077c2a61e7d..cf2b3e8425fc 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/elements/PackagingElementFactoryImpl.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/elements/PackagingElementFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -115,7 +115,7 @@ public class PackagingElementFactoryImpl extends PackagingElementFactory { @Override public PackagingElementType[] getAllElementTypes() { final PackagingElementType[] types = Extensions.getExtensions(PackagingElementType.EP_NAME); - return ArrayUtil.mergeArrays(STANDARD_TYPES, types, PackagingElementType.class); + return ArrayUtil.mergeArrays(STANDARD_TYPES, types); } @NotNull diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibrariesContainerFactory.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibrariesContainerFactory.java index 0cf59d85a72f..762e1d0219e3 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibrariesContainerFactory.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibrariesContainerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -140,11 +140,11 @@ public class LibrariesContainerFactory { Library[] libraries = getLibraries(LibraryLevel.GLOBAL); Library[] projectLibraries = getLibraries(LibraryLevel.PROJECT); if (projectLibraries.length > 0) { - libraries = ArrayUtil.mergeArrays(libraries, projectLibraries, Library.class); + libraries = ArrayUtil.mergeArrays(libraries, projectLibraries); } Library[] moduleLibraries = getLibraries(LibraryLevel.MODULE); if (moduleLibraries.length > 0) { - libraries = ArrayUtil.mergeArrays(libraries, moduleLibraries, Library.class); + libraries = ArrayUtil.mergeArrays(libraries, moduleLibraries); } return libraries; } diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/OverrideImplementUtil.java b/java/java-impl/src/com/intellij/codeInsight/generation/OverrideImplementUtil.java index ad680c89e773..54dbcecea156 100644 --- a/java/java-impl/src/com/intellij/codeInsight/generation/OverrideImplementUtil.java +++ b/java/java-impl/src/com/intellij/codeInsight/generation/OverrideImplementUtil.java @@ -530,7 +530,7 @@ public class OverrideImplementUtil { if (candidates.isEmpty() && secondary.isEmpty()) return null; final PsiMethodMember[] onlyPrimary = convertToMethodMembers(candidates); - final PsiMethodMember[] all = ArrayUtil.mergeArrays(onlyPrimary, convertToMethodMembers(secondary), PsiMethodMember.class); + final PsiMethodMember[] all = ArrayUtil.mergeArrays(onlyPrimary, convertToMethodMembers(secondary)); final String toMerge = PropertiesComponent.getInstance(project).getValue(PROP_COMBINED_OVERRIDE_IMPLEMENT); final Ref merge = Ref.create(!"false".equals(toMerge)); diff --git a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java index 3ed96d076be0..8436fe8d2ef6 100644 --- a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java +++ b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java @@ -1289,7 +1289,7 @@ public class JavaDocInfoGenerator { PsiDocTag[] tags1 = comment.findTagsByName(THROWS_KEYWORD); PsiDocTag[] tags2 = comment.findTagsByName("exception"); - return ArrayUtil.mergeArrays(tags1, tags2, PsiDocTag.class); + return ArrayUtil.mergeArrays(tags1, tags2); } private static boolean areWeakEqual(String one, String two) { diff --git a/java/java-impl/src/com/intellij/openapi/module/JavaModuleType.java b/java/java-impl/src/com/intellij/openapi/module/JavaModuleType.java index 869dc6e7a891..e8f68b15b606 100644 --- a/java/java-impl/src/com/intellij/openapi/module/JavaModuleType.java +++ b/java/java-impl/src/com/intellij/openapi/module/JavaModuleType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -80,7 +80,7 @@ public class JavaModuleType extends ModuleType { steps.add(supportForFrameworksStep); } final ModuleWizardStep[] wizardSteps = steps.toArray(new ModuleWizardStep[steps.size()]); - return ArrayUtil.mergeArrays(wizardSteps, super.createWizardSteps(wizardContext, moduleBuilder, modulesProvider), ModuleWizardStep.class); + return ArrayUtil.mergeArrays(wizardSteps, super.createWizardSteps(wizardContext, moduleBuilder, modulesProvider)); } private static class IconHolder { diff --git a/java/java-impl/src/com/intellij/psi/impl/source/JavaStubPsiElement.java b/java/java-impl/src/com/intellij/psi/impl/source/JavaStubPsiElement.java index ee095f14588e..b56e4e71e4ff 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/JavaStubPsiElement.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/JavaStubPsiElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -39,6 +39,7 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public abstract class JavaStubPsiElement extends StubBasedPsiElementBase implements StubBasedPsiElement { private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.JavaStubPsiElement"); @@ -84,7 +85,7 @@ public abstract class JavaStubPsiElement extends StubBase return SourceTreeToPsiMap.treeElementToPsi(elementCopy); } - public PsiElement addAfter(@NotNull PsiElement element, PsiElement anchor) throws IncorrectOperationException { + public PsiElement addAfter(@NotNull PsiElement element, @Nullable PsiElement anchor) throws IncorrectOperationException { CheckUtil.checkWritable(this); TreeElement elementCopy = ChangeUtil.copyToElement(element); calcTreeElement().addInternal(elementCopy, elementCopy, SourceTreeToPsiMap.psiElementToTree(anchor), Boolean.FALSE); diff --git a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportHelper.java b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportHelper.java index 1b89fab7844d..e13b9b2ad21a 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportHelper.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -673,7 +673,7 @@ public class ImportHelper{ final JspFile jspFile = JspPsiUtil.getJspFile(file); collectNamesToImport(names, comments, file, jspFile); if (jspFile != null) { - PsiFile[] files = ArrayUtil.mergeArrays(JspSpiUtil.getIncludingFiles(jspFile), JspSpiUtil.getIncludedFiles(jspFile), PsiFile.class); + PsiFile[] files = ArrayUtil.mergeArrays(JspSpiUtil.getIncludingFiles(jspFile), JspSpiUtil.getIncludedFiles(jspFile)); for (PsiFile includingFile : files) { final PsiFile javaRoot = includingFile.getViewProvider().getPsi(StdLanguages.JAVA); if (javaRoot instanceof PsiJavaFile && file != javaRoot) { diff --git a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/JavaCodeStyleManagerImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/JavaCodeStyleManagerImpl.java index b14a608ef745..aa194e3e748f 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/JavaCodeStyleManagerImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/JavaCodeStyleManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -723,7 +723,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager { if (SET_PREFIX.equals(firstWord)) { final String propertyName = methodName.substring(firstWord.length()); final String[] setterNames = getSuggestionsByName(propertyName, variableKind, false, correctKeywords); - names = ArrayUtil.mergeArrays(names, setterNames, String.class); + names = ArrayUtil.mergeArrays(names, setterNames); } } } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassReference.java b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassReference.java index 62b462cb90fa..96f8d8761ac2 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassReference.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -231,7 +231,7 @@ public class JavaClassReference extends GenericReference implements PsiJavaRefer final PsiClass aClass = (PsiClass)context; if (myInStaticImport) { - return ArrayUtil.mergeArrays(aClass.getInnerClasses(), aClass.getFields(), Object.class); + return ArrayUtil.mergeArrays(aClass.getInnerClasses(), aClass.getFields()); } else if (isDefinitelyStatic()) { final PsiClass[] psiClasses = aClass.getInnerClasses(); diff --git a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassReferenceSet.java b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassReferenceSet.java index 853b381b4b54..9dec07075f40 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassReferenceSet.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassReferenceSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -208,7 +208,7 @@ public class JavaClassReferenceSet { JavaClassReference[] result = myReferences; if (myNestedGenericParameterReferences != null) { for(JavaClassReferenceSet set:myNestedGenericParameterReferences) { - result = ArrayUtil.mergeArrays(result, set.getAllReferences(),JavaClassReference.class); + result = ArrayUtil.mergeArrays(result, set.getAllReferences()); } } return result; diff --git a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PathListReferenceProvider.java b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PathListReferenceProvider.java index 70ef04124594..6a2adb548ada 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PathListReferenceProvider.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PathListReferenceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -60,13 +60,13 @@ public class PathListReferenceProvider extends PsiReferenceProviderBase { if (nextPos == -1) { PsiReference[] refs = createReferences(element, s.substring(pos + 1), pos + offset + 1, false); - result = ArrayUtil.mergeArrays(result, refs, PsiReference.class); + result = ArrayUtil.mergeArrays(result, refs); break; } else { PsiReference[] refs = createReferences(element, s.substring(pos + 1, nextPos), pos + offset + 1, false); - result = ArrayUtil.mergeArrays(result, refs, PsiReference.class); + result = ArrayUtil.mergeArrays(result, refs); pos = nextPos; } } diff --git a/java/java-impl/src/com/intellij/util/xml/CanonicalPsiTypeConverterImpl.java b/java/java-impl/src/com/intellij/util/xml/CanonicalPsiTypeConverterImpl.java index 4e0a7e42e94a..35a77d781ece 100644 --- a/java/java-impl/src/com/intellij/util/xml/CanonicalPsiTypeConverterImpl.java +++ b/java/java-impl/src/com/intellij/util/xml/CanonicalPsiTypeConverterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -101,7 +101,7 @@ public class CanonicalPsiTypeConverterImpl extends CanonicalPsiTypeConverter imp public Object[] getVariants() { final Object[] variants = super.getVariants(); if (myIndex == 0) { - return ArrayUtil.mergeArrays(variants, PRIMITIVES, Object.class); + return ArrayUtil.mergeArrays(variants, PRIMITIVES); } return variants; } diff --git a/platform/core-api/src/com/intellij/psi/search/GlobalSearchScope.java b/platform/core-api/src/com/intellij/psi/search/GlobalSearchScope.java index d5c664fac9b3..02b56b91e8a0 100644 --- a/platform/core-api/src/com/intellij/psi/search/GlobalSearchScope.java +++ b/platform/core-api/src/com/intellij/psi/search/GlobalSearchScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -415,7 +415,7 @@ public abstract class GlobalSearchScope extends SearchScope implements ProjectAw if (scope instanceof FileTypeRestrictionScope) { FileTypeRestrictionScope restrict = (FileTypeRestrictionScope)scope; if (restrict.myBaseScope == myBaseScope) { - return new FileTypeRestrictionScope(myBaseScope, ArrayUtil.mergeArrays(myFileTypes, restrict.myFileTypes, FileType.class)); + return new FileTypeRestrictionScope(myBaseScope, ArrayUtil.mergeArrays(myFileTypes, restrict.myFileTypes)); } } return super.uniteWith(scope); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternAction.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternAction.java index 1d769b8e8e2b..69e0a1e942d0 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternAction.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2011 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.codeInsight.generation; import com.intellij.openapi.actionSystem.AnAction; @@ -26,7 +41,7 @@ public class GenerateByPatternAction extends AnAction { PatternProvider[] extensions = Extensions.getExtensions(PatternProvider.EXTENSION_POINT_NAME); for (PatternProvider extension : extensions) { if (extension.isAvailable(e.getDataContext())) { - patterns = ArrayUtil.mergeArrays(patterns, extension.getDescriptors(), PatternDescriptor.class); + patterns = ArrayUtil.mergeArrays(patterns, extension.getDescriptors()); } } GenerateByPatternDialog dialog = new GenerateByPatternDialog(e.getProject(), patterns, e.getDataContext()); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/DescriptorProviderInspection.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/DescriptorProviderInspection.java index 9793b0bf9aed..396f22337928 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/DescriptorProviderInspection.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/DescriptorProviderInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -73,7 +73,7 @@ public abstract class DescriptorProviderInspection extends InspectionTool implem problems = descriptions; } else { - problems = ArrayUtil.mergeArrays(problems, descriptions, CommonProblemDescriptor.class); + problems = ArrayUtil.mergeArrays(problems, descriptions); } getProblemElements().put(refElement, problems); for (CommonProblemDescriptor description : descriptions) { diff --git a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java index 81804af6ad67..8a96f66f9fe9 100644 --- a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java +++ b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -37,7 +37,6 @@ import com.intellij.util.ArrayUtil; import com.intellij.util.Function; import com.intellij.util.containers.ContainerUtil; import gnu.trove.THashSet; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -457,7 +456,7 @@ public class AllFileTemplatesConfigurable implements SearchableConfigurable { myInternalTemplateNames.add(((FileTemplateBase)internalTemplate).getQualifiedName()); } - myTemplatesList.init(ArrayUtil.mergeArrays(internalTemplates, templateManager.getAllTemplates(), FileTemplate.class)); + myTemplatesList.init(ArrayUtil.mergeArrays(internalTemplates, templateManager.getAllTemplates())); myIncludesList.init(templateManager.getAllPatterns()); myCodeTemplatesList.init(templateManager.getAllCodeTemplates()); if (myJ2eeTemplatesList != null) { diff --git a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopePaneSelectInTarget.java b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopePaneSelectInTarget.java index 719eacc2ce3d..0dbc4767eed8 100644 --- a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopePaneSelectInTarget.java +++ b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopePaneSelectInTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -46,7 +46,7 @@ public class ScopePaneSelectInTarget extends ProjectViewSelectInTarget { PsiFile file = (PsiFile) fileSystemItem; NamedScopesHolder scopesHolder = DependencyValidationManager.getInstance(myProject); NamedScope[] allScopes = scopesHolder.getScopes(); - allScopes = ArrayUtil.mergeArrays(allScopes, NamedScopeManager.getInstance(myProject).getScopes(), NamedScope.class); + allScopes = ArrayUtil.mergeArrays(allScopes, NamedScopeManager.getInstance(myProject).getScopes()); for (NamedScope scope : allScopes) { PackageSet packageSet = scope.getValue(); if (packageSet != null && packageSet.contains(file, scopesHolder)) return true; diff --git a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeViewPane.java b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeViewPane.java index 3fa2e59a8f3f..4105c526c97c 100644 --- a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeViewPane.java +++ b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeViewPane.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -125,7 +125,7 @@ public class ScopeViewPane extends AbstractProjectViewPane { @NotNull public String[] getSubIds() { NamedScope[] scopes = myDependencyValidationManager.getScopes(); - scopes = ArrayUtil.mergeArrays(scopes, myNamedScopeManager.getScopes(), NamedScope.class); + scopes = ArrayUtil.mergeArrays(scopes, myNamedScopeManager.getScopes()); String[] ids = new String[scopes.length]; for (int i = 0; i < scopes.length; i++) { final NamedScope scope = scopes[i]; diff --git a/platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java b/platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java index 08dd429b4b17..3c7ea6a4db01 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java @@ -382,11 +382,11 @@ public abstract class DialogWrapper { if (okNdx >= 0 && okNdx != actions.length - 1) { actions = ArrayUtil.append(ArrayUtil.remove(actions, getOKAction()), getOKAction()); } - + // move cancel action to the left int cancelNdx = ArrayUtil.indexOf(actions, getCancelAction()); if (cancelNdx > 0) { - actions = ArrayUtil.join(new Action[] {getCancelAction()}, ArrayUtil.remove(actions, getCancelAction())); + actions = ArrayUtil.mergeArrays(new Action[] {getCancelAction()}, ArrayUtil.remove(actions, getCancelAction())); } if (!hasFocusedAction(actions)) { @@ -396,7 +396,7 @@ public abstract class DialogWrapper { } } } - + JPanel buttonsPanel = createButtons(actions, buttons); lrButtonsPanel.add(buttonsPanel, new GridBagConstraints(gridx++, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insets, 0, diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/IdeaPluginDescriptorImpl.java b/platform/platform-impl/src/com/intellij/ide/plugins/IdeaPluginDescriptorImpl.java index 7c6b8656b2d8..ad643455e601 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/IdeaPluginDescriptorImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/IdeaPluginDescriptorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -557,7 +557,7 @@ public class IdeaPluginDescriptorImpl implements IdeaPluginDescriptor { } else if (second == null) { return first; } else { - return ArrayUtil.mergeArrays(first, second, ComponentConfig.class); + return ArrayUtil.mergeArrays(first, second); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/DesktopLayout.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/DesktopLayout.java index eb77b4a62cc6..24c6d948afe6 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/DesktopLayout.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/DesktopLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -189,7 +189,7 @@ public final class DesktopLayout implements JDOMExternalizable { WindowInfoImpl[] getAllInfos() { final WindowInfoImpl[] registeredInfos = getInfos(); final WindowInfoImpl[] unregisteredInfos = getUnregisteredInfos(); - myAllInfos = ArrayUtil.mergeArrays(registeredInfos, unregisteredInfos, WindowInfoImpl.class); + myAllInfos = ArrayUtil.mergeArrays(registeredInfos, unregisteredInfos); return myAllInfos; } diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java index 62cf40cf4a3c..bc56225cf18f 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -754,7 +754,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig final CommonProcessors.CollectProcessor processor = new CommonProcessors.CollectProcessor(); assert handler != null : "Cannot find handler for: " + targetElement; - final PsiElement[] psiElements = ArrayUtil.mergeArrays(handler.getPrimaryElements(), handler.getSecondaryElements(), PsiElement.class); + final PsiElement[] psiElements = ArrayUtil.mergeArrays(handler.getPrimaryElements(), handler.getSecondaryElements()); final FindUsagesOptions options = handler.getFindUsagesOptions(); for (PsiElement psiElement : psiElements) { handler.processElementUsages(psiElement, processor, options); diff --git a/platform/util/src/com/intellij/util/ArrayUtil.java b/platform/util/src/com/intellij/util/ArrayUtil.java index 8102b809ef75..e2bc58ec0efd 100644 --- a/platform/util/src/com/intellij/util/ArrayUtil.java +++ b/platform/util/src/com/intellij/util/ArrayUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -44,13 +44,16 @@ public class ArrayUtil { public static final Collection[] EMPTY_COLLECTION_ARRAY = new Collection[0]; public static final CharSequence EMPTY_CHAR_SEQUENCE = new CharArrayCharSequence(EMPTY_CHAR_ARRAY); public static final File[] EMPTY_FILE_ARRAY = new File[0]; + public static final Runnable[] EMPTY_RUNNABLE_ARRAY = new Runnable[0]; + public static final ArrayFactory STRING_ARRAY_FACTORY = new ArrayFactory() { @Override public String[] create(int count) { return newStringArray(count); } }; - public static final Runnable[] EMPTY_RUNNABLE_ARRAY = new Runnable[0]; + + private ArrayUtil() { } @NotNull public static byte[] realloc(@NotNull byte[] array, final int newSize) { @@ -143,15 +146,21 @@ public class ArrayUtil { return ret; } + /** @deprecated use {@linkplain #mergeArrays(Object[], Object[])} (to remove in IDEA 13) */ @NotNull public static T[] mergeArrays(@NotNull T[] a1, @NotNull T[] a2, @NotNull Class aClass) { + return mergeArrays(a1, a2); + } + + @NotNull + public static T[] mergeArrays(@NotNull T[] a1, @NotNull T[] a2) { if (a1.length == 0) { return a2; } if (a2.length == 0) { return a1; } - T[] result = (T[])Array.newInstance(aClass, a1.length + a2.length); + @SuppressWarnings("unchecked") T[] result = (T[])Array.newInstance(a1.getClass().getComponentType(), a1.length + a2.length); System.arraycopy(a1, 0, result, 0, a1.length); System.arraycopy(a2, 0, result, a1.length, a2.length); return result; @@ -176,7 +185,6 @@ public class ArrayUtil { return mergeArrays(a1, a2, STRING_ARRAY_FACTORY); } - @NotNull public static int[] mergeArrays(@NotNull int[] a1, @NotNull int[] a2) { if (a1.length == 0) { @@ -185,15 +193,10 @@ public class ArrayUtil { if (a2.length == 0) { return a1; } - int[] a = new int[a1.length + a2.length]; - int idx = 0; - for (int i : a1) { - a[idx++] = i; - } - for (int i : a2) { - a[idx++] = i; - } - return a; + int[] result = new int[a1.length + a2.length]; + System.arraycopy(a1, 0, result, 0, a1.length); + System.arraycopy(a2, 0, result, a1.length, a2.length); + return result; } /** @@ -617,10 +620,8 @@ public class ArrayUtil { return array.length > 0 ? array[array.length - 1] : null; } + /** @deprecated use {@linkplain #mergeArrays(Object[], Object[])} (to remove in IDEA 12) */ public static T[] join(T[] array1, T[] array2) { - final T[] newArray = (T[])Array.newInstance(array1.getClass().getComponentType(), array1.length + array2.length); - System.arraycopy(array1, 0, newArray, 0, array1.length); - System.arraycopy(array2, 0, newArray, array1.length, array2.length); - return newArray; + return mergeArrays(array1, array2); } } diff --git a/plugins/devkit/src/DevKitInspectionToolProvider.java b/plugins/devkit/src/DevKitInspectionToolProvider.java index fee7c6643b3f..53bd128fece2 100644 --- a/plugins/devkit/src/DevKitInspectionToolProvider.java +++ b/plugins/devkit/src/DevKitInspectionToolProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -35,7 +35,7 @@ public class DevKitInspectionToolProvider implements InspectionToolProvider { InspectionDescriptionNotFoundInspection.class, IntentionDescriptionNotFoundInspection.class, }; - return ArrayUtil.mergeArrays(result, InternalInspectionToolsProvider.getPublicClasses(), Class.class); + return ArrayUtil.mergeArrays(result, InternalInspectionToolsProvider.getPublicClasses()); } } diff --git a/plugins/devkit/src/module/PluginModuleType.java b/plugins/devkit/src/module/PluginModuleType.java index b1637ec0e643..1336a52594c5 100644 --- a/plugins/devkit/src/module/PluginModuleType.java +++ b/plugins/devkit/src/module/PluginModuleType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -76,7 +76,7 @@ public class PluginModuleType extends ModuleType { } }, ADD_PLUGIN_MODULE_ICON, "reference.dialogs.new.project.fromScratch.sdk")); final ModuleWizardStep[] wizardSteps = steps.toArray(new ModuleWizardStep[steps.size()]); - return ArrayUtil.mergeArrays(wizardSteps, super.createWizardSteps(wizardContext, moduleBuilder, modulesProvider), ModuleWizardStep.class); + return ArrayUtil.mergeArrays(wizardSteps, super.createWizardSteps(wizardContext, moduleBuilder, modulesProvider)); } public PluginModuleBuilder createModuleBuilder() { diff --git a/plugins/git4idea/tests/git4idea/test/GitTestRunEnv.java b/plugins/git4idea/tests/git4idea/test/GitTestRunEnv.java index 54b6a1be0eea..a819f83d49ac 100644 --- a/plugins/git4idea/tests/git4idea/test/GitTestRunEnv.java +++ b/plugins/git4idea/tests/git4idea/test/GitTestRunEnv.java @@ -48,7 +48,7 @@ public class GitTestRunEnv { * @return */ public String run(@NotNull String command, String... params) throws IOException { - String[] arguments = (String[])ArrayUtil.join(new String[]{gitExecutable, command}, params); + String[] arguments = ArrayUtil.mergeArrays(new String[]{gitExecutable, command}, params); log("# " + StringUtil.join(arguments, " ")); final ProcessBuilder builder = new ProcessBuilder().command(arguments); builder.directory(myRootDir); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/config/AbstractConfigUtils.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/config/AbstractConfigUtils.java index a09ee1fd5b20..91111a890a9d 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/config/AbstractConfigUtils.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/config/AbstractConfigUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -32,7 +32,6 @@ import org.jetbrains.plugins.groovy.util.LibrariesUtil; import java.io.File; import java.io.InputStream; -import java.util.Collection; import java.util.List; import java.util.jar.Attributes; import java.util.jar.JarEntry; @@ -143,7 +142,7 @@ public abstract class AbstractConfigUtils { } public Library[] getAllSDKLibraries(@Nullable Project project) { - return ArrayUtil.mergeArrays(getGlobalSDKLibraries(), getProjectSDKLibraries(project), Library.class); + return ArrayUtil.mergeArrays(getGlobalSDKLibraries(), getProjectSDKLibraries(project)); } public Library[] getGlobalSDKLibraries() { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocFieldReferenceImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocFieldReferenceImpl.java index 160d6d498c29..a6273928fb37 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocFieldReferenceImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocFieldReferenceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -97,7 +97,7 @@ public class GrDocFieldReferenceImpl extends GrDocMemberReferenceImpl implements MethodResolverProcessor constructorProcessor = new MethodResolverProcessor(name, this, true, thisType, null, PsiType.EMPTY_ARRAY); resolved.processDeclarations(methodProcessor, ResolveState.initial(), resolved, this); resolved.processDeclarations(constructorProcessor, ResolveState.initial(), resolved, this); - candidates = ArrayUtil.mergeArrays(methodProcessor.getCandidates(), constructorProcessor.getCandidates(), GroovyResolveResult.class); + candidates = ArrayUtil.mergeArrays(methodProcessor.getCandidates(), constructorProcessor.getCandidates()); if (candidates.length > 0) { candidates = new GroovyResolveResult[]{candidates[0]}; } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMemberReferenceImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMemberReferenceImpl.java index 0c56173622b3..41936f988321 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMemberReferenceImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMemberReferenceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -184,7 +184,7 @@ public abstract class GrDocMemberReferenceImpl extends GroovyDocPsiElementImpl i PsiElement[] methodCandidates = ResolveUtil.mapToElements(methodProcessor.getCandidates()); - PsiElement[] elements = ArrayUtil.mergeArrays(propertyCandidates, methodCandidates, PsiElement.class); + PsiElement[] elements = ArrayUtil.mergeArrays(propertyCandidates, methodCandidates); return ContainerUtil.map2Array(elements, new Function() { public Object fun(PsiElement psiElement) { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMethodReferenceImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMethodReferenceImpl.java index c9ca6bbf2eb5..a37c295e4641 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMethodReferenceImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMethodReferenceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -27,7 +27,6 @@ import org.jetbrains.plugins.groovy.lang.groovydoc.psi.api.GrDocMethodParams; import org.jetbrains.plugins.groovy.lang.groovydoc.psi.api.GrDocMethodReference; import org.jetbrains.plugins.groovy.lang.groovydoc.psi.api.GrDocReferenceElement; import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor; -import org.jetbrains.plugins.groovy.lang.psi.api.GroovyResolveResult; import org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement; import org.jetbrains.plugins.groovy.lang.resolve.processors.MethodResolverProcessor; @@ -103,7 +102,7 @@ public class GrDocMethodReferenceImpl extends GrDocMemberReferenceImpl implement MethodResolverProcessor constructorProcessor = new MethodResolverProcessor(name, this, true, thisType, parameterTypes, PsiType.EMPTY_ARRAY); resolved.processDeclarations(processor, ResolveState.initial(), resolved, this); resolved.processDeclarations(constructorProcessor, ResolveState.initial(), resolved, this); - return ArrayUtil.mergeArrays(processor.getCandidates(), constructorProcessor.getCandidates(), GroovyResolveResult.class); + return ArrayUtil.mergeArrays(processor.getCandidates(), constructorProcessor.getCandidates()); } return new ResolveResult[0]; } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumTypeDefinitionImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumTypeDefinitionImpl.java index 548c0ef07098..de4b361f5e8d 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumTypeDefinitionImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumTypeDefinitionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -105,7 +105,7 @@ public class GrEnumTypeDefinitionImpl extends GrTypeDefinitionImpl implements Gr GrEnumConstant[] enumConstants = getEnumConstants(); if (bodyFields.length == 0) return enumConstants; if (enumConstants.length == 0) return bodyFields; - return ArrayUtil.mergeArrays(bodyFields, enumConstants, GrField.class); + return ArrayUtil.mergeArrays(bodyFields, enumConstants); } @Override diff --git a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java index 2e10b5f4e5bb..4dd09c4ecebd 100644 --- a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java +++ b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -97,7 +97,7 @@ public class I18nInspection extends BaseLocalInspectionTool { if (myCachedNonNlsPattern != null) { actions = new SuppressIntentionAction[]{new SuppressByCommentOutAction(nonNlsCommentPattern)}; } - return ArrayUtil.mergeArrays(actions, super.getSuppressActions(element), SuppressIntentionAction.class); + return ArrayUtil.mergeArrays(actions, super.getSuppressActions(element)); } public void readSettings(Element node) throws InvalidDataException { diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltSymbolIndex.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltSymbolIndex.java index 0619a641db7b..05810b698f1d 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltSymbolIndex.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltSymbolIndex.java @@ -213,7 +213,7 @@ public class XsltSymbolIndex extends FileBasedIndexExtension { }); final Module[] modules = ModuleManager.getInstance(project).getModules(); - myModule.setModel(new DefaultComboBoxModel(ArrayUtil.mergeArrays(new Object[]{""}, modules, Object.class))); + myModule.setModel(new DefaultComboBoxModel(ArrayUtil.mergeArrays(new Object[]{""}, modules))); myModule.setRenderer(new ListCellRendererWrapper(myModule) { @Override public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) { diff --git a/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java index 3c7febe07949..13201f8f993a 100644 --- a/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java +++ b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -48,8 +48,7 @@ public class RelaxedHtmlFromSchemaElementDescriptor extends XmlElementDescriptor public XmlElementDescriptor[] getElementsDescriptors(final XmlTag context) { return ArrayUtil.mergeArrays( super.getElementsDescriptors(context), - HtmlUtil.getCustomTagDescriptors(context), - XmlElementDescriptor.class + HtmlUtil.getCustomTagDescriptors(context) ); } @@ -75,7 +74,7 @@ public class RelaxedHtmlFromSchemaElementDescriptor extends XmlElementDescriptor return descriptors; } for (XmlAttributeDescriptorsProvider provider: Extensions.getExtensions(XmlAttributeDescriptorsProvider.EP_NAME)) { - descriptors = ArrayUtil.mergeArrays(descriptors, provider.getAttributeDescriptors(context), XmlAttributeDescriptor.class); + descriptors = ArrayUtil.mergeArrays(descriptors, provider.getAttributeDescriptors(context)); } return descriptors; } diff --git a/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaNSDescriptor.java b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaNSDescriptor.java index 676247847a9a..06a9bc979947 100644 --- a/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaNSDescriptor.java +++ b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaNSDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -49,6 +49,6 @@ public class RelaxedHtmlFromSchemaNSDescriptor extends XmlNSDescriptorImpl imple @NotNull public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument doc) { - return ArrayUtil.mergeArrays(super.getRootElementsDescriptors(doc), HtmlUtil.getCustomTagDescriptors(doc), XmlElementDescriptor.class); + return ArrayUtil.mergeArrays(super.getRootElementsDescriptors(doc), HtmlUtil.getCustomTagDescriptors(doc)); } } diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDoctypeImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDoctypeImpl.java index 48402e7e238e..676c536e4579 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDoctypeImpl.java +++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDoctypeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -240,8 +240,7 @@ public class XmlDoctypeImpl extends XmlElementImpl implements XmlDoctype { return ArrayUtil.mergeArrays( uriRefs != null? uriRefs: PsiReference.EMPTY_ARRAY, - referencesFromProviders, - PsiReference.class + referencesFromProviders ); } } diff --git a/xml/impl/src/com/intellij/psi/xml/XmlChildRole.java b/xml/impl/src/com/intellij/psi/xml/XmlChildRole.java index 37bf06afe64f..0e39ab22e2ab 100644 --- a/xml/impl/src/com/intellij/psi/xml/XmlChildRole.java +++ b/xml/impl/src/com/intellij/psi/xml/XmlChildRole.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -67,7 +67,7 @@ public interface XmlChildRole { { final StartTagEndTokenProvider[] tokenProviders = Extensions.getExtensions(EP_NAME); for (StartTagEndTokenProvider tokenProvider : tokenProviders) { - myElementTypes = ArrayUtil.mergeArrays(myElementTypes, tokenProvider.getTypes(), IElementType.class); + myElementTypes = ArrayUtil.mergeArrays(myElementTypes, tokenProvider.getTypes()); } } }; diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java index 998a64808e32..3baa1839a0f6 100644 --- a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java +++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -218,8 +218,7 @@ public class XmlElementDescriptorImpl implements XmlElementDescriptor, PsiWritab if (nsDescriptor != null) { elementsDescriptors = ArrayUtil.mergeArrays( elementsDescriptors, - nsDescriptor.getRootElementsDescriptors(((XmlFile)containingFile).getDocument()), - XmlElementDescriptor.class + nsDescriptor.getRootElementsDescriptors(((XmlFile)containingFile).getDocument()) ); } } @@ -278,8 +277,7 @@ public class XmlElementDescriptorImpl implements XmlElementDescriptor, PsiWritab if (descriptor instanceof XmlNSDescriptorImpl) { attributeDescriptors = ArrayUtil.mergeArrays( attributeDescriptors, - ((XmlNSDescriptorImpl)descriptor).getRootAttributeDescriptors(context), - XmlAttributeDescriptor.class + ((XmlNSDescriptorImpl)descriptor).getRootAttributeDescriptors(context) ); } } diff --git a/xml/impl/src/com/intellij/xml/util/HtmlUtil.java b/xml/impl/src/com/intellij/xml/util/HtmlUtil.java index 3397755d90f9..80deca4eaf78 100644 --- a/xml/impl/src/com/intellij/xml/util/HtmlUtil.java +++ b/xml/impl/src/com/intellij/xml/util/HtmlUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -316,8 +316,7 @@ public class HtmlUtil { if (declarationTag instanceof HtmlTag) { descriptors = ArrayUtil.mergeArrays( descriptors, - getCustomAttributeDescriptors(context), - XmlAttributeDescriptor.class + getCustomAttributeDescriptors(context) ); return descriptors; } diff --git a/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java index 9237ba01a2b0..a56ee566e2fc 100644 --- a/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java +++ b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2011 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.intellij.html; import com.intellij.html.impl.RelaxedHtmlFromSchemaElementDescriptor; @@ -41,8 +56,7 @@ public class RelaxedHtmlFromRngElementDescriptor implements XmlElementDescriptor public XmlElementDescriptor[] getElementsDescriptors(final XmlTag context) { return ArrayUtil.mergeArrays( myDelegate.getElementsDescriptors(context), - HtmlUtil.getCustomTagDescriptors(context), - XmlElementDescriptor.class + HtmlUtil.getCustomTagDescriptors(context) ); } diff --git a/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngNSDescriptor.java b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngNSDescriptor.java index ad58613c0dc8..141c53944750 100644 --- a/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngNSDescriptor.java +++ b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngNSDescriptor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2011 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.intellij.html; import com.intellij.html.RelaxedHtmlNSDescriptor; @@ -38,6 +53,6 @@ public class RelaxedHtmlFromRngNSDescriptor extends RngNsDescriptor implements R @NotNull public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable final XmlDocument doc) { - return ArrayUtil.mergeArrays(super.getRootElementsDescriptors(doc), HtmlUtil.getCustomTagDescriptors(doc), XmlElementDescriptor.class); + return ArrayUtil.mergeArrays(super.getRootElementsDescriptors(doc), HtmlUtil.getCustomTagDescriptors(doc)); } } diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/BaseInspection.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/BaseInspection.java index 501be380a45c..90a27d875377 100644 --- a/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/BaseInspection.java +++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/BaseInspection.java @@ -109,7 +109,7 @@ public abstract class BaseInspection extends XmlSuppressableInspectionTool { return super.isAvailable(project, editor, element) && getTarget(element).getText().startsWith("grammar "); } } - }, getXmlOnlySuppressions(element), SuppressIntentionAction.class); + }, getXmlOnlySuppressions(element)); } else { return super.getSuppressActions(element); } diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java index 84ebffbcf995..da137bca4554 100644 --- a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java +++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java @@ -243,7 +243,7 @@ public class RngNsDescriptor implements XmlNSDescriptor, Validator { final PsiElementProcessor.CollectElements processor = new PsiElementProcessor.CollectElements(); RelaxIncludeIndex.processForwardDependencies(myFile, processor); if (processor.getCollection().size() > 0) { - return ArrayUtil.mergeArrays(a, processor.toArray(), Object.class); + return ArrayUtil.mergeArrays(a, processor.toArray()); } else { return a; }