mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git@git.labs.intellij.net:idea/community
This commit is contained in:
@@ -19,8 +19,6 @@
|
||||
*/
|
||||
package com.intellij.ide.impl;
|
||||
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.util.newProjectWizard.AddModuleWizard;
|
||||
import com.intellij.ide.util.projectWizard.ProjectBuilder;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -41,7 +39,6 @@ import com.intellij.openapi.roots.ex.ProjectRootManagerEx;
|
||||
import com.intellij.openapi.roots.ui.configuration.ModulesConfigurator;
|
||||
import com.intellij.openapi.roots.ui.configuration.ModulesProvider;
|
||||
import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
@@ -197,17 +194,8 @@ public class NewProjectUtil {
|
||||
public static void closePreviousProject(final Project projectToClose) {
|
||||
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
|
||||
if (openProjects.length > 0) {
|
||||
final GeneralSettings settings = GeneralSettings.getInstance();
|
||||
int exitCode = settings.getConfirmOpenNewProject();
|
||||
if (exitCode == GeneralSettings.OPEN_PROJECT_ASK) {
|
||||
exitCode = Messages.showOkCancelDialog(projectToClose,
|
||||
IdeBundle.message("prompt.open.project.in.new.frame"),
|
||||
IdeBundle.message("title.new.project"),
|
||||
IdeBundle.message("button.existingframe"),
|
||||
IdeBundle.message("button.newframe"),
|
||||
Messages.getQuestionIcon(), new ProjectNewWindowDoNotAskOption());
|
||||
}
|
||||
if (exitCode == DialogWrapper.OK_EXIT_CODE) { // "No" option
|
||||
int exitCode = ProjectUtil.confirmOpenNewProject(true);
|
||||
if (exitCode == 0) { // this window option
|
||||
ProjectUtil.closeAndDispose(projectToClose != null ? projectToClose : openProjects[openProjects.length - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,8 +151,6 @@ public abstract class ProjectOpenProcessorBase extends ProjectOpenProcessor {
|
||||
final String projectFilePath = wizardContext.getProjectFileDirectory() + File.separator + wizardContext.getProjectName() +
|
||||
ProjectFileType.DOT_DEFAULT_EXTENSION;
|
||||
|
||||
boolean shouldOpenExisting = false;
|
||||
|
||||
File dotIdeaFile = new File(dotIdeaFilePath);
|
||||
File projectFile = new File(projectFilePath);
|
||||
|
||||
@@ -163,12 +161,14 @@ public abstract class ProjectOpenProcessorBase extends ProjectOpenProcessor {
|
||||
pathToOpen = dotIdeaFile.getParent();
|
||||
}
|
||||
|
||||
boolean shouldOpenExisting = false;
|
||||
if (!ApplicationManager.getApplication().isHeadlessEnvironment() && (projectFile.exists() || dotIdeaFile.exists())) {
|
||||
String existingName;
|
||||
if (dotIdeaFile.exists()) {
|
||||
existingName = "an existing project";
|
||||
pathToOpen = dotIdeaFile.getParent();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
existingName = "'" + projectFile.getName() + "'";
|
||||
pathToOpen = projectFilePath;
|
||||
}
|
||||
|
||||
+8
-2
@@ -34,6 +34,10 @@ import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.psi.search.searches.SuperMethodsSearch;
|
||||
import com.intellij.psi.util.*;
|
||||
import com.intellij.refactoring.extractInterface.ExtractInterfaceHandler;
|
||||
import com.intellij.refactoring.extractSuperclass.ExtractSuperclassHandler;
|
||||
import com.intellij.refactoring.memberPullUp.JavaPullUpHandler;
|
||||
import com.intellij.refactoring.memberPullUp.PullUpHelper;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
@@ -1016,8 +1020,10 @@ public class GenericsHighlightUtil {
|
||||
try {
|
||||
MethodSignatureBackedByPsiMethod superMethod = SuperMethodsSearch.search(method, null, true, false).findFirst();
|
||||
if (superMethod == null) {
|
||||
return HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, overrideAnnotation,
|
||||
JavaErrorMessages.message("method.doesnot.override.super"));
|
||||
HighlightInfo highlightInfo = HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, overrideAnnotation,
|
||||
JavaErrorMessages.message("method.doesnot.override.super"));
|
||||
PullAsAbstractUpFix.registerQuickFix(highlightInfo, method);
|
||||
return highlightInfo;
|
||||
}
|
||||
LanguageLevel languageLevel = PsiUtil.getLanguageLevel(method);
|
||||
PsiClass superClass = superMethod.getMethod().getContainingClass();
|
||||
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* 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.daemon.impl.quickfix;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightUtilBase;
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
|
||||
import com.intellij.codeInsight.navigation.NavigationUtil;
|
||||
import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement;
|
||||
import com.intellij.ide.util.PsiClassListCellRenderer;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.refactoring.extractInterface.ExtractInterfaceHandler;
|
||||
import com.intellij.refactoring.extractSuperclass.ExtractSuperclassHandler;
|
||||
import com.intellij.refactoring.memberPullUp.JavaPullUpHandler;
|
||||
import com.intellij.refactoring.memberPullUp.PullUpHelper;
|
||||
import com.intellij.refactoring.util.DocCommentPolicy;
|
||||
import com.intellij.refactoring.util.classMembers.MemberInfo;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
|
||||
public class PullAsAbstractUpFix extends LocalQuickFixAndIntentionActionOnPsiElement {
|
||||
private static final Logger LOG = Logger.getInstance("#" + PullAsAbstractUpFix.class.getName());
|
||||
private String myName;
|
||||
|
||||
public PullAsAbstractUpFix(PsiMethod psiMethod, final String name) {
|
||||
super(psiMethod);
|
||||
myName = name;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getText() {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getFamilyName() {
|
||||
return "Pull up";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull Project project,
|
||||
@NotNull PsiFile file,
|
||||
@NotNull PsiElement startElement,
|
||||
@NotNull PsiElement endElement) {
|
||||
return startElement instanceof PsiMethod && startElement.isValid() && ((PsiMethod)startElement).getContainingClass() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project,
|
||||
@NotNull PsiFile file,
|
||||
@Nullable("is null when called from inspection") Editor editor,
|
||||
@NotNull PsiElement startElement,
|
||||
@NotNull PsiElement endElement) {
|
||||
final PsiMethod method = (PsiMethod)startElement;
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(method.getContainingFile())) return;
|
||||
|
||||
final PsiClass containingClass = method.getContainingClass();
|
||||
LOG.assertTrue(containingClass != null);
|
||||
|
||||
PsiManager manager = containingClass.getManager();
|
||||
if (containingClass instanceof PsiAnonymousClass) {
|
||||
final PsiClassType baseClassType = ((PsiAnonymousClass)containingClass).getBaseClassType();
|
||||
final PsiClass baseClass = baseClassType.resolve();
|
||||
if (baseClass != null && manager.isInProject(baseClass)) {
|
||||
pullUp(method, containingClass, baseClass);
|
||||
}
|
||||
}
|
||||
else {
|
||||
final LinkedHashSet<PsiClass> classesToPullUp = new LinkedHashSet<PsiClass>();
|
||||
collectClassesToPullUp(manager, classesToPullUp, containingClass.getExtendsListTypes());
|
||||
collectClassesToPullUp(manager, classesToPullUp, containingClass.getImplementsListTypes());
|
||||
|
||||
if (classesToPullUp.size() == 0) {
|
||||
//check visibility
|
||||
new ExtractInterfaceHandler().invoke(project, new PsiElement[]{containingClass}, null);
|
||||
}
|
||||
else if (classesToPullUp.size() == 1) {
|
||||
pullUp(method, containingClass, classesToPullUp.iterator().next());
|
||||
}
|
||||
else if (editor != null) {
|
||||
NavigationUtil.getPsiElementPopup(classesToPullUp.toArray(new PsiClass[classesToPullUp.size()]), new PsiClassListCellRenderer(),
|
||||
"Choose super class",
|
||||
new PsiElementProcessor<PsiClass>() {
|
||||
@Override
|
||||
public boolean execute(PsiClass aClass) {
|
||||
pullUp(method, containingClass, aClass);
|
||||
return false;
|
||||
}
|
||||
}, classesToPullUp.iterator().next()).showInBestPositionFor(editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void collectClassesToPullUp(PsiManager manager, LinkedHashSet<PsiClass> classesToPullUp, PsiClassType[] extendsListTypes) {
|
||||
for (PsiClassType extendsListType : extendsListTypes) {
|
||||
PsiClass resolve = extendsListType.resolve();
|
||||
if (resolve != null && manager.isInProject(resolve)) {
|
||||
classesToPullUp.add(resolve);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void pullUp(PsiMethod method, PsiClass containingClass, PsiClass baseClass) {
|
||||
final MemberInfo memberInfo = new MemberInfo(method);
|
||||
memberInfo.setChecked(true);
|
||||
memberInfo.setToAbstract(true);
|
||||
new PullUpHelper(containingClass, baseClass, new MemberInfo[]{memberInfo}, new DocCommentPolicy(DocCommentPolicy.ASIS)).run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void registerQuickFix(HighlightInfo highlightInfo, PsiMethod methodWithOverrides) {
|
||||
PsiClass containingClass = methodWithOverrides.getContainingClass();
|
||||
if (containingClass == null) return;
|
||||
final PsiManager manager = containingClass.getManager();
|
||||
|
||||
boolean canBePulledUp = true;
|
||||
String name = "Pull method \'" + methodWithOverrides.getName() + "\' up";
|
||||
if (containingClass instanceof PsiAnonymousClass) {
|
||||
final PsiClassType baseClassType = ((PsiAnonymousClass)containingClass).getBaseClassType();
|
||||
final PsiClass baseClass = baseClassType.resolve();
|
||||
if (baseClass == null) return;
|
||||
if (!manager.isInProject(baseClass)) return;
|
||||
if (!baseClass.hasModifierProperty(PsiModifier.ABSTRACT)) {
|
||||
name = "Pull method \'" + methodWithOverrides.getName() + "\' up and make it abstract";
|
||||
}
|
||||
} else {
|
||||
final LinkedHashSet<PsiClass> classesToPullUp = new LinkedHashSet<PsiClass>();
|
||||
collectClassesToPullUp(manager, classesToPullUp, containingClass.getExtendsListTypes());
|
||||
collectClassesToPullUp(manager, classesToPullUp, containingClass.getImplementsListTypes());
|
||||
if (classesToPullUp.size() == 0) {
|
||||
name = "Extract method \'" + methodWithOverrides.getName() + "\' to new interface";
|
||||
canBePulledUp = false;
|
||||
} else if (classesToPullUp.size() == 1) {
|
||||
final PsiClass baseClass = classesToPullUp.iterator().next();
|
||||
name = "Pull method \'" + methodWithOverrides.getName() + "\' to \'" + baseClass.getName() + "\'";
|
||||
if (!baseClass.hasModifierProperty(PsiModifier.ABSTRACT)) {
|
||||
name+= " and make it abstract";
|
||||
}
|
||||
}
|
||||
QuickFixAction.registerQuickFixAction(highlightInfo, new RunRefactoringIntention(new ExtractInterfaceHandler(), "Extract interface"));
|
||||
QuickFixAction.registerQuickFixAction(highlightInfo, new RunRefactoringIntention(new ExtractSuperclassHandler(), "Extract superclass"));
|
||||
}
|
||||
|
||||
|
||||
if (canBePulledUp) {
|
||||
QuickFixAction.registerQuickFixAction(highlightInfo, new RunRefactoringIntention(new JavaPullUpHandler(), "Pull members up"));
|
||||
}
|
||||
QuickFixAction.registerQuickFixAction(highlightInfo, new PullAsAbstractUpFix(methodWithOverrides, name));
|
||||
}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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.daemon.impl.quickfix;
|
||||
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInsight.intention.LowPriorityAction;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.refactoring.RefactoringActionHandler;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 9/5/11
|
||||
*/
|
||||
public class RunRefactoringIntention implements IntentionAction, Iconable, LowPriorityAction {
|
||||
public static final Icon REFACTORING_BULB = IconLoader.getIcon("/actions/refactoringBulb.png");
|
||||
private final RefactoringActionHandler myHandler;
|
||||
private final String myCommandName;
|
||||
|
||||
public RunRefactoringIntention(RefactoringActionHandler handler, String commandName) {
|
||||
myHandler = handler;
|
||||
myCommandName = commandName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getText() {
|
||||
return myCommandName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Refactorings";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
myHandler.invoke(project, editor, file, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int flags) {
|
||||
return REFACTORING_BULB;
|
||||
}
|
||||
}
|
||||
@@ -298,7 +298,7 @@ public class PsiSubstitutorImpl implements PsiSubstitutor {
|
||||
PsiType substitutedBoundType = boundType.accept(mySimpleSubstitutionVisitor);
|
||||
PsiWildcardType wildcardType = (PsiWildcardType)substituted;
|
||||
if (substitutedBoundType != null && !(substitutedBoundType instanceof PsiWildcardType) && !substitutedBoundType.equalsToText("java.lang.Object")) {
|
||||
if (originalBound == null || !TypeConversionUtil.erasure(substitutedBoundType).isAssignableFrom(originalBound)) { //erasure is essential to avoid infinite recursion
|
||||
if (originalBound == null || !TypeConversionUtil.erasure(substitutedBoundType).isAssignableFrom(TypeConversionUtil.erasure(originalBound))) { //erasure is essential to avoid infinite recursion
|
||||
if (wildcardType.isExtends()) {
|
||||
final PsiType glb = GenericsUtil.getGreatestLowerBound(wildcardType.getBound(), substitutedBoundType);
|
||||
if (glb != null) {
|
||||
|
||||
+15
-10
@@ -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,6 +37,7 @@ import com.intellij.psi.search.LocalSearchScope;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import com.intellij.psi.tree.ChildRoleBase;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
import com.intellij.ui.RowIcon;
|
||||
import com.intellij.util.CharTable;
|
||||
@@ -47,6 +48,7 @@ import gnu.trove.THashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
public class PsiLocalVariableImpl extends CompositePsiElement implements PsiLocalVariable, PsiVariableEx, Constants {
|
||||
@@ -100,13 +102,16 @@ public class PsiLocalVariableImpl extends CompositePsiElement implements PsiLoca
|
||||
|
||||
@NotNull
|
||||
public PsiTypeElement getTypeElement() {
|
||||
final CompositeElement parent = getTreeParent();
|
||||
assert parent != null : this + "; [" + getText() + "]";
|
||||
final ASTNode first = parent.findChildByType(LOCAL_VARIABLE);
|
||||
assert first != null : this + "; [" + getText() + "]";
|
||||
final ASTNode type = first.findChildByType(TYPE);
|
||||
assert type != null : this + "; [" + getText() + "]";
|
||||
return SourceTreeToPsiMap.treeToPsiNotNull(type);
|
||||
PsiTypeElement typeElement = PsiTreeUtil.getChildOfType(this, PsiTypeElement.class);
|
||||
if (typeElement != null) return typeElement;
|
||||
|
||||
final PsiElement parent = getParent();
|
||||
assert parent != null : "no parent; " + this + "; [" + getText() + "]";
|
||||
final PsiLocalVariable localVariable = PsiTreeUtil.getChildOfType(parent, PsiLocalVariable.class);
|
||||
assert localVariable != null : "no local variable in " + Arrays.toString(parent.getChildren());
|
||||
typeElement = PsiTreeUtil.getChildOfType(localVariable, PsiTypeElement.class);
|
||||
assert typeElement != null : "no type element in " + Arrays.toString(localVariable.getChildren());
|
||||
return typeElement;
|
||||
}
|
||||
|
||||
public PsiModifierList getModifierList() {
|
||||
@@ -177,13 +182,13 @@ public class PsiLocalVariableImpl extends CompositePsiElement implements PsiLoca
|
||||
CompositeElement statement1 = Factory.createCompositeElement(DECLARATION_STATEMENT, charTableByTree, getManager());
|
||||
statement1.addChild(variable, null);
|
||||
|
||||
ASTNode space = Factory.createSingleLeafElement(JavaTokenType.WHITE_SPACE, " ", 0, 1, treeCharTab, getManager());
|
||||
ASTNode space = Factory.createSingleLeafElement(TokenType.WHITE_SPACE, " ", 0, 1, treeCharTab, getManager());
|
||||
variable.addChild(space, variable.getFirstChildNode());
|
||||
|
||||
variable.addChild(typeCopy, variable.getFirstChildNode());
|
||||
|
||||
if (modifierListCopy.getTextLength() > 0) {
|
||||
space = Factory.createSingleLeafElement(JavaTokenType.WHITE_SPACE, " ", 0, 1, treeCharTab, getManager());
|
||||
space = Factory.createSingleLeafElement(TokenType.WHITE_SPACE, " ", 0, 1, treeCharTab, getManager());
|
||||
variable.addChild(space, variable.getFirstChildNode());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ public class ExtractSuperclassHandler implements RefactoringActionHandler, Extra
|
||||
|
||||
if (!CommonRefactoringUtil.checkReadOnlyStatus(project, mySubclass)) return;
|
||||
|
||||
Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
|
||||
Editor editor = dataContext != null ? PlatformDataKeys.EDITOR.getData(dataContext) : null;
|
||||
if (mySubclass.isInterface()) {
|
||||
String message =
|
||||
RefactoringBundle.getCannotRefactorMessage(RefactoringBundle.message("superclass.cannot.be.extracted.from.an.interface"));
|
||||
|
||||
+25
-1
@@ -44,6 +44,7 @@ import com.intellij.util.Processor;import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -65,13 +66,36 @@ public class InlineSuperClassRefactoringProcessor extends FixableUsagesRefactori
|
||||
return true;
|
||||
}
|
||||
});
|
||||
final List<MemberInfo> members = memberInfoStorage.getClassMemberInfos(mySuperClass);
|
||||
List<MemberInfo> members = memberInfoStorage.getClassMemberInfos(mySuperClass);
|
||||
for (MemberInfo member : members) {
|
||||
member.setChecked(true);
|
||||
}
|
||||
members = appendSuperRefs(members);
|
||||
myMemberInfos = members.toArray(new MemberInfo[members.size()]);
|
||||
}
|
||||
|
||||
private List<MemberInfo> appendSuperRefs(List<MemberInfo> members) {
|
||||
if (!mySuperClass.isInterface()) {
|
||||
PsiReferenceList extendsList = mySuperClass.getExtendsList();
|
||||
if (extendsList != null && extendsList.getReferenceElements().length > 0) {
|
||||
PsiElement resolve = extendsList.getReferenceElements()[0].resolve();
|
||||
if (resolve instanceof PsiClass) {
|
||||
members = new ArrayList<MemberInfo>(members);
|
||||
|
||||
MemberInfo memberInfo = new MemberInfo((PsiMember)resolve, true, extendsList) {
|
||||
{
|
||||
overrides = false;
|
||||
}
|
||||
};
|
||||
|
||||
memberInfo.setChecked(true);
|
||||
members.add(memberInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return members;
|
||||
}
|
||||
|
||||
protected UsageViewDescriptor createUsageViewDescriptor(final UsageInfo[] usages) {
|
||||
return new InlineSuperClassUsageViewDescriptor(mySuperClass);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class JavaPullUpHandler implements RefactoringActionHandler, PullUpDialog
|
||||
}
|
||||
|
||||
private void invoke(Project project, DataContext dataContext, PsiClass aClass, PsiElement aMember) {
|
||||
Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
|
||||
final Editor editor = dataContext != null ? PlatformDataKeys.EDITOR.getData(dataContext) : null;
|
||||
if (aClass == null) {
|
||||
String message =
|
||||
RefactoringBundle.getCannotRefactorMessage(RefactoringBundle.message("is.not.supported.in.the.current.context", REFACTORING_NAME));
|
||||
|
||||
@@ -204,15 +204,15 @@ public class PullUpHelper extends BaseRefactoringProcessor{
|
||||
for (MemberInfo info : myMembersToMove) {
|
||||
if (info.getMember() instanceof PsiMethod) {
|
||||
PsiMethod method = (PsiMethod)info.getMember();
|
||||
PsiMethod methodCopy = (PsiMethod)method.copy();
|
||||
if (method.findDeepestSuperMethods().length == 0) {
|
||||
deleteOverrideAnnotationIfFound(methodCopy);
|
||||
}
|
||||
final boolean isOriginalMethodAbstract = method.hasModifierProperty(PsiModifier.ABSTRACT);
|
||||
if (myIsTargetInterface || info.isToAbstract()) {
|
||||
PsiMethod methodCopy = (PsiMethod)method.copy();
|
||||
ChangeContextUtil.clearContextInfo(method);
|
||||
RefactoringUtil.abstractizeMethod(myTargetSuperClass, methodCopy);
|
||||
RefactoringUtil.replaceMovedMemberTypeParameters(methodCopy, PsiUtil.typeParametersIterable(mySourceClass), substitutor, elementFactory);
|
||||
if (method.findDeepestSuperMethods().length == 0 || (myTargetSuperClass.isInterface() && !PsiUtil.isLanguageLevel6OrHigher(mySourceClass))) {
|
||||
deleteOverrideAnnotationIfFound(methodCopy);
|
||||
}
|
||||
|
||||
myJavaDocPolicy.processCopiedJavaDoc(methodCopy.getDocComment(), method.getDocComment(), isOriginalMethodAbstract);
|
||||
|
||||
@@ -240,14 +240,14 @@ public class PullUpHelper extends BaseRefactoringProcessor{
|
||||
if (isOriginalMethodAbstract) {
|
||||
PsiUtil.setModifierProperty(myTargetSuperClass, PsiModifier.ABSTRACT, true);
|
||||
}
|
||||
RefactoringUtil.replaceMovedMemberTypeParameters(method, PsiUtil.typeParametersIterable(mySourceClass), substitutor, elementFactory);
|
||||
fixReferencesToStatic(method, movedMembers);
|
||||
final PsiMethod superClassMethod = myTargetSuperClass.findMethodBySignature(method, false);
|
||||
RefactoringUtil.replaceMovedMemberTypeParameters(methodCopy, PsiUtil.typeParametersIterable(mySourceClass), substitutor, elementFactory);
|
||||
fixReferencesToStatic(methodCopy, movedMembers);
|
||||
final PsiMethod superClassMethod = myTargetSuperClass.findMethodBySignature(methodCopy, false);
|
||||
if (superClassMethod != null && superClassMethod.hasModifierProperty(PsiModifier.ABSTRACT)) {
|
||||
superClassMethod.replace(method);
|
||||
superClassMethod.replace(methodCopy);
|
||||
}
|
||||
else {
|
||||
final PsiMember movedElement = (PsiMember)myTargetSuperClass.add(method);
|
||||
final PsiMember movedElement = (PsiMember)myTargetSuperClass.add(methodCopy);
|
||||
myMembersAfterMove.add(movedElement);
|
||||
}
|
||||
method.delete();
|
||||
|
||||
@@ -385,10 +385,14 @@ public class PushDownProcessor extends BaseRefactoringProcessor {
|
||||
}
|
||||
else if (member instanceof PsiClass) {
|
||||
if (Boolean.FALSE.equals(memberInfo.getOverrides())) {
|
||||
final PsiClass aClass = (PsiClass)member;
|
||||
final PsiClass aClass = (PsiClass)memberInfo.getMember();
|
||||
if (!targetClass.isInheritor(aClass, false)) {
|
||||
PsiJavaCodeReferenceElement classRef = factory.createClassReferenceElement(aClass);
|
||||
targetClass.getImplementsList().add(classRef);
|
||||
if (aClass.isInterface()) {
|
||||
targetClass.getImplementsList().add(classRef);
|
||||
} else {
|
||||
targetClass.getExtendsList().add(classRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
<orderEntry type="module" module-name="ui-designer" scope="TEST" />
|
||||
<orderEntry type="module" module-name="eclipse" scope="TEST" />
|
||||
<orderEntry type="module" module-name="execution-openapi" />
|
||||
<orderEntry type="module" module-name="IntentionPowerPackPlugin" />
|
||||
<orderEntry type="module" module-name="InspectionGadgetsPlugin" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
public class SOE {
|
||||
}
|
||||
abstract class VersionEntity<V extends Version<V, R>, R extends Ref<V, R>>
|
||||
implements Version<V, R>{}
|
||||
|
||||
interface Version<V extends Version<V, R>, R extends Ref<V, R>>{}
|
||||
|
||||
abstract class RefEntity<V extends Version<V, R>, R extends Ref<V, R>>
|
||||
implements Ref<V, R> {}
|
||||
|
||||
interface Ref<V extends Version<V, R>, R extends Ref<V, R>>{}
|
||||
|
||||
|
||||
abstract class Node<G extends Node<G, GR>,
|
||||
GR extends NodeRef<G, GR>> extends VersionEntity<G, GR> {}
|
||||
|
||||
abstract class NodeRef<G extends Node<G, GR>, GR extends NodeRef<G, GR>> extends RefEntity<G, GR> {}
|
||||
|
||||
|
||||
class D {
|
||||
void f() {
|
||||
Version v = new Node<<error descr="Wildcard type '?' cannot be instantiated directly">?</error>, <error descr="Wildcard type '?' cannot be instantiated directly">?</error>>(){}<EOLError descr="';' expected"></EOLError>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Pull method 'foo' to 'Int'" "true"
|
||||
public class Test implements Int {
|
||||
@Override
|
||||
public void foo(){}
|
||||
}
|
||||
|
||||
interface Int {
|
||||
void foo();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Pull method 'foo' up and make it abstract" "true"
|
||||
public class Test{
|
||||
void main(){
|
||||
new Int(){
|
||||
@Override
|
||||
void foo(){
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class Int {
|
||||
abstract void foo();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Pull method 'foo' to 'Int'" "true"
|
||||
public class Test implements Int {
|
||||
@Overr<caret>ide
|
||||
void foo(){}
|
||||
}
|
||||
|
||||
interface Int {}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Pull method 'foo' to 'List'" "false"
|
||||
import java.util.List;
|
||||
|
||||
public abstract class Test implements List{
|
||||
@Overr<caret>ide
|
||||
void foo(){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Pull method 'foo' up and make it abstract" "true"
|
||||
public class Test{
|
||||
void main(){
|
||||
new Int(){
|
||||
@Overr<caret>ide
|
||||
void foo(){
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class Int {}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Extract interface" "false"
|
||||
public class Test{
|
||||
void main(){
|
||||
new Int(){
|
||||
@Overr<caret>ide
|
||||
void foo(){
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class Int {}
|
||||
@@ -0,0 +1,7 @@
|
||||
import java.util.ArrayList;
|
||||
public abstract class Test extends ArrayList<String> implements Int {
|
||||
@Overr<caret>ide
|
||||
void foo(){}
|
||||
}
|
||||
|
||||
interface Int {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
|
||||
interface Int {}
|
||||
|
||||
class Dummy {}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test extends Dummy implements Int {
|
||||
Test(){}
|
||||
|
||||
public void main() {}
|
||||
}
|
||||
|
||||
class U {
|
||||
public static void main(String[] args) {
|
||||
new Test().main();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
|
||||
interface Int {}
|
||||
|
||||
class Dummy {}
|
||||
|
||||
public class Super extends Dummy implements Int {
|
||||
public void main() {}
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Test extends Super{
|
||||
Test(){}
|
||||
}
|
||||
|
||||
class U {
|
||||
public static void main(String[] args) {
|
||||
new Test().main();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
public class Test {
|
||||
abstract class Base extends IntImpl {
|
||||
@Override
|
||||
public abstract String<caret> foo();
|
||||
}
|
||||
|
||||
class IntImpl extends Int {}
|
||||
|
||||
class Int {
|
||||
public abstract String foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
public class Test {
|
||||
abstract class Base extends IntImpl {
|
||||
}
|
||||
|
||||
abstract class IntImpl extends Int {
|
||||
@Override
|
||||
public abstract String foo();
|
||||
}
|
||||
|
||||
class Int {
|
||||
public abstract String foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class Test {
|
||||
abstract class Base extends Int {
|
||||
@Override
|
||||
public abstract String<caret> foo();
|
||||
}
|
||||
|
||||
class Int {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
public class Test {
|
||||
abstract class Base extends Int {
|
||||
}
|
||||
|
||||
abstract class Int {
|
||||
public abstract String foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
interface Int {}
|
||||
public class Test implements In<caret>t {}
|
||||
class B extends Test implements Int {}
|
||||
@@ -0,0 +1,3 @@
|
||||
interface Int {}
|
||||
public class Test {}
|
||||
class B extends Test implements Int {}
|
||||
@@ -81,6 +81,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEADEV24166() throws Exception { doTest(true); }
|
||||
public void testIDEADEV25778() throws Exception { doTest(true); }
|
||||
public void testIDEADEV57343() throws Exception { doTest(false); }
|
||||
public void testSOE() throws Exception { doTest(true); }
|
||||
|
||||
public void testGenericExtendException() throws Exception { doTest(false); }
|
||||
public void testSameErasureDifferentReturnTypes() throws Exception { doTest(false); }
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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.daemon.quickFix;
|
||||
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
|
||||
public class PullOverrideMethodUpFixTest extends LightQuickFixTestCase {
|
||||
public void test1() throws Exception {
|
||||
doSingleTest("1.java");
|
||||
}
|
||||
|
||||
public void test2() throws Exception {
|
||||
doSingleTest("2.java");
|
||||
}
|
||||
|
||||
public void test3() throws Exception {
|
||||
doSingleTest("3.java");
|
||||
}
|
||||
|
||||
public void test4() throws Exception {
|
||||
doSingleTest("4.java");
|
||||
}
|
||||
|
||||
public void testRefactoringIntentionsAvailable() throws Exception {
|
||||
doTestActionAvailable(5, "Pull members up");
|
||||
doTestActionAvailable(5, "Extract interface");
|
||||
doTestActionAvailable(5, "Extract superclass");
|
||||
}
|
||||
|
||||
private void doTestActionAvailable(final int suffix, final String actionText) {
|
||||
final String testFullPath = getBasePath() + "/before" + suffix + ".java";
|
||||
configureByFile(testFullPath);
|
||||
doHighlighting();
|
||||
final IntentionAction action = findActionWithText(actionText);
|
||||
assertNotNull(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/codeInsight/daemonCodeAnalyzer/quickFix/pullUp";
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -58,7 +58,7 @@ class Test {
|
||||
doTest(before, toPaste, expected)
|
||||
}
|
||||
|
||||
void _testStringBeforeAnotherStringShouldNotIncreaseIndentOfTheFollowingString() {
|
||||
void testStringBeforeAnotherStringShouldNotIncreaseIndentOfTheFollowingString() {
|
||||
def before = '''\
|
||||
class Test {
|
||||
void test() {
|
||||
@@ -75,7 +75,7 @@ class Test {
|
||||
class Test {
|
||||
void test() {
|
||||
int b = 200;
|
||||
<caret> int a = 100;
|
||||
int a = 100;
|
||||
int b = 200;
|
||||
}\
|
||||
'''
|
||||
|
||||
@@ -171,6 +171,10 @@ public class InlineSuperClassTest extends MultiFileTestCase {
|
||||
doTestMultipleSubclasses();
|
||||
}
|
||||
|
||||
public void testInlineSuperclassExtendsList() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTestMultipleSubclasses() throws Exception {
|
||||
doTest(new PerformAction() {
|
||||
@Override
|
||||
|
||||
@@ -105,6 +105,14 @@ public class PullUpTest extends LightCodeInsightTestCase {
|
||||
doTest(false, new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
|
||||
}
|
||||
|
||||
public void testRemoveOverrideFromPulledMethod() throws Exception {
|
||||
doTest(false, new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
|
||||
}
|
||||
|
||||
public void testPreserveOverrideInPulledMethod() throws Exception {
|
||||
doTest(false, new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
|
||||
}
|
||||
|
||||
private void doTest(RefactoringTestUtil.MemberDescriptor... membersToFind) throws Exception {
|
||||
doTest(true, membersToFind);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.intellij.psi.*;
|
||||
import com.intellij.refactoring.memberPushDown.PushDownProcessor;
|
||||
import com.intellij.refactoring.util.DocCommentPolicy;
|
||||
import com.intellij.refactoring.util.classMembers.MemberInfo;
|
||||
import com.intellij.refactoring.util.classMembers.MemberInfoStorage;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.usageView.UsageInfo;
|
||||
@@ -28,7 +29,7 @@ public class PushDownTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
|
||||
private void doTest(final boolean failure) throws Exception {
|
||||
final String filePath = "/refactoring/pushDown/" + getTestName(false)+ ".java";
|
||||
final String filePath = "/refactoring/pushDown/" + getTestName(false) + ".java";
|
||||
configureByFile(filePath);
|
||||
|
||||
final PsiElement targetElement = TargetElementUtilBase.findTargetElement(getEditor(), TargetElementUtilBase.ELEMENT_NAME_ACCEPTED);
|
||||
@@ -53,7 +54,8 @@ public class PushDownTest extends LightCodeInsightTestCase {
|
||||
memberInfo.setChecked(true);
|
||||
membersToMove.add(memberInfo);
|
||||
|
||||
new PushDownProcessor(getProject(), membersToMove.toArray(new MemberInfo[membersToMove.size()]), currentClass, new DocCommentPolicy(DocCommentPolicy.ASIS)){
|
||||
new PushDownProcessor(getProject(), membersToMove.toArray(new MemberInfo[membersToMove.size()]), currentClass,
|
||||
new DocCommentPolicy(DocCommentPolicy.ASIS)) {
|
||||
@Override
|
||||
protected boolean showConflicts(MultiMap<PsiElement, String> conflicts, UsageInfo[] usages) {
|
||||
if (failure ? conflicts.isEmpty() : !conflicts.isEmpty()) {
|
||||
@@ -109,4 +111,30 @@ public class PushDownTest extends LightCodeInsightTestCase {
|
||||
public void testMethodTypeParametersList() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSameClassInterface() throws Exception {
|
||||
final String filePath = "/refactoring/pushDown/" + getTestName(false) + ".java";
|
||||
configureByFile(filePath);
|
||||
|
||||
PsiClass currentClass = JavaPsiFacade.getInstance(getProject()).findClass("Test");
|
||||
MemberInfoStorage memberInfoStorage = new MemberInfoStorage(currentClass, new MemberInfo.Filter<PsiMember>() {
|
||||
public boolean includeMember(PsiMember element) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
List<MemberInfo> members = memberInfoStorage.getClassMemberInfos(currentClass);
|
||||
for (MemberInfo member : members) {
|
||||
member.setChecked(true);
|
||||
}
|
||||
|
||||
new PushDownProcessor(getProject(), members.toArray(new MemberInfo[members.size()]), currentClass,
|
||||
new DocCommentPolicy(DocCommentPolicy.ASIS)) {
|
||||
@Override
|
||||
protected boolean showConflicts(MultiMap<PsiElement, String> conflicts, UsageInfo[] usages) {
|
||||
return true;
|
||||
}
|
||||
}.run();
|
||||
|
||||
checkResultByFile(filePath + ".after");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,6 +114,10 @@ public class PsiDiamondType extends PsiType {
|
||||
return DiamondInferenceResult.EXPLICIT_CONSTRUCTOR_TYPE_ARGS;
|
||||
}
|
||||
|
||||
return resolveInferredTypesNoCheck(newExpression, context);
|
||||
}
|
||||
|
||||
public static DiamondInferenceResult resolveInferredTypesNoCheck(PsiNewExpression newExpression, PsiElement context) {
|
||||
final PsiClass psiClass = findClass(newExpression);
|
||||
if (psiClass == null) return DiamondInferenceResult.NULL_RESULT;
|
||||
final PsiExpressionList argumentList = newExpression.getArgumentList();
|
||||
@@ -129,7 +133,8 @@ public class PsiDiamondType extends PsiType {
|
||||
final PsiTypeParameter[] classParameters = psiClass.getTypeParameters();
|
||||
final PsiJavaCodeReferenceElement classOrAnonymousClassReference = newExpression.getClassOrAnonymousClassReference();
|
||||
LOG.assertTrue(classOrAnonymousClassReference != null);
|
||||
final DiamondInferenceResult result = new DiamondInferenceResult(classOrAnonymousClassReference.getReferenceName() + "<>", newExpression.getProject());
|
||||
final DiamondInferenceResult
|
||||
result = new DiamondInferenceResult(classOrAnonymousClassReference.getReferenceName() + "<>", newExpression.getProject());
|
||||
for (PsiTypeParameter parameter : parameters) {
|
||||
for (PsiTypeParameter classParameter : classParameters) {
|
||||
if (Comparing.strEqual(classParameter.getName(), parameter.getName())) {
|
||||
|
||||
@@ -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.
|
||||
@@ -142,9 +142,9 @@ public interface ASTNode extends UserDataHolder {
|
||||
* Adds the specified child node at the specified position in the child list.
|
||||
*
|
||||
* @param child the child node to add.
|
||||
* @param anchorBefore the node before which the child node is inserted.
|
||||
* @param anchorBefore the node before which the child node is inserted (<code>null</code> to add a child as a last node).
|
||||
*/
|
||||
void addChild(@NotNull ASTNode child, ASTNode anchorBefore);
|
||||
void addChild(@NotNull ASTNode child, @Nullable ASTNode anchorBefore);
|
||||
|
||||
/**
|
||||
* Add leaf element with specified type and text in the child list.
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class LanguageLineWrapPositionStrategy extends LanguageExtension<LineWrap
|
||||
public LineWrapPositionStrategy forEditor(@NotNull Editor editor) {
|
||||
LineWrapPositionStrategy result = getDefaultImplementation();
|
||||
Project project = editor.getProject();
|
||||
if (project != null) {
|
||||
if (project != null && !project.isDisposed()) {
|
||||
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
|
||||
if (psiFile != null) {
|
||||
result = INSTANCE.forLanguage(psiFile.getLanguage());
|
||||
|
||||
+4
-2
@@ -400,8 +400,10 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
}
|
||||
|
||||
public void closeAndFinish(boolean hideLookup) {
|
||||
Lookup lookup = LookupManager.getActiveLookup(myEditor);
|
||||
LOG.assertTrue(lookup == myLookup, lookup + "; " + this);
|
||||
if (!myLookup.isLookupDisposed()) {
|
||||
Lookup lookup = LookupManager.getActiveLookup(myEditor);
|
||||
LOG.assertTrue(lookup == myLookup, lookup + "; " + this);
|
||||
}
|
||||
myLookup.removeLookupListener(myLookupListener);
|
||||
finishCompletionProcess(true);
|
||||
CompletionServiceImpl.assertPhase(CompletionPhase.NoCompletion.getClass());
|
||||
|
||||
@@ -444,7 +444,10 @@ public class PasteHandler extends EditorActionHandler implements EditorTextInser
|
||||
}
|
||||
|
||||
// Insert white space from the start line of the pasted block.
|
||||
document.insertString(start, chars.subSequence(firstLineStart, CharArrayUtil.shiftForward(chars, firstLineStart, " \t")));
|
||||
int indentToKeepEndOffset = Math.min(startOffset, CharArrayUtil.shiftForward(chars, firstLineStart, " \t"));
|
||||
if (indentToKeepEndOffset > firstLineStart) {
|
||||
document.insertString(start, chars.subSequence(firstLineStart, indentToKeepEndOffset));
|
||||
}
|
||||
}
|
||||
else {
|
||||
lastLine = document.getLineNumber(endOffset);
|
||||
|
||||
+11
@@ -19,10 +19,12 @@ package com.intellij.codeInsight.template.impl;
|
||||
import com.intellij.codeInsight.CodeInsightActionHandler;
|
||||
import com.intellij.codeInsight.CodeInsightBundle;
|
||||
import com.intellij.codeInsight.CodeInsightUtilBase;
|
||||
import com.intellij.codeInsight.completion.CompletionUtil;
|
||||
import com.intellij.codeInsight.hint.HintManager;
|
||||
import com.intellij.codeInsight.template.CustomLiveTemplate;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
@@ -108,6 +110,15 @@ public class SurroundWithTemplateHandler implements CodeInsightActionHandler {
|
||||
final int selEnd = editor.getSelectionModel().getSelectionEnd();
|
||||
startOffset = (offset == selStart) ? selEnd : selStart;
|
||||
}
|
||||
|
||||
if (!selection) {
|
||||
file = (PsiFile)file.copy();
|
||||
final Document document = file.getViewProvider().getDocument();
|
||||
assert document != null;
|
||||
document.insertString(offset, CompletionUtil.DUMMY_IDENTIFIER_TRIMMED);
|
||||
PsiDocumentManager.getInstance(file.getProject()).commitDocument(document);
|
||||
}
|
||||
|
||||
ArrayList<TemplateImpl> list = new ArrayList<TemplateImpl>();
|
||||
for (TemplateImpl template : TemplateSettings.getInstance().getTemplates()) {
|
||||
if (!template.isDeactivated() &&
|
||||
|
||||
@@ -39,8 +39,7 @@ import java.util.*;
|
||||
public class TreeChangeEventImpl implements TreeChangeEvent{
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.pom.tree.events.impl.TreeChangeEventImpl");
|
||||
private final Map<ASTNode, TreeChange> myChangedElements = new THashMap<ASTNode, TreeChange>();
|
||||
private final List<ASTNode> myChangedInOrder = new ArrayList<ASTNode>();
|
||||
private List<ASTNode> myChangedInOrderNew;
|
||||
private List<ASTNode> myChangedInOrder;
|
||||
private final List<Set<ASTNode>> myOfEqualDepth = new ArrayList<Set<ASTNode>>(10);
|
||||
private final PomModelAspect myAspect;
|
||||
private final FileElement myFileElement;
|
||||
@@ -57,10 +56,10 @@ public class TreeChangeEventImpl implements TreeChangeEvent{
|
||||
|
||||
@NotNull
|
||||
public ASTNode[] getChangedElements() {
|
||||
if (myChangedInOrderNew == null) {
|
||||
myChangedInOrderNew = new ArrayList<ASTNode>(myChangedElements.keySet());
|
||||
if (myChangedInOrder == null) {
|
||||
myChangedInOrder = new ArrayList<ASTNode>(myChangedElements.keySet());
|
||||
|
||||
Collections.sort(myChangedInOrderNew, new Comparator<ASTNode>() {
|
||||
Collections.sort(myChangedInOrder, new Comparator<ASTNode>() {
|
||||
final Map<ASTNode, int[]> routeMap = new THashMap<ASTNode, int[]>(myChangedElements.size());
|
||||
final TObjectIntHashMap<ASTNode> nodeIndex = new TObjectIntHashMap<ASTNode>(myChangedElements.size());
|
||||
|
||||
@@ -73,23 +72,8 @@ public class TreeChangeEventImpl implements TreeChangeEvent{
|
||||
return compareRoutes(route, route2);
|
||||
}
|
||||
});
|
||||
|
||||
int size = myChangedInOrderNew.size();
|
||||
if (size == myChangedInOrder.size()) {
|
||||
for(int i = 0; i < size; ++i) {
|
||||
if (myChangedInOrderNew.get(i) != myChangedInOrder.get(i)) {
|
||||
LOG.error("Unexpected changed elements difference");
|
||||
return myChangedInOrder.toArray(new ASTNode[myChangedInOrder.size()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG.error("Unexpected changed elements difference");
|
||||
return myChangedInOrder.toArray(new ASTNode[myChangedInOrder.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
return myChangedInOrderNew.toArray(new ASTNode[myChangedInOrderNew.size()]);
|
||||
return myChangedInOrder.toArray(new ASTNode[myChangedInOrder.size()]);
|
||||
}
|
||||
|
||||
public TreeChange getChangesByElement(@NotNull ASTNode element) {
|
||||
@@ -141,8 +125,7 @@ public class TreeChangeEventImpl implements TreeChangeEvent{
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
myChangedInOrderNew = null;
|
||||
myChangedInOrder.clear();
|
||||
myChangedInOrder = null;
|
||||
myChangedElements.clear();
|
||||
myOfEqualDepth.clear();
|
||||
}
|
||||
@@ -152,7 +135,6 @@ public class TreeChangeEventImpl implements TreeChangeEvent{
|
||||
if (treeChange == null) {
|
||||
treeChange = new TreeChangeImpl(parent);
|
||||
myChangedElements.put(parent, treeChange);
|
||||
insertAtList(parent);
|
||||
|
||||
final int index = depth >= 0 ? depth : getDepth(parent);
|
||||
addToEqualsDepthList(index, parent);
|
||||
@@ -221,7 +203,6 @@ public class TreeChangeEventImpl implements TreeChangeEvent{
|
||||
|
||||
private void removeAssociatedChanges(ASTNode treeElement, int depth) {
|
||||
if(myChangedElements.remove(treeElement) != null) {
|
||||
myChangedInOrder.remove(treeElement);
|
||||
if (depth < 0) depth = getDepth(treeElement);
|
||||
if (depth < myOfEqualDepth.size()) {
|
||||
myOfEqualDepth.get(depth < 0 ? getDepth(treeElement) : depth).remove(treeElement);
|
||||
@@ -229,41 +210,6 @@ public class TreeChangeEventImpl implements TreeChangeEvent{
|
||||
}
|
||||
}
|
||||
|
||||
private void insertAtList(ASTNode node){
|
||||
if (!myChangedInOrder.isEmpty()) {
|
||||
final int[] nodeRoute = getRoute(node);
|
||||
for (int index = 0; index < myChangedInOrder.size(); index++) {
|
||||
final ASTNode current = myChangedInOrder.get(index);
|
||||
final int[] route = getRoute(current);
|
||||
if (compareRoutes(nodeRoute, route) < 0) {
|
||||
myChangedInOrder.add(index, node);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
myChangedInOrder.add(node);
|
||||
}
|
||||
|
||||
private static int[] getRoute(ASTNode node){
|
||||
final List<ASTNode> parents = new ArrayList<ASTNode>(20);
|
||||
while(node != null){
|
||||
parents.add(node);
|
||||
node = node.getTreeParent();
|
||||
}
|
||||
final int[] root = new int[parents.size() - 1];
|
||||
for(int i = 0; i < root.length; i++){
|
||||
final ASTNode parent = parents.get(root.length - i - 1);
|
||||
int rootIndex = 0;
|
||||
ASTNode current = parent.getTreeParent().getFirstChildNode();
|
||||
while(current != parent){
|
||||
current = current.getTreeNext();
|
||||
rootIndex++;
|
||||
}
|
||||
root[i] = rootIndex;
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
private static int[] getRoute(ASTNode node, TObjectIntHashMap<ASTNode> index){
|
||||
final List<ASTNode> parents = new ArrayList<ASTNode>(20);
|
||||
while(node != null){
|
||||
@@ -361,7 +307,6 @@ public class TreeChangeEventImpl implements TreeChangeEvent{
|
||||
for (final Map.Entry<ASTNode, TreeChange> entry : changedElements.entrySet()) {
|
||||
final ASTNode changed = entry.getKey();
|
||||
myChangedElements.put(changed, entry.getValue());
|
||||
insertAtList(changed);
|
||||
addToEqualsDepthList(depth, changed);
|
||||
compactChanges(changed, depth);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -66,7 +66,7 @@ public class CompositeElement extends TreeElement {
|
||||
return myModificationsCount;
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
public CompositeElement clone() {
|
||||
CompositeElement clone = (CompositeElement)super.clone();
|
||||
|
||||
synchronized (PsiLock.LOCK) {
|
||||
@@ -109,8 +109,8 @@ public class CompositeElement extends TreeElement {
|
||||
PsiFile psiFile = null;
|
||||
boolean ok = ApplicationManager.getApplication().isWriteAccessAllowed() ||
|
||||
Thread.holdsLock(START_OFFSET_LOCK) ||
|
||||
wrapper != null && !wrapper.isPhysical() ||
|
||||
(fileElement = TreeUtil.getFileElement(this)) == null ||
|
||||
wrapper != null && !wrapper.isPhysical() ||
|
||||
(psiFile = (PsiFile)fileElement.getPsi()) == null ||
|
||||
psiFile instanceof DummyHolder ||
|
||||
psiFile.getViewProvider() instanceof FreeThreadedFileViewProvider ||
|
||||
@@ -612,7 +612,7 @@ public class CompositeElement extends TreeElement {
|
||||
this.lastChild = lastChild;
|
||||
}
|
||||
|
||||
public void addChild(@NotNull ASTNode child, final ASTNode anchorBefore) {
|
||||
public void addChild(@NotNull ASTNode child, @Nullable final ASTNode anchorBefore) {
|
||||
LOG.assertTrue(anchorBefore == null || ((TreeElement)anchorBefore).getTreeParent() == this, "anchorBefore == null || anchorBefore.getTreeParent() == parent");
|
||||
TreeUtil.ensureParsed(getFirstChildNode());
|
||||
TreeUtil.ensureParsed(child);
|
||||
|
||||
@@ -43,6 +43,14 @@ public abstract class CompositePsiElement extends CompositeElement implements Ps
|
||||
|
||||
protected CompositePsiElement(IElementType type) {
|
||||
super(type);
|
||||
setPsi(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompositePsiElement clone() {
|
||||
CompositePsiElement clone = (CompositePsiElement)super.clone();
|
||||
clone.setPsi(clone);
|
||||
return clone;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -259,11 +267,6 @@ public abstract class CompositePsiElement extends CompositeElement implements Ps
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PsiElement createPsiNoLock() {
|
||||
return this;
|
||||
}
|
||||
|
||||
private PsiElement addInnerBefore(final PsiElement element, final PsiElement anchor) throws IncorrectOperationException {
|
||||
CheckUtil.checkWritable(this);
|
||||
TreeElement elementCopy = ChangeUtil.copyToElement(element);
|
||||
@@ -276,3 +279,4 @@ public abstract class CompositePsiElement extends CompositeElement implements Ps
|
||||
return this == another;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+19
-21
@@ -146,38 +146,36 @@ public class LazyParseableElement extends CompositeElement {
|
||||
}
|
||||
|
||||
private void ensureParsed() {
|
||||
ASTNode parsedNode;
|
||||
CharSequence text = myText();
|
||||
if (text == null) return;
|
||||
|
||||
if (TreeUtil.getFileElement(this) == null) {
|
||||
LOG.error("Chameleons must not be parsed till they're in file tree: " + this);
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().assertReadAccessAllowed();
|
||||
|
||||
ILazyParseableElementType type = (ILazyParseableElementType)getElementType();
|
||||
ASTNode parsedNode = type.parseContents(this);
|
||||
|
||||
if (parsedNode == null && text.length() > 0) {
|
||||
CharSequence diagText = ApplicationManager.getApplication().isInternal() ? text : "";
|
||||
LOG.error("No parse for a non-empty string: " + diagText + "; type=" + LogUtil.objectAndClass(type));
|
||||
}
|
||||
|
||||
synchronized (lock) {
|
||||
if (myText == null) return;
|
||||
if (rawFirstChild() != null) {
|
||||
LOG.error("Reentrant parsing?");
|
||||
}
|
||||
|
||||
if (TreeUtil.getFileElement(this) == null) {
|
||||
LOG.error("Chameleons must not be parsed till they're in file tree: " + this);
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().assertReadAccessAllowed();
|
||||
|
||||
ILazyParseableElementType type = (ILazyParseableElementType)getElementType();
|
||||
parsedNode = type.parseContents(this);
|
||||
|
||||
if (parsedNode == null && myText.length() > 0) {
|
||||
if (ApplicationManager.getApplication().isInternal() && !ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
LOG.error("No parse for a non-empty string: " + myText + "; type=" + LogUtil.objectAndClass(type));
|
||||
} else {
|
||||
LOG.error("No parse for a non-empty string: type=" + LogUtil.objectAndClass(type));
|
||||
}
|
||||
}
|
||||
|
||||
//CharSequence text = myText;
|
||||
myText = null;
|
||||
|
||||
if (parsedNode == null) return;
|
||||
rawAddChildrenWithoutNotifications((TreeElement)parsedNode);
|
||||
super.rawAddChildrenWithoutNotifications((TreeElement)parsedNode);
|
||||
|
||||
//if (getNotCachedLength() != text.length()) {
|
||||
// if (ApplicationManagerEx.getApplicationEx().isInternal()) {
|
||||
// if (ApplicationManager.getApplication().isInternal()) {
|
||||
// LOG.error("Inconsistent reparse: type=" + getElementType() + "; text=" + text + "; treeText=" + getText());
|
||||
// } else {
|
||||
// LOG.error("Inconsistent reparse: type=" + getElementType());
|
||||
|
||||
+9
-6
@@ -51,6 +51,14 @@ public class LazyParseablePsiElement extends LazyParseableElement implements Psi
|
||||
|
||||
public LazyParseablePsiElement(@NotNull IElementType type, CharSequence buffer) {
|
||||
super(type, buffer);
|
||||
setPsi(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LazyParseablePsiElement clone() {
|
||||
LazyParseablePsiElement clone = (LazyParseablePsiElement)super.clone();
|
||||
clone.setPsi(clone);
|
||||
return clone;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -72,7 +80,7 @@ public class LazyParseablePsiElement extends LazyParseableElement implements Psi
|
||||
for (PsiElement cur = getFirstChild(); cur != null; cur = cur.getNextSibling()) {
|
||||
if (ReflectionCache.isInstance(cur, aClass)) result.add((T)cur);
|
||||
}
|
||||
return result.toArray((T[]) Array.newInstance(aClass, result.size()));
|
||||
return result.toArray((T[])Array.newInstance(aClass, result.size()));
|
||||
}
|
||||
|
||||
public PsiElement getFirstChild() {
|
||||
@@ -287,11 +295,6 @@ public class LazyParseablePsiElement extends LazyParseableElement implements Psi
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PsiElement createPsiNoLock() {
|
||||
return this;
|
||||
}
|
||||
|
||||
private PsiElement addInnerBefore(final PsiElement element, final PsiElement anchor) throws IncorrectOperationException {
|
||||
CheckUtil.checkWritable(this);
|
||||
TreeElement elementCopy = ChangeUtil.copyToElement(element);
|
||||
|
||||
@@ -20,12 +20,13 @@ import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Vector;
|
||||
import java.awt.*;
|
||||
import java.util.Vector;
|
||||
|
||||
public class ComboBoxWithWidePopup extends JComboBox {
|
||||
|
||||
private boolean myLayingOut = false;
|
||||
private int myMinLength = 20;
|
||||
|
||||
public ComboBoxWithWidePopup(final ComboBoxModel aModel) {
|
||||
super(aModel);
|
||||
@@ -47,6 +48,23 @@ public class ComboBoxWithWidePopup extends JComboBox {
|
||||
|
||||
public ComboBoxWithWidePopup() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("GtkPreferredJComboBoxRenderer")
|
||||
@Override
|
||||
public void setRenderer(ListCellRenderer renderer) {
|
||||
super.setRenderer(new AdjustingListCellRenderer(this, renderer));
|
||||
}
|
||||
|
||||
public void setMinLength(int minLength) {
|
||||
myMinLength = minLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return min string len to show
|
||||
*/
|
||||
protected int getMinLength() {
|
||||
return myMinLength;
|
||||
}
|
||||
|
||||
public void doLayout() {
|
||||
try {
|
||||
@@ -65,8 +83,46 @@ public class ComboBoxWithWidePopup extends JComboBox {
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
private Dimension _getSuperSize() {
|
||||
return super.getSize();
|
||||
}
|
||||
|
||||
protected Dimension getOriginalPreferredSize() {
|
||||
return getPreferredSize();
|
||||
}
|
||||
|
||||
private class AdjustingListCellRenderer implements ListCellRenderer {
|
||||
JLabel myTempLabel;
|
||||
private final ListCellRenderer myOldRenderer;
|
||||
private final ComboBoxWithWidePopup myComboBox;
|
||||
|
||||
public AdjustingListCellRenderer(ComboBoxWithWidePopup comboBox, ListCellRenderer oldRenderer) {
|
||||
myComboBox = comboBox;
|
||||
myOldRenderer = oldRenderer;
|
||||
myTempLabel = new JLabel();
|
||||
if (oldRenderer instanceof JComponent) {
|
||||
myTempLabel.setFont(((JComponent)oldRenderer).getFont());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
Object _value = value;
|
||||
if (index == -1 && _value instanceof String && !myComboBox.isValid()) {
|
||||
int minLength = getMinLength();
|
||||
|
||||
Dimension size = myComboBox._getSuperSize();
|
||||
String stringValue = (String)_value;
|
||||
|
||||
if (size.width == 0) {
|
||||
if (stringValue.length() > minLength) {
|
||||
_value = stringValue.substring(0, minLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return myOldRenderer.getListCellRendererComponent(list, _value, index, isSelected, cellHasFocus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.ui.ComboBoxWithWidePopup;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.DocumentListener;
|
||||
@@ -24,7 +24,7 @@ import java.awt.event.KeyListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TextFieldWithHistory extends ComboBox {
|
||||
public class TextFieldWithHistory extends ComboBoxWithWidePopup {
|
||||
private int myHistorySize = 5;
|
||||
private final MyModel myModel;
|
||||
|
||||
|
||||
@@ -146,11 +146,11 @@ public class ProjectUtil {
|
||||
}
|
||||
|
||||
if (!forceOpenInNewFrame && openProjects.length > 0) {
|
||||
int exitCode = confirmOpenNewProject();
|
||||
if (exitCode == 0) { // "Yes" option
|
||||
int exitCode = confirmOpenNewProject(false);
|
||||
if (exitCode == 0) { // this window option
|
||||
if (!closeAndDispose(projectToClose != null ? projectToClose : openProjects[openProjects.length - 1])) return null;
|
||||
}
|
||||
else if (exitCode != 1) { // not "No"
|
||||
else if (exitCode != 1) { // not in a new window
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -177,11 +177,17 @@ public class ProjectUtil {
|
||||
return project;
|
||||
}
|
||||
|
||||
public static int confirmOpenNewProject() {
|
||||
/**
|
||||
* @return 0 - this window
|
||||
* 1 - new window
|
||||
* 2 - cancel
|
||||
* @param isNewProject
|
||||
*/
|
||||
public static int confirmOpenNewProject(boolean isNewProject) {
|
||||
final GeneralSettings settings = GeneralSettings.getInstance();
|
||||
if (settings.getConfirmOpenNewProject() == GeneralSettings.OPEN_PROJECT_ASK) {
|
||||
return Messages.showYesNoCancelDialog(IdeBundle.message("prompt.open.project.in.new.frame"),
|
||||
IdeBundle.message("title.open.project"),
|
||||
isNewProject ? IdeBundle.message("title.new.project") : IdeBundle.message("title.open.project"),
|
||||
IdeBundle.message("button.existingframe"),
|
||||
IdeBundle.message("button.newframe"),
|
||||
CommonBundle.getCancelButtonText(), Messages.getQuestionIcon(),
|
||||
|
||||
@@ -99,11 +99,11 @@ public class PlatformProjectOpenProcessor extends ProjectOpenProcessor {
|
||||
|
||||
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
|
||||
if (!forceOpenInNewFrame && openProjects.length > 0) {
|
||||
int exitCode = ProjectUtil.confirmOpenNewProject();
|
||||
if (exitCode == 1) { // "No" option
|
||||
int exitCode = ProjectUtil.confirmOpenNewProject(false);
|
||||
if (exitCode == 0) { // this window option
|
||||
if (!ProjectUtil.closeAndDispose(projectToClose != null ? projectToClose : openProjects[openProjects.length - 1])) return null;
|
||||
}
|
||||
else if (exitCode != 0) { // not "Yes"
|
||||
else if (exitCode != 1) { // not in a new window
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public interface Computable <T> {
|
||||
|
||||
@Nullable
|
||||
T compute();
|
||||
|
||||
class PredefinedValueComputable<T> implements Computable<T> {
|
||||
|
||||
@@ -75,6 +75,7 @@ public class ChangesFragmentedDiffPanel implements Disposable {
|
||||
private boolean myCurrentHorizontal;
|
||||
private JPanel myTopPanel;
|
||||
|
||||
// todo here
|
||||
public ChangesFragmentedDiffPanel(final Project project, final FragmentedContent fragmentedContent,
|
||||
final LinkedList<DiffPanel> cache, String filePath) {
|
||||
myProject = project;
|
||||
|
||||
+2
-17
@@ -202,23 +202,8 @@ public class FragmentedDiffRequestFromChange {
|
||||
|
||||
private String notNullContentRevision(final ContentRevision cr) throws VcsException {
|
||||
if (cr == null) return "";
|
||||
final Ref<VcsException> ref = new Ref<VcsException>();
|
||||
final String s = new BackgroundSynchronousInvisibleComputable<String>() {
|
||||
@Override
|
||||
protected String runImpl() {
|
||||
try {
|
||||
return cr.getContent();
|
||||
}
|
||||
catch (VcsException e) {
|
||||
ref.set(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}.compute();
|
||||
if (! ref.isNull()) {
|
||||
throw ref.get();
|
||||
}
|
||||
return s == null ? "" : s;
|
||||
String content = cr.getContent();
|
||||
return content == null ? "" : content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,12 +26,14 @@ import com.intellij.openapi.progress.BackgroundTaskQueue;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.MessageType;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.vcs.Details;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vcs.VcsKey;
|
||||
import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier;
|
||||
import com.intellij.util.BeforeAfter;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.util.continuation.ModalityIgnorantBackgroundableTask;
|
||||
@@ -125,12 +127,11 @@ public class VcsChangeDetailsManager {
|
||||
|
||||
@Override
|
||||
protected void doInAwtIfFail(Exception e) {
|
||||
System.out.println("FAIL");
|
||||
VcsBalloonProblemNotifier.showOverChangesView(myProject, e.getMessage(), MessageType.ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doInAwtIfCancel() {
|
||||
System.out.println("CANCEL");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -130,7 +130,7 @@ public class XDebuggerTestUtil {
|
||||
node.myName = ((XNamedValue)value).getName();
|
||||
}
|
||||
value.computePresentation(node, XValuePlace.TREE);
|
||||
Assert.assertTrue(node.waitFor(TIMEOUT));
|
||||
Assert.assertTrue("timed out", node.waitFor(TIMEOUT));
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
+5
-2
@@ -16,6 +16,7 @@
|
||||
package com.siyeh.ipp.types;
|
||||
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.siyeh.ipp.base.Intention;
|
||||
import com.siyeh.ipp.base.PsiElementPredicate;
|
||||
@@ -45,9 +46,11 @@ public class ReplaceDiamondWithExplicitTypeArgumentsIntention extends Intention
|
||||
final StringBuilder text = new StringBuilder();
|
||||
text.append(javaCodeReferenceElement.getQualifiedName());
|
||||
text.append('<');
|
||||
final PsiType[] typeArguments = referenceParameterList.getTypeArguments();
|
||||
final PsiTypeElement[] typeElements = referenceParameterList.getTypeParameterElements();
|
||||
final PsiNewExpression newExpression = PsiTreeUtil.getParentOfType(typeElements[0], PsiNewExpression.class);
|
||||
final PsiDiamondType.DiamondInferenceResult result = PsiDiamondType.resolveInferredTypesNoCheck(newExpression, newExpression);
|
||||
boolean first = true;
|
||||
for (PsiType typeArgument : typeArguments) {
|
||||
for (PsiType typeArgument : result.getInferredTypes()) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public interface Anonymous<T> {}
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Anonymous<Integer> anon = new Anonymous<<caret>>() {};
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public interface Anonymous<T> {}
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Anonymous<Integer> anon = new Anonymous<Integer>() {};
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public class MyClass<T> {}
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
MyClass<Integer> anon = new MyClass<<caret>>();
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public class MyClass<T> {}
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
MyClass<Integer> anon = new MyClass<Integer>();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Foo<T> {
|
||||
<U> Foo(T t) {}
|
||||
}
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Foo<String> c = new <Integer>Foo<<caret>>("");
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Foo<T> {
|
||||
<U> Foo(T t) {}
|
||||
}
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Foo<String> c = new <Integer>Foo<String>("");
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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.siyeh.ipp.types;
|
||||
|
||||
import com.siyeh.IntentionPowerPackBundle;
|
||||
import com.siyeh.ipp.IPPTestCase;
|
||||
|
||||
public class ReplaceDiamondWithExplicitTypeIntentionTest extends IPPTestCase {
|
||||
public void testAnonymousClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testApplicableDiamond() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testExplicitTypeArgs() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getIntentionName() {
|
||||
return IntentionPowerPackBundle.message("replace.diamond.with.explicit.type.arguments.intention.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRelativePath() {
|
||||
return "types/diamond2explicit";
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ public class CreateResourceFileActionGroup extends DefaultActionGroup {
|
||||
a.add(new CreateTypedResourceFileAction("Layout", "layout", "LinearLayout"));
|
||||
a.add(new CreateTypedResourceFileAction("XML", "xml", "PreferenceScreen"));
|
||||
a.add(new CreateTypedResourceFileAction("Drawable", "drawable", "selector"));
|
||||
a.add(new CreateTypedResourceFileAction("Color", "color", "selector", false, false));
|
||||
a.add(new CreateTypedResourceFileAction("Values", "values", "resources", true, false));
|
||||
a.add(new CreateTypedResourceFileAction("Menu", "menu", "menu", false, false));
|
||||
a.add(new CreateTypedResourceFileAction("Animation", "anim", "set"));
|
||||
|
||||
@@ -81,7 +81,7 @@ public class AndroidManifestUtils {
|
||||
else if (element instanceof Application) {
|
||||
Collections.addAll(strings, "activity", "service", "provider", "receiver", "uses-library");
|
||||
}
|
||||
else if (element instanceof Activity || element instanceof ActivityAlias) {
|
||||
else if (element instanceof Activity || element instanceof ActivityAlias || element instanceof Receiver || element instanceof Service) {
|
||||
strings.add("intent-filter");
|
||||
}
|
||||
else if (element instanceof IntentFilter) {
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.jetbrains.android.dom.AndroidAttributeValue;
|
||||
import org.jetbrains.android.dom.converters.PackageClassConverter;
|
||||
import org.jetbrains.android.util.AndroidUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
@@ -31,4 +33,8 @@ public interface Receiver extends ApplicationComponent {
|
||||
@Convert(PackageClassConverter.class)
|
||||
@ExtendClass(AndroidUtils.RECEIVER_CLASS_NAME)
|
||||
AndroidAttributeValue<PsiClass> getReceiverClass();
|
||||
|
||||
List<IntentFilter> getIntentFilters();
|
||||
|
||||
IntentFilter addIntentFilter();
|
||||
}
|
||||
@@ -21,6 +21,8 @@ import org.jetbrains.android.dom.AndroidAttributeValue;
|
||||
import org.jetbrains.android.dom.converters.PackageClassConverter;
|
||||
import org.jetbrains.android.util.AndroidUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
@@ -31,4 +33,8 @@ public interface Service extends ApplicationComponent {
|
||||
@Convert(PackageClassConverter.class)
|
||||
@ExtendClass(AndroidUtils.SERVICE_CLASS_NAME)
|
||||
AndroidAttributeValue<PsiClass> getServiceClass();
|
||||
|
||||
List<IntentFilter> getIntentFilters();
|
||||
|
||||
IntentFilter addIntentFilter();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="p1.p2">
|
||||
<application android:label="@string/app_name">
|
||||
<receiver android:enabled="true" android:name=".Starter">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPL<caret>" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="p1.p2">
|
||||
<application android:label="@string/app_name">
|
||||
<receiver android:enabled="true" android:name=".Starter">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="p1.p2">
|
||||
<application android:label="@string/app_name">
|
||||
<service>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPL<caret>" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="p1.p2">
|
||||
<application android:label="@string/app_name">
|
||||
<service>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -154,4 +154,12 @@ public class AndroidManifestDomTest extends AndroidDomTest {
|
||||
copyFileToProject("MyActivity.java", "src/p1/p2/MyActivity.java");
|
||||
doTestCompletion(false);
|
||||
}
|
||||
|
||||
public void testIntentsCompletion1() throws Throwable {
|
||||
doTestCompletion();
|
||||
}
|
||||
|
||||
public void testIntentsCompletion2() throws Throwable {
|
||||
doTestCompletion();
|
||||
}
|
||||
}
|
||||
|
||||
+4
-8
@@ -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,9 +60,8 @@ public class IOFilesBasedDirectoryPruner {
|
||||
final File[] subFiles = file.listFiles();
|
||||
if (subFiles == null) return true;
|
||||
|
||||
boolean canPrune = true;
|
||||
|
||||
if (!new File(file, CvsUtil.CVS).isDirectory()) return false;
|
||||
boolean canPrune = true;
|
||||
for (File subFile : subFiles) {
|
||||
if (!isAdminDirectory(subFile)) {
|
||||
canPrune &= execute(subFile);
|
||||
@@ -74,7 +73,6 @@ public class IOFilesBasedDirectoryPruner {
|
||||
if (!canPrune) return false;
|
||||
|
||||
if (!FileUtil.delete(file)) return false;
|
||||
|
||||
CvsUtil.removeEntryFor(file);
|
||||
return true;
|
||||
}
|
||||
@@ -87,9 +85,8 @@ public class IOFilesBasedDirectoryPruner {
|
||||
catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
final Collection entries = entriesHandler.getEntries().getEntries();
|
||||
for (final Object entry1 : entries) {
|
||||
Entry entry = (Entry)entry1;
|
||||
final Collection<Entry> entries = entriesHandler.getEntries().getEntries();
|
||||
for (final Entry entry : entries) {
|
||||
if (!entry.isDirectory()) return true;
|
||||
}
|
||||
return false;
|
||||
@@ -98,5 +95,4 @@ public class IOFilesBasedDirectoryPruner {
|
||||
private static boolean isAdminDirectory(final File file) {
|
||||
return file.isDirectory() && file.getName().equals(CvsUtil.CVS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -19,31 +19,20 @@ import com.intellij.CvsBundle;
|
||||
import com.intellij.cvsSupport2.CvsVcs2;
|
||||
import com.intellij.cvsSupport2.actions.update.UpdateSettings;
|
||||
import com.intellij.cvsSupport2.config.CvsConfiguration;
|
||||
import com.intellij.cvsSupport2.connections.CvsRootProvider;
|
||||
import com.intellij.cvsSupport2.cvsExecution.ModalityContext;
|
||||
import com.intellij.cvsSupport2.cvsoperations.common.FindAllRoots;
|
||||
import com.intellij.cvsSupport2.cvsoperations.common.FindAllRootsHelper;
|
||||
import com.intellij.cvsSupport2.cvsoperations.common.PostCvsActivity;
|
||||
import com.intellij.cvsSupport2.cvsoperations.cvsUpdate.MergedWithConflictProjectOrModuleFile;
|
||||
import com.intellij.cvsSupport2.cvsoperations.cvsUpdate.UpdateOperation;
|
||||
import com.intellij.cvsSupport2.cvsoperations.cvsUpdate.ui.CorruptedProjectFilesDialog;
|
||||
import com.intellij.cvsSupport2.errorHandling.CannotFindCvsRootException;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.VcsKey;
|
||||
import com.intellij.openapi.vcs.update.FileGroup;
|
||||
import com.intellij.openapi.vcs.update.UpdatedFiles;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.Options;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.netbeans.lib.cvsclient.file.ICvsFileSystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -52,18 +41,14 @@ import java.util.Collection;
|
||||
*/
|
||||
public class UpdateHandler extends CommandCvsHandler implements PostCvsActivity {
|
||||
private final FilePath[] myFiles;
|
||||
private final Collection<VirtualFile> myRoots = new ArrayList<VirtualFile>();
|
||||
private final Collection<File> myNotProcessedRepositories = new HashSet<File>();
|
||||
private double myDirectoriesToBeProcessedCount;
|
||||
|
||||
private static final CvsMessagePattern UPDATE_PATTERN = new CvsMessagePattern(new String[]{"cvs server: Updating ", "*"}, 2);
|
||||
private final Project myProject;
|
||||
private final Collection<MergedWithConflictProjectOrModuleFile> myCorruptedFiles = new ArrayList<MergedWithConflictProjectOrModuleFile>();
|
||||
private final UpdatedFiles myUpdatedFiles;
|
||||
private final UpdateSettings myUpdateSettings;
|
||||
|
||||
public UpdateHandler(FilePath[] files, UpdateSettings updateSettings, @NotNull Project project, @NotNull UpdatedFiles updatedFiles) {
|
||||
super(CvsBundle.message("operation.name.update"), new UpdateOperation(new FilePath[0], updateSettings, project),
|
||||
super(CvsBundle.message("operation.name.update"), new UpdateOperation(files, updateSettings, project),
|
||||
FileSetToBeUpdated.selectedFiles(files));
|
||||
myFiles = files;
|
||||
myProject = project;
|
||||
@@ -71,65 +56,21 @@ public class UpdateHandler extends CommandCvsHandler implements PostCvsActivity
|
||||
myUpdateSettings = updateSettings;
|
||||
}
|
||||
|
||||
public void beforeLogin() {
|
||||
try {
|
||||
super.beforeLogin();
|
||||
FindAllRoots findAllRoots = new FindAllRoots(myProject);
|
||||
final FilePath[] filteredFiles = FindAllRootsHelper.findVersionedUnder(myFiles);
|
||||
myRoots.addAll(findAllRoots.executeOn(filteredFiles));
|
||||
myNotProcessedRepositories.addAll(findAllRoots.getDirectoriesToBeUpdated());
|
||||
myDirectoriesToBeProcessedCount = myNotProcessedRepositories.size();
|
||||
for(VirtualFile file: myRoots) {
|
||||
if (getValidCvsRoot(file) != null) {
|
||||
((UpdateOperation)myCvsOperation).addFile(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ProcessCanceledException ex) {
|
||||
myIsCanceled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static CvsRootProvider getValidCvsRoot(final VirtualFile file) {
|
||||
try {
|
||||
return CvsRootProvider.createOn(new File(file.getPath()));
|
||||
}
|
||||
catch (CannotFindCvsRootException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void addFileMessage(String message, ICvsFileSystem cvsFileSystem) {
|
||||
super.addFileMessage(message, cvsFileSystem);
|
||||
ProgressIndicator progress = getProgress();
|
||||
if (progress == null) return;
|
||||
if (UPDATE_PATTERN.matches(message)) {
|
||||
String relativeFileName = UPDATE_PATTERN.getRelativeFileName(message);
|
||||
myNotProcessedRepositories.remove(cvsFileSystem.getLocalFileSystem().getFile(relativeFileName));
|
||||
int notProcessedSize = myNotProcessedRepositories.size();
|
||||
progress.setFraction(0.5 + (myDirectoriesToBeProcessedCount - notProcessedSize) / (2 * myDirectoriesToBeProcessedCount));
|
||||
}
|
||||
}
|
||||
|
||||
public void registerCorruptedProjectOrModuleFile(MergedWithConflictProjectOrModuleFile mergedWithConflictProjectOrModuleFile) {
|
||||
myCorruptedFiles.add(mergedWithConflictProjectOrModuleFile);
|
||||
}
|
||||
|
||||
protected void onOperationFinished(ModalityContext modalityContext) {
|
||||
|
||||
if (myUpdateSettings.getPruneEmptyDirectories()) {
|
||||
final IOFilesBasedDirectoryPruner pruner = new IOFilesBasedDirectoryPruner(ProgressManager.getInstance().getProgressIndicator());
|
||||
for (final VirtualFile myRoot : myRoots) {
|
||||
pruner.addFile(new File(myRoot.getPath()));
|
||||
for (FilePath file : myFiles) {
|
||||
pruner.addFile(file.getIOFile());
|
||||
}
|
||||
|
||||
pruner.execute();
|
||||
}
|
||||
|
||||
if (!myCorruptedFiles.isEmpty()) {
|
||||
int showOptions = CvsConfiguration.getInstance(myProject).SHOW_CORRUPTED_PROJECT_FILES;
|
||||
final int showOptions = CvsConfiguration.getInstance(myProject).SHOW_CORRUPTED_PROJECT_FILES;
|
||||
|
||||
if (showOptions == Options.PERFORM_ACTION_AUTOMATICALLY) {
|
||||
for (final MergedWithConflictProjectOrModuleFile myCorruptedFile : myCorruptedFiles) {
|
||||
@@ -142,7 +83,6 @@ public class UpdateHandler extends CommandCvsHandler implements PostCvsActivity
|
||||
new CorruptedProjectFilesDialog(myProject, myCorruptedFiles).show();
|
||||
}
|
||||
}, myProject);
|
||||
|
||||
}
|
||||
|
||||
final VcsKey vcsKey = CvsVcs2.getKey();
|
||||
@@ -154,9 +94,7 @@ public class UpdateHandler extends CommandCvsHandler implements PostCvsActivity
|
||||
myUpdatedFiles.getGroupById(FileGroup.MODIFIED_ID).add(myCorruptedFile.getOriginal().getPath(), vcsKey, null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected PostCvsActivity getPostActivityHandler() {
|
||||
|
||||
+2
@@ -255,6 +255,8 @@ public abstract class CvsCommandOperation extends CvsOperation implements IFileI
|
||||
try {
|
||||
command.execute(requestProcessor, eventManager, eventManager, clientEnvironment, new IProgressViewer() {
|
||||
public void setProgress(double value) {
|
||||
ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
|
||||
if (progressIndicator != null) progressIndicator.setFraction(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
-184
@@ -1,184 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.cvsSupport2.cvsoperations.common;
|
||||
|
||||
import com.intellij.CvsBundle;
|
||||
import com.intellij.cvsSupport2.CvsUtil;
|
||||
import com.intellij.cvsSupport2.application.CvsEntriesManager;
|
||||
import com.intellij.cvsSupport2.connections.CvsEnvironment;
|
||||
import com.intellij.cvsSupport2.util.CvsVfsUtil;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* author: lesya
|
||||
*/
|
||||
|
||||
public class FindAllRoots {
|
||||
private final CvsEntriesManager myManager = CvsEntriesManager.getInstance();
|
||||
private int myProcessedFiles;
|
||||
private int mySuitableFiles;
|
||||
private final Collection<File> myRepositories = new HashSet<File>();
|
||||
|
||||
private final Collection<VirtualFile> myResult = new ArrayList<VirtualFile>();
|
||||
private final ProgressIndicator myProgress;
|
||||
private final ProjectRootManager myProjectRootManager;
|
||||
|
||||
public FindAllRoots(Project project) {
|
||||
myProgress = ProgressManager.getInstance().getProgressIndicator();
|
||||
myProjectRootManager = ProjectRootManager.getInstance(project);
|
||||
}
|
||||
|
||||
public Collection<VirtualFile> executeOn(final FilePath[] roots) {
|
||||
final Collection<FilePath> rootsWithoutIntersections = getRootsWithoutIntersections(roots);
|
||||
setText(CvsBundle.message("progress.text.searching.for.cvs.root"));
|
||||
myManager.lockSynchronizationActions();
|
||||
mySuitableFiles = calcVirtualFilesUnderCvsIn(rootsWithoutIntersections) * 2;
|
||||
myProcessedFiles = 0;
|
||||
try {
|
||||
ApplicationManager.getApplication().runReadAction(new Runnable() {
|
||||
public void run() {
|
||||
for (final FilePath file : rootsWithoutIntersections) {
|
||||
VirtualFile virtualFile = file.getVirtualFile();
|
||||
if (virtualFile != null) {
|
||||
myResult.add(virtualFile);
|
||||
process(virtualFile);
|
||||
}
|
||||
else {
|
||||
VirtualFile virtualFileParent = file.getVirtualFileParent();
|
||||
if (virtualFileParent != null) {
|
||||
myResult.add(virtualFileParent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
finally {
|
||||
myManager.unlockSynchronizationActions();
|
||||
}
|
||||
|
||||
return myResult;
|
||||
}
|
||||
|
||||
private int calcVirtualFilesUnderCvsIn(Collection<FilePath> rootsWithoutIntersections) {
|
||||
int result = 0;
|
||||
for (final FilePath cvsFileWrapper : rootsWithoutIntersections) {
|
||||
if (!cvsFileWrapper.isDirectory()) {
|
||||
result += 1;
|
||||
}
|
||||
else {
|
||||
result += calcVirtualFilesUnderCvsIn(cvsFileWrapper.getVirtualFile());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private int calcVirtualFilesUnderCvsIn(VirtualFile file) {
|
||||
if (file == null || !file.isDirectory()) return 0;
|
||||
if (!myProjectRootManager.getFileIndex().isInContent(file)) return 0;
|
||||
int result = 0;
|
||||
if (file.findChild(CvsUtil.CVS) == null) return result;
|
||||
result += 1;
|
||||
VirtualFile[] children = file.getChildren();
|
||||
if (children == null) return result;
|
||||
for (VirtualFile child : children) {
|
||||
if (child.getName() == CvsUtil.CVS) continue;
|
||||
result += calcVirtualFilesUnderCvsIn(child);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Collection<FilePath> getRootsWithoutIntersections(FilePath[] roots) {
|
||||
ArrayList<FilePath> result = new ArrayList<FilePath>();
|
||||
List<FilePath> list = Arrays.asList(roots);
|
||||
Collections.sort(list, new Comparator<FilePath>() {
|
||||
public int compare(FilePath file, FilePath file1) {
|
||||
return file.getPath().compareTo(file1.getPath());
|
||||
}
|
||||
});
|
||||
FilePath[] sortedRoots = list.toArray(new FilePath[list.size()]);
|
||||
for (int i = 0; i < sortedRoots.length; i++) {
|
||||
FilePath root = sortedRoots[i];
|
||||
if (i == 0) {
|
||||
result.add(root);
|
||||
}
|
||||
else {
|
||||
FilePath prevRoot = result.isEmpty() ? null : result.get(result.size() - 1);
|
||||
if ((prevRoot == null) || ! VfsUtil.isAncestor(prevRoot.getIOFile(), root.getIOFile(), false)){
|
||||
result.add(root);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void setText(final String text) {
|
||||
if (myProgress == null) return;
|
||||
myProgress.setText(text);
|
||||
ProgressManager.checkCanceled();
|
||||
}
|
||||
|
||||
private void setText2(final String text) {
|
||||
if (myProgress == null) return;
|
||||
myProgress.setText2(text);
|
||||
ProgressManager.checkCanceled();
|
||||
}
|
||||
|
||||
private void process(VirtualFile root) {
|
||||
if (!myProjectRootManager.getFileIndex().isInContent(root)) return;
|
||||
setText2(CvsVfsUtil.getPresentablePathFor(root));
|
||||
myProcessedFiles++;
|
||||
setFraction();
|
||||
VirtualFile[] children = root.getChildren();
|
||||
if (children == null) return;
|
||||
CvsEnvironment parentEnv = myManager.getCvsConnectionSettingsFor(root);
|
||||
if (!parentEnv.isValid()) return;
|
||||
myManager.cacheCvsAdminInfoIn(root);
|
||||
myRepositories.add(CvsVfsUtil.getFileFor(root));
|
||||
for (VirtualFile child : children) {
|
||||
if (!child.isDirectory()) continue;
|
||||
if (!myProjectRootManager.getFileIndex().isInContent(child)) continue;
|
||||
CvsEnvironment childEnv = myManager.getCvsConnectionSettingsFor(child);
|
||||
if (childEnv == null || !childEnv.isValid()) continue;
|
||||
if (!childEnv.equals(parentEnv)) {
|
||||
myResult.add(child);
|
||||
}
|
||||
process(child);
|
||||
}
|
||||
}
|
||||
|
||||
private void setFraction() {
|
||||
if (myProgress == null) return;
|
||||
myProgress.setFraction((double)myProcessedFiles / (double)mySuitableFiles);
|
||||
ProgressManager.checkCanceled();
|
||||
}
|
||||
|
||||
public Collection<File> getDirectoriesToBeUpdated() {
|
||||
return myRepositories;
|
||||
}
|
||||
|
||||
}
|
||||
+12
-10
@@ -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.
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.cvsSupport2.cvsoperations.cvsImport;
|
||||
|
||||
import com.intellij.CvsBundle;
|
||||
import com.intellij.cvsSupport2.connections.CvsEnvironment;
|
||||
import com.intellij.cvsSupport2.connections.CvsRootProvider;
|
||||
import com.intellij.cvsSupport2.cvsoperations.common.CvsCommandOperation;
|
||||
@@ -42,20 +43,21 @@ public class ImportOperation extends CvsCommandOperation {
|
||||
}
|
||||
|
||||
protected Command createCommand(CvsRootProvider root, CvsExecutionEnvironment cvsExecutionEnvironment) {
|
||||
ImportCommand result = new ImportCommand();
|
||||
final ImportCommand result = new ImportCommand();
|
||||
myDetails.prepareCommand(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ImportOperation createTestInstance(File sourceLocation, CvsEnvironment env) {
|
||||
ImportDetails details = new ImportDetails(sourceLocation, com.intellij.CvsBundle.message("import.defaults.vendor"),
|
||||
com.intellij.CvsBundle.message("import.defaults.release_tag"),
|
||||
com.intellij.CvsBundle.message("import.defaults.log.message"),
|
||||
sourceLocation.getName(), env, new ArrayList(), new IIgnoreFileFilter(){
|
||||
public boolean shouldBeIgnored(AbstractFileObject abstractFileObject, ICvsFileSystem cvsFileSystem) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
final ImportDetails details = new ImportDetails(sourceLocation, CvsBundle.message("import.defaults.vendor"),
|
||||
CvsBundle.message("import.defaults.release_tag"),
|
||||
CvsBundle.message("import.defaults.log.message"),
|
||||
sourceLocation.getName(), env, new ArrayList(),
|
||||
new IIgnoreFileFilter(){
|
||||
public boolean shouldBeIgnored(AbstractFileObject abstractFileObject, ICvsFileSystem cvsFileSystem) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return new ImportOperation(details);
|
||||
}
|
||||
|
||||
|
||||
+8
-15
@@ -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,18 +46,21 @@ import java.io.File;
|
||||
|
||||
public class UpdateOperation extends CvsOperationOnFiles {
|
||||
private final UpdateSettings myUpdateSettings;
|
||||
private final Project myProject;
|
||||
private final ProjectLevelVcsManager myVcsManager;
|
||||
private final CvsVcs2 myVcs;
|
||||
|
||||
public UpdateOperation(FilePath[] files, UpdateSettings updateSettings, Project project) {
|
||||
myUpdateSettings = updateSettings;
|
||||
myProject = project;
|
||||
myVcsManager = ProjectLevelVcsManager.getInstance(project);
|
||||
myVcs = CvsVcs2.getInstance(project);
|
||||
addAllFiles(files);
|
||||
}
|
||||
|
||||
public UpdateOperation(FilePath[] files, String branchName,
|
||||
boolean makeNewFilesReadOnly, Project project) {
|
||||
this(files, new UpdateByBranchUpdateSettings(branchName, makeNewFilesReadOnly), project);
|
||||
}
|
||||
|
||||
public void addAllFiles(FilePath[] files) {
|
||||
for (FilePath file : files) {
|
||||
addFile(file.getIOFile());
|
||||
@@ -74,17 +77,8 @@ public class UpdateOperation extends CvsOperationOnFiles {
|
||||
return "update";
|
||||
}
|
||||
|
||||
public UpdateOperation(UpdateSettings updateSettings, Project project) {
|
||||
this(new FilePath[0], updateSettings, project);
|
||||
}
|
||||
|
||||
public UpdateOperation(FilePath[] files, String branchName,
|
||||
boolean makeNewFilesReadOnly, Project project) {
|
||||
this(files, new UpdateByBranchUpdateSettings(branchName, makeNewFilesReadOnly), project);
|
||||
}
|
||||
|
||||
protected Command createCommand(CvsRootProvider root, CvsExecutionEnvironment cvsExecutionEnvironment) {
|
||||
UpdateCommand updateCommand = new UpdateCommand();
|
||||
final UpdateCommand updateCommand = new UpdateCommand();
|
||||
addFilesToCommand(root, updateCommand);
|
||||
//updateCommand.setPruneDirectories(myUpdateSettings.getPruneEmptyDirectories());
|
||||
updateCommand.setCleanCopy(myUpdateSettings.getCleanCopy());
|
||||
@@ -103,7 +97,6 @@ public class UpdateOperation extends CvsOperationOnFiles {
|
||||
return updateCommand;
|
||||
}
|
||||
|
||||
|
||||
public void modifyOptions(GlobalOptions options) {
|
||||
super.modifyOptions(options);
|
||||
options.setDoNoChanges(myUpdateSettings.getDontMakeAnyChanges());
|
||||
@@ -141,7 +134,7 @@ public class UpdateOperation extends CvsOperationOnFiles {
|
||||
if (ignoreFileFilterFromSuper.shouldBeIgnored(abstractFileObject, cvsFileSystem)) {
|
||||
return true;
|
||||
}
|
||||
VirtualFile fileByIoFile = CvsVfsUtil.findFileByIoFile(cvsFileSystem.getLocalFileSystem().getFile(abstractFileObject));
|
||||
final VirtualFile fileByIoFile = CvsVfsUtil.findFileByIoFile(cvsFileSystem.getLocalFileSystem().getFile(abstractFileObject));
|
||||
return fileByIoFile != null && myVcsManager.getVcsFor(fileByIoFile) != myVcs;
|
||||
}
|
||||
};
|
||||
|
||||
+15
-27
@@ -40,13 +40,9 @@ import java.util.*;
|
||||
*/
|
||||
public final class ImportCommand extends Command {
|
||||
|
||||
// Constants ==============================================================
|
||||
|
||||
@NonNls public static final String EXAM_DIR = "server: Importing ";
|
||||
|
||||
// Fields =================================================================
|
||||
|
||||
private final Map wrapperMap = new HashMap();
|
||||
private final Map<SimpleStringPattern, KeywordSubstitution> wrapperMap = new HashMap();
|
||||
private String logMessage;
|
||||
private String module;
|
||||
private String releaseTag;
|
||||
@@ -56,8 +52,7 @@ public final class ImportCommand extends Command {
|
||||
|
||||
// Setup ==================================================================
|
||||
|
||||
public ImportCommand() {
|
||||
}
|
||||
public ImportCommand() {}
|
||||
|
||||
// Implemented ============================================================
|
||||
|
||||
@@ -110,7 +105,7 @@ public final class ImportCommand extends Command {
|
||||
}
|
||||
|
||||
public String getCvsCommandLine() {
|
||||
@NonNls final StringBuffer cvsArguments = new StringBuffer("import ");
|
||||
@NonNls final StringBuilder cvsArguments = new StringBuilder("import ");
|
||||
cvsArguments.append(getCvsArguments());
|
||||
|
||||
cvsArguments.append(' ');
|
||||
@@ -199,7 +194,7 @@ public final class ImportCommand extends Command {
|
||||
// Utils ==================================================================
|
||||
|
||||
private String getCvsArguments() {
|
||||
@NonNls final StringBuffer cvsArguments = new StringBuffer();
|
||||
@NonNls final StringBuilder cvsArguments = new StringBuilder();
|
||||
cvsArguments.append("-m \"");
|
||||
cvsArguments.append(CommandUtils.getMessageNotNull(getLogMessage()));
|
||||
cvsArguments.append("\" ");
|
||||
@@ -215,10 +210,8 @@ public final class ImportCommand extends Command {
|
||||
cvsArguments.append(" ");
|
||||
}
|
||||
if (wrapperMap.size() > 0) {
|
||||
final Iterator it = wrapperMap.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
final SimpleStringPattern pattern = (SimpleStringPattern)it.next();
|
||||
final KeywordSubstitution keywordSubstitutionOptions = (KeywordSubstitution)wrapperMap.get(pattern);
|
||||
for (final SimpleStringPattern pattern : wrapperMap.keySet()) {
|
||||
final KeywordSubstitution keywordSubstitutionOptions = wrapperMap.get(pattern);
|
||||
cvsArguments.append("-W ");
|
||||
cvsArguments.append(pattern.toString());
|
||||
cvsArguments.append(" -k '");
|
||||
@@ -232,15 +225,14 @@ public final class ImportCommand extends Command {
|
||||
/**
|
||||
* Adds requests for specified wrappers to the specified requestList.
|
||||
*/
|
||||
private static void addWrapperRequests(Requests requests, Map wrapperMap) {
|
||||
private static void addWrapperRequests(Requests requests, Map<SimpleStringPattern, KeywordSubstitution> wrapperMap) {
|
||||
// override the server's ignore list
|
||||
requests.addArgumentRequest("-I !");
|
||||
|
||||
for (Iterator it = wrapperMap.keySet().iterator(); it.hasNext();) {
|
||||
final SimpleStringPattern pattern = (SimpleStringPattern)it.next();
|
||||
final KeywordSubstitution keywordSubstitutionOptions = (KeywordSubstitution)wrapperMap.get(pattern);
|
||||
for (final SimpleStringPattern pattern : wrapperMap.keySet()) {
|
||||
final KeywordSubstitution keywordSubstitutionOptions = wrapperMap.get(pattern);
|
||||
|
||||
@NonNls final StringBuffer buffer = new StringBuffer();
|
||||
@NonNls final StringBuilder buffer = new StringBuilder();
|
||||
buffer.append(pattern.toString());
|
||||
buffer.append(" -k '");
|
||||
buffer.append(keywordSubstitutionOptions.toString());
|
||||
@@ -270,11 +262,9 @@ public final class ImportCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
final List subdirectories = new ArrayList();
|
||||
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
final File file = files[i];
|
||||
final List<File> subdirectories = new ArrayList();
|
||||
|
||||
for (final File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
final DirectoryObject subDirObject = clientEnvironment.getCvsFileSystem().getLocalFileSystem().getDirectoryObject(file);
|
||||
|
||||
@@ -300,8 +290,7 @@ public final class ImportCommand extends Command {
|
||||
}
|
||||
}
|
||||
|
||||
for (Iterator it = subdirectories.iterator(); it.hasNext();) {
|
||||
final File subdirectory = (File)it.next();
|
||||
for (final File subdirectory : subdirectories) {
|
||||
addFileRequests(subdirectory, requests, requestProcessor, clientEnvironment);
|
||||
}
|
||||
}
|
||||
@@ -324,10 +313,9 @@ public final class ImportCommand extends Command {
|
||||
private KeywordSubstitution getKeywordSubstMode(String fileName) {
|
||||
KeywordSubstitution keywordSubstMode = getKeywordSubstitutionOption();
|
||||
|
||||
for (Iterator it = wrapperMap.keySet().iterator(); it.hasNext();) {
|
||||
final SimpleStringPattern pattern = (SimpleStringPattern)it.next();
|
||||
for (final SimpleStringPattern pattern : wrapperMap.keySet()) {
|
||||
if (pattern.doesMatch(fileName)) {
|
||||
keywordSubstMode = (KeywordSubstitution)wrapperMap.get(pattern);
|
||||
keywordSubstMode = wrapperMap.get(pattern);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +142,9 @@ public class GradleConfigurable implements SearchableConfigurable {
|
||||
if (myGradleHomeSettingType == GradleHomeSettingType.EXPLICIT_INCORRECT) {
|
||||
new DelayedBalloonInfo(MessageType.ERROR, myGradleHomeSettingType).run();
|
||||
}
|
||||
else {
|
||||
myAlarm.cancelAllRequests();
|
||||
}
|
||||
myGradleHomeComponent.setPath(valueToUse);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,9 @@ public class GroovyCompiler extends GroovyCompilerBase {
|
||||
final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
|
||||
Set<Module> modules = new HashSet<Module>();
|
||||
for (VirtualFile file : files) {
|
||||
if (scriptExtensions.contains(file.getExtension()) || compilerManager.isExcludedFromCompilation(file)) {
|
||||
if (scriptExtensions.contains(file.getExtension()) ||
|
||||
compilerManager.isExcludedFromCompilation(file) ||
|
||||
CompilerConfiguration.getInstance(myProject).isResourceFile(file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -829,7 +829,7 @@ public class ZenCodingTemplate implements CustomLiveTemplate {
|
||||
myIndex++;
|
||||
token = nextToken();
|
||||
if (token != ZenCodingTokens.EQ) {
|
||||
return null;
|
||||
return new Pair<String, String>(name, "");
|
||||
}
|
||||
|
||||
myIndex++;
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.PsiCachedValueImpl;
|
||||
import com.intellij.psi.impl.meta.MetaRegistry;
|
||||
import com.intellij.psi.impl.source.html.dtd.HtmlNSDescriptorImpl;
|
||||
import com.intellij.psi.impl.source.tree.CompositePsiElement;
|
||||
import com.intellij.psi.impl.source.tree.TreeElement;
|
||||
import com.intellij.psi.meta.PsiMetaData;
|
||||
import com.intellij.psi.meta.PsiMetaOwner;
|
||||
@@ -287,7 +288,7 @@ public class XmlDocumentImpl extends XmlElementImpl implements XmlDocument {
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
public CompositePsiElement clone() {
|
||||
HashMap<String, CachedValue<XmlNSDescriptor>> cacheStrict = new HashMap<String, CachedValue<XmlNSDescriptor>>(
|
||||
myDefaultDescriptorsCacheStrict
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user